com.xpn.xwiki.plugin.applicationmanager.doc
Class XWikiApplicationClass

java.lang.Object
  extended by com.xpn.xwiki.plugin.applicationmanager.core.doc.objects.classes.AbstractXClassManager<XWikiApplication>
      extended by com.xpn.xwiki.plugin.applicationmanager.doc.XWikiApplicationClass
All Implemented Interfaces:
XClassManager<XWikiApplication>

public class XWikiApplicationClass
extends AbstractXClassManager<XWikiApplication>

XClassManager implementation for XAppClasses.XWikiApplicationClass class.

Version:
$Id: a3e81293da8947e9aacacc203db2a8fdd4c00ee5 $
See Also:
XClassManager, AbstractXClassManager

Field Summary
static String DEFAULT_FIELDDT
          Default list display type of XAppClasses.XWikiApplicationClass fields.
static String DEFAULT_FIELDS
          Default list separators of XAppClasses.XWikiApplicationClass fields.
static String FIELD_APPAUTHORS
          Name of field appauthors for the XWiki class XAppClasses.XWikiApplicationClass.
static String FIELD_APPLICATIONS
          Name of field applications for the XWiki class XAppClasses.XWikiApplicationClass.
static String FIELD_APPNAME
          Name of field appname for the XWiki class XAppClasses.XWikiApplicationClass.
static String FIELD_APPPRETTYNAME
          Name of field appprettyname for the XWiki class XAppClasses.XWikiApplicationClass.
static String FIELD_APPVERSION
          Name of field version for the XWiki class XAppClasses.XWikiApplicationClass.
static String FIELD_DEPENDENCIES
          Name of field dependencies for the XWiki class XAppClasses.XWikiApplicationClass.
static String FIELD_DESCRIPTION
          Name of field description for the XWiki class XAppClasses.XWikiApplicationClass.
static String FIELD_DOCSTOINCLUDE
          Name of field docstoinclude for the XWiki class XAppClasses.XWikiApplicationClass.
static String FIELD_DOCSTOLINK
          Name of field docstolink for the XWiki class XAppClasses.XWikiApplicationClass.
static String FIELD_DOCUMENTS
          Name of field documents for the XWiki class XAppClasses.XWikiApplicationClass.
static String FIELD_LICENSE
          Name of field license for the XWiki class XAppClasses.XWikiApplicationClass.
static String FIELD_TRANSLATIONDOCS
          Name of field translationdocs for the XWiki class XAppClasses.XWikiApplicationClass.
static String FIELDPN_APPAUTHORS
          Pretty name of field appauthors for the XWiki class XAppClasses.XWikiApplicationClass.
static String FIELDPN_APPLICATIONS
          Pretty name of field applications for the XWiki class XAppClasses.XWikiApplicationClass.
static String FIELDPN_APPNAME
          Pretty name of field appname for the XWiki class XAppClasses.XWikiApplicationClass.
static String FIELDPN_APPPRETTYNAME
          Pretty name of field appprettyname for the XWiki class XAppClasses.XWikiApplicationClass.
static String FIELDPN_APPVERSION
          Pretty name of field version for the XWiki class XAppClasses.XWikiApplicationClass.
static String FIELDPN_DEPENDENCIES
          Pretty name of field dependencies for the XWiki class XAppClasses.XWikiApplicationClass.
static String FIELDPN_DESCRIPTION
          Pretty name of field description for the XWiki class XAppClasses.XWikiApplicationClass.
static String FIELDPN_DOCSTOINCLUDE
          Pretty name of field docstoinclude for the XWiki class XAppClasses.XWikiApplicationClass.
static String FIELDPN_DOCSTOLINK
          Pretty name of field docstolink for the XWiki class XAppClasses.XWikiApplicationClass.
static String FIELDPN_DOCUMENTS
          Pretty name of field documents for the XWiki class XAppClasses.XWikiApplicationClass.
static String FIELDPN_LICENSE
          Pretty name of field license for the XWiki class XAppClasses.XWikiApplicationClass.
