Author: tmortagne
Date: 2007-09-26 16:42:13 +0200 (Wed, 26 Sep 2007)
New Revision: 5097

Modified:
   
xwiki-platform/xwiki-plugins/trunk/application-manager/src/main/java/com/xpn/xwiki/plugin/applicationmanager/core/doc/objects/classes/AbstractSuperClass.java
   
xwiki-platform/xwiki-plugins/trunk/application-manager/src/main/java/com/xpn/xwiki/plugin/applicationmanager/core/doc/objects/classes/DefaultSuperDocument.java
   
xwiki-platform/xwiki-plugins/trunk/application-manager/src/main/java/com/xpn/xwiki/plugin/applicationmanager/core/doc/objects/classes/SuperClass.java
   
xwiki-platform/xwiki-plugins/trunk/application-manager/src/main/java/com/xpn/xwiki/plugin/applicationmanager/core/doc/objects/classes/SuperDocument.java
Log:
XAAM-4 : Add getClassTemplateSpace and getClassSheetSpace in SuperClass.
Little javadoc improvement.

Modified: 
xwiki-platform/xwiki-plugins/trunk/application-manager/src/main/java/com/xpn/xwiki/plugin/applicationmanager/core/doc/objects/classes/AbstractSuperClass.java
===================================================================
--- 
xwiki-platform/xwiki-plugins/trunk/application-manager/src/main/java/com/xpn/xwiki/plugin/applicationmanager/core/doc/objects/classes/AbstractSuperClass.java
       2007-09-26 12:56:58 UTC (rev 5096)
+++ 
xwiki-platform/xwiki-plugins/trunk/application-manager/src/main/java/com/xpn/xwiki/plugin/applicationmanager/core/doc/objects/classes/AbstractSuperClass.java
       2007-09-26 14:42:13 UTC (rev 5097)
@@ -31,9 +31,18 @@
 
 /**
  * Abstract implementation of SuperClass.
- * @todo See http://jira.xwiki.org/jira/browse/XWIKI-1571. When that issue is 
applied in XWiki
- *       Core and when this plugin moves to the version of XWiki Core where it 
was applied then
- *       remove this class.
+ * <p>
+ * This class has to be extended with at least :
+ * <ul>
+ * <li>overload [EMAIL PROTECTED] #updateBaseClass(BaseClass)}
+ * <li>in constructor call AbstractSuperClass constructor with a name that 
will be used to generate
+ * all the documents and spaces needed.
+ * </p>
+ * 
+ * @see SuperClass
+ * @todo See http://jira.xwiki.org/jira/browse/XWIKI-1571. When that issue is 
applied in XWiki Core
+ *       and when this plugin moves to the version of XWiki Core where it was 
applied then remove
+ *       this class.
  */
 public abstract class AbstractSuperClass implements SuperClass
 {
@@ -43,6 +52,7 @@
      * @see #getClassSpace()
      */
     private final String CLASS_SPACE_PREFIX;
+
     /**
      * Prefix of class document.
      * 
@@ -56,12 +66,14 @@
      * @see #getClassSpace()
      */
     private final String CLASS_SPACE;
+
     /**
      * Name of class document.
      * 
      * @see #getClassName()
      */
     private final String CLASS_NAME;
+
     /**
      * Full name of class document.
      * 
@@ -75,12 +87,14 @@
      * @see #getClassSpace()
      */
     private final String CLASSSHEET_SPACE;
+
     /**
      * Name of class sheet document.
      * 
      * @see #getClassSheetName()
      */
     private final String CLASSSHEET_NAME;
+
     /**
      * Full name of class sheet document.
      * 
@@ -94,12 +108,14 @@
      * @see #getClassSpace()
      */
     private final String CLASSTEMPLATE_SPACE;
+
     /**
      * Name of class template document.
      * 
      * @see #getClassTemplateName()
      */
     private final String CLASSTEMPLATE_NAME;
+
     /**
      * Full name of class template document.
      * 
@@ -111,8 +127,9 @@
      * Default content of class template document.
      */
     private final String classSheetDefaultContent;
+
     /**
-     * Default content of class sheet docuement.
+     * Default content of class sheet document.
      */
     private final String classTemplateDefaultContent;
 
@@ -121,8 +138,8 @@
         return CLASS_SPACE_PREFIX;
     }
 
-    /*
-     * (non-Javadoc)
+    /**
+     * [EMAIL PROTECTED]
      * 
      * @see com.xpn.xwiki.util.SuperClass#getClassSpace()
      */
@@ -131,8 +148,8 @@
         return CLASS_SPACE;
     }
 
-    /*
-     * (non-Javadoc)
+    /**
+     * [EMAIL PROTECTED]
      * 
      * @see com.xpn.xwiki.util.SuperClass#getClassPrefix()
      */
@@ -141,8 +158,8 @@
         return CLASS_PREFIX;
     }
 
