List Info

Thread: DO NOT REPLY Live documents with unpublished links fail




DO NOT REPLY Live documents with unpublished links fail
user name
2006-12-15 16:33:22
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41
183>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41183





------- Additional Comments From andreasapache.org  2006-12-15 08:33 -------
I introduced LinkTarget.exists() for this purpose, maybe
this works:
(I didn't try it yet)

Index:
/Users/nobby/apache/lenya/trunk/src/modules-core/linking/jav
a/src/org/apache/lenya/cms/cocoon/transformation/LinkRewriti
ngTransformer.java
============================================================
=======
---
/Users/nobby/apache/lenya/trunk/src/modules-core/linking/jav
a/src/org/apache/lenya/cms/cocoon/transformation/LinkRewriti
ngTransformer.java
(revision 482993)
+++
/Users/nobby/apache/lenya/trunk/src/modules-core/linking/jav
a/src/org/apache/lenya/cms/cocoon/transformation/LinkRewriti
ngTransformer.java
(working copy)
 -36,6
+36,7 
 import org.apache.lenya.ac.Policy;
 import org.apache.lenya.ac.PolicyManager;
 import org.apache.lenya.cms.linking.LinkResolver;
+import org.apache.lenya.cms.linking.LinkTarget;
 import org.apache.lenya.cms.publication.Document;
 import org.apache.lenya.cms.publication.DocumentFactory;
 import org.apache.lenya.cms.publication.DocumentUtil;
 -56,7
+57,7 
  * <p>
  * This transformer is applied to an XHMTL document. It
processes all links
  * following the {link LinkResolver} syntax which are
denoted by
- * {link ResourceType#getLinkAttributeXPaths()}.
+ * {link
org.apache.lenya.cms.publication.ResourceType#getLinkAttribu
teXPaths()}.
  * </p>
  * <p>
  * These links are resolved using the following rules:
 -209,8
+210,9 
                         if (linkUriAndQuery.length > 1)
{
                             queryString =
linkUriAndQuery[1];
                         }
-                        Document targetDocument =
this.linkResolver.resolve(doc, linkUri).getDocument();
-                        if (targetDocument != null) {
+                        LinkTarget target =
this.linkResolver.resolve(doc,
linkUri);
+                        if (target.exists()) {
+                            Document targetDocument =
target.getDocument();
                             String extension =
targetDocument.getExtension();
                             if (extension.length() > 0)
{
                                 extension = "." +
extension;


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=ema
il
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the
assignee.

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribelenya.apache.org
For additional commands, e-mail: dev-helplenya.apache.org

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )