You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by jw...@apache.org on 2005/03/20 18:43:40 UTC
svn commit: r158341 -
lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentTypeResolverImpl.java
Author: jwkaltz
Date: Sun Mar 20 09:43:39 2005
New Revision: 158341
URL: http://svn.apache.org/viewcvs?view=rev&rev=158341
Log:
[minor change] added some docu and debug messages
Modified:
lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentTypeResolverImpl.java
Modified: lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentTypeResolverImpl.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentTypeResolverImpl.java?view=diff&r1=158340&r2=158341
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentTypeResolverImpl.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentTypeResolverImpl.java Sun Mar 20 09:43:39 2005
@@ -31,7 +31,11 @@
import org.apache.lenya.cms.cocoon.uriparameterizer.URIParameterizer;
/**
- * Class to resolve the document type for a document.
+ * Service to resolve the document type for a document.
+ *
+ * <p>Note that in the current architecture, this requires access to the
+ * request, that is, the document type is determined upon each request.
+ * This service is currently not poolable.</p>
*
* @version $Id: DocumentTypeResolverImpl.java 152682 2005-02-08 18:13:39Z
* gregor $
@@ -60,6 +64,8 @@
}
/**
+ * Determine the document type for a document.
+ *
* @see org.apache.lenya.cms.publication.DocumentTypeResolver#resolve(org.apache.lenya.cms.publication.Document)
*/
public DocumentType resolve(Document document) {
@@ -79,8 +85,15 @@
String context = request.getContextPath();
String webappUrl = document.getCanonicalWebappURL();
String url = context + webappUrl;
+ if (getLogger().isDebugEnabled())
+ getLogger().debug("DocumentTypeResolverImpl.resolve() url = [" + url + "]");
+
map = parameterizer.parameterize(filterURI(url), filterURI(source), parameters);
String name = (String) map.get(URI_PARAMETER_DOCTYPE);
+
+ if (getLogger().isDebugEnabled())
+ getLogger().debug("DocumentTypeResolverImpl.resolve() name = [" + name + "], now calling DocumentTypeBuilder");
+
documentType = DocumentTypeBuilder.buildDocumentType(name, document.getPublication());
} catch (Exception e) {
@@ -90,8 +103,11 @@
this.manager.release(parameterizer);
}
}
- return documentType;
+ if (getLogger().isDebugEnabled())
+ getLogger().debug("DocumentTypeResolverImpl.resolve() returning documentType = [" + documentType + "]");
+
+ return documentType;
}
/**
@@ -110,4 +126,4 @@
return uri;
}
-}
\ No newline at end of file
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org