-    /*
-     * (non-Javadoc)
+    /**
+     * [EMAIL PROTECTED]
      * 
      * @see com.xpn.xwiki.util.SuperClass#getClassName()
      */
@@ -151,8 +168,8 @@
         return CLASS_NAME;
     }
 
-    /*
-     * (non-Javadoc)
+    /**
+     * [EMAIL PROTECTED]
      * 
      * @see com.xpn.xwiki.util.SuperClass#getClassFullName()
      */
@@ -161,8 +178,8 @@
         return CLASS_FULLNAME;
     }
 
-    /*
-     * (non-Javadoc)
+    /**
+     * [EMAIL PROTECTED]
      * 
      * @see com.xpn.xwiki.util.SuperClass#getClassTemplateName()
      */
@@ -171,8 +188,8 @@
         return CLASSTEMPLATE_SPACE;
     }
 
-    /*
-     * (non-Javadoc)
+    /**
+     * [EMAIL PROTECTED]
      * 
      * @see com.xpn.xwiki.util.SuperClass#getClassTemplateName()
      */
@@ -181,8 +198,8 @@
         return CLASSTEMPLATE_NAME;
     }
 
-    /*
-     * (non-Javadoc)
+    /**
+     * [EMAIL PROTECTED]
      * 
      * @see com.xpn.xwiki.util.SuperClass#getClassTemplateFullName()
      */
@@ -191,8 +208,8 @@
         return CLASSTEMPLATE_FULLNAME;
     }
 
-    /*
-     * (non-Javadoc)
+    /**
+     * [EMAIL PROTECTED]
      * 
      * @see com.xpn.xwiki.util.SuperClass#getClassSheetName()
      */
@@ -201,8 +218,8 @@
         return CLASSSHEET_SPACE;
     }
 
-    /*
-     * (non-Javadoc)
+    /**
+     * [EMAIL PROTECTED]
      * 
      * @see com.xpn.xwiki.util.SuperClass#getClassSheetName()
      */
@@ -211,8 +228,8 @@
         return CLASSSHEET_NAME;
     }
 
-    /*
-     * (non-Javadoc)
+    /**
+     * [EMAIL PROTECTED]
      * 
      * @see com.xpn.xwiki.util.SuperClass#getClassSheetFullName()
      */
@@ -245,9 +262,9 @@
     /**
      * Constructor for AbstractSuperClass.
      * 
-     * @param spaceprefix   Space of class document.
-     * @param prefix        Prefix of class document.
-     * @param dispatch      Use XWiki applications space names. 
+     * @param spaceprefix Space of class document.
+     * @param prefix Prefix of class document.
+     * @param dispatch Use XWiki applications space names.
      */
     protected AbstractSuperClass(String spaceprefix, String prefix, boolean 
dispatch)
     {
@@ -292,8 +309,7 @@
 
     /**
      * Check if all necessary documents for manage this class in this context 
exists and update.
-     * Create if not exists.
-     * Thread safe.
+     * Create if not exists. Thread safe.
      * 
      * @param context Context.
      * @throws XWikiException
@@ -307,7 +323,7 @@
                 _checkClassTemplateDocument(context);
 
                 this.databasesInitedMap.add(context.getDatabase());
-            }   
+            }
         }
     }
 
@@ -340,8 +356,8 @@
             xwiki.saveDocument(doc, context);
     }
 
-    /*
-     * (non-Javadoc)
+    /**
+     * [EMAIL PROTECTED]
      * 
      * @see com.xpn.xwiki.util.SuperClass#getClassSheetDefaultContent()
      */
@@ -379,8 +395,8 @@
             xwiki.saveDocument(doc, context);
     }
 
-    /*
-     * (non-Javadoc)
+    /**
+     * [EMAIL PROTECTED]
      * 
      * @see com.xpn.xwiki.util.SuperClass#getClassTemplateDefaultContent()
      */
@@ -442,8 +458,8 @@
         return needUpdate;
     }
 
-    /*
-     * (non-Javadoc)
+    /**
+     * [EMAIL PROTECTED]
      * 
      * @see com.xpn.xwiki.util.SuperClass#getBaseClass()
      */
@@ -457,8 +473,8 @@
         return this.baseClass;
     }
 
-    /*
-     * (non-Javadoc)
+    /**
+     * [EMAIL PROTECTED]
      * 
      * @see 
com.xpn.xwiki.util.SuperClass#getClassDocument(com.xpn.xwiki.XWikiContext)
      */
@@ -469,8 +485,8 @@
         return context.getWiki().getDocument(getClassFullName(), context);
     }
 
-    /*
-     * (non-Javadoc)
+    /**
+     * [EMAIL PROTECTED]
      * 
      * @see 
com.xpn.xwiki.util.SuperClass#getClassSheetDocument(com.xpn.xwiki.XWikiContext)
      */
