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

java.lang.Object
  extended by com.xpn.xwiki.api.Api
      extended by com.xpn.xwiki.api.Document
          extended by com.xpn.xwiki.plugin.applicationmanager.core.doc.objects.classes.DefaultXObjectDocument
              extended by com.xpn.xwiki.plugin.applicationmanager.doc.XWikiApplication
All Implemented Interfaces:
XObjectDocument

public class XWikiApplication
extends DefaultXObjectDocument

This class manage an XWiki document containing XApp.XWikiApplicationClass object. It add some specifics methods, getters and setters for this type of object and fields.

Version:
$Id: 5685f9e46bb0e7cbd5cac2d72a3bab4a1da32a14 $

Field Summary
 
Fields inherited from class com.xpn.xwiki.plugin.applicationmanager.core.doc.objects.classes.DefaultXObjectDocument
isNew, objectId, sclass
 
Fields inherited from class com.xpn.xwiki.api.Document
cloned, currentObj, doc
 
Fields inherited from class com.xpn.xwiki.api.Api
context
 
Fields inherited from interface com.xpn.xwiki.plugin.applicationmanager.core.doc.objects.classes.XObjectDocument
SPACE_DOC_SEPARATOR, WIKI_SPACE_SEPARATOR
 
Constructor Summary
XWikiApplication(XWikiDocument xdoc, int objectId, XWikiContext context)
          Create new XWikiApplication managing provided XWikiDocument.
 
Method Summary
protected  void addXWikiApplicationSet(XWikiApplication rootApplication, Collection<XWikiApplication> applicationList, boolean recurse, XWikiContext context)
          Add all applications on which current application depend.
 boolean equals(Object object)
           
 String getAppAuthors()
           
 List<String> getApplications()
           
 String getAppName()
           
 String getAppPrettyName()
           
 String getAppVersion()
           
 List<String> getDependencies()
           
 String getDescription()
           
 Set<String> getDocsNameToInclude(boolean recurse)
          Get and resolve all documents names to include application contains.
static Set<String> getDocsNameToInclude(Collection<XWikiApplication> applications)
          Get and resolve all documents names to include applications XWikiApplication list contains.
 Set<String> getDocsNameToLink(boolean recurse)
          Get and resolve all documents names to link application contains.
static Set<String> getDocsNameToLink(Collection<XWikiApplication> applications)
          Get and resolve all documents names to link applications XWikiApplication list contains.
 List<String> getDocsToInclude()
           
 List<String> getDocsToLink()
           
 List<String> getDocuments()
           
 Set<String> getDocumentsNames(boolean recurse, boolean includeAppDesc)
          Get and resolve all documents names application contains.
 String getLicense()
           
 List<String> getTranslationDocs()
           
 Set<XWikiApplication> getXWikiApplicationSet(boolean recurse, XWikiContext context)
          Get set of XWikiApplication containing all applications on which current application depend.
 int hashCode()
           
 void setAppAuthors(String appauthors)
          Modify the authors of the application.
 void setApplications(List<String> applications)
          Modify the list of other applications on which current application depends.
 void setAppName(String appname)
          Modify the name of the application.
 void setAppPrettyName(String appprettyname)
          Modify the pratty name of the application.
 void setAppVersion(String appversion)
          Modify the version of the application.
 void setDependencies(List<String> dependencies)
          Modify the list of plugins on which application depends.
 void setDescription(String description)
          Modify the description of the application.
 void setDocsToInclude(List<String> docstoinclude)
          Modify the list of document application contains that will be included in place of copy from wiki template.
 void setDocsToLink(List<String> docstolink)
          Modify the list of document application contains that will be included in place of copy from wiki template.
 void setDocuments(List<String> documents)
          Modify the list of documents application contains.
 void setLicense(String license)
          Modify the version of the application.
 void setTranslationDocs(List<String> translationdocs)
          Modify the list of documents containing translations strings.
 String toString()
           
 
Methods inherited from class com.xpn.xwiki.plugin.applicationmanager.core.doc.objects.classes.DefaultXObjectDocument
delete, getBaseObject, getBooleanValue, getDocumentApi, getIntValue, getLargeStringValue, getListValue, getObjectApi, getObjectId, getStringListValue, getStringValue, getXClassManager, isNew, mergeObject, reload, saveDocument, setBooleanValue, setFullName, setIntValue, setLargeStringValue, setListValue, setStringListValue, setStringValue
 
