Hi!
I'm new to Tapestry and try to access the Apache Lenya 2.0 repository with
Tapestry. My Code looks like that:
import org.apache.avalon.framework.service.ServiceException;
import org.apache.avalon.framework.service.ServiceManager;
import org.apache.cocoon.environment.Request;
import org.apache.lenya.cms.cocoon.components.context.ContextUtility;
import org.apache.lenya.cms.linking.Link;
import org.apache.lenya.cms.publication.Area;
import org.apache.lenya.cms.publication.Document;
import org.apache.lenya.cms.publication.DocumentFactory;
import org.apache.lenya.cms.publication.DocumentUtil;
import org.apache.lenya.cms.publication.Publication;
import org.apache.lenya.cms.publication.PublicationException;
import org.apache.lenya.cms.publication.URLInformation;
import org.apache.lenya.cms.site.SiteNode;
import org.apache.lenya.cms.site.SiteStructure;
import org.apache.lenya.util.ServletHelper;
import org.apache.tapestry.html.BasePage;
public abstract class Home extends BasePage {
public ServiceManager manager;
public String getlenya() throws ServiceException, PublicationException {
Request request;
ContextUtility context = null;
try {
context = (ContextUtility) manager.lookup(ContextUtility.ROLE);
request = context.getRequest();
}
finally {
manager.release(context);
}
DocumentFactory factory =
DocumentUtil.getDocumentFactory(this.manager, request);
String uuid = "783cfe30-c5c3-11dc-a7bf-b323ba12c062";
String language = "de";
String webappUrl = ServletHelper.getWebappURI(request);
URLInformation info = new URLInformation(webappUrl);
Publication pub = factory.getPublication(info.getPublicationId());
Area authoring = pub.getArea("authoring");
Document[] docs = authoring.getDocuments();
Document doc = authoring.getDocument(uuid, language);
String dname = doc.getArea();
System.out.println("Name des Dokumentes:"+dname);
return dname;
}
}
When I run this code I get a "Unable to parse OGNL expression 'lenya':
lenya" error with the line 20:
18 <component id="lenya" type="Insert">
19
20 <binding name="value" value="lenya"/>
21
22 </component>
and a org.apache.tapestry.BindingException together with an
java.lang.NullPointerException.
The error occours in the component when "manager" is the first time used.
Manager is of the type ServiceManager which is from
org.apache.avalon.framework.service.ServiceManager.
Maybe anyone could help me?
Thank's in advance.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]