@@ -481,8 +497,8 @@
         return context.getWiki().getDocument(getClassSheetFullName(), context);
     }
 
-    /*
-     * (non-Javadoc)
+    /**
+     * [EMAIL PROTECTED]
      * 
      * @see 
com.xpn.xwiki.util.SuperClass#getClassTemplateDocument(com.xpn.xwiki.XWikiContext)
      */
@@ -493,8 +509,8 @@
         return context.getWiki().getDocument(getClassTemplateFullName(), 
context);
     }
 
-    /*
-     * (non-Javadoc)
+    /**
+     * [EMAIL PROTECTED]
      * 
      * @see 
com.xpn.xwiki.util.SuperClass#isInstanceOf(com.xpn.xwiki.doc.XWikiDocument,
      *      com.xpn.xwiki.XWikiContext)
@@ -504,8 +520,8 @@
         return doc.getObject(getClassFullName()) != null;
     }
 
-    /*
-     * (non-Javadoc)
+    /**
+     * [EMAIL PROTECTED]
      * 
      * @see com.xpn.xwiki.util.SuperClass#getItemDocumentName(java.lang.String)
      */
@@ -513,11 +529,12 @@
     {
         itemName = context.getWiki().clearName(itemName, true, true, context);
 
-        return getClassPrefix() + itemName.substring(0, 1).toUpperCase() + 
itemName.substring(1).toLowerCase();
+        return getClassPrefix() + itemName.substring(0, 1).toUpperCase()
+            + itemName.substring(1).toLowerCase();
     }
 
-    /*
-     * (non-Javadoc)
+    /**
+     * [EMAIL PROTECTED]
      * 
      * @see 
com.xpn.xwiki.util.SuperClass#getItemDocumentFullName(java.lang.String)
      */
@@ -525,59 +542,77 @@
     {
         return getClassSpacePrefix() + "." + 
getItemDocumentDefaultName(itemName, context);
     }
-    
-    /* (non-Javadoc)
-     * @see 
com.xpn.xwiki.plugin.applicationmanager.core.doc.objects.classes.SuperClass#getItemDefaultName(java.lang.String,
 com.xpn.xwiki.XWikiContext)
+
+    /**
+     * [EMAIL PROTECTED]
+     * 
+     * @see 
com.xpn.xwiki.plugin.applicationmanager.core.doc.objects.classes.SuperClass#getItemDefaultName(java.lang.String,
+     *      com.xpn.xwiki.XWikiContext)
      */
     public String getItemDefaultName(String docFullName, XWikiContext context)
     {
-        return docFullName.substring((getClassSpacePrefix() + "." + 
getClassPrefix()).length()).toLowerCase();
+        return docFullName.substring((getClassSpacePrefix() + "." + 
getClassPrefix()).length())
+            .toLowerCase();
     }
-    
-    /* (non-Javadoc)
-     * @see com.xpn.xwiki.util.SuperClass#getItemDocument(java.lang.String, 
com.xpn.xwiki.XWikiContext)
+
+    /**
+     * [EMAIL PROTECTED]
+     * 
+     * @see com.xpn.xwiki.util.SuperClass#getItemDocument(java.lang.String,
+     *      com.xpn.xwiki.XWikiContext)
      */
-    public XWikiDocument getItemDocument(String itemName, XWikiContext 
context) throws XWikiException
+    public XWikiDocument getItemDocument(String itemName, XWikiContext context)
+        throws XWikiException
     {
-        return 
context.getWiki().getDocument(getItemDocumentDefaultFullName(itemName, 
context), context);
+        return 
context.getWiki().getDocument(getItemDocumentDefaultFullName(itemName, context),
+            context);
     }
-    
+
     public List searchItemDocuments(XWikiContext context) throws XWikiException
     {
         return searchItemDocumentsByFields(null, null, context);
     }
-    
-    public List searchItemDocuments(String docFullName, XWikiContext context) 
throws XWikiException
+
+    public List searchItemDocuments(String docFullName, XWikiContext context)
+        throws XWikiException
     {
         return searchItemDocumentsByFields(docFullName, null, context);
     }
-    
-    /* (non-Javadoc)
-     * @see 
com.xpn.xwiki.plugin.applicationmanager.core.doc.objects.classes.SuperClass#searchItemDocumentsByField(java.lang.String,
 java.lang.String, java.lang.String, com.xpn.xwiki.XWikiContext)
+
+    /**
+     * [EMAIL PROTECTED]
+     * 
+     * @see 
com.xpn.xwiki.plugin.applicationmanager.core.doc.objects.classes.SuperClass#searchItemDocumentsByField(java.lang.String,
+     *      java.lang.String, java.lang.String, com.xpn.xwiki.XWikiContext)
      */
     public List searchItemDocumentsByField(String fieldName, String 
fieldValue, String fieldType,
         XWikiContext context) throws XWikiException
     {
-        return searchItemDocumentsByFields(null, new String[][] {{fieldType, 
fieldName, fieldValue}}, context);
+        return searchItemDocumentsByFields(null, new String[][] {{fieldType, 
fieldName,
+        fieldValue}}, context);
     }
-    
-    /* (non-Javadoc)
-     * @see 
com.xpn.xwiki.plugin.applicationmanager.core.doc.objects.classes.SuperClass#searchItemDocumentsByFields(java.lang.String,
 java.lang.String[][], com.xpn.xwiki.XWikiContext)
+
+    /**
+     * [EMAIL PROTECTED]
+     * 
+     * @see 
com.xpn.xwiki.plugin.applicationmanager.core.doc.objects.classes.SuperClass#searchItemDocumentsByFields(java.lang.String,
+     *      java.lang.String[][], com.xpn.xwiki.XWikiContext)
      */
-    public List searchItemDocumentsByFields(String docFullName, String[][] 
fieldDescriptors, XWikiContext context) throws XWikiException
+    public List searchItemDocumentsByFields(String docFullName, String[][] 
fieldDescriptors,
+        XWikiContext context) throws XWikiException
     {
         check(context);
-        
+
         String from = ", BaseObject as obj";
 
-        String where = " where doc.fullName=obj.name"
-            + " and obj.className='" + getClassFullName() + "'";
-        
+        String where =
+            " where doc.fullName=obj.name" + " and obj.className='" + 
getClassFullName() + "'";
+
         if (docFullName != null)
             where += " and obj.name='" + docFullName + "'";
         else
             where += " and obj.name<>'" + getClassTemplateFullName() + "'";
-        
+
         if (fieldDescriptors != null)
             for (int i = 0; i < fieldDescriptors.length; ++i) {
                 from += ", " + fieldDescriptors[i][0] + " as field" + i;
@@ -587,27 +622,37 @@
                         + fieldDescriptors[i][1] + "'" + " and field" + i + 
".id.value='"
                         + fieldDescriptors[i][2] + "'";
             }
-        
+
         return context.getWiki().getStore().searchDocuments(from + where, 
context);
     }
-    
-    /* (non-Javadoc)
-     * @see 
com.xpn.xwiki.plugin.applicationmanager.core.doc.objects.classes.SuperClass#newSuperDocument(com.xpn.xwiki.doc.XWikiDocument,
 com.xpn.xwiki.XWikiContext)
+
+    /**
+     * [EMAIL PROTECTED]
+     * 
+     * @see 
com.xpn.xwiki.plugin.applicationmanager.core.doc.objects.classes.SuperClass#newSuperDocument(com.xpn.xwiki.doc.XWikiDocument,
+     *      com.xpn.xwiki.XWikiContext)
      */
-    public SuperDocument newSuperDocument(XWikiDocument doc, XWikiContext 
context) throws XWikiException
+    public SuperDocument newSuperDocument(XWikiDocument doc, XWikiContext 
context)
+        throws XWikiException
     {
         return new DefaultSuperDocument(this, doc, context);
     }
-    
-    /* (non-Javadoc)
-     * @see com.xpn.xwiki.util.SuperClass#newSuperDocument(java.lang.String, 
com.xpn.xwiki.XWikiContext)
+
+    /**
+     * [EMAIL PROTECTED]
+     * 
+     * @see com.xpn.xwiki.util.SuperClass#newSuperDocument(java.lang.String,
+     *      com.xpn.xwiki.XWikiContext)
      */
-    public SuperDocument newSuperDocument(String docFullName, XWikiContext 
context) throws XWikiException
+    public SuperDocument newSuperDocument(String docFullName, XWikiContext 
context)
+        throws XWikiException
     {
         return newSuperDocument(context.getWiki().getDocument(docFullName, 
context), context);
     }
-    
-    /* (non-Javadoc)
+
+    /**
+     * [EMAIL PROTECTED]
+     * 
      * @see 
com.xpn.xwiki.util.SuperClass#newSuperDocument(com.xpn.xwiki.XWikiContext)
      */
     public SuperDocument newSuperDocument(XWikiContext context) throws 
XWikiException

Modified: 
xwiki-platform/xwiki-plugins/trunk/application-manager/src/main/java/com/xpn/xwiki/plugin/applicationmanager/core/doc/objects/classes/DefaultSuperDocument.java
===================================================================
--- 
xwiki-platform/xwiki-plugins/trunk/application-manager/src/main/java/com/xpn/xwiki/plugin/applicationmanager/core/doc/objects/classes/DefaultSuperDocument.java
     2007-09-26 12:56:58 UTC (rev 5096)
+++ 
xwiki-platform/xwiki-plugins/trunk/application-manager/src/main/java/com/xpn/xwiki/plugin/applicationmanager/core/doc/objects/classes/DefaultSuperDocument.java
     2007-09-26 14:42:13 UTC (rev 5097)
