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/04/13 14:42:34 UTC

svn commit: r161178 - in lenya/trunk/src/java/org/apache/lenya/cms/publication: DefaultDocument.java DefaultDocumentBuilder.java util/CollectionImpl.java util/XlinkCollection.java

Author: jwkaltz
Date: Wed Apr 13 05:42:32 2005
New Revision: 161178

URL: http://svn.apache.org/viewcvs?view=rev&rev=161178
Log:
[minor change] enabled using logger in DefaultDocument

Modified:
    lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultDocument.java
    lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultDocumentBuilder.java
    lenya/trunk/src/java/org/apache/lenya/cms/publication/util/CollectionImpl.java
    lenya/trunk/src/java/org/apache/lenya/cms/publication/util/XlinkCollection.java

Modified: lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultDocument.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultDocument.java?view=diff&r1=161177&r2=161178
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultDocument.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultDocument.java Wed Apr 13 05:42:32 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright  1999-2004 The Apache Software Foundation
+ * Copyright  1999-2005 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@
 
 import org.apache.avalon.framework.container.ContainerUtil;
 import org.apache.avalon.framework.logger.AbstractLogEnabled;
+import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.ServiceSelector;
 import org.apache.excalibur.source.SourceResolver;
@@ -62,10 +63,11 @@
      * @param publication The publication.
      * @param _id The document ID (starting with a slash).
      * @param _area The area.
+     * @param _logger a logger
      */
     protected DefaultDocument(ServiceManager manager, DocumentIdentityMap map,
-            Publication publication, String _id, String _area) {
-        this(manager, map, publication, _id, _area, publication.getDefaultLanguage());
+            Publication publication, String _id, String _area, Logger _logger) {
+        this(manager, map, publication, _id, _area, publication.getDefaultLanguage(), _logger);
     }
 
     /**
@@ -76,9 +78,16 @@
      * @param _id The document ID (starting with a slash).
      * @param _area The area.
      * @param _language the language
+     * @param _logger a logger
      */
     protected DefaultDocument(ServiceManager manager, DocumentIdentityMap map,
-            Publication publication, String _id, String _area, String _language) {
+            Publication publication, String _id, String _area, String _language,
+            Logger _logger) {
+
+        ContainerUtil.enableLogging(this, _logger);
+        if (getLogger().isDebugEnabled())
+            getLogger().debug("DefaultDocument() creating new instance with _id [" + _id + "], _language [" + _language + "]");
+
         this.manager = manager;
         if (_id == null) {
             throw new IllegalArgumentException("The document ID must not be null!");
@@ -502,4 +511,4 @@
         return nodes;
     }
 
-}
\ No newline at end of file
+}

Modified: lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultDocumentBuilder.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultDocumentBuilder.java?view=diff&r1=161177&r2=161178
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultDocumentBuilder.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultDocumentBuilder.java Wed Apr 13 05:42:32 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright  1999-2004 The Apache Software Foundation
+ * Copyright  1999-2005 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -102,7 +102,7 @@
     protected DefaultDocument createDocument(DocumentIdentityMap map, Publication publication,
             String area, String documentId, String language) throws DocumentBuildException {
         DefaultDocument document = new DefaultDocument(this.manager, map, publication, documentId,
-                area, language);
+                area, language, getLogger());
         return document;
     }
 
@@ -213,4 +213,4 @@
         return url;
     }
 
-}
\ No newline at end of file
+}

Modified: lenya/trunk/src/java/org/apache/lenya/cms/publication/util/CollectionImpl.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/publication/util/CollectionImpl.java?view=diff&r1=161177&r2=161178
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/publication/util/CollectionImpl.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/publication/util/CollectionImpl.java Wed Apr 13 05:42:32 2005
@@ -26,6 +26,7 @@
 
 import javax.xml.parsers.ParserConfigurationException;
 
+import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.lenya.cms.publication.DefaultDocument;
 import org.apache.lenya.cms.publication.Document;
@@ -55,11 +56,12 @@
      * @param publication The publication.
      * @param id The document ID.
      * @param area The area the document belongs to.
+     * @param _logger a logger
      * @throws DocumentException when something went wrong.
      */
     public CollectionImpl(ServiceManager manager, DocumentIdentityMap map, Publication publication,
-            String id, String area) throws DocumentException {
-        super(manager, map, publication, id, area);
+            String id, String area, Logger _logger) throws DocumentException {
+        super(manager, map, publication, id, area, _logger);
     }
 
     /**
@@ -70,11 +72,12 @@
      * @param id The document ID.
      * @param area The area the document belongs to.
      * @param language The language of the document.
+     * @param _logger a logger
      * @throws DocumentException when something went wrong.
      */
     public CollectionImpl(ServiceManager manager, DocumentIdentityMap map, Publication publication,
-            String id, String area, String language) throws DocumentException {
-        super(manager, map, publication, id, area, language);
+            String id, String area, String language, Logger _logger) throws DocumentException {
+        super(manager, map, publication, id, area, language, _logger);
     }
 
     private List documentsList = new ArrayList();
@@ -296,4 +299,4 @@
         return documents().size();
     }
 
-}
\ No newline at end of file
+}

Modified: lenya/trunk/src/java/org/apache/lenya/cms/publication/util/XlinkCollection.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/publication/util/XlinkCollection.java?view=diff&r1=161177&r2=161178
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/publication/util/XlinkCollection.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/publication/util/XlinkCollection.java Wed Apr 13 05:42:32 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright  1999-2004 The Apache Software Foundation
+ * Copyright  1999-2005 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
 
 import javax.xml.parsers.ParserConfigurationException;
 
+import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.lenya.cms.publication.Document;
 import org.apache.lenya.cms.publication.DocumentException;
@@ -44,11 +45,12 @@
      * @param publication The publication.
      * @param id The document ID.
      * @param area The area the document belongs to.
+     * @param _logger a logger
      * @throws DocumentException when something went wrong.
      */
     public XlinkCollection(ServiceManager manager, DocumentIdentityMap map,
-            Publication publication, String id, String area) throws DocumentException {
-        super(manager, map, publication, id, area);
+            Publication publication, String id, String area, Logger _logger) throws DocumentException {
+        super(manager, map, publication, id, area, _logger);
     }
 
     /**
@@ -59,12 +61,13 @@
      * @param id The document ID.
      * @param area The area the document belongs to.
      * @param language The language of the document.
+     * @param _logger a logger
      * @throws DocumentException when something went wrong.
      */
     public XlinkCollection(ServiceManager manager, DocumentIdentityMap map,
-            Publication publication, String id, String area, String language)
+            Publication publication, String id, String area, String language, Logger _logger)
             throws DocumentException {
-        super(manager, map, publication, id, area, language);
+        super(manager, map, publication, id, area, language, _logger);
     }
 
     /**
@@ -118,4 +121,4 @@
         return helper;
     }
 
-}
\ 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