I would like to know if someone has done a direct call to a servlet in admin
part (Author) context.
Because I found the filter info.magnolia.cms.filters.AggregorFilter stop my
request. This method return an exception and my server throws page not found.
[code]
/**
* Collect content from the pre configured repository and attach it to the
HttpServletRequest.
* @throws PathNotFoundException
* @throws RepositoryException
*/
protected boolean collect() throws RepositoryException {
final AggregationState aggregationState =
MgnlContext.getAggregationState();
final String handle = aggregationState.getHandle();
final String repository = aggregationState.getRepository();
final HierarchyManager hierarchyManager =
MgnlContext.getHierarchyManager(repository);
Content requestedPage = null;
NodeData requestedData = null;
final String templateName;
if (!isJcrPathValid(handle)) {
// avoid calling isExist if the path can't be valid
return false;
}
if (hierarchyManager.isExist(handle) &&
!hierarchyManager.isNodeData(handle)) {
requestedPage = hierarchyManager.getContent(handle);
// check if its a request for a versioned page
if (MgnlContext.getAttribute(VERSION_NUMBER) != null) {
// get versioned state
try {
requestedPage =
requestedPage.getVersionedContent((String)MgnlContext.getAttribute(VERSION_NUMBER));
}
catch (RepositoryException re) {
log.debug(re.getMessage(), re);
log.error("Unable to get versioned state, rendering current
state of {}", handle);
}
}
templateName = requestedPage.getMetaData().getTemplate();
if (StringUtils.isBlank(templateName)) {
log.error("No template configured for page [{}].",
requestedPage.getHandle()); //$NON-NLS-1$
}
}
else {
if (hierarchyManager.isNodeData(handle)) {
requestedData = hierarchyManager.getNodeData(handle);
}
else {
// check again, resource might have different name
int lastIndexOfSlash = handle.lastIndexOf("/"); //$NON-NLS-1$
if (lastIndexOfSlash > 0) {
final String handleToUse =
StringUtils.substringBeforeLast(handle, "/"); //$NON-NLS-1$
try {
requestedData =
hierarchyManager.getNodeData(handleToUse);
aggregationState.setHandle(handleToUse);
// this is needed for binary nodedata, e.g. images are
found using the path:
// /features/integration/headerImage instead of
/features/integration/headerImage/header30_2
}
catch (PathNotFoundException e) {
// no page available
return false;
}
catch (RepositoryException e) {
log.debug(e.getMessage(), e);
return false;
}
}
}
if (requestedData != null) {
templateName =
requestedData.getAttribute(FileProperties.PROPERTY_TEMPLATE);
}
else {
return false;
}
}
// Attach all collected information to the HttpServletRequest.
if (requestedPage != null) {
aggregationState.setMainContent(requestedPage);
aggregationState.setCurrentContent(requestedPage);
}
if ((requestedData != null) && (requestedData.getType() ==
PropertyType.BINARY)) {
File file = new File(requestedData);
aggregationState.setFile(file);
}
aggregationState.setTemplateName(templateName);
return true;
}
[/code]
--
Context is everything:
http://forum.magnolia-cms.com/forum/thread.html?threadId=46792229-594e-4050-ad6c-94a43ced29d7
----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------