Hi!
Thank's for the answer.
At the moment i have done something like that:
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;
}
But it didn't work so far.
How can I initialize the ServiceManager?
And is something else missing?
Thank's in advance.
-----Ursprüngliche Nachricht-----
Von: Jörn Nettingsmeier [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 24. Januar 2008 11:34
An: [email protected]
Betreff: Re: Sample code for accessing the repository
Danny Waldmann wrote:
>
> Hi!
>
> I want to ask if there is some sample code to access content in the
> repository in Apache Lenya 2.0. I searched but did not found anything like
> that.
>
> Thank's in advance.
such a thing would be nice to have... should go into
http://lenya.apache.org/docs/2_0_x/reference/repository/index.html
currently, it contains a list of objects related to repository
management that might help you get started (in combination with the
javadocs).
danny, my standard reply would be UTSL, but it can be a little dangerous
with lenya, because i fear we might be using deprecated or hackish
access methods internally in some places...
i hope i'll find time soon to create a generic editor handler, at which
point i'll have to learn to work with our repo - some documentation
fallout might result. but don't hold your breath.
andreas, you being the repository man: can you maybe name a source file
that demonstrates how to get, store, update, lock, whatever, documents
in the repo in a concise manner, according to current best practice?
that would be a valuable starting point. the concepts page you mentioned
is really scarce indeed, and for example does not demonstrate locking.
--
Jörn Nettingsmeier
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]