@@ -30,6 +30,8 @@
 
 /**
  * Default implementation of SuperDocument.
+ * 
+ * @see SuperDocument
  */
 public class DefaultSuperDocument extends Document implements SuperDocument
 {
@@ -63,9 +65,9 @@
         getDoc().setFullName(docFullName, context);
     }
     
-    /*
-     * (non-Javadoc)
-     * 
+    /**
+     * [EMAIL PROTECTED]
+     *
      * @see com.xpn.xwiki.util.SuperDocument#reload(com.xpn.xwiki.api.Document,
      *      com.xpn.xwiki.XWikiContext)
      */
@@ -90,9 +92,9 @@
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
+    /**
+     * [EMAIL PROTECTED]
+     *
      * @see 
com.xpn.xwiki.util.SuperDocument#merge(com.xpn.xwiki.util.SuperDocument)
      */
     public void mergeBaseObject(SuperDocument sdoc)
@@ -104,9 +106,9 @@
             sdoc.getDocument().getObject(this.sclass.getClassFullName()));
     }
    
-    /*
-     * (non-Javadoc)
-     * 
+    /**
+     * [EMAIL PROTECTED]
+     *
      * @see com.xpn.xwiki.util.SuperDocument#getSuperClass()
      */
     public SuperClass getSuperClass()
@@ -114,19 +116,19 @@
         return this.sclass;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