Methods inherited from class com.xpn.xwiki.api.Document
addAttachment, addAttachment, addAttachments, addAttachments, addObjectFromRequest, addObjectFromRequest, addObjectFromRequest, addObjectsFromRequest, addObjectsFromRequest, checkAccess, convertSyntax, createNewObject, deleteAsAuthor, deleteDocument, deleteWithProgrammingRights, display, display, display, display, display, display, display, displayEdit, displayForm, displayForm, displayForm, displayHidden, displayPrettyName, displayPrettyName, displayPrettyName, displayPrettyName, displayPrettyName, displayPrettyName, displayRendered, displayTooltip, displayTooltip, displayView, dropPermissions, get, getActiveClass, getArchive, getAttachment, getAttachmentDiff, getAttachmentList, getAttachmentRevisionURL, getAttachmentRevisionURL, getAttachmentURL, getAttachmentURL, getAttachmentURL, getAuthor, getBacklinks, getChildren, getChildren, getClassDiff, getComment, getComments, getComments, getContent, getContentAuthor, getContentDiff, getContentUpdateDate, getCreationDate, getCreator, getCurrentMonthPageStats, getCurrentMonthRefStats, getCurrentMonthSpaceStats, getDate, getDefaultEditMode, getDefaultEditURL, getDefaultLanguage, getDefaultTemplate, getDisplayTitle, getDoc, getDocument, getDocumentArchive, getDocumentReference, getDocumentRevision, getEditURL, getEditURL, getEscapedContent, getExternalURL, getExternalURL, getExternalURL, getFirstObject, getFormat, getFullName, getId, getIncludedMacros, getIncludedPages, getLanguage, getLastChanges, getLinkedPages, getLinks, getLocked, getLockingDate, getLockingUser, getMetaDataDiff, getName, getObject, getObject, getObject, getObject, getObject, getObjectDiff, getObjectNumbers, getObjects, getObjects, getParent, getParentURL, getPlainTitle, getPrefixedFullName, getPreviousDocument, getPreviousVersion, getRCSVersion, getRealLanguage, getRecentRevisions, getRecentRevisions, getRenderedContent, getRenderedContent, getRenderedContent, getRenderedContent, getRenderedContent, getRenderedContentDiff, getRenderedContentRestricted, getRenderedTitle, getRevisionInfo, getRevisions, getRevisions, getSections, getSpace, getSyntax, getSyntaxId, getTagList, getTags, getTagsPossibleValues, getTemplate, getTextArea, getTitle, getTOC, getTranslatedContent, getTranslatedContent, getTranslatedDocument, getTranslatedDocument, getTranslationList, getURL, getURL, getURL, getValidationScript, getValue, getValue, getVersion, getVersionHashCode, getWeb, getWiki, getXMLContent, getXMLDiff, getXObjects, getxWikiClass, getxWikiClasses, getxWikiObjects, hasAccessLevel, hasAccessLevel, insertText, isAdvancedContent, isCreator, isCurrentLocalUserPage, isCurrentUserCreator, isCurrentUserPage, isFromCache, isHidden, isMinorEdit, isMostRecent, isProgrammaticContent, newObject, removeObject, removeObjects, rename, rename, rename, rename, rename, renameDocument, renameDocument, save, save, save, saveAsAuthor, saveAsAuthor, saveAsAuthor, saveWithProgrammingRights, saveWithProgrammingRights, saveWithProgrammingRights, set, set, setComment, setContent, setCustomClass, setDefaultTemplate, setHidden, setMinorEdit, setParent, setSyntax, setSyntaxId, setTitle, setValidationScript, toXML, toXMLDocument, updateObjectFromRequest, updateObjectFromRequest, updateObjectsFromRequest, updateObjectsFromRequest, use, use, use, validate, validate
 
Methods inherited from class com.xpn.xwiki.api.Api
convert, convert, convert, convertAttachments, getXWikiContext, hasAdminRights, hasProgrammingRights, hasWikiAdminRights
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XWikiApplication

public XWikiApplication(XWikiDocument xdoc,
                        int objectId,
                        XWikiContext context)
                 throws XWikiException
Create new XWikiApplication managing provided XWikiDocument.

Parameters:
xdoc - the encapsulated XWikiDocument
objectId - the id of the XWiki object included in the document to manage.
context - the XWiki context
Throws:
XWikiException - error when:
See Also:
DefaultXObjectDocument.DefaultXObjectDocument(com.xpn.xwiki.plugin.applicationmanager.core.doc.objects.classes.XClassManager, XWikiDocument, int, XWikiContext)
Method Detail

