Author: xlawrence
Date: Thu Jun 28 17:06:13 2007
New Revision: 17821

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D17821&repname=
=3Djahia
Log:
backport javadoc fixes from SP branch

Modified:
    trunk/core/src/java/org/jahia/data/containers/JahiaContainerSet.java

Modified: trunk/core/src/java/org/jahia/data/containers/JahiaContainerSet.j=
ava
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/java/o=
rg/jahia/data/containers/JahiaContainerSet.java&rev=3D17821&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/java/org/jahia/data/containers/JahiaContainerSet.java (o=
riginal)
+++ trunk/core/src/java/org/jahia/data/containers/JahiaContainerSet.java Th=
u Jun 28 17:06:13 2007
@@ -39,6 +39,7 @@
 import org.jahia.services.pages.ContentPage;
 import org.jahia.services.version.EntryLoadRequest;
 import org.jahia.utils.JahiaTools;
+import org.jahia.params.ProcessingContext;
 import org.springframework.context.ApplicationContext;
 =

 import java.util.*;
@@ -181,9 +182,9 @@
      * @param        fieldType       the field tpe
      * @param        defaultValue    the default field value
      *
-     * @exception    raises a critical JahiaException if the container has=
 been already declared
-     * @exception    raises a critical JahiaException if one of the contai=
nerFields have not been declared
-     * @exception    raises a critical JahiaException if one of the fields=
 has the same name as the container
+     * @throws JahiaException raises a critical JahiaException if the cont=
ainer has been already declared
+     * @throws JahiaException raises a critical JahiaException if one of t=
he containerFields have not been declared
+     * @throws JahiaException raises a critical JahiaException if one of t=
he fields has the same name as the container
      *
      * @deprecated, use declareField (String containerName, String fieldNa=
me, String fieldTitle,
      *                         int fieldType, String defaultValue)
@@ -203,9 +204,9 @@
      * @param        fieldType       the field tpe
      * @param        defaultValue    the default field value
      *
-     * @exception    raises a critical JahiaException if the container has=
 been already declared
-     * @exception    raises a critical JahiaException if one of the contai=
nerFields have not been declared
-     * @exception    raises a critical JahiaException if one of the fields=
 has the same name as the container
+     * @throws JahiaException raises a critical JahiaException if the cont=
ainer has been already declared
+     * @throws JahiaException raises a critical JahiaException if one of t=
he containerFields have not been declared
+     * @throws JahiaException raises a critical JahiaException if one of t=
he fields has the same name as the container
      *
      */
     public void declareField (String containerName, String fieldName, Stri=
ng fieldTitle,
@@ -220,21 +221,20 @@
         declareField(containerName, fieldName, fieldTitle, fieldType, defa=
ultValue, new String[0], 1.0f);
     }
 =

-    public void declareField (String containerName, String fieldName, Stri=
ng fieldTitle,
-                              int fieldType, String defaultValue, String[]=
 aliasNames, float boostFactor)