+    /**
+     * [EMAIL PROTECTED]
+     *
      * @see com.xpn.xwiki.util.SuperDocument#isNew()
      */
     public boolean isNew()
     {
-        return this.isNew;
+        return super.isNew() || this.isNew;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
+    /**
+     * [EMAIL PROTECTED]
+     *
      * @see com.xpn.xwiki.util.SuperDocument#save(com.xpn.xwiki.XWikiContext)
      */
     public void save() throws XWikiException
@@ -135,11 +137,6 @@
         this.isNew = false;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see com.xpn.xwiki.util.SuperDocument#delete(com.xpn.xwiki.XWikiContext)
-     */
     public void delete(XWikiContext context) throws XWikiException
     {
         super.delete();

Modified: 
xwiki-platform/xwiki-plugins/trunk/application-manager/src/main/java/com/xpn/xwiki/plugin/applicationmanager/core/doc/objects/classes/SuperClass.java
===================================================================
--- 
xwiki-platform/xwiki-plugins/trunk/application-manager/src/main/java/com/xpn/xwiki/plugin/applicationmanager/core/doc/objects/classes/SuperClass.java
       2007-09-26 12:56:58 UTC (rev 5096)
+++ 
xwiki-platform/xwiki-plugins/trunk/application-manager/src/main/java/com/xpn/xwiki/plugin/applicationmanager/core/doc/objects/classes/SuperClass.java
       2007-09-26 14:42:13 UTC (rev 5097)
@@ -27,248 +27,301 @@
 import com.xpn.xwiki.doc.XWikiDocument;
 import com.xpn.xwiki.objects.classes.BaseClass;
 
+/**
+ * Interface that give way to manage a XWiki class :
+ * <ul>
+ * <li>assume that the XWiki class exist in the context we are working
+ * <li>search in documents that contains this class with conditions on class 
fields
+ * <li>support the XWiki norm about spaces and documents naming
+ * </ul>
+ */
 public interface SuperClass
 {
     /**
-     * Default class document suffix.
+     * Default suffix for the document containing the class.
      */
     static final String XWIKI_CLASS_SUFFIX = "Class";
 
     /**
-     * Default class sheet document suffix.
+     * Default suffix for a document containing a class sheet.
      */
     static final String XWIKI_CLASSSHEET_SUFFIX = "ClassSheet";
-    
+
     /**
-     * Default class template document suffix.
+     * Default suffix for a document containing a class template.
      */
     static final String XWIKI_CLASSTEMPLATE_SUFFIX = "ClassTemplate";
-   
+
     /**
-     * Default class document space.
+     * Default prefix for a document's space containing a class.
      */
     static final String XWIKI_CLASS_SPACE_PREFIX = "XWiki";
 
     /**
-     * Default class document space.
+     * Default suffix for a document's space containing a class.
      */
     static final String XWIKI_CLASS_SPACE_SUFFIX = "Classes";
-    
+
     /**
-     * Default class document space.
+     * Default suffix for a document's space containing a class sheet.
      */
     static final String XWIKI_CLASSSHEET_SPACE_SUFFIX = "Sheets";
-    
+
     /**
-     * Default class document space.
+     * Default suffix for a document's space containing a class template.
      */
     static final String XWIKI_CLASSTEMPLATE_SPACE_SUFFIX = "Templates";
-    
+
     // ///
 
     /**
-     * @return String   Space prefix of class document.
+     * @return the space prefix name of the document containing the class.
      */
     String getClassSpacePrefix();
-    
+
     /**
-     * @return String   Space of class document.
+     * @return the prefix name of the document containing the class. Usually 
extracted from :
+     *         ClassSpace.ClassPrefixXWIKI_CLASS_SUFFIX.
+     * @see #getClassSpace()
      */
-    String getClassSpace();
+    String getClassPrefix();
 
+    // Classes
+
     /**
-     * @return String   Prefix of class document.
+     * @return the space name of the document containing the class. Usually 
class space is :
+     *         SpacePrefixXWIKI_CLASS_SPACE_SUFFIX.
+     * @see #getClassSpacePrefix()
+     * @see #XWIKI_CLASS_SPACE_SUFFIX
      */
-    String getClassPrefix();
+    String getClassSpace();
 
     /**
-     * @return String   Name of class document.
+     * @return the name of the document containing the class. Usually class 
name is :
+     *         ClassPrefixXWIKI_CLASS_SUFFIX.
+     * @see #getClassFullName()
+     * @see #getClassPrefix()
+     * @see #XWIKI_CLASS_SUFFIX
      */
     String getClassName();
 
     /**
-     * @return String   Full name of class document.
+     * @return the full name of the document containing the class. Usually 
class full name is :
+     *         ClassSpace.ClassName.
+     * @see #getClassName()
+     * @see #getClassSpace()
      */
     String getClassFullName();
 
+    // Templates
+
     /**
-     * @return String   Name of class template document.
+     * @return the space name of the document containing the class template. 
Usually class template
+     *         space name is : 
ClassSpacePrefixXWIKI_CLASSTEMPLATE_SPACE_SUFFIX.
+     * @see #getClassPrefix()
+     * @see #XWIKI_CLASSTEMPLATE_SPACE_SUFFIX
      */
+    String getClassTemplateSpace();
+
+    /**
+     * @return the name of the document containing the class template. Usually 
class template name
+     *         is : ClassPrefixClassXWIKI_CLASSTEMPLATE_SUFFIX.
+     * @see #getClassPrefix()
+     * @see #getClassTemplateFullName()
+     * @see #XWIKI_CLASSTEMPLATE_SUFFIX
+     */
     String getClassTemplateName();
 
     /**
-     * @return String   Full name of class template document.
+     * @return the full name of the document containing the class template. 
Usually class template
+     *         full name is : ClassTemplateSpace.ClassTemplateName.
+     * @see #getClassTemplateSpace()
+     * @see #getClassTemplateName()
      */
     String getClassTemplateFullName();
 
+    // Sheets
+
     /**
-     * @return String   Name of class sheet document.
+     * @return the space name of the document containing the class sheet. 
Usually class sheet space
+     *         name is : ClassSpacePrefixXWIKI_CLASSSHEET_SPACE_SUFFIX.
+     * @see #getClassSpacePrefix()
+     * @see #XWIKI_CLASSSHEET_SPACE_SUFFIX
      */
+    String getClassSheetSpace();
+
+    /**
+     * @return the name of the document containing the class sheet. Usually 
class sheet name is :
+     *         ClassPrefixXWIKI_CLASSSHEET_SUFFIX.
+     * @see #getClassPrefix()
+     * @see #getClassSheetFullName()
+     * @see #XWIKI_CLASSSHEET_SUFFIX
+     */
     String getClassSheetName();
 
     /**
-     * @return String   Full name of class sheet document.
+     * @return the full name of the document containing the class sheet. 
Usually class sheet full
+     *         name is : ClassSheetSpace.ClassSheetName.
+     * @see #getClassSheetSpace()
+     * @see #getClassSheetName()
      */
     String getClassSheetFullName();
 
+    // ///
+
     /**
-     * @return BaseClass   BaseClass object managed.
+     * @return the BaseClass managed by this SuperClass.
      */
     BaseClass getBaseClass() throws XWikiException;
 
     /**
-     * Return super class document for this context.
-     *
-     * @param context           Context.
+     * Get the document containing the class in this context's database.
      * 
-     * @return XWikiDocument   Class document for this context.
+     * @param context the XWiki context.
+     * @return the document containing the class for this context.
      */
     XWikiDocument getClassDocument(XWikiContext context) throws XWikiException;
-    
+
     /**
-     * Return super class sheet document content.
-     * 
-     * @return String   Default new class sheet document content.
+     * @return the default content to add in a new class sheet document.
      */
     String getClassSheetDefaultContent();
 
     /**
-     * Return super class sheet document for this context.
-     *
-     * @param context           Context.
-     *
-     * @return XWikiDocument    Class sheet document for this context.
+     * Get the document containing the class sheet for this context's database.
+     * 
+     * @param context the XWiki context.
+     * @return the document containing the class sheet for this context.
      */
     XWikiDocument getClassSheetDocument(XWikiContext context) throws 
XWikiException;
 
     /**
-     * Return super class template document content.
-     * 
-     * @return String   Default new class template document content.
+     * @return the default content to add in a new class template document.
      */
     String getClassTemplateDefaultContent();
-    
+
     /**
-     * Return super class template document for this context.
+     * Get the document containing the class template for this context's 
database.
      * 
-     * @param context       Context.
-     * 
-     * @return XWikiDocument   Class template document for this context.
+     * @param context the XWiki context.
+     * @return the class template document for this context.
      */
     XWikiDocument getClassTemplateDocument(XWikiContext context) throws 
XWikiException;
-        
+
     /**
-     * Determines if the specified <code>doc</code> is compatible with this 
xwiki class (if he contains class object).
+     * Determines if the specified <code>doc</code> is compatible with this 
xwiki class (if he
+     * contains class object).
      * 
-     * @param doc       XWikidocument to test.
-     * @param context   Context.
-     * 
-     * @return boolean  True if <code>doc</code> support this class.
-     * 
+     * @param doc the XWikidocument to test.
+     * @param context the XWiki context.
+     * @return true if <code>doc</code> support this class, false otherwise.
      * @throws XWikiException
      */
     boolean isInstance(XWikiDocument doc, XWikiContext context) throws 
XWikiException;
-    
+
     /**
-     * Get document name for item name <code>item</code>.
+     * Get document name from item name <code>item</code>. Usually a Document 
name is
+     * DocumentTypeItemName.
      * 
-     * @param itemName  Name of the item.
-     * @param context   Context.
-     * 
-     * @return String   Name of the document.
+     * @param itemName the name of the item to find.
+     * @param context the XWiki context.
+     * @return the name of the document.
+     * @see #getItemDocumentDefaultFullName(String, XWikiContext)
+     * @see #getItemDefaultName(String, XWikiContext)
      */
     String getItemDocumentDefaultName(String itemName, XWikiContext context);
-    
+
     /**
-     * Get document full name for item name <code>itemName</code>.
+     * Get document full name from item name <code>item</code>. Usually a 
Document full name is
+     * Space.DocumentTypeItemName.
      * 
-     * @param itemName  Full name of the item.
-     * @param context   Context.
-     * 
-     * @return String   Full name of the document.
+     * @param itemName the name of the item.
+     * @param context the XWiki context.
+     * @return the full name of the document.
+     * @see #getItemDocumentDefaultName(String, XWikiContext)
+     * @see #getItemDefaultName(String, XWikiContext)
      */
     String getItemDocumentDefaultFullName(String itemName, XWikiContext 
context);
-    
+
     /**
-     * Get item name extracted from document full name.
+     * Get item name extracted from document full name. Usually a Document 
full name is
+     * Space.DocumentTypeItemName.
      * 
-     * @param docFullName   Full name of the document.
-     * @param context       Context.
-     * 
-     * @return String       Item Name.
+     * @param docFullName the full name of the document.
+     * @param context the XWiki context.
+     * @return the item name extracted from document name.
+     * @see #getItemDocumentDefaultFullName(String, XWikiContext)
      */
     public String getItemDefaultName(String docFullName, XWikiContext context);
-    
+
     /**
-     * Get document by full name for item name <code>itemName</code>.
+     * Get document by full name from item name <code>itemName</code>.
      * 
-     * @param itemName  Full name of the item.
-     * @param context   Context.
-     *
-     * @return String   Full name of the document.
-     * 
-     * @throws XWikiException 
+     * @param itemName the full name of the item.
+     * @param context the XWiki context.
+     * @return the full name of the document.
+     * @throws XWikiException
+     * @see #getItemDefaultName(String, XWikiContext)
+     * @see #getItemDocumentDefaultFullName(String, XWikiContext)
      */
     XWikiDocument getItemDocument(String itemName, XWikiContext context) 
throws XWikiException;
-    
+
     /**
      * Search in instances of this document class.
-     * @param fieldName     Name of field.
-     * @param fieldValue    Value of field.
-     * @param fieldType     Type of field.
-     * @param context       Context.
-     *
-     * @return List         List of found XWikiDocuments.
-     *
+     * 
+     * @param fieldName the name of field.
+     * @param fieldValue the value of field.
+     * @param fieldType the type of field.
+     * @param context the XWiki context.
+     * @return the list of found XWikiDocuments.
      * @throws XWikiException
      */
-    List searchItemDocumentsByField(String fieldName, String fieldValue, 
String fieldType, XWikiContext context) throws XWikiException;
+    List searchItemDocumentsByField(String fieldName, String fieldValue, 
String fieldType,
+        XWikiContext context) throws XWikiException;
 
     /**
      * Search in instances of this document class.
      * 
-     * @param docFullName       Full name of the document. If Null, it is not 
consider.
-     * @param fieldDescriptors  List of fields name/value constraints.
-     * @param context           Context.
-     *
-     * @return List             List of found XWikiDocuments.
-     * 
+     * @param docFullName the full name of the document. If Null, it is not 
consider.
+     * @param fieldDescriptors the list of fields name/value constraints.
+     * @param context the XWiki context.
+     * @return the list of found XWikiDocuments.
      * @throws XWikiException
      */
-    List searchItemDocumentsByFields(String docFullName, String[][] 
fieldDescriptors, XWikiContext context) throws XWikiException;
+    List searchItemDocumentsByFields(String docFullName, String[][] 
fieldDescriptors,
+        XWikiContext context) throws XWikiException;
 
     /**
-     * Create new super document.
+     * Create new super document containing object of class [EMAIL PROTECTED] 
#getClassFullName()}. If
+     * document already exist it is returned with new object if it does not 
contains any.
      * 
-     * @param doc               Document to encapsulate.
-     * @param context           Context.
-     *
-     * @return SuperDocument   Super document.
-     * 
+     * @param doc the XWiki document to manage.
+     * @param context the XWiki context.
+     * @return a new SuperDocument instance.
      * @throws XWikiException
      */
     SuperDocument newSuperDocument(XWikiDocument doc, XWikiContext context) 
throws XWikiException;
 
     /**
-     * Create new empty super document.
-     *
-     * @param context           Context.
+     * Create new super document containing object of class [EMAIL PROTECTED] 
#getClassFullName()}. If
+     * document already exist it is returned with new object if it does not 
contains any.
      * 
-     * @return SuperDocument   Super document.
-     * 
+     * @param context the XWiki context.
+     * @return a new SuperDocument instance.
      * @throws XWikiException
      */
     SuperDocument newSuperDocument(XWikiContext context) throws XWikiException;
 
     /**
-     * Create new super document.
+     * Create new super document containing object of class [EMAIL PROTECTED] 
#getClassFullName()}. If
+     * document already exist it is returned with new object if it does not 
contains any.
      * 
-     * @param docFullName       Full name of document to encapsulate.
-     * @param context           Context.
-     * 
-     * @return SuperDocument   Super document.
-     * 
+     * @param docFullName the full name of document to manage.
+     * @param context the XWiki context.
+     * @return a new SuperDocument instance.
      * @throws XWikiException
+     * @see #getClassFullName()
      */
-    SuperDocument newSuperDocument(String docFullName, XWikiContext context) 
throws XWikiException;
+    SuperDocument newSuperDocument(String docFullName, XWikiContext context)
+        throws XWikiException;
 }

Modified: 
xwiki-platform/xwiki-plugins/trunk/application-manager/src/main/java/com/xpn/xwiki/plugin/applicationmanager/core/doc/objects/classes/SuperDocument.java
===================================================================
--- 
xwiki-platform/xwiki-plugins/trunk/application-manager/src/main/java/com/xpn/xwiki/plugin/applicationmanager/core/doc/objects/classes/SuperDocument.java
    2007-09-26 12:56:58 UTC (rev 5096)
+++ 
xwiki-platform/xwiki-plugins/trunk/application-manager/src/main/java/com/xpn/xwiki/plugin/applicationmanager/core/doc/objects/classes/SuperDocument.java
    2007-09-26 14:42:13 UTC (rev 5097)
@@ -25,14 +25,16 @@
 import com.xpn.xwiki.doc.XWikiDocument;
 
 /**
- * SuperDocument inteface.
+ * SuperDocument interface.
+ * 
+ * @see SuperClass
  */
 public interface SuperDocument
 {   
     /**
-     * Reload document.
+     * Reload XWiki document from database using Document full name.
      * 
-     * @param context   Context.
+     * @param context   the XWiki context.
      * 
      * @throws XWikiException
      */
@@ -41,28 +43,23 @@
     /**
      * Merge two documents BaseObject.
      * 
-     * @param sdoc Document to merge.
+     * @param sdoc the document to merge.
+     * @see com.xpn.xwiki.objects.BaseCollection#merge(BaseObject)
      */
     void mergeBaseObject(SuperDocument sdoc);
        
     /**
-     * Return super class.
-     * 
-     * @return SuperClass  Class manager for this document.
+     * @return the class manager for this document.
      */
     SuperClass getSuperClass();
       
     /**
-     * Indicate if document already exists in database.
-     *
-     * @return boolean  True if this is a new document of this class (this 
document can exist but not for this class).
+     * @return true if this is a new document of this class (this document can 
exist but does not contains object of this class).
      */
     boolean isNew();
 
     /**
-     * Return the document.
-     * 
-     * @return XWikiDocument The document.
+     * @return the XWiki document.
      */
     XWikiDocument getDocument();
 }

_______________________________________________
notifications mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/notifications

Reply via email to