Hi Muro.

W dniu 2010-05-19 15:12, Muro Copenhagen pisze:
Hi Michal,

Thanks for the reply

Yes that was my idea.

It would be better with a static reference to a localdrive folder, so the
folder works as a image repository.

I am working on a wepapp where users has to login...the problem i am
experiencing is that the the
image reference is temporary, based on user login etc.

So if user logs in, uploads the image, the next time the user logs in the
reference to the image would be wrong.
What are you doing with those uploaded images and text which come from tiny ? Do you display them after submit as normal text in the page ? I have also a login application. Text/images which came from tiny are shown as "news" to any logged user. But this whole text must be parsed and src of image must be rerendered. I get this text and build panel with dynamic labels and images (dynamic markup).
Some like this:
public abstract class AbstractImagePanel extends Panel implements IMarkupResourceStreamProvider, IMarkupCacheKeyProvider { public IResourceStream getMarkupResourceStream(MarkupContainer pContainer,
            Class<?> pContainerClass) {
String markup = String.format("<wicket:panel>%s</wicket:panel>", createMarkup()); StringBufferResourceStream stringBuf = new StringBufferResourceStream();
        stringBuf.append(markup);
        return stringBuf;
    }

    private String createMarkup() {
        StringBuffer sb = new StringBuffer();
        Matcher matcher = getMatcher();
        int index = 0;
        while(matcher.find()) {
matcher.appendReplacement(sb, String.format(IMG_TAG, (index++)+matcher.group(1)+getMarkupId()));
        }
        matcher.appendTail(sb);
        return sb.toString();
    }

        @Override
    protected void onBeforeRender() {
        super.onBeforeRender();
        // Images must be added on each request, before phase render
        removeAll();
        addImages();
    }
}

in addImmages() i het the same matcher parsing with adding Image components
return new Image(pIndex+pFileName+getMarkupId(), new Resource() {
                        @Override
                        public IResourceStream getResourceStream() {
return ResourceStream which points to our image
                        }
                    });

Of course you can also put it to sharedResources. But it depends on how many images you are going to upload :) In sharedResources we should have images which are provided with our application.

Also a different user would not be able to see the same image...

Therefore i was thinking on a solution like this one integrated with youre
code...:
http://dotev.blogspot.com/2009/11/serving-images-and-other-resources-with.html

And images could be referenced as in the link...:
resources/global/images?id=image105

Would it be possible ?

Best Regards
Muro

2010/5/19 Michał Letyński<mletyn...@consol.pl>

Hi.
Whay do you want to change exactly Muro ? Temporary path is set to
"javax.servlet.context.tempdir". Image must be temporary uploaded somewhere
to show it in editor later.
This src in<img>  tag points into ImageUploadPanel which implements
IResourceListener. So the ImageUploadPanel is called when a resource is
requested. (resource is created from image which is uploaded to temp
directory).
Do you want to have a static path like ../../resources/images/locked.gif  ?

W dniu 2010-05-18 17:52, Muro Copenhagen pisze:

  Hi...
I am facing a new problem with the TinyMCE upload image, i hope someone
can
assist me on.

I can see that the ImageUpload tinymce example uses a temporary path to
store the images...

If i want to store them on a static folder, like the folder: c:\images

How would i achive that ?

If can to overwrite you getTemporaryDirPath() folder and set it to
c:\images, the upload works fine.

But the reference to the image, is store with the wicket session
reference.
Here is the an example on how it is stored:

<img

src="?wicket:interface=:25:editCaseForm:uploadPanel::IResourceListener::&amp;filename=testerman.JPG&amp;contenttype=image/jpeg"
alt="" />

How would i manage to store it a manner so it is not session dependent...?

Any help will be appreciated...

Best Regards
Muso

On Fri, May 14, 2010 at 3:03 PM, Muro Copenhagen<copenha...@gmail.com
wrote:


Hi Michal

Great thanks for the help..

Best Regards
Muro

2010/5/14 Michał Letyński<mletyn...@consol.pl>

Hi.


Yes you are right the last released version is 1.4.1. So you must build
it
localy.

W dniu 2010-05-14 11:19, Muro Copenhagen pisze:

  Hi Michal


I appreciate you're effort spelling things out.

I am still not sure on how to get it to work.

When i add this dependency to my project it won't work:
         <dependency>
             <groupId>org.wicketstuff</groupId>
             <artifactId>tinymce</artifactId>
             <version>1.4.7-SNAPSHOT</version>
         </dependency>
And that makes sense since i can't find that version in the repo:
http://wicketstuff.org/maven/repository

So how would i get my project to use the tinymce version 1.4.7-SNAPSHOT
?