getAppName

public String getAppName()
Returns:
the name of the application
See Also:
setAppName(String)

setAppName

public void setAppName(String appname)
Modify the name of the application.

Parameters:
appname - the new name of the application.
See Also:
getAppName()

getAppPrettyName

public String getAppPrettyName()
Returns:
the pretty name of the application
See Also:
setAppPrettyName(String)

setAppPrettyName

public void setAppPrettyName(String appprettyname)
Modify the pratty name of the application.

Parameters:
appprettyname - the new pretty name of the application.
See Also:
getAppPrettyName()

getDescription

public String getDescription()
Returns:
the description of the application.
See Also:
setDescription(String)

setDescription

public void setDescription(String description)
Modify the description of the application.

Parameters:
description - the new description of the application.
See Also:
getDescription()

getAppVersion

public String getAppVersion()
Returns:
the version of the application.
See Also:
setAppVersion(String)

setAppVersion

public void setAppVersion(String appversion)
Modify the version of the application.

Parameters:
appversion - the version of the application.
See Also:
getAppVersion()

getAppAuthors

public String getAppAuthors()
Returns:
the authors of the application.
See Also:
setAppAuthors(String)

setAppAuthors

public void setAppAuthors(String appauthors)
Modify the authors of the application.

Parameters:
appauthors - the authors of the application.
See Also:
getAppAuthors()

getLicense

public String getLicense()
Returns:
the license of the application.
See Also:
setLicense(String)

setLicense

public void setLicense(String license)
Modify the version of the application.

Parameters:
license - the license of the application.
See Also:
getAppVersion()

getDependencies

public List<String> getDependencies()
Returns:
the list of plugins on which application depends.
See Also:
setDependencies(List)

setDependencies

public void setDependencies(List<String> dependencies)
Modify the list of plugins on which application depends.

Parameters:
dependencies - the new list of plugins on which application depends.
See Also:
getDependencies()

getApplications

public List<String> getApplications()
Returns:
the list of other applications on which current application depends.

setApplications

public void setApplications(List<String> applications)
Modify the list of other applications on which current application depends.

Parameters:
applications - the new list of other applications on which current application depends.
See Also:
getApplications()

getDocuments

public List<String> getDocuments()
Returns:
the list of documents application contains. This method return the content of the field "documents", if you want the real list of documents names with resolved patterns and recursive tools you should use getDocumentsNames(boolean, boolean).
See Also:
setDocuments(List)

setDocuments

public void setDocuments(List<String> documents)
Modify the list of documents application contains.

Parameters:
documents - the new list of documents application contains.
See Also:
getDocuments()

getDocsToInclude

public List<String> getDocsToInclude()
Returns:
the list of document application contains that will be included in place of copy from wiki template. This method return the content of the field "docstoinclude", if you want the real list of documents names with resolved patterns and recursive tools you should use getDocsNameToInclude(boolean).
See Also:
setDocsToInclude(List)

setDocsToInclude

public void setDocsToInclude(List<String> docstoinclude)
Modify the list of document application contains that will be included in place of copy from wiki template.

Parameters:
docstoinclude - the new list of document application contains that will be included in place of copy from a wiki template.
See Also:
getDocsToInclude()

getDocsToLink

public List<String> getDocsToLink()
Returns:
the list of document application contains that will be linked in place of copy from a wiki template. This method return the content of the field "docstolink", if you want the real list of documents names with resolved patterns and recursive tools you should use getDocsNameToLink(boolean).
See Also:
setDocsToLink(List)

setDocsToLink

public void setDocsToLink(List<String> docstolink)
Modify the list of document application contains that will be included in place of copy from wiki template.

Parameters:
docstolink - the new list of document application contains that will be linked in place of copy from a wiki template.
See Also:
getDocsToLink()

getTranslationDocs

public List<String> getTranslationDocs()
Returns:
the list of documents containing translations strings.

Theses documents are added to XWiki.XWikiPreferences "documentBundles" field at application installation.


setTranslationDocs

public void setTranslationDocs(List<String> translationdocs)
Modify the list of documents containing translations strings.

Theses documents are added to XWiki.XWikiPreferences "documentBundles" field at application installation.

Parameters:
translationdocs - the new list of documents containing translations strings. Theses documents are added to XWiki.XWikiPreferences "documentBundles" field at application installation.

