ASF Bugzilla – Attachment 21140 Details for
Bug 43886
[PATCH] DocumentPolicyManagerWrapper fails with non-UUID site nodes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for DocumentPolicyManagerWrapper
patch-bug43886.txt (text/plain), 3.17 KB, created by
Andreas Hartmann
on 2007-11-16 15:05:12 UTC
(
hide
)
Description:
Patch for DocumentPolicyManagerWrapper
Filename:
MIME Type:
Creator:
Andreas Hartmann
Created:
2007-11-16 15:05:12 UTC
Size:
3.17 KB
patch
obsolete
>Index: src/modules-core/ac/java/src/org/apache/lenya/cms/ac/DocumentPolicyManagerWrapper.java >=================================================================== >--- src/modules-core/ac/java/src/org/apache/lenya/cms/ac/DocumentPolicyManagerWrapper.java (revision 595265) >+++ src/modules-core/ac/java/src/org/apache/lenya/cms/ac/DocumentPolicyManagerWrapper.java (working copy) >@@ -42,8 +42,8 @@ > import org.apache.lenya.ac.Role; > import org.apache.lenya.ac.impl.DefaultAccessController; > import org.apache.lenya.cms.cocoon.components.context.ContextUtility; >-import org.apache.lenya.cms.publication.Document; > import org.apache.lenya.cms.publication.DocumentFactory; >+import org.apache.lenya.cms.publication.DocumentLocator; > import org.apache.lenya.cms.publication.DocumentUtil; > import org.apache.lenya.cms.publication.Publication; > import org.apache.lenya.cms.publication.PublicationUtil; >@@ -101,30 +101,16 @@ > .getRequest()); > DocumentFactory map = DocumentUtil.createDocumentFactory(this.serviceManager, session); > >- // always check for authoring URL since the live document doesn't >- // have to exist >- > URLInformation info = new URLInformation(webappUrl); >- // Danger, Will Robinson! If area or pubId is null, webappUrl.substring() >- // will be out of bounds, because null becomes "null" in string concatenation > String pubId = info.getPublicationId(); > String area = info.getArea(); >- String prefix = "/" + ((pubId != null) ? pubId + "/" : ""); >- // String prefix = "/" + pubId + "/"; >- String prefixWithArea = prefix + ((area != null) ? area : ""); >- // String prefixWithArea = prefix + area; >- String authoringUrl = prefix + Publication.AUTHORING_AREA >- + ((webappUrl.length()>prefixWithArea.length())?webappUrl.substring(prefixWithArea.length()):"/"); >- >- if (map.isDocument(authoringUrl)) { >- Document authoringDoc = map.getFromURL(authoringUrl); >- url = "/" + authoringDoc.getPublication().getId() + "/" + area >- + authoringDoc.getPath(); >- if (getLogger().isDebugEnabled()) { >- getLogger().debug(" Document exists"); >- getLogger().debug(" Document path: [" + authoringDoc.getPath() + "]"); >- } >+ >+ if (pubId != null && area != null && info.getDocumentUrl().length() > 0) { >+ Publication pub = map.getPublication(pubId); >+ DocumentLocator loc = pub.getDocumentBuilder().getLocator(map, webappUrl); >+ url = "/" + pubId + "/" + area + loc.getPath(); > } >+ > } catch (ServiceException e) { > throw new AccessControlException("Error looking up ContextUtility component", e); > } catch (Exception e) { >@@ -137,7 +123,7 @@ > > if (url == null) { > if (getLogger().isDebugEnabled()) { >- getLogger().debug(" Document does not exist."); >+ getLogger().debug(" URL does not refer to a document."); > } > url = webappUrl; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 43886
:
21140
|
21150