static String FIELDPN_TRANSLATIONDOCS
          Pretty name of field translationdocs for the XWiki class XAppClasses.XWikiApplicationClass.
 
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 XWikiApplicationClass()
          Construct the overload of AbstractXClassManager with spaceprefix=CLASS_SPACE_PREFIX and prefix= CLASS_PREFIX.
 
Method Summary
 XWikiApplication getApplication(String appName, boolean validate, XWikiContext context)
          Get the XWiki document descriptor of containing XAppClasses.XWikiApplication XWiki object with "appname" field equals to appName.
protected  XWikiDocument getApplicationDocument(String appName, XWikiContext context, boolean validate)
          Get the XWiki document descriptor of containing XAppClasses.XWikiApplication XWiki object with "appname" field equals to appName.
static XWikiApplicationClass getInstance(XWikiContext context)
          Return unique instance of XWikiApplicationClass and update documents for this context.
static XWikiApplicationClass getInstance(XWikiContext context, boolean check)
          Return unique instance of XWikiApplicationClass and update documents for this context.
static boolean isApplication(XWikiDocument doc)
          Indicate if the provided document contains application descriptor.
 XWikiApplication newXObjectDocument(XWikiDocument doc, int objId, XWikiContext context)
          Create new super document containing object of class XClassManager.getClassFullName().
protected  boolean updateBaseClass(BaseClass baseClass)
          Configure BaseClass.
protected  boolean updateClassTemplateDocument(XWikiDocument doc)
          Initialize template document with default content.
 
Methods inherited from class com.xpn.xwiki.plugin.applicationmanager.core.doc.objects.classes.AbstractXClassManager
check, checkClassDocument, checkClassSheetDocument, checkClassTemplateDocument, createWhereClause, forceValidDocumentName, getBaseClass, getClassDocument, getClassFullName, getClassName, getClassPrefix, getClassSheetDefaultContent, getClassSheetDocument, getClassSheetFullName, getClassSheetName, getClassSheetSpace, getClassSpace, getClassSpacePrefix, getClassTemplateDefaultContent, getClassTemplateDocument, getClassTemplateFullName, getClassTemplateName, getClassTemplateSpace, getItemDefaultName, getItemDocumentDefaultFullName, getItemDocumentDefaultName, getXObjectDocument, intFromBoolean, isInstance, isInstance, isValidName, newXObjectDocument, newXObjectDocument, newXObjectDocumentList, newXObjectDocumentList, searchXObjectDocuments, searchXObjectDocumentsByField, searchXObjectDocumentsByFields, updateBooleanClassDefaultValue, updateDocBooleanValue, updateDocStringValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FIELDDT

public static final String DEFAULT_FIELDDT
Default list display type of XAppClasses.XWikiApplicationClass fields.

See Also:
Constant Field Values

DEFAULT_FIELDS

public static final String DEFAULT_FIELDS
Default list separators of XAppClasses.XWikiApplicationClass fields.

See Also:
Constant Field Values

FIELD_APPNAME

public static final String FIELD_APPNAME
Name of field appname for the XWiki class XAppClasses.XWikiApplicationClass. The unique name of the application.

See Also:
Constant Field Values

FIELDPN_APPNAME

public static final String FIELDPN_APPNAME
Pretty name of field appname for the XWiki class XAppClasses.XWikiApplicationClass.

See Also:
Constant Field Values

FIELD_APPPRETTYNAME

public static final String FIELD_APPPRETTYNAME
Name of field appprettyname for the XWiki class XAppClasses.XWikiApplicationClass. The displayed name of the application.

See Also:
Constant Field Values

FIELDPN_APPPRETTYNAME

public static final String FIELDPN_APPPRETTYNAME
Pretty name of field appprettyname for the XWiki class XAppClasses.XWikiApplicationClass.

See Also:
Constant Field Values

FIELD_DESCRIPTION

public static final String FIELD_DESCRIPTION
Name of field description for the XWiki class XAppClasses.XWikiApplicationClass. The description of the application.

See Also:
Constant Field Values

FIELDPN_DESCRIPTION