Maybe it's a silly question... but i am not sure how to make it work...

Best Regards
Muro

2010/5/13 Michał Letyński<mletyn...@consol.pl>





Hi.
Its commited to trunk and in pom we have 1.4.7-SNAPSHOT so it should
be
available ...


W dniu 2010-05-12 15:23, Muro Copenhagen pisze:

  Hi again...




I guess a new release of wicket-stuff tinymce has to be made in order
to
use
it...

The current release 1.4-rc7 misses the changes you have commited...

Who can make a new release of wicket-stuff tinymce so we can use the
commited code ?

Best Regards
Muro

2010/5/12 Michał Letyński<mletyn...@consol.pl>







Hi.
Its one of tiny examples:




https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/tinymce-parent/tinymce-examples

W dniu 2010-05-12 12:40, Muro Copenhagen pisze:







Hi Michael,

That is a great example. But you mentioned that you have commited
the
sample
to wicket-stuff.

I can't find it anywhere so can you please send a link or
something...

Best regards
Muro

On Tue, May 4, 2010 at 2:49 PM, Robert Kimotho<kimot...@gmail.com>
  wrote:









You are right I have a wicket path in src and it looks like this





'resources/wicket.contrib.tinymce.InPlaceEditBehavior/tiny_mce/plugins/emotions/img/smiley-cool.gif'
this is what you get submitted to the server, but the image does
not
get
displayed.
Can you guide me to using the IResourceListener or getting the
emoticon
displayed at the client side.

Regards,
Kimotho.

2010/5/4 Michał Letyński<mletyn...@consol.pl>









Hi.
If you have images in tiny with external src it should work but
if
you








have








in src a wicket path you must change it (to component which will
get
the
image look at IResourceListener)  before displainng image in
label,
multilinelabel, etc.


W dniu 2010-05-03 09:10, Robert Kimotho pisze:

  When I submit a form with an emoticon from the fullfeatured
tinymce,
the








image doesn't get displayed in the destination
only the text.....
any suggestions, I've been stuck here for a while now.

2010/5/1 新希望软件 -- 俞宏伟<nhsoft....@gmail.com>











image upload example run failuer, the application
throwsNoClassDefFoundError
.

WicketMessage: Can't instantiate page using constructor public
wicket.contrib.examples.tinymce.ImageUploadTinyMCEPage()

Root cause:

java.lang.NoClassDefFoundError:
wicket/contrib/tinymce/image/ImageUploadPanel
     at















wicket.contrib.examples.tinymce.ImageUploadTinyMCEPage.<init>(ImageUploadTinyMCEPage.java:42)








     at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native






Method)




     at
java.lang.reflect.Constructor.newInstance(Constructor.java:513)
     at















org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:192)








     at


















org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:57)








     at


















org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298)








     at


















org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)








     at


















org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234)








     at


















org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)








     at


















org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)








     at
org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)






     at
org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)




     at
org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
     at














org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)








     at


















org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)








     at


















org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)








     at

















org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)








     at


















org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)








     at

















org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)








     at

















org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)








     at






org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)




     at















org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)








     at


















org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)








     at

















org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)








     at org.mortbay.jetty.Server.handle(Server.java:326)






     at





org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
     at















org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)








     at
org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)






     at




org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
     at

org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)

     at















org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)








     at


















org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)








Complete stack:






org.apache.wicket.WicketRuntimeException: Can't instantiate page




using
constructor public
wicket.contrib.examples.tinymce.ImageUploadTinyMCEPage()

     at















org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:212)








     at


















org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:57)








     at


















org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298)








     at


















org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)








     at


















org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234)








     at


















org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)








     at


















org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)








     at
org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)






     at
org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)




     at
org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
     at














org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)








java.lang.reflect.InvocationTargetException






     at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native




Method)
     at















sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)








     at
java.lang.reflect.Constructor.newInstance(Constructor.java:513)






     at
















org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:192)








     at


















org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:57)








     at


















org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298)








     at


















org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)








     at


















org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234)








     at


















org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)








     at


















org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)








     at
org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)






     at
org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)




     at
org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
     at














org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)













2010/4/26 Michał Letyński<mletyn...@consol.pl>











I commited it to wicket-stuff tinymce project with proper
example.

W dniu 2010-04-21 10:23, Johan Haleby pisze:

  That would be really helpful. I'm struggling to get your
example
to










work.



















---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org












--
新希望软件---俞宏伟
Addr:宁波市人民路645弄312号(日湖国贸)1304室
Site:http://www.nhsoft.cn
Tel: 0574-87280538
Fax: 0574-27825902
Mobile:13780081921















---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


















---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org










---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org








---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to