hi !

i need to walk the publication templating tree in an xsp serverpage.
the problem is i don't know how to get hold of a Publication object via a publicationID.

here's my code so far:

DocumentFactory factory =
    DocumentUtil.createDocumentFactory(this.manager, session);
Publication pub =
    factory.getPublication(parameters.getParameter("pubid", "null"));

while (pub != null) {
  do_something();
  // walk down the template tree:
  // i have no idea why templateIds is an array. multiple inheritance?
  pub = factory.getPublication(pub.getTemplateIds()[0]);
}

the problem is the DocumentFactory. it wants a org.apache.lenya.cms.repository.Session, and all i have in an xsp is a org.apache.cocoon.environment.Session.

so either i need a way to get a valid repository.Session, or maybe someone can point out an altogether simpler approach?

to get the current publication, i know i can also do
  Publication publication = (Publication) <input:get-attribute
     module="page-envelope" as="object" name="publication"/>;
but what if i need to access pubs other than the current?

tia,

jörn




--
"It's sad to behold how lately the wonderful English language has,
in the hands of corporate executives and marketing experts, re-
adjusted its prospective itinerary towards mythical subterranean
realms of discomfort, leveraging traditional woven containment
devices."

--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: [EMAIL PROTECTED], Telefon: 0203/379-2736

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to