public static final String FIELDPN_DESCRIPTION
Pretty name of field description for the XWiki class XAppClasses.XWikiApplicationClass.

See Also:
Constant Field Values

FIELD_APPVERSION

public static final String FIELD_APPVERSION
Name of field version for the XWiki class XAppClasses.XWikiApplicationClass. The version of the application.

See Also:
Constant Field Values

FIELDPN_APPVERSION

public static final String FIELDPN_APPVERSION
Pretty name of field version for the XWiki class XAppClasses.XWikiApplicationClass.

See Also:
Constant Field Values

FIELD_APPAUTHORS

public static final String FIELD_APPAUTHORS
Name of field appauthors for the XWiki class XAppClasses.XWikiApplicationClass. The description of the application.

See Also:
Constant Field Values

FIELDPN_APPAUTHORS

public static final String FIELDPN_APPAUTHORS
Pretty name of field appauthors for the XWiki class XAppClasses.XWikiApplicationClass.

See Also:
Constant Field Values

FIELD_LICENSE

public static final String FIELD_LICENSE
Name of field license for the XWiki class XAppClasses.XWikiApplicationClass. The description of the application.

See Also:
Constant Field Values

FIELDPN_LICENSE

public static final String FIELDPN_LICENSE
Pretty name of field license for the XWiki class XAppClasses.XWikiApplicationClass.

See Also:
Constant Field Values

FIELD_DEPENDENCIES

public static final String FIELD_DEPENDENCIES
Name of field dependencies for the XWiki class XAppClasses.XWikiApplicationClass. The list of plugins on which application depends.

See Also:
Constant Field Values

FIELDPN_DEPENDENCIES

public static final String FIELDPN_DEPENDENCIES
Pretty name of field dependencies for the XWiki class XAppClasses.XWikiApplicationClass.

See Also:
Constant Field Values

FIELD_APPLICATIONS

public static final String FIELD_APPLICATIONS
Name of field applications for the XWiki class XAppClasses.XWikiApplicationClass. The list of other applications on which current application depends.

See Also:
Constant Field Values

FIELDPN_APPLICATIONS

public static final String FIELDPN_APPLICATIONS
Pretty name of field applications for the XWiki class XAppClasses.XWikiApplicationClass.

See Also:
Constant Field Values

FIELD_DOCUMENTS

public static final String FIELD_DOCUMENTS
Name of field documents for the XWiki class XAppClasses.XWikiApplicationClass. The list of documents application contains.

See Also:
Constant Field Values

FIELDPN_DOCUMENTS

public static final String FIELDPN_DOCUMENTS
Pretty name of field documents for the XWiki class XAppClasses.XWikiApplicationClass.

See Also:
Constant Field Values

FIELD_DOCSTOINCLUDE

public static final String FIELD_DOCSTOINCLUDE
Name of field docstoinclude for the XWiki class XAppClasses.XWikiApplicationClass. The list of document application contains that will be included in place of copy from wiki template.

See Also:
Constant Field Values

FIELDPN_DOCSTOINCLUDE

public static final String FIELDPN_DOCSTOINCLUDE
Pretty name of field docstoinclude for the XWiki class XAppClasses.XWikiApplicationClass.

See Also:
Constant Field Values

FIELD_DOCSTOLINK

public static final String FIELD_DOCSTOLINK
Name of field docstolink for the XWiki class XAppClasses.XWikiApplicationClass. The list of document application contains that will be linked in place of copy from wiki template.

See Also:
Constant Field Values

FIELDPN_DOCSTOLINK

public static final String FIELDPN_DOCSTOLINK
Pretty name of field docstolink for the XWiki class XAppClasses.XWikiApplicationClass.

See Also:
Constant Field Values

FIELD_TRANSLATIONDOCS

public static final String FIELD_TRANSLATIONDOCS
Name of field translationdocs for the XWiki class XAppClasses.XWikiApplicationClass.

See Also:
Constant Field Values

FIELDPN_TRANSLATIONDOCS

public static final String FIELDPN_TRANSLATIONDOCS
Pretty name of field translationdocs for the XWiki class XAppClasses.XWikiApplicationClass.

