public class HDBModel extends java.lang.Object implements ManagedDBAttribute, de.innovationgate.webgate.api.WGDesignChangeListener
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
EVENT_ON_CREATE |
static java.lang.String |
EVENT_ON_SAVE |
static java.lang.String |
EVENT_POST_CREATE |
static java.lang.String |
EVENT_POST_DELETE |
static java.lang.String |
EVENT_POST_MOVE_FROM |
static java.lang.String |
EVENT_POST_MOVE_TO |
static java.lang.String |
EVENT_POST_UPDATE |
static java.lang.String |
EVENT_PRE_CREATE |
static java.lang.String |
EVENT_PRE_DELETE |
static java.lang.String |
EVENT_PRE_MOVE_FROM |
static java.lang.String |
EVENT_PRE_MOVE_TO |
static java.lang.String |
EVENT_PRE_UPDATE |
static java.lang.String |
ITEM_CONTENT_ID |
static java.lang.String |
ITEM_STORAGE_ID |
static java.lang.String |
ITEM_TYPE |
static java.lang.String |
MODEL_FILE |
static java.lang.String |
OPTION_EXTRACLAUSE
Option containing an extra HQL clause to inject to the retrieval of relation targets or sources
|
static java.lang.String |
OPTION_EXTRAPARAMS
Option containing a
Map of extra query parameters to give to the retrieval of relation targets or sources, parameter names as map keys, parameter values as map values |
static java.lang.String |
OPTION_INCLUDECURRENT
Determines if the currently stored target of the relation should also be included in the retrieval of valid relation targets, even if it is no longer valid
|
static java.lang.String |
PARENT_RELATION_PREFIX |
static java.lang.String |
STORAGE_CONTENTCLASS |
static java.lang.String |
TYPE_CONTENT |
static java.lang.String |
TYPE_STORAGE |
static java.lang.Object |
VERSIONING_FULL |
static java.lang.Object |
VERSIONING_NONE |
| Modifier and Type | Method and Description |
|---|---|
void |
assignContentID(java.lang.String contentId) |
void |
assignContentID(de.innovationgate.webgate.api.WGContent content,
java.lang.String contentId)
Assings a content id to the given content.
|
void |
close() |
de.innovationgate.webgate.api.WGContent |
createContent(Form form)
Create a HDBModel content based on the information from a WebTML form.
|
de.innovationgate.webgate.api.WGContent |
createContent(HDBModelParams params)
Create a HDBModel content
|
de.innovationgate.webgate.api.WGContent |
createContent(java.lang.String contentClass)
Create a HDBModel content
|
de.innovationgate.webgate.api.WGContent |
createContent(java.lang.String contentClass,
java.lang.Object ref)
Create a HDBModel content
|
de.innovationgate.webgate.api.WGContent |
createContent(java.lang.String contentClass,
java.lang.Object ref,
java.lang.Object param)
Create a HDBModel content
|
static void |
createModelObject(WGACore core,
de.innovationgate.webgate.api.WGDatabase db)
Creates the HDBModel object.
|
void |
deleteContent() |
void |
deleteContent(Context context) |
void |
deleteContent(HDBModelParams params)
Delete a HDBModel content
|
void |
deleteContent(de.innovationgate.webgate.api.WGContent content)
Delete a HDBModel content
|
void |
designChanged(de.innovationgate.webgate.api.WGDesignChangeEvent event) |
de.innovationgate.wga.common.beans.hdbmodel.ModelDefinition |
getDefinition()
Returns the HDBModel definition
|
de.innovationgate.webgate.api.WGContent |
getDocument(java.lang.String id)
Retrieves a root storage by its storage id
|
de.innovationgate.webgate.api.WGContent |
getDocument(java.lang.String id,
de.innovationgate.webgate.api.WGContent relContent)
Returns a document, either a storage or content, relative to the given content or absolute if omitted.
|
de.innovationgate.webgate.api.WGContent |
getDocumentByStructKey(java.lang.Object structKey)
Retrieves a document by its struct key.
|
static java.lang.String |
getID(de.innovationgate.webgate.api.WGContent content)
Returns the HDB ID of the given document, the content id for contents, the storage id for storages
|
static HDBModel |
getModel(de.innovationgate.webgate.api.WGDatabase db) |
de.innovationgate.wga.common.beans.hdbmodel.Document |
getModelForContent(de.innovationgate.webgate.api.WGContent content)
Returns the model definition for the given document
|
java.util.List<de.innovationgate.wga.common.beans.hdbmodel.Document> |
getModelPathForContent(de.innovationgate.webgate.api.WGContent content)
Returns a complete path of model definitions for the given document, holding all definitions from root to this document top-down
|
java.util.List<de.innovationgate.wga.common.beans.hdbmodel.Content> |
getModelsForContentClass(java.lang.String contentClass)
Returns all model definitions for the given content class
|
java.util.List<de.innovationgate.wga.common.beans.hdbmodel.Content> |
getModelsForContentClass(java.lang.String contentClass,
de.innovationgate.webgate.api.WGContent ref,
boolean forceRelative)
Returns all models for the given content class whose positions are determinable from the given reference document.
|
de.innovationgate.webgate.api.WGAbstractResultSet |
getRelationSources(de.innovationgate.webgate.api.WGContent target,
java.lang.String contentClass,
java.lang.String relation)
Retrieves the source contents for a HDBModel relation that point to a given content
|
de.innovationgate.webgate.api.WGAbstractResultSet |
getRelationSources(de.innovationgate.webgate.api.WGContent target,
java.lang.String contentClass,
java.lang.String relation,
java.util.Map options)
Retrieves the source contents for a HDBModel relation that point to a given content
|
de.innovationgate.webgate.api.WGAbstractResultSet |
getRelationTargets(de.innovationgate.webgate.api.WGContent content,
java.lang.String contentClass,
java.lang.String relation)
Retrieve the valid relation targets for a HDBModel relation
|
de.innovationgate.webgate.api.WGAbstractResultSet |
getRelationTargets(de.innovationgate.webgate.api.WGContent content,
java.lang.String contentClass,
java.lang.String relation,
java.util.Map options)
Retrieve the valid relation targets for a HDBModel relation
|
static boolean |
isContent(de.innovationgate.webgate.api.WGContent content)
Returns if the given document is a HDBModel content
|
static boolean |
isDocument(de.innovationgate.webgate.api.WGContent content)
Returns if the given content is a HDBModel document
|
boolean |
isModelReinitRunning()
Returns if a reinit of the HDBModel in the database is currently taking place
|
boolean |
isModelVersionChanged()
Indicates if the HDBModel definition has changed since the last HDBModel reinit, so the model definition may not match the stored content in the database
|
static boolean |
isStorage(de.innovationgate.webgate.api.WGContent content)
Returns if the given document is a HDBModel storage
|
void |
moveContent(de.innovationgate.webgate.api.WGContent content,
de.innovationgate.webgate.api.WGContent ref)
Move a HDBModel content
|
HDBModelParams |
newCreateContentParams(java.lang.String contentClass,
java.lang.Object parent)
Creates a parameter object for creating a HDBModel content
|
HDBModelParams |
newDeleteContentParams(de.innovationgate.webgate.api.WGContent content)
Create parameters for deleting a HDBModel content
|
HDBModelParams |
newUpdateContentParams(de.innovationgate.webgate.api.WGContent content)
Create parameters for updating a HDBModel content
|
boolean |
onCreate(ContentTypeEvent event)
Event method for executing necessary operations when a HDBModel content is created.
|
boolean |
onSave(ContentTypeEvent event)
Event method for executing necessary operations when a HDBModel content is saved.
|
java.util.List<java.lang.String> |
readOldHashes() |
void |
reduceContentEditors(de.innovationgate.webgate.api.WGContent con,
java.util.List editors)
Sets valid editors on a content, keeping inherited rights effective and reduce the rights additionally.
|
void |
reinitModel()
Do a complete reinitialisation of the database according to the model
|
void |
reloadDefinition()
Reload the HDBModel definition
|
void |
setContentEditors(de.innovationgate.webgate.api.WGContent con,
java.util.List contentEditors,
java.util.List childEditors)
Sets valid editors on a content
|
void |
setContentReaders(de.innovationgate.webgate.api.WGContent con,
java.util.List readers)
Sets readers for a content document
|
boolean |
storeForm(Form form,
de.innovationgate.webgate.api.WGContent content)
Stores the data of a WebTML form in into the database.
|
void |
updateContent() |
void |
updateContent(Context ctx,
java.lang.Object param) |
void |
updateContent(HDBModelParams params)
Update a HDBModel content
|
void |
updateContent(java.lang.Object param) |
void |
updateContent(de.innovationgate.webgate.api.WGContent content)
Update a HDBModel content
|
void |
updateContent(de.innovationgate.webgate.api.WGContent content,
HDBModelProcess process)
Update a HDBModel content
|
void |
updateContent(de.innovationgate.webgate.api.WGContent content,
java.lang.String tmlscriptModule)
Update a HDBModel content
|
void |
updateContent(de.innovationgate.webgate.api.WGContent content,
java.lang.String tmlscriptModule,
java.lang.Object param)
Update a HDBModel content
|
boolean |
updateContentUniqueName(de.innovationgate.webgate.api.WGContent childContent) |
void |
writeOldHashes(java.util.List<java.lang.String> oldHashes) |
public static final java.lang.String PARENT_RELATION_PREFIX
public static final java.lang.String STORAGE_CONTENTCLASS
public static final java.lang.String OPTION_EXTRACLAUSE
public static final java.lang.String OPTION_EXTRAPARAMS
Map of extra query parameters to give to the retrieval of relation targets or sources, parameter names as map keys, parameter values as map valuespublic static final java.lang.String OPTION_INCLUDECURRENT
public static final java.lang.String EVENT_PRE_CREATE
public static final java.lang.String EVENT_POST_CREATE
public static final java.lang.String EVENT_PRE_UPDATE
public static final java.lang.String EVENT_POST_UPDATE
public static final java.lang.String EVENT_ON_CREATE
public static final java.lang.String EVENT_ON_SAVE
public static final java.lang.String EVENT_PRE_MOVE_FROM
public static final java.lang.String EVENT_PRE_MOVE_TO
public static final java.lang.String EVENT_POST_MOVE_FROM
public static final java.lang.String EVENT_POST_MOVE_TO
public static final java.lang.String EVENT_PRE_DELETE
public static final java.lang.String EVENT_POST_DELETE
public static final java.lang.String ITEM_TYPE
public static final java.lang.String TYPE_STORAGE
public static final java.lang.String TYPE_CONTENT
public static final java.lang.String MODEL_FILE
public static final java.lang.String ITEM_CONTENT_ID
public static final java.lang.String ITEM_STORAGE_ID
public static final java.lang.Object VERSIONING_FULL
public static final java.lang.Object VERSIONING_NONE
public boolean isModelReinitRunning()
public static HDBModel getModel(de.innovationgate.webgate.api.WGDatabase db)
public static boolean isStorage(de.innovationgate.webgate.api.WGContent content)
throws de.innovationgate.webgate.api.WGAPIException
content - The documentde.innovationgate.webgate.api.WGAPIExceptionpublic static boolean isContent(de.innovationgate.webgate.api.WGContent content)
throws de.innovationgate.webgate.api.WGAPIException
content - The documentde.innovationgate.webgate.api.WGAPIExceptionpublic static boolean isDocument(de.innovationgate.webgate.api.WGContent content)
throws de.innovationgate.webgate.api.WGAPIException
content - de.innovationgate.webgate.api.WGAPIExceptionpublic static java.lang.String getID(de.innovationgate.webgate.api.WGContent content)
throws de.innovationgate.webgate.api.WGAPIException
content - Documentde.innovationgate.webgate.api.WGAPIExceptionpublic void reloadDefinition()
public void reinitModel()
public boolean updateContentUniqueName(de.innovationgate.webgate.api.WGContent childContent)
throws de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGAPIExceptionpublic void writeOldHashes(java.util.List<java.lang.String> oldHashes)
throws de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGAPIExceptionpublic java.util.List<java.lang.String> readOldHashes()
throws de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGAPIExceptionpublic de.innovationgate.wga.common.beans.hdbmodel.Document getModelForContent(de.innovationgate.webgate.api.WGContent content)
throws de.innovationgate.webgate.api.WGAPIException
content - The documentde.innovationgate.webgate.api.WGAPIExceptionpublic java.util.List<de.innovationgate.wga.common.beans.hdbmodel.Document> getModelPathForContent(de.innovationgate.webgate.api.WGContent content)
throws de.innovationgate.webgate.api.WGAPIException
content - The documentde.innovationgate.webgate.api.WGAPIExceptionpublic java.util.List<de.innovationgate.wga.common.beans.hdbmodel.Content> getModelsForContentClass(java.lang.String contentClass)
contentClass - The content classpublic java.util.List<de.innovationgate.wga.common.beans.hdbmodel.Content> getModelsForContentClass(java.lang.String contentClass,
de.innovationgate.webgate.api.WGContent ref,
boolean forceRelative)
throws de.innovationgate.webgate.api.WGAPIException
contentClass - The content class to searchref - The reference document. Use null if you do not want any.forceRelative - Setting to true will exclude "root models"de.innovationgate.webgate.api.WGAPIExceptionpublic void close()
close in interface ManagedDBAttributepublic void designChanged(de.innovationgate.webgate.api.WGDesignChangeEvent event)
designChanged in interface de.innovationgate.webgate.api.WGDesignChangeListenerpublic static void createModelObject(WGACore core, de.innovationgate.webgate.api.WGDatabase db) throws de.innovationgate.webgate.api.WGException, java.security.NoSuchAlgorithmException, java.io.IOException
core - WGA Coredb - The HDBModel databasede.innovationgate.webgate.api.WGAPIExceptionjava.security.NoSuchAlgorithmExceptionjava.io.IOExceptionde.innovationgate.webgate.api.WGExceptionpublic de.innovationgate.webgate.api.WGContent createContent(HDBModelParams params) throws HDBModelException, de.innovationgate.webgate.api.WGAPIException
params - Parameters for the operationHDBModelExceptionde.innovationgate.webgate.api.WGAPIExceptionpublic de.innovationgate.webgate.api.WGContent createContent(java.lang.String contentClass)
throws de.innovationgate.webgate.api.WGException
contentClass - Content class of the content to createde.innovationgate.webgate.api.WGExceptionpublic de.innovationgate.webgate.api.WGContent createContent(java.lang.String contentClass,
java.lang.Object ref)
throws de.innovationgate.webgate.api.WGException
contentClass - Content class of the content to createref - Reference document (Context|contex-expression|WGContent|null) for the creation below which the content is to be createdde.innovationgate.webgate.api.WGExceptionpublic HDBModelParams newCreateContentParams(java.lang.String contentClass, java.lang.Object parent) throws de.innovationgate.webgate.api.WGAPIException
contentClass - The content class of the content to createparent - Reference document for the creation below which the content is to be createdde.innovationgate.webgate.api.WGAPIExceptionpublic de.innovationgate.webgate.api.WGContent createContent(java.lang.String contentClass,
java.lang.Object ref,
java.lang.Object param)
throws de.innovationgate.webgate.api.WGException
contentClass - Content class of the content to createref - Reference document (Context|contex-expression|WGContent|null) for the creation below which the content is to be createdparam - Custom parameter to inject to the operationde.innovationgate.webgate.api.WGExceptionpublic de.innovationgate.webgate.api.WGContent createContent(Form form) throws de.innovationgate.webgate.api.WGAPIException, HDBModelException
form - The formde.innovationgate.webgate.api.WGAPIExceptionHDBModelExceptionpublic void updateContent(de.innovationgate.webgate.api.WGContent content)
throws de.innovationgate.webgate.api.WGAPIException,
HDBModelException
content - The contentde.innovationgate.webgate.api.WGAPIExceptionHDBModelExceptionpublic HDBModelParams newUpdateContentParams(de.innovationgate.webgate.api.WGContent content) throws de.innovationgate.webgate.api.WGAPIException
content - The content to updatede.innovationgate.webgate.api.WGAPIExceptionpublic HDBModelParams newDeleteContentParams(de.innovationgate.webgate.api.WGContent content) throws de.innovationgate.webgate.api.WGAPIException
content - The content to deletede.innovationgate.webgate.api.WGAPIExceptionpublic void updateContent(HDBModelParams params) throws de.innovationgate.webgate.api.WGAPIException, HDBModelException
params - Parameters for the operationde.innovationgate.webgate.api.WGAPIExceptionHDBModelExceptionpublic void updateContent(de.innovationgate.webgate.api.WGContent content,
HDBModelProcess process)
throws de.innovationgate.webgate.api.WGAPIException,
HDBModelException
content - The content to updateprocess - A process to be executed on the updatede.innovationgate.webgate.api.WGAPIExceptionHDBModelExceptionpublic void updateContent(de.innovationgate.webgate.api.WGContent content,
java.lang.String tmlscriptModule)
throws de.innovationgate.webgate.api.WGAPIException,
HDBModelException
content - The content to updatetmlscriptModule - Name of a TMLScript module from the design of the HDBModel database to execute as process on the updatede.innovationgate.webgate.api.WGAPIExceptionHDBModelExceptionpublic void updateContent(de.innovationgate.webgate.api.WGContent content,
java.lang.String tmlscriptModule,
java.lang.Object param)
throws de.innovationgate.webgate.api.WGAPIException,
HDBModelException
content - The content to updatetmlscriptModule - Name of a TMLScript module from the design of the HDBModel database to execute as process on the updateparam - A custom parameter to inject to the operationde.innovationgate.webgate.api.WGAPIExceptionHDBModelExceptionpublic void updateContent(Context ctx, java.lang.Object param) throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGExceptionpublic void updateContent(java.lang.Object param)
throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGExceptionpublic void updateContent()
throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGExceptionpublic void deleteContent(de.innovationgate.webgate.api.WGContent content)
throws de.innovationgate.webgate.api.WGAPIException
content - The content to deletede.innovationgate.webgate.api.WGAPIExceptionpublic void deleteContent(Context context) throws de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGAPIExceptionpublic void deleteContent()
throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGExceptionpublic void deleteContent(HDBModelParams params) throws de.innovationgate.webgate.api.WGAPIException
params - Parameters for the operationde.innovationgate.webgate.api.WGAPIExceptionpublic void moveContent(de.innovationgate.webgate.api.WGContent content,
de.innovationgate.webgate.api.WGContent ref)
throws de.innovationgate.webgate.api.WGAPIException,
HDBModelException
content - The content to moveref - The new parent of the contentde.innovationgate.webgate.api.WGAPIExceptionHDBModelExceptionpublic de.innovationgate.webgate.api.WGAbstractResultSet getRelationTargets(de.innovationgate.webgate.api.WGContent content,
java.lang.String contentClass,
java.lang.String relation)
throws de.innovationgate.webgate.api.WGException,
HDBModelException
content - The content having the relation or a parent content below which the model of this content is defined (in case the content does not yet exist)contentClass - The content class of the content for which the relation is definedrelation - Name of the relationde.innovationgate.webgate.api.WGExceptionHDBModelExceptionpublic de.innovationgate.webgate.api.WGAbstractResultSet getRelationTargets(de.innovationgate.webgate.api.WGContent content,
java.lang.String contentClass,
java.lang.String relation,
java.util.Map options)
throws de.innovationgate.webgate.api.WGException,
HDBModelException
content - The content having the relation or a parent content below which the model of this content is defined (in case the content does not yet exist)contentClass - The content class of the content for which the relation is definedrelation - Name of the relationoptions - Custom options for the retrieval. Use constants OPTION_... from this class or QUERYOPTION_... from WGDatabasede.innovationgate.webgate.api.WGExceptionHDBModelExceptionpublic de.innovationgate.webgate.api.WGAbstractResultSet getRelationSources(de.innovationgate.webgate.api.WGContent target,
java.lang.String contentClass,
java.lang.String relation,
java.util.Map options)
throws de.innovationgate.webgate.api.WGAPIException,
HDBModelException
target - The content to which the relations pointcontentClass - The content class of the source contents to return. Specify null to return contents of all content classes.relation - The name of the relation that should point to the target contentoptions - Custom options for the retrieval. Use constants OPTION_... from this class or QUERYOPTION_... from WGDatabasede.innovationgate.webgate.api.WGAPIExceptionHDBModelExceptionpublic de.innovationgate.webgate.api.WGAbstractResultSet getRelationSources(de.innovationgate.webgate.api.WGContent target,
java.lang.String contentClass,
java.lang.String relation)
throws de.innovationgate.webgate.api.WGAPIException,
HDBModelException
target - The content to which the relations pointcontentClass - The content class of the source contents to return. Specify null to return contents of all content classes.relation - The name of the relation that should point to the target contentde.innovationgate.webgate.api.WGAPIExceptionHDBModelExceptionpublic void assignContentID(de.innovationgate.webgate.api.WGContent content,
java.lang.String contentId)
throws de.innovationgate.webgate.api.WGAPIException
content - The contentcontentId - The content IDde.innovationgate.webgate.api.WGAPIExceptionpublic void assignContentID(java.lang.String contentId)
throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGExceptionpublic boolean onCreate(ContentTypeEvent event) throws java.lang.Throwable
event - The HDBModel operation eventjava.lang.Throwablepublic boolean onSave(ContentTypeEvent event) throws java.lang.Throwable
event - The HDBModel operation eventjava.lang.Throwablepublic de.innovationgate.wga.common.beans.hdbmodel.ModelDefinition getDefinition()
public void reduceContentEditors(de.innovationgate.webgate.api.WGContent con,
java.util.List editors)
throws de.innovationgate.webgate.api.WGAPIException
con - The contenteditors - The valid editors (user names, groups or roles) of this content and its subcontentsde.innovationgate.webgate.api.WGAPIExceptionpublic void setContentEditors(de.innovationgate.webgate.api.WGContent con,
java.util.List contentEditors,
java.util.List childEditors)
throws de.innovationgate.webgate.api.WGAPIException
con - The contentcontentEditors - The valid editors (user names, groups or roles) of this contentchildEditors - The valid editors (user names, groups or roles) for child contents of this contentde.innovationgate.webgate.api.WGAPIExceptionpublic void setContentReaders(de.innovationgate.webgate.api.WGContent con,
java.util.List readers)
throws de.innovationgate.webgate.api.WGAPIException
con - The content documentreaders - The readers (user names, groups or roles) of this contentde.innovationgate.webgate.api.WGAPIExceptionpublic boolean storeForm(Form form, de.innovationgate.webgate.api.WGContent content) throws WGAServerException, de.innovationgate.webgate.api.WGAPIException
form - The formcontent - Either the content to update or the reference content below which a new content is to be created.WGAServerExceptionde.innovationgate.webgate.api.WGAPIExceptionpublic de.innovationgate.webgate.api.WGContent getDocument(java.lang.String id)
throws de.innovationgate.webgate.api.WGAPIException
id - The storage idde.innovationgate.webgate.api.WGAPIExceptionpublic de.innovationgate.webgate.api.WGContent getDocument(java.lang.String id,
de.innovationgate.webgate.api.WGContent relContent)
throws de.innovationgate.webgate.api.WGAPIException
id - The document id, either storage or content idrelContent - The parent storage/content of the document to fetch. Specify null to retrieve root storages.de.innovationgate.webgate.api.WGAPIExceptionpublic de.innovationgate.webgate.api.WGContent getDocumentByStructKey(java.lang.Object structKey)
throws de.innovationgate.webgate.api.WGAPIException
structKey - The struct keyde.innovationgate.webgate.api.WGAPIExceptionpublic boolean isModelVersionChanged()