I started by building from source. After downloading hivemind 1.1 alpha and setting my hivebuild.dir property file to the hivebuild directory, the build went with relatively few problems. It would have been nice to have found some document giving a step-by-step guide on this. The steps are pretty simple but its nice to know what they are. I noticed that Jcharts 0.6.0 is no longer in the referenced location in ibiblio, so I had to find that manually.
I had to make a couple of changes to the the application itself, built for 3.0.2. In particular, the AbstractPage method includes a couple of other abstract methods – in particular getComponentSpecification(). I'm not sure what form this method implementation was supposed to take – the Javadocs did not help. I used the working assumption that if I left the page class abstract and did not implement this method, it would be handled by the enhanced class version. No idea whether this is the correct assumption, though.
Once these changes were made, it deployed without problems, but was broken when I ran it. The home page uses a reference to Global, which it itself obtains from IEngine. Unfortunately, the page reference to IEngine was null. Going through in debug mode, it did not appear that the attach() method was being called at all, which is where the page's IEngine reference is set. The method was getting called in the Exception page, which was shown, although the restart session link did not work: instead of forwarding to
/myappname/app?service=home it went to /app?service=home
I applied a workaround to this problem. The next problem I encountered was for one of my own components, a component to apply a Javascript redirect. Here, it did not appear as if the binding from the page properties to the component parameters was being applied at all.
Here's my page class:
public abstract class Redirect extends BasePage
{
public abstract Object[] getParameters();
public abstract void setParameters(Object[] parameters);
public abstract String getTargetPage();
public abstract void setTargetPage(String newPage);
}and page specification
<page-specification class="com.bt.gmatest.pages.Redirect"> <description>Redirect Page</description> <property-specification name = "targetPage" type = "String"/> <property-specification name = "paramters" type = "java.lang.Object[]"/> </page-specification>
and here's my page HTML:
<HTML> <HEAD>
<!-- use custom Redirect component to redirect -->
<SCRIPT jwcid = "@Redirect"
targetPage = "ognl:targetPage"
parameters = "ognl:parameters">
window.location.replace("http://www.realsolve.co.uk/");
</SCRIPT></HEAD> <BODY> Should have redirected </BODY> </HTML>
Here's my component JWC file:
<component-specification class="com.bt.gmatest.components.Redirect" allow-body="no" allow-informal-parameters="no">
<parameter name="targetPage" type="java.lang.String" required="yes" direction="in"/>
<parameter name="parameters" type="java.lang.Object[]" required="no" direction="in"/>
</component-specification>
and component implementation:
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
{
writer.begin("SCRIPT");
ILink link = getLink(cycle, Tapestry.EXTERNAL_SERVICE);
writer.printRaw("window.location.replace(\"" + link.getURL() + "\");");
writer.end();
}protected ILink getLink(IRequestCycle cycle, String serviceName)
{
IEngineService service = cycle.getEngine().getService(serviceName);
Object[] serviceParameters = null;
if (parameters == null)
{
serviceParameters = new Object[]
{
targetPage
};
}
else
{
serviceParameters = new Object[parameters.length + 1];
System.arraycopy(parameters, 0, serviceParameters, 1, parameters.length);
serviceParameters[0] = targetPage;
}
return service.getLink(cycle, this, serviceParameters);
}The error I get is:
Parameter pageName must not be null. Stack Trace:
org.apache.hivemind.util.Defense.notNull(Defense.java:41)
org.apache.tapestry.engine.ExternalServiceParameter.<init>(ExternalServiceParameter.java:38)
com.bt.gmatest.components.Redirect.getLink(Redirect.java:36) com.bt.gmatest.components.Redirect.renderComponent(Redirect.java:27) org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:606) org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92) org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:606) org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:280)
The null is definitely a binding problem – and is NOT caused by the original targetPage property of Redirect.java being set to null when the page is activated.
Any help on any of the following would be appreciated:
- any help for any of the specific issues mentioned
- is there any 3.0 to 3.1 gotchas documentation (ie. What are the non-backward compatible changes in 3.1 which WILL require modifications in an existing 3.0.2 changes document)
- is there any 3.0 to 3.1 migration documentation. Because the specification is changing so radically, it would be very useful to know what changes are superficial (ie just prefered vocabulary) and what - - changes are substantive. How do 3.0 specification elements map to their 3.1 counterparts
Thanks, Phil Zoio
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
