throw new AccessControlException(e);
}
org.apache.lenya.cms.repository.Session repoSession = RepositoryUtil.getSession(
this.manager, request);
DocumentFactory factory = DocumentUtil.createDocumentFactory(this.manager, repoSession);
Document document = null;
try {
publication = PublicationUtil.getPublication(this.manager, objectModel);
envelope = PageEnvelopeFactory.getInstance().getPageEnvelope(factory, objectModel,
publication);
document = envelope.getDocument();
} catch (Exception e) {
getLogger().error("Resolving page envelope failed: ", e);
throw e;
}
// get Parameters for RC
String publicationPath = publication.getDirectory().getCanonicalPath();
RCEnvironment rcEnvironment = RCEnvironment.getInstance(publication.getServletContext()
.getCanonicalPath(), getLogger());
this.rcmlDirectory = rcEnvironment.getRCMLDirectory();
this.rcmlDirectory = publicationPath + File.separator + this.rcmlDirectory;
this.backupDirectory = rcEnvironment.getBackupDirectory();
this.backupDirectory = publicationPath + File.separator + this.backupDirectory;
// Get session
Session session = request.getSession(false);
if (session == null) {
getLogger().error(".act(): No session object");
return null;
}
Identity identity = (Identity) session.getAttribute(Identity.class.getName());
getLogger().debug(".act(): Identity: " + identity);
// FIXME: hack because of the uri for the editor bitflux. The filename
// cannot be get from
// the page-envelope
String documentid = document.getPath();
int bx = documentid.lastIndexOf("-bxe");
if (bx > 0) {
String language = document.getLanguage();
int l = documentid.length();
int bxLength = "-bxe".length();
int lang = documentid.lastIndexOf("_", bx);
int langLength = bx - lang;
if (bx > 0 && bx + bxLength <= l) {
documentid = documentid.substring(0, bx) + documentid.substring(bx + bxLength, l);
if (lang > 0 && langLength + lang < l) {
language = documentid.substring(lang + 1, lang + langLength);
documentid = documentid.substring(0, lang)
+ documentid.substring(lang + langLength, l - bxLength);
}
}
Document srcDoc = factory.get(publication, document.getArea(), documentid, language);
this.node = srcDoc.getRepositoryNode();
} else {
this.node = document.getRepositoryNode();
}