See Also:
Constant Field Values
Constructor Detail

XWikiApplicationClass

protected XWikiApplicationClass()
Construct the overload of AbstractXClassManager with spaceprefix=CLASS_SPACE_PREFIX and prefix= CLASS_PREFIX.

Method Detail

getInstance

public static XWikiApplicationClass getInstance(XWikiContext context,
                                                boolean check)
                                         throws XWikiException
Return unique instance of XWikiApplicationClass and update documents for this context. It also check if the corresponding XWiki class/template/sheet exist in context's database and create it if not.

Parameters:
context - the XWiki context.
check - indicate if class existence has to be checked in the wiki.
Returns:
a unique instance of XWikiApplicationClass.
Throws:
XWikiException - error when checking for class, class template and class sheet.

getInstance

public static XWikiApplicationClass getInstance(XWikiContext context)
                                         throws XWikiException
Return unique instance of XWikiApplicationClass and update documents for this context. It also check if the corresponding Xwiki class/template/sheet exist in context's database and create it if not.

Parameters:
context - the XWiki context.
Returns:
a unique instance of XWikiApplicationClass.
Throws:
XWikiException - error when checking for class, class template and class sheet.

isApplication

public static boolean isApplication(XWikiDocument doc)
Indicate if the provided document contains application descriptor.

Parameters:
doc - the document.
Returns:
true if the document contains an application descriptor, false otherwise.

updateBaseClass

protected boolean updateBaseClass(BaseClass baseClass)
Description copied from class: AbstractXClassManager
Configure BaseClass.

Overrides:
updateBaseClass in class AbstractXClassManager<XWikiApplication>
Parameters:
baseClass - the baseClass to configure.
Returns:
true if baseClass modified.

updateClassTemplateDocument

protected boolean updateClassTemplateDocument(XWikiDocument doc)
Description copied from class: AbstractXClassManager
Initialize template document with default content.

Overrides:
updateClassTemplateDocument in class AbstractXClassManager<XWikiApplication>
Parameters:
doc - the class template document that will be saved.
Returns:
true if doc modified.

getApplicationDocument

protected XWikiDocument getApplicationDocument(String appName,
                                               XWikiContext context,
                                               boolean validate)
                                        throws XWikiException
Get the XWiki document descriptor of containing XAppClasses.XWikiApplication XWiki object with "appname" field equals to appName.

Parameters:
appName - the name of the application.
context - the XWiki context.
validate - indicate if it return new XWikiDocument or throw exception if application descriptor does not exist.
Returns:
the XWikiDocument representing application descriptor.
Throws:
XWikiException - error when searching for application descriptor document.
See Also:
#getApplication(String, XWikiContext, boolean)

getApplication

public XWikiApplication getApplication(String appName,
                                       boolean validate,
                                       XWikiContext context)
                                throws XWikiException
Get the XWiki document descriptor of containing XAppClasses.XWikiApplication XWiki object with "appname" field equals to appName.

Parameters:
appName - the name of the application.
context - the XWiki context.
validate - indicate if it return new XWikiDocument or throw exception if application descriptor does not exist.
Returns:
the XWikiApplication representing application descriptor.
Throws:
XWikiException - error when searching for application descriptor document.
See Also:
getApplicationDocument(String, XWikiContext, boolean)

newXObjectDocument

public XWikiApplication newXObjectDocument(XWikiDocument doc,
                                           int objId,
                                           XWikiContext context)
                                    throws XWikiException
Description copied from interface: XClassManager
Create new super document containing object of class XClassManager.getClassFullName(). If document already exist it is returned with new object if it does not contains any.

Specified by:
newXObjectDocument in interface XClassManager<XWikiApplication>
Overrides:
newXObjectDocument in class AbstractXClassManager<XWikiApplication>
Parameters:
doc - the XWiki document to manage.
objId - the id of the XWiki object included in the document to manage.
context - the XWiki context.
Returns:
a new XObjectDocument instance.
Throws:
XWikiException - error when calling XObjectDocument implementation constructor.


Copyright © 2004-2013 XWiki. All Rights Reserved.