de.innovationgate.wgpublisher.hdb
public class HDBModel extends Object implements de.innovationgate.webgate.api.WGDesignChangeListener
Modifier and Type | Field and Description |
---|---|
static String |
EVENT_ON_CREATE |
static String |
EVENT_ON_SAVE |
static String |
EVENT_POST_CREATE |
static String |
EVENT_POST_DELETE |
static String |
EVENT_POST_MOVE_FROM |
static String |
EVENT_POST_MOVE_TO |
static String |
EVENT_POST_UPDATE |
static String |
EVENT_PRE_CREATE |
static String |
EVENT_PRE_DELETE |
static String |
EVENT_PRE_MOVE_FROM |
static String |
EVENT_PRE_MOVE_TO |
static String |
EVENT_PRE_UPDATE |
static String |
ITEM_CONTENT_ID |
static String |
ITEM_STORAGE_ID |
static String |
ITEM_TYPE |
static String |
MODEL_FILE |
static String |
OPTION_EXTRACLAUSE
Option containing an extra HQL clause to inject to the retrieval of relation targets or sources
|
static 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 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 String |
PARENT_RELATION_PREFIX |
static String |
STORAGE_CONTENTCLASS |
static String |
TYPE_CONTENT |
static String |
TYPE_STORAGE |
static Object |
VERSIONING_FULL |
static Object |
VERSIONING_NONE |
Modifier and Type | Method and Description |
---|---|
void |
assignContentID(de.innovationgate.webgate.api.WGContent content,
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(String contentClass,
de.innovationgate.webgate.api.WGContent ref)
Create a HDBModel content
|
de.innovationgate.webgate.api.WGContent |
createContent(String contentClass,
de.innovationgate.webgate.api.WGContent ref,
Object param)
Create a HDBModel content
|
static void |
createModelObject(WGACore core,
de.innovationgate.webgate.api.WGDatabase db)
Creates the HDBModel object.
|
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(String id)
Retrieves a root storage by its storage id
|
de.innovationgate.webgate.api.WGContent |
getDocument(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(Object structKey)
Retrieves a document by its struct key.
|
static 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
|
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
|
List<de.innovationgate.wga.common.beans.hdbmodel.Content> |
getModelsForContentClass(String contentClass)
Returns all model definitions for the given content class
|
List<de.innovationgate.wga.common.beans.hdbmodel.Content> |
getModelsForContentClass(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,
String contentClass,
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,
String contentClass,
String relation,
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,
String contentClass,
String relation)
Retrieve the valid relation targets for a HDBModel relation
|
de.innovationgate.webgate.api.WGAbstractResultSet |
getRelationTargets(de.innovationgate.webgate.api.WGContent content,
String contentClass,
String relation,
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(String contentClass,
de.innovationgate.webgate.api.WGContent 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(Event event)
Event method for executing necessary operations when a HDBModel content is created.
|
boolean |
onSave(Event event)
Event method for executing necessary operations when a HDBModel content is saved.
|
void |
reduceContentEditors(de.innovationgate.webgate.api.WGContent con,
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,
List contentEditors,
List childEditors)
Sets valid editors on a content
|
void |
setContentReaders(de.innovationgate.webgate.api.WGContent con,
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(Form form)
Update a HDBModel content based on the information from a WebTML form.
|
void |
updateContent(HDBModelParams params)
Update a HDBModel content
|
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,
String tmlscriptModule)
Update a HDBModel content
|
void |
updateContent(de.innovationgate.webgate.api.WGContent content,
String tmlscriptModule,
Object param)
Update a HDBModel content
|
public static final String PARENT_RELATION_PREFIX
public static final String STORAGE_CONTENTCLASS
public static final String OPTION_EXTRACLAUSE
public static final 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 String OPTION_INCLUDECURRENT
public static final String EVENT_PRE_CREATE
public static final String EVENT_POST_CREATE
public static final String EVENT_PRE_UPDATE
public static final String EVENT_POST_UPDATE
public static final String EVENT_ON_CREATE
public static final String EVENT_ON_SAVE
public static final String EVENT_PRE_MOVE_FROM
public static final String EVENT_PRE_MOVE_TO
public static final String EVENT_POST_MOVE_FROM
public static final String EVENT_POST_MOVE_TO
public static final String EVENT_PRE_DELETE
public static final String EVENT_POST_DELETE
public static final String ITEM_TYPE
public static final String TYPE_STORAGE
public static final String TYPE_CONTENT
public static final String MODEL_FILE
public static final String ITEM_CONTENT_ID
public static final String ITEM_STORAGE_ID
public static final Object VERSIONING_FULL
public static final 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.WGAPIException
public static boolean isContent(de.innovationgate.webgate.api.WGContent content) throws de.innovationgate.webgate.api.WGAPIException
content
- The documentde.innovationgate.webgate.api.WGAPIException
public static boolean isDocument(de.innovationgate.webgate.api.WGContent content) throws de.innovationgate.webgate.api.WGAPIException
content
- de.innovationgate.webgate.api.WGAPIException
public static String getID(de.innovationgate.webgate.api.WGContent content) throws de.innovationgate.webgate.api.WGAPIException
content
- Documentde.innovationgate.webgate.api.WGAPIException
public void reloadDefinition()
public void reinitModel()
public 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.WGAPIException
public 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.WGAPIException
public List<de.innovationgate.wga.common.beans.hdbmodel.Content> getModelsForContentClass(String contentClass)
contentClass
- The content classpublic List<de.innovationgate.wga.common.beans.hdbmodel.Content> getModelsForContentClass(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.WGAPIException
public void close()
public void designChanged(de.innovationgate.webgate.api.WGDesignChangeEvent event)
designChanged
in interface de.innovationgate.webgate.api.WGDesignChangeListener
public static void createModelObject(WGACore core, de.innovationgate.webgate.api.WGDatabase db) throws de.innovationgate.webgate.api.WGAPIException, NoSuchAlgorithmException, IOException
core
- WGA Coredb
- The HDBModel databasede.innovationgate.webgate.api.WGAPIException
NoSuchAlgorithmException
IOException
public de.innovationgate.webgate.api.WGContent createContent(HDBModelParams params) throws HDBModelException, de.innovationgate.webgate.api.WGAPIException
params
- Parameters for the operationHDBModelException
de.innovationgate.webgate.api.WGAPIException
public de.innovationgate.webgate.api.WGContent createContent(String contentClass, de.innovationgate.webgate.api.WGContent ref) throws de.innovationgate.webgate.api.WGAPIException, HDBModelException
contentClass
- Content class of the content to createref
- Reference document for the creation below which the content is to be createdHDBModelException
de.innovationgate.webgate.api.WGAPIException
public HDBModelParams newCreateContentParams(String contentClass, de.innovationgate.webgate.api.WGContent 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.WGAPIException
public de.innovationgate.webgate.api.WGContent createContent(String contentClass, de.innovationgate.webgate.api.WGContent ref, Object param) throws de.innovationgate.webgate.api.WGAPIException, HDBModelException
contentClass
- Content class of the content to createref
- Reference document for the creation below which the content is to be createdparam
- Custom parameter to inject to the operationHDBModelException
de.innovationgate.webgate.api.WGAPIException
public de.innovationgate.webgate.api.WGContent createContent(Form form) throws de.innovationgate.webgate.api.WGAPIException, HDBModelException
form
- The formde.innovationgate.webgate.api.WGAPIException
HDBModelException
public void updateContent(de.innovationgate.webgate.api.WGContent content) throws de.innovationgate.webgate.api.WGAPIException, HDBModelException
content
- The contentde.innovationgate.webgate.api.WGAPIException
HDBModelException
public HDBModelParams newUpdateContentParams(de.innovationgate.webgate.api.WGContent content) throws de.innovationgate.webgate.api.WGAPIException
content
- The content to updatede.innovationgate.webgate.api.WGAPIException
public HDBModelParams newDeleteContentParams(de.innovationgate.webgate.api.WGContent content) throws de.innovationgate.webgate.api.WGAPIException
content
- The content to deletede.innovationgate.webgate.api.WGAPIException
public void updateContent(HDBModelParams params) throws de.innovationgate.webgate.api.WGAPIException, HDBModelException
params
- Parameters for the operationde.innovationgate.webgate.api.WGAPIException
HDBModelException
public 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.WGAPIException
HDBModelException
public void updateContent(de.innovationgate.webgate.api.WGContent content, 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.WGAPIException
HDBModelException
public void updateContent(de.innovationgate.webgate.api.WGContent content, String tmlscriptModule, 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.WGAPIException
HDBModelException
public void updateContent(Form form) throws de.innovationgate.webgate.api.WGAPIException, HDBModelException
form
- The formde.innovationgate.webgate.api.WGAPIException
HDBModelException
public void deleteContent(de.innovationgate.webgate.api.WGContent content) throws de.innovationgate.webgate.api.WGAPIException
content
- The content to deletede.innovationgate.webgate.api.WGAPIException
public void deleteContent(HDBModelParams params) throws de.innovationgate.webgate.api.WGAPIException
params
- Parameters for the operationde.innovationgate.webgate.api.WGAPIException
public 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.WGAPIException
HDBModelException
public de.innovationgate.webgate.api.WGAbstractResultSet getRelationTargets(de.innovationgate.webgate.api.WGContent content, String contentClass, 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.WGException
HDBModelException
public de.innovationgate.webgate.api.WGAbstractResultSet getRelationTargets(de.innovationgate.webgate.api.WGContent content, String contentClass, String relation, 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 WGDatabase
de.innovationgate.webgate.api.WGException
HDBModelException
public de.innovationgate.webgate.api.WGAbstractResultSet getRelationSources(de.innovationgate.webgate.api.WGContent target, String contentClass, String relation, 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 WGDatabase
de.innovationgate.webgate.api.WGAPIException
HDBModelException
public de.innovationgate.webgate.api.WGAbstractResultSet getRelationSources(de.innovationgate.webgate.api.WGContent target, String contentClass, 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.WGAPIException
HDBModelException
public void assignContentID(de.innovationgate.webgate.api.WGContent content, String contentId) throws de.innovationgate.webgate.api.WGAPIException
content
- The contentcontentId
- The content IDde.innovationgate.webgate.api.WGAPIException
public boolean onCreate(Event event) throws Throwable
event
- The HDBModel operation eventThrowable
public boolean onSave(Event event) throws Throwable
event
- The HDBModel operation eventThrowable
public de.innovationgate.wga.common.beans.hdbmodel.ModelDefinition getDefinition()
public void reduceContentEditors(de.innovationgate.webgate.api.WGContent con, 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.WGAPIException
public void setContentEditors(de.innovationgate.webgate.api.WGContent con, List contentEditors, 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.WGAPIException
public void setContentReaders(de.innovationgate.webgate.api.WGContent con, 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.WGAPIException
public 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.WGAServerException
de.innovationgate.webgate.api.WGAPIException
public de.innovationgate.webgate.api.WGContent getDocument(String id) throws de.innovationgate.webgate.api.WGAPIException
id
- The storage idde.innovationgate.webgate.api.WGAPIException
public de.innovationgate.webgate.api.WGContent getDocument(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.WGAPIException
public de.innovationgate.webgate.api.WGContent getDocumentByStructKey(Object structKey) throws de.innovationgate.webgate.api.WGAPIException
structKey
- The struct keyde.innovationgate.webgate.api.WGAPIException
public boolean isModelVersionChanged()