|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xpn.xwiki.plugin.applicationmanager.core.doc.objects.classes.AbstractXClassManager<T>
T - the item class extending XObjectDocument.public abstract class AbstractXClassManager<T extends XObjectDocument>
Abstract implementation of XClassManager.
This class has to be extended with at least :
updateBaseClass(BaseClass)
XClassManager| Field Summary |
|---|
| Fields inherited from interface com.xpn.xwiki.plugin.applicationmanager.core.doc.objects.classes.XClassManager |
|---|
XWIKI_CLASS_SPACE_PREFIX, XWIKI_CLASS_SPACE_SUFFIX, XWIKI_CLASS_SUFFIX, XWIKI_CLASSSHEET_SPACE_SUFFIX, XWIKI_CLASSSHEET_SUFFIX, XWIKI_CLASSTEMPLATE_SPACE_SUFFIX, XWIKI_CLASSTEMPLATE_SUFFIX |
| Constructor Summary | |
|---|---|
protected |
AbstractXClassManager(java.lang.String prefix)
Constructor for AbstractXClassManager. |
protected |
AbstractXClassManager(java.lang.String spaceprefix,
java.lang.String prefix)
Constructor for AbstractXClassManager. |
protected |
AbstractXClassManager(java.lang.String spaceprefix,
java.lang.String prefix,
boolean dispatch)
Constructor for AbstractXClassManager. |
| Method Summary | |
|---|---|
protected void |
check(com.xpn.xwiki.XWikiContext context)
Check if all necessary documents for manage this class in this context exists and update. |
java.lang.String |
createWhereClause(java.lang.Object[][] fieldDescriptors,
java.util.List<java.lang.Object> parameterValues)
Construct HQL where clause to use with XWikiStoreInterface "searchDocuments" methods. |
com.xpn.xwiki.objects.classes.BaseClass |
getBaseClass()
|
com.xpn.xwiki.api.Document |
getClassDocument(com.xpn.xwiki.XWikiContext context)
Get the document containing the class in this context's database. |
java.lang.String |
getClassFullName()
|
java.lang.String |
getClassName()
|
java.lang.String |
getClassPrefix()
|
java.lang.String |
getClassSheetDefaultContent()
|
com.xpn.xwiki.api.Document |
getClassSheetDocument(com.xpn.xwiki.XWikiContext context)
Get the document containing the class sheet for this context's database. |
java.lang.String |
getClassSheetFullName()
|
java.lang.String |
getClassSheetName()
|
java.lang.String |
getClassSheetSpace()
|
java.lang.String |
getClassSpace()
|
java.lang.String |
getClassSpacePrefix()
|
java.lang.String |
getClassTemplateDefaultContent()
|
com.xpn.xwiki.api.Document |
getClassTemplateDocument(com.xpn.xwiki.XWikiContext context)
Get the document containing the class template for this context's database. |
java.lang.String |
getClassTemplateFullName()
|
java.lang.String |
getClassTemplateName()
|
java.lang.String |
getClassTemplateSpace()
|
java.lang.String |
getItemDefaultName(java.lang.String docFullName)
Get item name extracted from document full name. |
java.lang.String |
getItemDocumentDefaultFullName(java.lang.String itemName,
com.xpn.xwiki.XWikiContext context)
Get document full name from item name item. |
java.lang.String |
getItemDocumentDefaultName(java.lang.String itemName,
com.xpn.xwiki.XWikiContext context)
Get document name from item name item. |
T |
getXObjectDocument(java.lang.String itemName,
int objectId,
boolean validate,
com.xpn.xwiki.XWikiContext context)
Get document by full name from item name itemName. |
protected int |
intFromBoolean(java.lang.Boolean value)
|
boolean |
isInstance(com.xpn.xwiki.api.Document doc)
Determines if the specified doc is compatible with this xwiki class (if he contains class object). |
boolean |
isInstance(com.xpn.xwiki.doc.XWikiDocument doc)
Determines if the specified doc is compatible with this xwiki class (if he contains class object). |
T |
newXObjectDocument(java.lang.String docFullName,
int objId,
com.xpn.xwiki.XWikiContext context)
Create new super document containing object of class XClassManager.getClassFullName(). |
T |
newXObjectDocument(com.xpn.xwiki.XWikiContext context)
Create new super document containing object of class XClassManager.getClassFullName(). |
T |
newXObjectDocument(com.xpn.xwiki.doc.XWikiDocument doc,
int objId,
com.xpn.xwiki.XWikiContext context)
Create new super document containing object of class XClassManager.getClassFullName(). |
java.util.List<T> |
newXObjectDocumentList(java.util.List<com.xpn.xwiki.doc.XWikiDocument> documents,
com.xpn.xwiki.XWikiContext context)
Create new super document for each object of class XClassManager.getClassFullName() of each XWikiDocument in
the list and return it. |
java.util.List<T> |
newXObjectDocumentList(com.xpn.xwiki.doc.XWikiDocument document,
com.xpn.xwiki.XWikiContext context)
Create new super documents for each object of class XClassManager.getClassFullName() for provided
XWikiDocument and return it. |
java.util.List<T> |
searchXObjectDocuments(com.xpn.xwiki.XWikiContext context)
Find all XWikiDocument containing object of this XWiki class. |
java.util.List<T> |
searchXObjectDocumentsByField(java.lang.String fieldName,
java.lang.Object fieldValue,
java.lang.String fieldType,
com.xpn.xwiki.XWikiContext context)
Search in instances of this document class. |
java.util.List<T> |
searchXObjectDocumentsByFields(java.lang.Object[][] fieldDescriptors,
com.xpn.xwiki.XWikiContext context)
Search in instances of this document class. |
protected boolean |
updateBaseClass(com.xpn.xwiki.objects.classes.BaseClass baseClass)
Configure BaseClass. |
protected boolean |
updateBooleanClassDefaultValue(com.xpn.xwiki.objects.classes.BaseClass baseClass,
java.lang.String fieldName,
java.lang.Boolean value)
Set the default value of a boolean field of a XWiki class. |
protected boolean |
updateClassTemplateDocument(com.xpn.xwiki.doc.XWikiDocument doc)
Initialize template document with default content. |
protected boolean |
updateDocBooleanValue(com.xpn.xwiki.doc.XWikiDocument doc,
java.lang.String fieldName,
java.lang.Boolean value)
Set the value of a boolean field in a document. |
protected boolean |
updateDocStringValue(com.xpn.xwiki.doc.XWikiDocument doc,
java.lang.String fieldName,
java.lang.String value)
Set the value of a boolean field in a document. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractXClassManager(java.lang.String prefix)
prefix - the prefix of class document.AbstractXClassManager(String, String),
AbstractXClassManager(String, String, boolean)
protected AbstractXClassManager(java.lang.String spaceprefix,
java.lang.String prefix)
spaceprefix - the space prefix of class document.prefix - the prefix of class document.AbstractXClassManager(String),
AbstractXClassManager(String, String, boolean)
protected AbstractXClassManager(java.lang.String spaceprefix,
java.lang.String prefix,
boolean dispatch)
spaceprefix - the space of class document.prefix - the prefix of class document.dispatch - Indicate if it had to use standard XWiki applications space names.AbstractXClassManager(String),
AbstractXClassManager(String, String)| Method Detail |
|---|
public java.lang.String getClassSpacePrefix()
getClassSpacePrefix in interface XClassManager<T extends XObjectDocument>XClassManager.getClassSpacePrefix()public java.lang.String getClassSpace()
getClassSpace in interface XClassManager<T extends XObjectDocument>XClassManager.getClassSpace()public java.lang.String getClassPrefix()
getClassPrefix in interface XClassManager<T extends XObjectDocument>XClassManager.getClassPrefix()public java.lang.String getClassName()
getClassName in interface XClassManager<T extends XObjectDocument>XClassManager.getClassName()public java.lang.String getClassFullName()
getClassFullName in interface XClassManager<T extends XObjectDocument>XClassManager.getClassFullName()public java.lang.String getClassTemplateSpace()
getClassTemplateSpace in interface XClassManager<T extends XObjectDocument>XClassManager.getClassTemplateName()public java.lang.String getClassTemplateName()
getClassTemplateName in interface XClassManager<T extends XObjectDocument>XClassManager.getClassTemplateName()public java.lang.String getClassTemplateFullName()
getClassTemplateFullName in interface XClassManager<T extends XObjectDocument>XClassManager.getClassTemplateFullName()public java.lang.String getClassSheetSpace()
getClassSheetSpace in interface XClassManager<T extends XObjectDocument>XClassManager.getClassSheetName()public java.lang.String getClassSheetName()
getClassSheetName in interface XClassManager<T extends XObjectDocument>XClassManager.getClassSheetName()public java.lang.String getClassSheetFullName()
getClassSheetFullName in interface XClassManager<T extends XObjectDocument>XClassManager.getClassSheetFullName()
protected void check(com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
context - the XWiki context.
com.xpn.xwiki.XWikiException - error when saving documents.checkClassDocument(XWikiContext)public java.lang.String getClassSheetDefaultContent()
getClassSheetDefaultContent in interface XClassManager<T extends XObjectDocument>XClassManager.getClassSheetDefaultContent()public java.lang.String getClassTemplateDefaultContent()
getClassTemplateDefaultContent in interface XClassManager<T extends XObjectDocument>XClassManager.getClassTemplateDefaultContent()protected int intFromBoolean(java.lang.Boolean value)
value - the Boolean value to convert.
int value.protected boolean updateClassTemplateDocument(com.xpn.xwiki.doc.XWikiDocument doc)
doc - the class template document that will be saved.
doc modified.
protected boolean updateDocStringValue(com.xpn.xwiki.doc.XWikiDocument doc,
java.lang.String fieldName,
java.lang.String value)
doc - the document to modify.fieldName - the name of the field.value - the value.
doc modified.
protected boolean updateDocBooleanValue(com.xpn.xwiki.doc.XWikiDocument doc,
java.lang.String fieldName,
java.lang.Boolean value)
doc - the document to modify.fieldName - the name of the field.value - the value.
doc modified.protected boolean updateBaseClass(com.xpn.xwiki.objects.classes.BaseClass baseClass)
baseClass - the baseClass to configure.
baseClass modified.
protected boolean updateBooleanClassDefaultValue(com.xpn.xwiki.objects.classes.BaseClass baseClass,
java.lang.String fieldName,
java.lang.Boolean value)
baseClass - the XWiki class.fieldName - the name of the field.value - the default value.
baseClass modified.public com.xpn.xwiki.objects.classes.BaseClass getBaseClass()
getBaseClass in interface XClassManager<T extends XObjectDocument>XClassManager.getBaseClass()
public com.xpn.xwiki.api.Document getClassDocument(com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
getClassDocument in interface XClassManager<T extends XObjectDocument>context - the XWiki context.
com.xpn.xwiki.XWikiException - error when getting class document from the database.XClassManager.getClassDocument(com.xpn.xwiki.XWikiContext)
public com.xpn.xwiki.api.Document getClassSheetDocument(com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
getClassSheetDocument in interface XClassManager<T extends XObjectDocument>context - the XWiki context.
com.xpn.xwiki.XWikiException - error when getting class sheet document from the database.XClassManager.getClassSheetDocument(com.xpn.xwiki.XWikiContext)
public com.xpn.xwiki.api.Document getClassTemplateDocument(com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
getClassTemplateDocument in interface XClassManager<T extends XObjectDocument>context - the XWiki context.
com.xpn.xwiki.XWikiException - error when getting class template document from the database.XClassManager.getClassTemplateDocument(com.xpn.xwiki.XWikiContext)public boolean isInstance(com.xpn.xwiki.doc.XWikiDocument doc)
doc is compatible with this xwiki class (if he contains class object).
isInstance in interface XClassManager<T extends XObjectDocument>doc - the XWikidocument to test.
doc support this class, false otherwise.XClassManager.isInstance(com.xpn.xwiki.doc.XWikiDocument)public boolean isInstance(com.xpn.xwiki.api.Document doc)
doc is compatible with this xwiki class (if he contains class object).
isInstance in interface XClassManager<T extends XObjectDocument>doc - the XWikidocument to test.
doc support this class, false otherwise.XClassManager.isInstance(com.xpn.xwiki.doc.XWikiDocument)
public java.lang.String getItemDocumentDefaultName(java.lang.String itemName,
com.xpn.xwiki.XWikiContext context)
item. Usually a Document name is DocumentTypeItemName.
getItemDocumentDefaultName in interface XClassManager<T extends XObjectDocument>itemName - the name of the item to find.context - the XWiki context.
XClassManager.getItemDocumentDefaultName(java.lang.String, XWikiContext)
public java.lang.String getItemDocumentDefaultFullName(java.lang.String itemName,
com.xpn.xwiki.XWikiContext context)
item. Usually a Document full name is
Space.DocumentTypeItemName.
getItemDocumentDefaultFullName in interface XClassManager<T extends XObjectDocument>itemName - the name of the item.context - the XWiki context.
XClassManager.getItemDocumentDefaultFullName(java.lang.String, XWikiContext)public java.lang.String getItemDefaultName(java.lang.String docFullName)
getItemDefaultName in interface XClassManager<T extends XObjectDocument>docFullName - the full name of the document.
XClassManager.getItemDefaultName(java.lang.String)
public T getXObjectDocument(java.lang.String itemName,
int objectId,
boolean validate,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
itemName.
getXObjectDocument in interface XClassManager<T extends XObjectDocument>itemName - the full name of the item.objectId - the id of the XWiki object included in the document to manage.validate - indicate if it return new T or throw exception if wiki descriptor does not exist.context - the XWiki context.
com.xpn.xwiki.XWikiException - error when getting document from the database.XClassManager.getXObjectDocument(java.lang.String,
int, boolean, com.xpn.xwiki.XWikiContext)
public java.lang.String createWhereClause(java.lang.Object[][] fieldDescriptors,
java.util.List<java.lang.Object> parameterValues)
XWikiStoreInterface "searchDocuments" methods.
createWhereClause in interface XClassManager<T extends XObjectDocument>fieldDescriptors - the list of fields name/value constraints. Format : [[fieldName1, typeField1,
valueField1][fieldName2, typeField2, valueField2]].parameterValues - the where clause values that replace the question marks (?).
public java.util.List<T> searchXObjectDocuments(com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
context - the XWiki context.
XObjectDocument.
com.xpn.xwiki.XWikiException - error when searching for document in database.getClassFullName()
public java.util.List<T> searchXObjectDocumentsByField(java.lang.String fieldName,
java.lang.Object fieldValue,
java.lang.String fieldType,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
fieldName - the name of field.fieldValue - the value of field.fieldType - the type of field.context - the XWiki context.
T.
com.xpn.xwiki.XWikiException - error when searching for documents from in database.
public java.util.List<T> searchXObjectDocumentsByFields(java.lang.Object[][] fieldDescriptors,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
fieldDescriptors - the list of fields name/value constraints. Format : [[fieldName1, typeField1,
valueField1][fieldName2, typeField2, valueField2]].context - the XWiki context.
XObjectDocument.
com.xpn.xwiki.XWikiException - error when searching for documents from in database.
public T newXObjectDocument(com.xpn.xwiki.doc.XWikiDocument doc,
int objId,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
XClassManager.getClassFullName(). If document already exist it
is returned with new object if it does not contains any.
newXObjectDocument in interface XClassManager<T extends XObjectDocument>doc - the XWiki document to manage.objId - the id of the XWiki object included in the document to manage.context - the XWiki context.
com.xpn.xwiki.XWikiException - error when calling XObjectDocument implementation constructor.XClassManager.newXObjectDocument(com.xpn.xwiki.doc.XWikiDocument,
int, com.xpn.xwiki.XWikiContext)
public T newXObjectDocument(java.lang.String docFullName,
int objId,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
XClassManager.getClassFullName(). If document already exist it
is returned with new object if it does not contains any.
newXObjectDocument in interface XClassManager<T extends XObjectDocument>docFullName - the full name of document to manage.objId - the id of the XWiki object included in the document to manage.context - the XWiki context.
com.xpn.xwiki.XWikiException - error when calling T constructor.XClassManager.newXObjectDocument(java.lang.String,
int, com.xpn.xwiki.XWikiContext)
public T newXObjectDocument(com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
XClassManager.getClassFullName(). If document already exist it
is returned with new object if it does not contains any.
newXObjectDocument in interface XClassManager<T extends XObjectDocument>context - the XWiki context.
com.xpn.xwiki.XWikiException - error when calling T constructor.XClassManager.newXObjectDocument(com.xpn.xwiki.XWikiContext)
public java.util.List<T> newXObjectDocumentList(com.xpn.xwiki.doc.XWikiDocument document,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
XClassManager.getClassFullName() for provided
XWikiDocument and return it.
newXObjectDocumentList in interface XClassManager<T extends XObjectDocument>document - the list of XWikiDocument.context - the XWiki context.
T.
com.xpn.xwiki.XWikiException - error when calling XObjectDocument implementation constructor.XClassManager.newXObjectDocumentList(com.xpn.xwiki.doc.XWikiDocument,
com.xpn.xwiki.XWikiContext)
public java.util.List<T> newXObjectDocumentList(java.util.List<com.xpn.xwiki.doc.XWikiDocument> documents,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
XClassManager.getClassFullName() of each XWikiDocument in
the list and return it.
newXObjectDocumentList in interface XClassManager<T extends XObjectDocument>documents - the list of XWikiDocument.context - the XWiki context.
T.
com.xpn.xwiki.XWikiException - error when calling XObjectDocument implementation constructor.XClassManager.newXObjectDocumentList(java.util.List,
com.xpn.xwiki.XWikiContext)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||