Porting from echo2 to echo3

Hi, looking into porting an app from echo2 to echo3. Some of the epng components we use are not available in 3 so I'm looking at simplifying some things. Here are my first few issues:

1) In EPNG2 there is an ImageEncoder (Implementing Classes GifEncoder, PngEncoder) which does not exist in EPNG3. ImageEncoder is described as "...specifies an object that can encode image data to an output stream. It also indicates what MIME content type is encoded". From a brief look at the standard echo3 api, looks like StreamImageReference would do the same thing? (And we probably should have used it in echo2 anyway?)

2) We make quite a bit of use of 'Ex' components (eg ButtonEx) which allow us to call setText() with an XhtmlFragment. Is there any way to do this in a standard echo3 Button?

3) In echo2, WebRenderServlet does not appear to exist in echo3. Here's some code:

	public static HttpSession getHttpSession()
	{
		return WebRenderServlet.getActiveConnection().getRequest().getSession(false);
	}

Should we be doing this a different way? (Probably ;-) )

Cheers

aschild's picture

1) Yes, the

1) Yes, the StreamImageReference matches your needs, when you deliver the image from some sort of stream, instead of the other "locations" like AwtImageReference, HttpImageReference and ResourceImageReference.

2) Actually in echopoint we have the HtmlLabel component which supports plain XHTML content, but none of the buttons etc.

3) Look for WebContainerServlet, you can access the session that way:

 Connection conn = WebContainerServlet.getActiveConnection();
        if (conn != null)
        {
            HttpSession thisSession = conn.getRequest().getSession(false);
            if (thisSession != null)
            {
                _user= (IUser) thisSession.getAttribute("myUser");
            }
        } 

Hi, thanks for your replies.

Hi, thanks for your replies. I had partly resolved some of them but was trying to work my way thru things before I posted again (eg I found most of the render servlet stuff had moved into the container servlet).
Thanks for the tip about HtmlLabel ... I've just ripped out LabelEx and replaced with Label, but I was looking forward to a huge amount of follow up work, so HtmlLabel could save a lot of time ;-)

What I'm stuck on at the moment is replacing the epng2 TabbedPane with the E3Extras TabPane. The TabbedPane was easy - add components (and their tab labels) to a TabModel. But with the TabPane I cannot for the life of me see how it works. The only 'add' methods I can see are in the Component base class, and I guess I add my content panes to that... but where on earth do you set the label to appear on each tab?!? I cannot see any setText methods anywhere. So I'm totally confused...

Thanks

rakesh's picture

TabPaneLayoutData

You can configure a lot of properties via the TabPaneLayoutData class. When in doubt always look at the test-interactive code in the source repository. That is usually the best way to find how to do things.

Hi, yeah after looking for

Hi, yeah after looking for ages I finally found it in TabPaneLayoutData. I hadn't looked in there at all - I was used to the LayoutData objects (eg for Row and Column) being just for that - i.e get/set height width, etc. I wasn't expecting all the Title, Icon and appearance code to be in the LayoutData object for TabPane. Seems a little strange (or maybe imho the class should have been named differently ;-) )

aschild's picture

TabPaneLayoutData is a

TabPaneLayoutData is a logical name for that one when you are used to the other xxxLayoutData.
Basically you add multiple component to the content and then say how to "Format" them, a Accordion is just a bit more sophisticated layout ;)

André

Yes, I can see the reasoning

Yes, I can see the reasoning that all the extra stuff should be treated as layout data, cheers

Hi rakesh, how do I find the

Hi rakesh, how do I find the "...test-interactive code in the source repository"?

BTW I downloaded the source for the online demo (if this is what you are referring to) but that seems to be based around the new E3 client-side js API, not the old (E2 style) server-client API, which is what we are using.

Also while I'm here, the EPNG3 docs (API), like http://sptci.com/projects/echopoint/api/app/ - is this downloadable anywhere? Maybe I missed it...

rakesh's picture

You will not find it in the

You will not find it in the demo application. You can check out the sources for Echo3 and Extras from subversion and then look into the src/server-java/testapp-interactive/lib directory. We do not have the EchoPoint API available for download anywhere, but you can check out the sources and run the doc (I think) ant task to generate the documentation.

Ok, thanks for that. Just a

Ok, thanks for that. Just a quick question re. the current state of the port of echopoint (to echo3)... I was looking at the online docs and was wondering why DefaultMutableTreeNode (and other echopoint tree classes) wasn't in echopoint-3.0.0b2.jar. But then noticed the EchoPoint API - 3.0.0b2 docs refers to these as being in b3. But there's no b3 jar yet, right? I was considering getting the latest from SVN and building myself, but:
- How stable is the code in SVN at the moment (or are parts of it unstable)?
- Are those tree components checked in to SVN yet (and are they stable)?

Cheers!

aschild's picture

SVN is currently stable

Usually the SVN code is quite stable, as, most of the time only working components are checked in.

Just take care with the newest components, they usually have some "unexpected features" ;)

André

rakesh's picture

Andre now that you have

Andre now that you have added FCKEditor, can you release a b4 version of EchoPoint? Once it is done I will update the online API documentation. To the OP's question regarding the tree components, yes they are as mature as the original implementation was. i have used these classes in a couple of projects - http://kenai.com/projects/jcrmanager/ being one of them.

aschild's picture

I will release the b4

I will release the beta 4, but first I need to update the docs about fckeditor.

André

Awesome! Looking forward to

Awesome! Looking forward to it ;-)
Is there a rough change log somewhere?

rakesh's picture

Announcements

I have usually used the announcements as the changelogs for each release.