public class WGArea extends WGSchemaDocument implements PageHierarchyNode
Represents an area of the content database, containing content documents. Areas are treated as separated regions of the content, where each has it's own access controlling.
Modifier and Type | Class and Description |
---|---|
static class |
WGArea.AreaCache |
class |
WGArea.SessionData |
WGDocument.Cache, WGDocument.FakeMetaDataContext, WGDocument.SaveAction
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
META_ALLOWED_ROOTTYPES |
static java.lang.String |
META_EDITORS |
static java.lang.String |
META_READERS |
static java.lang.String |
META_ROOTPAGERESTRICTIONS |
static java.lang.String |
META_SYSTEM |
static MetaInfo |
METAINFO_ALLOWED_ROOTTYPES |
static MetaInfo |
METAINFO_EDITORS |
static MetaInfo |
METAINFO_READERS |
static MetaInfo |
METAINFO_ROOTPAGERESTRICTIONS |
static MetaInfo |
METAINFO_SYSTEM |
EXTDATA_SCHEMADEFINITION
META_DESCRIPTION, META_DESIGNREFERENCE, META_NAME, META_VARIANT, METAINFO_DESCRIPTION, METAINFO_DESIGNREFERENCE, METAINFO_NAME, METAINFO_VARIANT
CSFEATURE_EXTDATA, DERIVATE_NAME_PATTERN, DOCKEY_DIVIDER, EXT_PRIMARY_ATTACHMENT, EXTDATA_META_PREFIX, META_CREATED, META_LASTMODIFIED, META_PASTAUTHORS, META_PASTEDITDATES, META_REVISION, METAINFO_CREATED, METAINFO_LASTMODIFIED, METAINFO_PASTAUTHORS, METAINFO_PASTEDITDATES, METAINFO_REVISION, NOONE_ALLOWED, PAGERESTRICTION_ANY, PAGERESTRICTION_FIXEDTYPES, PAGERESTRICTION_NONE, PAGERESTRICTION_UNSPECIFIED, TYPE_ACLENTRY, TYPE_AREA, TYPE_CONTENT, TYPE_CONTENTTYPE, TYPE_CSSJS, TYPE_DBMETADATA, TYPE_FILECONTAINER, TYPE_FILEDERIVATE, TYPE_LANGUAGE, TYPE_STRUCTENTRY, TYPE_TML, TYPE_USERPROFILE, TYPENAME_ACLENTRY, TYPENAME_AREA, TYPENAME_CONTENT, TYPENAME_CONTENTTYPE, TYPENAME_CSSJS, TYPENAME_DBMETADATA, TYPENAME_FILECONTAINER, TYPENAME_FILEDERIVATE, TYPENAME_LANGUAGE, TYPENAME_STRUCTENTRY, TYPENAME_TML, TYPENAME_USERPROFILE
Constructor and Description |
---|
WGArea(WGDatabase db,
WGDocumentCore doc) |
WGArea(WGDatabase wgDatabase,
WGDocumentCore doc,
de.innovationgate.webgate.api.WGDocumentObjectFlags flags) |
Modifier and Type | Method and Description |
---|---|
WGDocument |
createClone(WGDatabase db)
Creates a clone of this design document in another database
|
WGContent |
createContent()
Creates a new content as root for this area.
|
WGContent |
createContent(java.lang.Object key,
java.lang.String title)
Creates a new content object as root in this area.
|
WGStructEntry |
createRootEntry(WGContentType contentType,
java.lang.String title)
Creates a new root entry for this area.
|
WGContent |
createRootPage(WGContentType contentType,
java.lang.String title)
Variant of
createRootPage(WGContentType, String, String) that always uses default language. |
WGContent |
createRootPage(WGContentType contentType,
java.lang.String title,
java.lang.String language)
Creates a new root page, including struct entry and content.
|
java.util.List<java.lang.String> |
getAllowedRootTypes()
Returns the allowed content types for root pages on this area.
|
de.innovationgate.utils.SkippingIterator<? extends PageHierarchyNode> |
getChildNodeIterator(int pageSize)
Returns an iterator for the child nodes of this hierarchy node
|
java.util.List<PageHierarchyNode> |
getChildNodes()
Returns the child nodes of this hierarchy node
|
java.lang.Class |
getChildNodeType()
Return the class type of child nodes
|
java.util.List |
getEditors()
Returns a list of allowed content editors in this area.
|
java.util.List |
getEffectiveEditors()
Returns the list of currently effective editors.
|
java.util.List |
getEffectiveReaders()
Returns the list of currently effective readers.
|
java.lang.String |
getName()
Returns the name of this area.
|
java.lang.String |
getNodeKey()
Returns a string key for the node that is unique among all keys of PageHierarchyNodes in this database.
|
java.lang.String |
getNodeTitle(java.lang.String language)
Returns the display title for the node.
|
WGStructEntryList |
getOrderedRootEntries(int offset,
int size,
java.lang.String orderExpression)
Returns a partial list of the root entries of this area, ordered by a special order expression
|
WGStructEntryList |
getOrderedRootEntries(java.lang.String orderExpression)
Returns a list of all root entries in this area, ordered by a special order expression
|
WGStructEntryIterator |
getOrderedRootEntryIterator(int pageSize,
java.lang.String pageOrder)
Returns an iterator over the root entries of this area, returned in a particular order
Internally the iterator fetches multiple entities at once from the backend for more performant backend retrieval processes.
|
PageHierarchyNode |
getParentNode()
Return the parent of this node in hierarchy.
|
java.util.List |
getReaders()
Returns a list of allowed readers of contents in this area.
|
WGHierarchyContentIterator |
getRootContentIterator(java.lang.String language,
int pageSize)
Returns an iterator over the root contents of area in a given language
Internally the iterator fetches multiple pages at once from the backend for more performant backend retrieval processes.
|
WGStructEntryList |
getRootEntries()
Returns a list of all root entries in this area.
|
WGStructEntryList |
getRootEntries(int offset,
int size)
Returns a partial list of the root entries in this area.
|
int |
getRootEntryCount() |
WGStructEntryIterator |
getRootEntryIterator(int pageSize)
Returns an iterator over the root entries of this area.
|
java.lang.String |
getRootPageRestrictions()
Returns the restrictions regarding root pages on this area.
|
int |
getType()
Returns the type of this document as constant WGDocument.TYPE_...
|
boolean |
isPublic()
Tests if this area is publicly accessible, i.e. anyone can generally read its content
|
boolean |
isSystemArea()
Returns if this area is marked as being a system area, which contains no publishable content
|
boolean |
mayEditAreaChildren()
Deprecated.
Use
mayEditPages() |
boolean |
mayEditPages()
Tests if the current user is generally allowed to edit documents in this area, according to area access rights
|
boolean |
mayReadContent()
Tests if the current user may read contents in this area
|
void |
performRemoveCheck(boolean deepCheck,
WGDocument deletionRoot)
Performs a validation for removing the document at the current state, just like it actually was removed.
|
void |
performRootCreationCheck(WGContentType ct)
Checks if the current user may create a new root struct entry of the given content type.
|
void |
performRootPageCreationCheck(WGContentType ct,
WGLanguage lang)
Checks if the current user may create a new root page with the given data.
|
void |
performSaveCheck()
Performs a validation for saving the document at the current state, just like it actually was saved.
|
void |
pushData(WGDocument doc)
Pushed the data of this document to another document of the same type.
|
void |
setAllowedRootTypes(java.util.List<java.lang.String> types)
Sets the allowed content types for root pages on this area.
|
boolean |
setEditors(java.util.List list)
Sets the allowed editors for this area.
|
boolean |
setReaders(java.util.List list)
Sets the allowed readers for this area.
|
void |
setRootPageRestrictions(java.lang.String rootPages)
Sets the restrictions regarding root pages on this area
|
void |
setSystemArea(boolean system)
Sets if this area should be marked a system area.
|
void |
visit(WGPageVisitor visitor)
Implements the visitor pattern on the page hierarchy of this area.
|
createSchemaDefinition, getSchemaDefinition, isMetaDeterminedInSchema, setMetaData
buildDesignDocumentKey, createClone, getDescription, getDesignReference, getMediaKey, getParentLockable, isVariant, mayEditDocument, rename, rename, retrieveCore, setDescription
afterSave, attachAllFiles, attachAllFiles, attachFile, attachFile, attachFile, attachFileWithoutAnnotation, attachFileWithoutAnnotation, autoSave, buildDocumentKey, createFileDerivate, createFileDerivate, docTypeClassToNumber, doctypeNameToNumber, doctypeNumberToClass, doctypeNumberToName, dropCache, dropCore, equals, evaluateExpression, getCore, getCoreRetrieved, getCreated, getDatabase, getDocumentKey, getDocumentKeyObj, getExpectedMetaClass, getExtdataMetaName, getExtensionData, getExtensionDataNames, getFileData, getFileDerivateData, getFileDerivateMetaData, getFileDerivates, getFileLastModified, getFileMetaData, getFileMimeType, getFileMimeTypes, getFileNames, getFileParent, getFileSize, getFileText, getFileText, getItemDate, getItemNames, getItemNumber, getItemText, getItemValue, getItemValueList, getLastModified, getLastUpdates, getLockStatus, getLockStatus, getMetaData, getMetaDataList, getMetaInfo, getMetaInfoByType, getMetaNames, getName, getNativeObject, getObjectCreated, getPastAuthors, getPastEditDates, getPersistentStore, getPrimaryFileName, getRevision, hasFile, hasFileMetadata, hashCode, hasItem, innerAttachFile, isCachingEnabled, isCoreRetrieved, isDeleted, isDeleted, isDummy, isEdited, isListMeta, isSaved, isTemporary, lock, lock, markEdited, markMetaDataModified, mayPushExtData, mayRemove, mayRemove, maySave, performRemoveCheck, performRemoveCheck, remove, removeAllExtensionData, removeAllFiles, removeAllItems, removeExtensionData, removeFile, removeFileDerivate, removeItem, renameFile, resultIsFalse, resultIsTrue, save, save, saveQuiet, saveWithGivenTimestamps, setCachingEnabled, setItem, setItems, setItemValue, setMeta, setMetas, setMetaToDefault, setPrimaryFileName, setValues, unlock, unlock, validateMetas, validateMetas, writeExtensionData, writeFileDerivateMetaData
public static final java.lang.String META_READERS
public static final MetaInfo METAINFO_READERS
public static final java.lang.String META_EDITORS
public static final MetaInfo METAINFO_EDITORS
public static final java.lang.String META_SYSTEM
public static final MetaInfo METAINFO_SYSTEM
public static final java.lang.String META_ROOTPAGERESTRICTIONS
public static final MetaInfo METAINFO_ROOTPAGERESTRICTIONS
public static final java.lang.String META_ALLOWED_ROOTTYPES
public static final MetaInfo METAINFO_ALLOWED_ROOTTYPES
public WGArea(WGDatabase db, WGDocumentCore doc) throws WGAPIException
WGAPIException
WGDocument.WGDocument(WGDatabase, WGDocumentCore)
public WGArea(WGDatabase wgDatabase, WGDocumentCore doc, de.innovationgate.webgate.api.WGDocumentObjectFlags flags) throws WGAPIException
WGAPIException
public java.lang.String getName() throws WGAPIException
getName
in class WGDesignDocument
WGAPIException
public WGStructEntryList getRootEntries() throws WGAPIException
WGSystemException
WGBackendException
WGAPIException
public WGStructEntryIterator getRootEntryIterator(int pageSize) throws WGAPIException
pageSize
- The size of retrieval pagesWGAPIException
public WGStructEntryIterator getOrderedRootEntryIterator(int pageSize, java.lang.String pageOrder) throws WGAPIException
pageSize
- The size of retrieval pagespageOrder
- Order expression denoting the order in which pages should be returnedWGAPIException
public WGHierarchyContentIterator getRootContentIterator(java.lang.String language, int pageSize) throws WGAPIException
pageSize
- The size of retrieval pagesWGAPIException
public WGStructEntryList getRootEntries(int offset, int size) throws WGAPIException
offset
- The offset of the first entry to retrieve, 0 being the first onesize
- The number of entries to retrieveWGSystemException
WGBackendException
WGAPIException
public WGStructEntryList getOrderedRootEntries(int offset, int size, java.lang.String orderExpression) throws WGAPIException
offset
- The offset of the first entry to retrieve, 0 being the first onesize
- The number of entries to retrieveorderExpression
- Page order set expressionWGAPIException
public WGStructEntryList getOrderedRootEntries(java.lang.String orderExpression) throws WGAPIException
orderExpression
- Page order set expressionWGSystemException
WGBackendException
WGAPIException
public java.util.List getEditors() throws WGAPIException
WGAPIException
public java.util.List getReaders() throws WGAPIException
WGAPIException
public boolean setEditors(java.util.List list) throws WGAPIException
list
- WGAPIException
public boolean setReaders(java.util.List list) throws WGAPIException
list
- WGAPIException
public boolean mayEditAreaChildren() throws WGAPIException
mayEditPages()
WGAPIException
public boolean mayEditPages() throws WGAPIException
WGAPIException
public java.util.List getEffectiveReaders() throws WGAPIException
WGAPIException
public java.util.List getEffectiveEditors() throws WGAPIException
WGAPIException
public WGStructEntry createRootEntry(WGContentType contentType, java.lang.String title) throws WGAPIException
contentType
- The content type for this new entry.title
- The title of this new entry.WGAPIException
public WGContent createRootPage(WGContentType contentType, java.lang.String title, java.lang.String language) throws WGAPIException
contentType
- The content type of the pagetitle
- The title of the page that will be used for both struct entrylanguage
- The language of the content to create. Leave null to use databases default language.WGAPIException
public WGContent createRootPage(WGContentType contentType, java.lang.String title) throws WGAPIException
createRootPage(WGContentType, String, String)
that always uses default language.contentType
- title
- WGAPIException
public WGDocument createClone(WGDatabase db) throws WGAPIException
WGDesignDocument
createClone
in class WGDesignDocument
db
- Target databaseWGAPIException
public void pushData(WGDocument doc) throws WGAPIException
WGDocument
pushData
in class WGDocument
doc
- The target document receiving the data.WGAPIException
- If something goes wrongpublic void performRemoveCheck(boolean deepCheck, WGDocument deletionRoot) throws WGAPIException
WGDocument
WGAuthorisationException
is thrown.
For checking remove permissions without catching an exception see WGDocument.mayRemove(boolean)
.deepCheck
- Perform an hierarchical check beyond the current document, which is more expensive but also 100% accurate. This is only effective for document types whose deletion will also delete dependent documents.WGAuthorisationException
WGAPIException
public WGContent createContent(java.lang.Object key, java.lang.String title) throws WGAPIException
key
- The key for the new contenttitle
- The title of the new contentWGAPIException
public WGContent createContent() throws WGAPIException
WGAPIException
public java.lang.Class getChildNodeType()
PageHierarchyNode
getChildNodeType
in interface PageHierarchyNode
public java.util.List<PageHierarchyNode> getChildNodes() throws WGAPIException
PageHierarchyNode
getChildNodes
in interface PageHierarchyNode
WGAPIException
public de.innovationgate.utils.SkippingIterator<? extends PageHierarchyNode> getChildNodeIterator(int pageSize) throws WGAPIException
PageHierarchyNode
getChildNodeIterator
in interface PageHierarchyNode
pageSize
- The size of a fetch page, if the implementation fetches childnodes page-wiseWGAPIException
public PageHierarchyNode getParentNode() throws WGAPIException
PageHierarchyNode
getParentNode
in interface PageHierarchyNode
WGAPIException
public java.lang.String getNodeKey() throws WGAPIException
PageHierarchyNode
getNodeKey
in interface PageHierarchyNode
WGAPIException
public java.lang.String getNodeTitle(java.lang.String language) throws WGAPIException
PageHierarchyNode
getNodeTitle
in interface PageHierarchyNode
language
- The language whose title is wantedWGAPIException
public void performSaveCheck() throws ResourceIsLockedException, WGAPIException
WGDocument
WGAuthorisationException
is thrown.
For checking saving permissions without catching an exception see WGDocument.maySave()
.performSaveCheck
in class WGSchemaDocument
WGAPIException
ResourceIsLockedException
public void visit(WGPageVisitor visitor) throws WGAPIException
visitor
- WGAPIException
public void performRootCreationCheck(WGContentType ct) throws WGAPIException
ct
- The content type to use.WGAPIException
- If the user may not create the document. The exception informs about the reason.public void performRootPageCreationCheck(WGContentType ct, WGLanguage lang) throws WGAPIException
ct
- The content type to use for the struct entrylang
- The language to use for the contentWGAPIException
- If the user may not create the document. The exception informs about the reason.public int getType()
WGDocument
getType
in class WGDocument
public boolean isSystemArea() throws WGAPIException
WGAPIException
public void setSystemArea(boolean system) throws WGAPIException
system
- WGAPIException
public boolean mayReadContent() throws WGAPIException
WGAPIException
public int getRootEntryCount() throws WGAPIException
WGAPIException
public boolean isPublic() throws WGAPIException
WGAPIException
public java.lang.String getRootPageRestrictions() throws WGAPIException
WGAPIException
public void setRootPageRestrictions(java.lang.String rootPages) throws WGAPIException
rootPages
- Restriction string. Use constants PAGERESTRICTION_...sWGAPIException
public java.util.List<java.lang.String> getAllowedRootTypes() throws WGAPIException
getRootPageRestrictions()
is WGDocument.PAGERESTRICTION_FIXEDTYPES
WGAPIException
public void setAllowedRootTypes(java.util.List<java.lang.String> types) throws WGAPIException
getRootPageRestrictions()
is WGDocument.PAGERESTRICTION_FIXEDTYPES
types
- Names of content typesWGAPIException