toString

public String toString()
Overrides:
toString in class Document

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object object)
Overrides:
equals in class Document

addXWikiApplicationSet

protected void addXWikiApplicationSet(XWikiApplication rootApplication,
                                      Collection<XWikiApplication> applicationList,
                                      boolean recurse,
                                      XWikiContext context)
                               throws XWikiException
Add all applications on which current application depend.

Parameters:
rootApplication - the root application containing recursively all in applicationList.
applicationList - the applications.
recurse - if true it add recursively all applications dependencies, if false return only direct dependencies.
context - the XWiki context.
Throws:
XWikiException - error when getting application descriptor document from the database.
See Also:
getApplications()

getXWikiApplicationSet

public Set<XWikiApplication> getXWikiApplicationSet(boolean recurse,
                                                    XWikiContext context)
                                             throws XWikiException
Get set of XWikiApplication containing all applications on which current application depend.

Parameters:
recurse - if true it add recursively all applications dependencies, if false return only direct dependencies.
context - the XWiki context.
Returns:
the set list of XWikiApplication.
Throws:
XWikiException - error when getting application descriptor document from the database.
See Also:
getApplications()

getDocumentsNames

public Set<String> getDocumentsNames(boolean recurse,
                                     boolean includeAppDesc)
                              throws XWikiException
Get and resolve all documents names application contains.

For each of these documents names, if are between "[" and "]", are considered as SQL matching string to use with "like".

Parameters:
recurse - if true it follow recursively all applications dependencies, if false parse only direct dependencies.
includeAppDesc - if true application descriptor document names is added to docsNames.
Returns:
all documents names application contains.
Throws:
XWikiException - error when:
  • resolving SQL matching.
  • or getting applications dependencies descriptors documents from the database.
See Also:
getDocuments(), XWikiApplicationClass.FIELD_DOCUMENTS

getDocsNameToInclude

public Set<String> getDocsNameToInclude(boolean recurse)
                                 throws XWikiException
Get and resolve all documents names to include application contains.

For each of these documents names, if are between "[" and "]", are considered as SQL matching string to use with "like".

Parameters:
recurse - if true it follow recursively all applications dependencies, if false parse only direct dependencies.
Returns:
all documents names to include application contains.
Throws:
XWikiException - error when:
  • resolving SQL matching.
  • or getting applications dependencies descriptors documents from the database.
See Also:
getDocsToInclude(), XWikiApplicationClass.FIELD_DOCSTOINCLUDE

getDocsNameToInclude

public static Set<String> getDocsNameToInclude(Collection<XWikiApplication> applications)
                                        throws XWikiException
Get and resolve all documents names to include applications XWikiApplication list contains.

For each of these documents names, if are between "[" and "]", are considered as SQL matching string to use with "like".

Parameters:
applications - the applications containing documents names to resolve and add to docsNames.
Returns:
all documents names to include applications contains.
Throws:
XWikiException - error when:
  • resolving SQL matching.
  • or getting applications dependencies descriptors documents from the database.
See Also:
getDocsToInclude(), XWikiApplicationClass.FIELD_DOCSTOINCLUDE

getDocsNameToLink

public Set<String> getDocsNameToLink(boolean recurse)
                              throws XWikiException
Get and resolve all documents names to link application contains.

For each of these documents names, if are between "[" and "]", are considered as SQL matching string to use with "like".

Parameters:
recurse - if true it follow recursively all applications dependencies, if false parse only direct dependencies.
Returns:
all documents names to link application contains.
Throws:
XWikiException - error when:
  • resolving SQL matching.
  • or getting applications dependencies descriptors documents from the database.
See Also:
getDocsToLink(), XWikiApplicationClass.FIELD_DOCSTOLINK

getDocsNameToLink

public static Set<String> getDocsNameToLink(Collection<XWikiApplication> applications)
                                     throws XWikiException
Get and resolve all documents names to link applications XWikiApplication list contains.

For each of these documents names, if are between "[" and "]", are considered as SQL matching string to use with "like".

Parameters:
applications - the applications containing documents names to resolve and add to docsNames.
Returns:
all documents names to link applications contains.
Throws:
XWikiException - error when:
  • resolving SQL matching.
  • or getting applications dependencies descriptors documents from the database.
See Also:
getDocsToLink(), XWikiApplicationClass.FIELD_DOCSTOLINK


Copyright © 2004-2013 XWiki. All Rights Reserved.