wicketstuff / core

Wicketstuff-core projects are bundled user contributions for use with Apache Wicket (https://wicket.apache.org/). They are released in step with Wicket releases to make them easy to use.
337 stars 298 forks source link

TinyMce ImageUpload button's ico is missing and uploaded image's link is broken #177

Closed sfeher closed 11 years ago

sfeher commented 11 years ago

Hi,

Two possible bugs:

  1. TinyMce upload icon is missing. Link works fine but invisible.
  2. After a succesful image upload the inserted link is broken.

I tested this with wicket 1.5.9 and tinymce-1.5.8 and wicket 6.3 and tinymce 6.0. The result is the same. I attached a quickstart project.

https://github.com/sfeher/tinymce_upload

bitstorm commented 11 years ago

Fixed in tinymce 6.0. The icon used for this plugin is the same used by "Insert/Edit image".

sfeher commented 11 years ago

Would you please backport it into 1.5.9 too ? This makes my life much easier. Thnx!

bitstorm commented 11 years ago

Ok, but only because it's Christmas :) :D

sfeher commented 11 years ago

I hoped so :). Thanks again!!

bitstorm commented 11 years ago

I've ported the fix to 1.5.x branch. If you have a minute try to run the tinymce examples from this branch and take a look at the page with the image upload plugin to check that everything is ok.

sfeher commented 11 years ago

Ok, thanks! I will have a try as soon as I can. (I have only fear is if the link after image upload will good or I will have to do it some tricky way. But I hope you took care about this too :) so it's just a theory.

bitstorm commented 11 years ago

I'm sorry but this is my first attempt to work with multiple branch in git so it's better double-checking it ;). Anyway, I've sucessfully tested the ported fix and we shouldn't find any problem.

sfeher commented 11 years ago

No problem. I realy appreciate your effort! I will let you know the result.

sfeher commented 11 years ago

Hi,

I tested 6.0-SNAPSHOT against my quickstart project and got the following error: .... ERROR - DefaultExceptionMapper - Unexpected error occurred org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor 'public com.mycompany.HomePage(org.apache.wicket.request.mapper.parameter.PageParameters)' and argument ''. Might be it doesn't exist, may be it is not visible (public). at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:193) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:75) at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:133) at org.apache.wicket.core.request.handler.PageProvider.resolvePageInstance(PageProvider.java:278) at org.apache.wicket.core.request.handler.PageProvider.getPageInstance(PageProvider.java:166) at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78) at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:94) at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:244) at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:165) at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:830) at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64) at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:253) at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:210) at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:281) at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:245) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:317) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:204) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:182) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:311) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:170) ... 35 more Caused by: java.lang.NoClassDefFoundError: org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow$WindowClosedCallback at com.mycompany.HomePage.(HomePage.java:43) ... 40 more Caused by: java.lang.ClassNotFoundException: org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow$WindowClosedCallback at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521) ... 41 more ....

Would you please make me sure if I'm wrong or missed something ? TIA. ( https://github.com/sfeher/tinymce_upload )

bitstorm commented 11 years ago

I've downloaded and run your quickstart project but I didn't get this exception. How did you exactly run the project against 6.0-SNAPSHOT? Do you have compiled the last source from repo? Anyway, the exception is quite strange, it seems more related to Wicket itself than to WicketStuff.

martin-g commented 11 years ago

The exception is quite clear - wicket-extensions.jar is not in the classpath.

sfeher commented 11 years ago

Sorry guys, it was a compilaton error at my wicketstuff-tinymce snapshot from core-master. So not all the files were installed under my .m2 repo. (I felt stupid myself because of @martin-g note about wicket-extension dependency because myproject has no such dependency :). @bitstorm The fix works like a charm as far as I see. Thnx again!

sfeher commented 11 years ago

Hi,

I'm struggling with one thing. Inserting, uploading images works fine via ImageUploadPanel. The uploaded image shows up in the editor. But if I want to display it on any other page via a label component then image gets broken. For example this link works fine inside the editor but I'm not able to display it. (error 404).

page?3-IResourceListener-container-editform-uploadPanel&filename=DSCF0164.JPG&contenttype=image/jpeg

thnx and happy new year ,Sandor

sfeher commented 11 years ago

Ok. Figured out. I have two pages. One for editing content with tinymce editor and one for showing content. If I mount showcontent but not editcontent page then image is broken. If I mount both of them then everything is fine. So I'm really happy now :).

panolitos commented 11 years ago

sorry guys, I'm still using version 1.4 so I still have this image upload icon problem. I'm using wicket 1.4 the question is: is it easier to fix the problem (how?) or use the 1.5.x version with my wicket 1.4? I'm planning to upgrade wicket but it will take long time I guess... thanks!

bitstorm commented 11 years ago

If you just need to display the icon for the image upload you should add the following CSS line somewhere in your style code:

.defaultSkin span.mce_upload {background-position:-380px 0}

This line must be applied after the original imageUpload.css has been loaded.

panolitos commented 11 years ago

ok thanks a lot! I' ve backported to 1.4 these commits https://github.com/wicketstuff/core/commit/24d0e96dbd54d4b184e7feabcbdb120dcd87af5d now we are considering the license thing. how shall we behave?

bitstorm commented 11 years ago

mmm..sorry, what do you mean with "license thing"? Would you like to commit your work to the official repository?

panolitos commented 11 years ago

sure, I would. about the licence, it's just lgpl, right?

bitstorm commented 11 years ago

I think that branch 1.4 is no more maintained. Anyway, If you want to commit your changes to the main repository you should first create a pull request (see the menu bar at the top of page). A pull request is essentially a diff between your fork of the project and the main repository.

panolitos commented 11 years ago

ok. I'm trying to do a proper pull request...

panolitos commented 11 years ago

I' m experiencing another issue related to tinymce integration with wicket

On 12 February 2013 14:27, Andrea Del Bene notifications@github.com wrote:

I think that branch 1.4 is no more maintained. Anyway, If you want to commit your changes to the main repository you should first create a pull request (see the menu bar at the top of page). A pull request is essentially a diff between your fork of the project and the main repository.

— Reply to this email directly or view it on GitHubhttps://github.com/wicketstuff/core/issues/177#issuecomment-13432270.

panolitos commented 11 years ago

I' ve just found out that I have to mime the SavePlugin behavior in the submit button! Is there anyone that did it already?

On 22 February 2013 12:29, marco di gasbarro m.digasbarro@gmail.com wrote:

I' m experiencing another issue related to tinymce integration with wicket

  • version 1.4 I have a page with a form, inside of which there is a panel with the editor textarea and TinyMceBehavior; when I submit the form, the textarea model object is not updated with the editor content. Is it a known issue? Thanks

On 12 February 2013 14:27, Andrea Del Bene notifications@github.comwrote:

I think that branch 1.4 is no more maintained. Anyway, If you want to commit your changes to the main repository you should first create a pull request (see the menu bar at the top of page). A pull request is essentially a diff between your fork of the project and the main repository.

— Reply to this email directly or view it on GitHubhttps://github.com/wicketstuff/core/issues/177#issuecomment-13432270.