-        throws JahiaException {
+    public void declareField(String containerName, String fieldName, Strin=
g fieldTitle,
+                             int fieldType, String defaultValue, String[] =
aliasNames, float boostFactor)
+            throws JahiaException {
         declareField(containerName, fieldName, fieldTitle, fieldType, defa=
ultValue, new String[0], boostFactor, true);
     }
 =

     /**
-     *
      * @param containerName
      * @param fieldName
      * @param fieldTitle
      * @param fieldType
      * @param defaultValue
      * @param aliasNames
-     * @param boostFactor the search boost factor, 1.0 by default
+     * @param boostFactor    the search boost factor, 1.0 by default
      * @param indexableField true by default, false if the field should no=
t be indexed
      * @throws JahiaException
      */
@@ -273,7 +273,7 @@
                              boolean indexableField,
                              boolean readOnly)
             throws JahiaException {
-        /** @todo ensure that the data provided by the user has no special=
 chars in it */
+        /** todo ensure that the data provided by the user has no special =
chars in it */
         // we check if a field with the same name was not already declared=
, of if the field has no
         // empty name or title
         boolean isDeclaredField =3D checkDeclaredField(containerName,field=
Name);
@@ -294,8 +294,8 @@
 =

         // boost Factor
         declareFieldDefProp(fieldName, FieldDefinition.SCORE_BOOST,String.=
valueOf(boostFactor));
-
-        declareFieldDefProp(fieldName, FieldDefinition.INDEXABLE_FIELD,new=
 Boolean(indexableField).toString());
+        declareFieldDefProp(fieldName, FieldDefinition.INDEXABLE_FIELD, St=
ring.valueOf(indexableField));
+        declareFieldDefProp(fieldName, FieldDefinition.READ_ONLY, String.v=
alueOf(readOnly));
 =

         if ( !isDeclaredField &&
             //MC: this check was removed as it doesn't seem to have any pu=
rpose anymore
@@ -459,9 +459,9 @@
      * @param        containerTitle  the container title
          * @param        containerFields the fields (or containers) in the=
 container
      *
-     * @exception    raises a critical JahiaException if the container has=
 been already declared
-     * @exception    raises a critical JahiaException if one of the contai=
nerFields have not been declared
-     * @exception    raises a critical JahiaException if one of the fields=
 has the same name as the container
+     * @throws JahiaException raises a critical JahiaException if the cont=
ainer has been already declared
+     * @throws JahiaException raises a critical JahiaException if one of t=
he containerFields have not been declared
+     * @throws JahiaException raises a critical JahiaException if one of t=
he fields has the same name as the container
      *
      * In order to let a container include itself, the keyword "_self" in =
the containeFields must be used.
      *
@@ -479,20 +479,18 @@
      *
      * @param        containerName   the container name
      * @param        containerTitle  the container title
-         * @param        containerFields the fields (or containers) in the=
 container
+     * @param        containerFields the fields (or containers) in the con=
tainer
      * @param        windowSize      an integer specifying the size of the
      * display window in number of containers. Valid values are >=3D 1, -1=
 to
      * deactivate this feature
      * @param        windowOffset    an integer specifying the offset in t=
he
          * list of containers, to be used only when windowSize >=3D 1. Val=
id values are
      * >=3D 0, and -1 is used to deactivate this feature
-     *
-     * @exception    raises a critical JahiaException if the container has=
 been already declared
-     * @exception    raises a critical JahiaException if one of the contai=
nerFields have not been declared
-     * @exception    raises a critical JahiaException if one of the fields=
 has the same name as the container
-     *
+     * @throws JahiaException raises a critical JahiaException if the cont=
ainer has been already declared
+     * @throws JahiaException raises a critical JahiaException if one of t=
he containerFields have not been declared
+     * @throws JahiaException raises a critical JahiaException if one of t=
he fields has the same name as the container
+     *                        <p/>
      * In order to let a container include itself, the keyword "_self" in =
the containeFields must be used.
-     *
      */
     public void declareContainer (String containerName, String containerTi=
tle,
                                   Vector containerFields, int windowSize,
@@ -519,13 +517,11 @@
      *                                  applied to this container
      * @param        containerBeanName  the name of the bean class being w=
rapped around
      *                                  the container facade
-     *
-     * @exception    raises a critical JahiaException if the container has=
 been already declared
-     * @exception    raises a critical JahiaException if one of the contai=
nerFields have not been declared
-     * @exception    raises a critical JahiaException if one of the fields=
 has the same name as the container
-     *
+     * @throws JahiaException raises a critical JahiaException if the cont=
ainer has been already declared
+     * @throws JahiaException raises a critical JahiaException if one of t=
he containerFields have not been declared
+     * @throws JahiaException raises a critical JahiaException if one of t=
he fields has the same name as the container
+     *                        <p/>
      * In order to let a container include itself, the keyword "_self" in =
the containeFields must be used.
-     *
      */
     public void declareContainer (String containerName, String containerTi=
tle,
                                   Vector containerFields, int windowSize,
@@ -558,13 +554,11 @@
      * @param        aliasNames         this container's alias ( Container=
 Definition Names )
      *                                  Commas separated names without spa=
ces , i.e : containerName1,containerName2,containerName3
      *                                  Theses alias state that a containe=
r is of same structure as another container of given alias name
-     *
-     * @exception    raises a critical JahiaException if the container has=
 been already declared
-     * @exception    raises a critical JahiaException if one of the contai=
nerFields have not been declared
-     * @exception    raises a critical JahiaException if one of the fields=
 has the same name as the container
-     *
+     * @throws JahiaException raises a critical JahiaException if the cont=
ainer has been already declared
+     * @throws JahiaException raises a critical JahiaException if one of t=
he containerFields have not been declared
+     * @throws JahiaException raises a critical JahiaException if one of t=
he fields has the same name as the container
+     *                        <p/>
      * In order to let a container include itself, the keyword "_self" in =
the containeFields must be used.
-     *
      */
     public void declareContainer (String containerName, String containerTi=
tle,
                                   Vector containerFields, int windowSize,
@@ -623,7 +617,7 @@
                                   Properties containerDefProperties)
         throws JahiaException {
 =

-            /** @todo ensure that the data provided by the user has no spe=
cial chars in it */
+            /** todo ensure that the data provided by the user has no spec=
ial chars in it */
         // check if a container has already been declared with the same na=
me
         if (checkDeclared(containerName)
                 ||
@@ -748,7 +742,7 @@
                         ctnDefRegistry.setDefinition(aDef);
                     }
                     /**
-                     * @todo we should now reload the container list since=
 a lot of things have changed, including window parameters.
+                     * todo we should now reload the container list since =
a lot of things have changed, including window parameters.
                      */
                     if (propertiesHaveChanged) {
                         logger.debug("Reloading containerList " + containe=
rName
@@ -832,7 +826,7 @@
      *
      * @param containerName
      *            the container name
-     * @param ContainerEditView ,
+     * @param editView ,
      *            the view definition
      */
     public void declareContainerEditView (String containerName,
@@ -840,7 +834,7 @@
         throws JahiaException {
 =

         logger.debug("for container [" + containerName + "]");
-        /** @todo ensure that the data provided by the user has no special=
 chars in it */
+        /** todo ensure that the data provided by the user has no special =
chars in it */
 =

         // check if a container has already been declared with the same na=
me
         if (containerName.length() !=3D 0) {
@@ -858,7 +852,7 @@
     }
 =

     //--------------------------------------------------------------------=
-----
-        /** @todo fix this implementation. It is extremely costly in perfo=
rmance. */
+        /** todo fix this implementation. It is extremely costly in perfor=
mance. */
     /***
      * enables a jahia template developer to update a container definition
      * used in the Jahia custom tag : org.jahia.tags.jahia.containers.Cont=
ainerListTag
@@ -1131,8 +1125,7 @@
             JahiaContainerList theContainerList =3D (JahiaContainerList)
                                                   containerLists.get(
                 containerName);
-            EntryLoadRequest usedLoadRequest =3D  jData.getProcessingConte=
xt().
-                        getEntryLoadRequest();
+            EntryLoadRequest usedLoadRequest =3D  jData.getProcessingConte=
xt().getEntryLoadRequest();
             if (theContainerList =3D=3D null) {
                 int clistID =3D ServicesRegistry.getInstance().
                               getJahiaContainersService().
@@ -1161,18 +1154,22 @@
                         // apply containers search and filtering.
 =

                         // When requesting an archived loadRequest
-                        EntryLoadRequest loadRequest =3D (EntryLoadRequest)
-                            ctnLoadRequest.clone();
+                        EntryLoadRequest loadRequest =3D (EntryLoadRequest=
) ctnLoadRequest.clone();
+                        final ProcessingContext jParams =3D this.jData.get=
ProcessingContext();
                         //if (loadRequest.isVersioned()) {
-                            if ( this.jData.getProcessingContext().showRev=
isionDiff() ){
-                                // @todo :
-                                // not fully handle so we dont load delete=
d yet
-                                loadRequest.setWithDeleted(true);
-                                loadRequest.setWithMarkedForDeletion(true);
-                            } else {
-                                loadRequest.setWithDeleted(false);
-                                loadRequest.setWithMarkedForDeletion(false=
);
-                            }
+                        if (jParams.showRevisionDiff()) {
+                            // @todo :
+                            // not fully handle so we dont load deleted yet
+                            loadRequest.setWithDeleted(true);
+                        } else {
+                            loadRequest.setWithDeleted(false);
+                        }
+                        if (ProcessingContext.EDIT.equals(jParams.getOpMod=
e()) ||
+                                ProcessingContext.COMPARE.equals(jParams.g=
etOpMode())) {
+                            loadRequest.setWithMarkedForDeletion(true);
+                        } else {
+                            loadRequest.setWithMarkedForDeletion(false);
+                        }
                         //}
                         usedLoadRequest =3D loadRequest;
                         try {
@@ -1182,8 +1179,8 @@
                                          this.cachedFieldsFromContainers,
                                          this.cachedContainersFromContaine=
rLists,
                                          this.cachedContainerListsFromCont=
ainers);
-                        } catch (Throwable t) {
-                            logger.error("error while loading containerlis=
t", t);
+                        } catch (final Throwable t) {
+                           logger.error("Error in getContainerList", t);
                         }
                     }
                 }
@@ -1195,6 +1192,7 @@
                         theContainerList,theContainerList.getACL().getPare=
ntID(),
                         jData.getProcessingContext());
             }
+
             if (theContainerList !=3D null && theContainerList.getID() =3D=
=3D 0) {
                 JahiaContainerDefinition containerDefinition =3D
                     JahiaContainerDefinitionsRegistry.getInstance().
@@ -1245,21 +1243,25 @@
 =

         Iterator containerListIter =3D containerLists.values().iterator();
         while (containerListIter.hasNext()) {
-            JahiaContainerList aList =3D (JahiaContainerList) containerLis=
tIter.
-                                       next();
+            JahiaContainerList aList =3D (JahiaContainerList) containerLis=
tIter.next();
             if (aList.getID() =3D=3D listID) {
                 if ( !aList.isContainersLoaded() ){
                     // When requesting an archived loadRequest
+                    final ProcessingContext jParams =3D jData.getProcessin=
gContext();
                     EntryLoadRequest loadRequest =3D
-                        (EntryLoadRequest) jData.getProcessingContext().
-                        getEntryLoadRequest().clone();
-                    if ( this.jData.getProcessingContext().showRevisionDif=
f() ){
+                        (EntryLoadRequest) jData.getProcessingContext().ge=
tEntryLoadRequest().clone();
+                    if ( jParams.showRevisionDiff() ){
                         loadRequest.setWithDeleted(true);
-                        loadRequest.setWithMarkedForDeletion(true);
                     } else {
                         loadRequest.setWithDeleted(false);
+                    }
+                    if (ProcessingContext.EDIT.equals(jParams.getOpMode())=
 ||
+                            ProcessingContext.COMPARE.equals(jParams.getOp=
Mode())) {
+                        loadRequest.setWithMarkedForDeletion(true);
+                    } else {
                         loadRequest.setWithMarkedForDeletion(false);
                     }
+
                     ContainerFactory.getInstance()
                             .fullyLoadContainerList(aList,LoadFlags.ALL,
                             this.jData.getProcessingContext(),loadRequest,
@@ -1320,7 +1322,7 @@
                                                       getInstance().getJah=
iaContainersService().
                                                       getContainerDefiniti=
onParents(theDef.getID());
             /**
-             * @todo possible bug here, should we check the parent sub
+             * todo possible bug here, should we check the parent sub
              * container definitions for their page ID ? Because container
              * definitions are not local to a page, but sub container defi=
nitions
              * are...
@@ -1353,6 +1355,7 @@
                     cachedContainersFromContainerLists=3D new HashMap();
                     cachedContainerListsFromContainers=3D new HashMap();
                 }
+               =

                 EntryLoadRequest ctnLoadRequest =3D jData.getProcessingCon=
text().
                                                   getEntryLoadRequest();
                 if (ctnLoadRequest.isVersioned()) {
@@ -1372,13 +1375,17 @@
                 } else {
 =

                     // When requesting an archived loadRequest
-                    EntryLoadRequest loadRequest =3D
-                        (EntryLoadRequest) ctnLoadRequest.clone();
-                    if ( this.jData.getProcessingContext().showRevisionDif=
f() ){
+                    EntryLoadRequest loadRequest =3D (EntryLoadRequest) ct=
nLoadRequest.clone();
+                    final ProcessingContext jParams =3D this.jData.getProc=
essingContext();
+                    if (jParams.showRevisionDiff()) {
                         loadRequest.setWithDeleted(true);
-                        loadRequest.setWithMarkedForDeletion(true);
                     } else {
                         loadRequest.setWithDeleted(false);
+                    }
+                    if (ProcessingContext.EDIT.equals(jParams.getOpMode())=
 ||
+                            ProcessingContext.COMPARE.equals(jParams.getOp=
Mode())) {
+                        loadRequest.setWithMarkedForDeletion(true);
+                    } else {
                         loadRequest.setWithMarkedForDeletion(false);
                     }
 =

@@ -1390,6 +1397,7 @@
                                      currentCachedFieldsFromContainers,
                                      currentCachedContainersFromContainerL=
ists,
                                      currentCachedContainerListsFromContai=
ners);
+
                     } else if ( !theContainerList.isContainersLoaded() ){
                         ContainerFactory.getInstance()
                                      .fullyLoadContainerList(theContainerL=
ist,
@@ -1398,10 +1406,11 @@
                                      currentCachedFieldsFromContainers,
                                      currentCachedContainersFromContainerL=
ists,
                                      currentCachedContainerListsFromContai=
ners);
+
                     }
                 }
-            } catch (Throwable t) {
-                logger.error("error while loading container list", t);
+            } catch (final Throwable t) {
+                logger.error("Error in getAbsoluteContainerList", t);
             }
             /** what this code does for NK **/
             if (theContainerList =3D=3D null) {
@@ -1559,7 +1568,7 @@
             } else {
                 id =3D jahiaContainersService.getContainerListID(def.getNa=
me(), page, parent);
             }
-            JahiaContainerList list =3D null;
+            final JahiaContainerList list;
             if (id =3D=3D -1) {
                 int parentAclID =3D 0;
                 if (parent !=3D 0) {

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to