public abstract class WGFakeDatabase extends java.lang.Object implements WGDatabaseCore, WGPersonalisationDatabaseCore
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
COPTION_LANGUAGE |
static java.lang.String |
DBTYPE |
static java.lang.String |
FAKE_AREA |
static java.lang.String |
FAKE_CONTENTNAME |
static java.lang.String |
FAKE_CONTENTTYPE |
static java.lang.String |
FAKE_LANGUAGE |
static java.lang.String |
FAKE_STRUCTKEY |
static java.lang.String |
FAKE_TITLE |
static java.lang.String |
FAKE_TML |
| Constructor and Description |
|---|
WGFakeDatabase() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
beginTransaction()
Called when a transaction should begin.
|
void |
clearSessionCache()
Is called when the cache of the current WGAPI session is cleared.
|
void |
close()
Called when a database implementation is completely closed and all cached data of it is dropped.
|
void |
closeSession()
Called when a database session is closed, i.e. the current thread/user stops working with this database for the logged in user.
|
boolean |
commitTransaction()
Called when a running transaction should get submitted
Needed when database supports feature WGDatabase.FEATURE_TRANSACTIONS.
|
java.lang.String |
convertFileNameForAttaching(java.lang.String name)
Returns a file name like it would be converted when a file of this name got attached to a document.
|
WGDocumentCore |
createContent(WGStructEntry structEntry,
WGLanguage language,
java.lang.String title,
int version)
Called to create a content document.
|
WGDocumentCore |
createCopy(WGDocumentCore original)
Create a copy of the given doc core.
|
WGDocumentCore |
createDesignDocument(int type,
java.lang.String name,
java.lang.String mediaKey)
Create a design document of the given type and keys.
|
WGDocumentCore |
createStructEntry(java.lang.Object key,
WGDocument reference,
WGContentType contentType)
Creates a struct entry.
|
WGDocumentCore |
createUserProfile(java.lang.String name,
int type)
Called to create a new user profile.
|
WGDocumentCore |
fastAccess(int type,
java.lang.Object key)
Called for fast re-retrieval of a document core, if that core on first instantiation specified a fast access key.
|
WGACLCore |
getACL()
Retrieves the ACL if implementation supports WGDatabase.FEATURE_ACL_MANAGEABLE
|
java.util.List |
getAllContent(WGStructEntry structEntry,
boolean includeCurrent)
Retrieves a list of all content unter the specified struct entry.
|
java.util.List |
getAllContentKeys(boolean includeArchived)
Retrieves all content keys of all contents in this database as list.
|
java.util.Iterator<java.lang.String> |
getAllUserProfileNames()
Returns the names of all user profiles stored inthe database
|
java.util.Iterator<WGDocumentCore> |
getChildEntries(WGStructEntry structEntry,
WGPageOrderSet order)
Retrieves all child struct entries for the provided struct entry.
|
WGDocumentCore |
getContentByKey(WGContentKey key)
Retrieves the content for the provided content key.
|
WGDocumentCore |
getContentByName(java.lang.String strName,
java.lang.String strLanguage)
Retrieves a content by it's unique name for the given language.
|
int |
getContentCount(WGStructEntry entry)
Returns the number of total contents on this struct entry, including those that are not visible to the user.
|
int |
getContentStorePatchLevel()
Returns the patch level of the storage format of this WGA Content Store.
|
double |
getContentStoreVersion()
Returns the version of WGA Content Store that this backend represents.
|
java.util.Date |
getCreated() |
java.lang.Class |
getDedicatedWorkflowEngine()
Retrieves the class of a dedicated workflow engine for this implementation.
|
java.util.Set |
getDeletions(java.util.Set documentKeys) |
WGDocumentCore |
getDesignObject(int type,
java.lang.String name,
java.lang.String strMediaKey)
Retrieves a design object by it's doc class and unique name.
|
java.util.List |
getDesignObjects(int type)
Retrieves all design objects of the given doc class.
|
WGDocumentCore |
getDummyContent(java.lang.String language)
Creates a "dummy content" object, that is used, when rendering WebTML without a content context.
|
java.lang.Object |
getExtensionData(java.lang.String name)
Retrieves the value of an extension data field stored in this database.
|
java.util.List<java.lang.String> |
getExtensionDataNames()
Retrieves names of all extension data fields stored in this database.
|
static java.lang.String |
getFakeLanguage(java.util.Map creationOptions) |
java.util.List<WGRelationData> |
getIncomingRelations(java.lang.Object structKey,
java.lang.String language,
java.lang.String contentClass,
java.lang.String relName,
java.lang.String relGroupName,
java.lang.Boolean includeUnreleased,
WGColumnSet order)
Must Return the relations that point to the given released content document
|
java.lang.Object |
getNativeObject()
Retrieves the native backend object for this database if there is any.
|
WGDocumentCore |
getParentEntry(WGStructEntry entry)
Retrieves the parent struct enty for the given entry.
|
java.util.Date |
getRevision()
Returns an revision indicator of the last change done to this database
This may be a anything that indicates the revision of the current database, like some java.util.Date or a sequence number.
|
java.util.Date |
getRevisionDate(java.lang.Comparable lastChanged)
Returns a date object corresponding to the given revision indicator
Use this method to get concrete dates for the revisions returned by
WGDatabaseCore.getRevision(). |
java.util.List |
getRoles()
Returns the roles that this database complies.
|
java.util.Iterator<WGDocumentCore> |
getRootEntries(WGArea area,
WGPageOrderSet pageOrder)
Retrieves the root entries (i.e. entries without parents) of the given area.
|
java.lang.String |
getServerName()
Returns the name of the server for the backend database (if there is one)
|
WGDocumentCore |
getStructEntryByKey(java.lang.Object key)
Retrieves a struct entry for the given struct key
|
WGDocumentCore |
getStructEntryByName(java.lang.String strName)
Returns a struct entry by it's unique name
|
java.lang.String |
getTitle()
Retrieves a descriptive database title.
|
java.lang.String |
getTypeName()
Returns a description of this core implementation type.
|
java.util.List |
getUpdateLogs(java.lang.Comparable cutoff)
Retrieves list of update logs - i.e. the operations done on documents - since a cutoff revision in ascending order of operation times.
|
WGDocumentCore |
getUserProfile(java.lang.String name)
Retrieves a user profile for the given name
|
boolean |
hasFeature(java.lang.String feature)
Returns information on specific features, that this database implements.
|
boolean |
isMemberOfUserList(java.util.List userList)
Determines if the currently logged in user is a member of the given user/group/role list.
|
boolean |
moveStructEntry(WGStructEntry entry,
WGDocument newParent)
Moves a struct entry to a new parent document, either another struct entry of an area.
|
WGUserAccess |
open(WGDatabase db,
java.lang.String path,
java.lang.String user,
java.lang.String pwd,
boolean prepareOnly)
Opens a database initially.
|
java.lang.Object |
parseStructKey(java.lang.String key)
Parses the string representation of a struct key (as used in URLs) to the implementation specific format.
|
WGResultSetCore |
query(java.lang.String type,
java.lang.String query,
java.util.Map parameters)
Queries the database for content.
|
java.util.List |
queryUserProfileNames(java.lang.String type,
java.lang.String query,
java.util.Map params)
Queries a user profile database for stored profiles, based on their data.
|
void |
refresh()
Is called when a database refresh is performed
The core should perform necessary cleanups of cached data and held resources
If the database supports WGAPI transactions it should reduce the impact of this method to the current session while in a transaction
|
void |
removeExtensionData(java.lang.String name)
Removes an extension data field from this database
|
boolean |
resultIsFalse(java.lang.Object result,
WGDocument doc)
Tests, if an native expression result equals false in the native expression language.
|
boolean |
resultIsTrue(java.lang.Object result,
WGDocument doc)
Tests, if an native expression result equals true in the native expression language.
|
boolean |
rollbackTransaction()
Called when a started transaction should be rolled back.
|
void |
setCurrentSession(WGSessionContext context)
Method to inject the current session context to the core.
|
void |
writeExtensionData(java.lang.String name,
java.lang.Object value)
Writes an extension data field to in this database.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbeginUpdate, callBackendService, isBackendServiceSupported, isContentTypeUsed, isLanguageUsed, openSessionpublic static final java.lang.String COPTION_LANGUAGE
public static final java.lang.String DBTYPE
public static final java.lang.String FAKE_TITLE
public static final java.lang.String FAKE_STRUCTKEY
public static final java.lang.String FAKE_CONTENTNAME
public static final java.lang.String FAKE_LANGUAGE
public static final java.lang.String FAKE_CONTENTTYPE
public static final java.lang.String FAKE_TML
public static final java.lang.String FAKE_AREA
public WGUserAccess open(WGDatabase db, java.lang.String path, java.lang.String user, java.lang.String pwd, boolean prepareOnly) throws WGInvalidDatabaseException, WGBackendException
WGDatabaseCoreopen in interface WGDatabaseCoredb - The WGDatabase object, that will wrap this database core.path - The path of the database, that should be opened. Interpretation of the path is up to the specific database coreuser - The user name for opening the initial session.pwd - The password for the given usernameprepareOnly - Flag if the database should only be prepared for openingWGBackendExceptionWGInvalidDatabaseExceptionWGDatabaseCore.open(WGDatabase, String, String, String, boolean)public void close()
throws WGBackendException
WGDatabaseCoreclose in interface WGDatabaseCoreWGBackendExceptionpublic void closeSession()
throws WGAPIException
WGDatabaseCorecloseSession in interface WGDatabaseCoreWGAPIExceptionpublic java.lang.String getTitle()
throws WGBackendException
WGDatabaseCoregetTitle in interface WGDatabaseCoreWGBackendExceptionpublic java.lang.String getTypeName()
WGDatabaseCoregetTypeName in interface WGDatabaseCorepublic java.util.Date getCreated()
throws WGBackendException
WGBackendExceptionpublic java.util.Date getRevision()
throws WGBackendException
WGDatabaseCoregetRevision in interface WGDatabaseCoreWGBackendExceptionpublic java.lang.Object getExtensionData(java.lang.String name)
throws WGBackendException
WGDatabaseCoregetExtensionData in interface WGDatabaseCorename - The name of the field.WGBackendExceptionpublic static java.lang.String getFakeLanguage(java.util.Map creationOptions)
public java.util.Iterator<WGDocumentCore> getChildEntries(WGStructEntry structEntry, WGPageOrderSet order)
WGDatabaseCoregetChildEntries in interface WGDatabaseCorestructEntry - The struct entry, whose children are to be retrievedorder - Instructions about the desired orderpublic java.util.Iterator<WGDocumentCore> getRootEntries(WGArea area, WGPageOrderSet pageOrder)
WGDatabaseCoregetRootEntries in interface WGDatabaseCorearea - The area, whose root entries are to be retrievedpageOrder - Order set denoting the order in which entries should be served, null for default order (position, title, both ascending)public WGDocumentCore getStructEntryByKey(java.lang.Object key)
WGDatabaseCoregetStructEntryByKey in interface WGDatabaseCorepublic WGDocumentCore getParentEntry(WGStructEntry entry)
WGDatabaseCoregetParentEntry in interface WGDatabaseCoreentry - The struct entry, whose parent is to be retrievedpublic java.util.List getAllContent(WGStructEntry structEntry, boolean includeCurrent)
WGDatabaseCoregetAllContent in interface WGDatabaseCorestructEntry - The struct entry, whose content is to be retrieved.includeCurrent - Decides, if archived documents should be also retrievedpublic WGDocumentCore getContentByKey(WGContentKey key)
WGDatabaseCoregetContentByKey in interface WGDatabaseCorekey - The content keypublic WGDocumentCore getContentByName(java.lang.String strName, java.lang.String strLanguage)
WGDatabaseCoregetContentByName in interface WGDatabaseCorestrName - The unique namestrLanguage - The language name (i.e. short code). If null, the default language of the content store is to be used.public WGDocumentCore getDummyContent(java.lang.String language)
WGDatabaseCoregetDummyContent in interface WGDatabaseCorepublic java.util.List getDesignObjects(int type)
WGDatabaseCoregetDesignObjects in interface WGDatabaseCoretype - The doc class. See constants WGDocument.FDC_...public WGDocumentCore getDesignObject(int type, java.lang.String name, java.lang.String strMediaKey) throws WGAPIException
WGDatabaseCoregetDesignObject in interface WGDatabaseCoretype - The doc class of the design object. See Constants under WGDocument.FDC_...name - The unique name of the designstrMediaKey - For media key specific design objects (e.g. WebTML-Modules), the media key of the design object to be retrievedWGAPIExceptionpublic WGDocumentCore fastAccess(int type, java.lang.Object key)
WGDatabaseCorefastAccess in interface WGDatabaseCorekey - The fast access key, that the document core provided, when it was instantiated the first time.public java.lang.Object parseStructKey(java.lang.String key)
WGDatabaseCoreparseStructKey in interface WGDatabaseCorekey - The string representation of the struct keypublic WGResultSetCore query(java.lang.String type, java.lang.String query, java.util.Map parameters) throws WGQueryException
WGDatabaseCorequery in interface WGDatabaseCoretype - Type of query. Interpretation is up to the specific core implementation.query - The queryparameters - Query options as Map influencing the query result. See WGDatabase.QUERYOPTION_... for options keys.WGQueryExceptionpublic boolean hasFeature(java.lang.String feature)
WGDatabaseCorehasFeature in interface WGDatabaseCorefeature - The requested feature. The constants WGDatabase.FEATURE_... are used here.public java.util.List getRoles()
WGDatabaseCoregetRoles in interface WGDatabaseCorepublic WGDocumentCore createUserProfile(java.lang.String name, int type) throws WGAPIException
WGPersonalisationDatabaseCorecreateUserProfile in interface WGPersonalisationDatabaseCorename - The name, that the caller wants for the new profile. If null, the implementation should create a name.type - The type, that the caller wants to assign the profile. Possible values chosen by personalisation implementationWGAPIExceptionpublic WGDocumentCore getUserProfile(java.lang.String name) throws WGBackendException
WGPersonalisationDatabaseCoregetUserProfile in interface WGPersonalisationDatabaseCorename - name of the requested user profileWGBackendExceptionpublic WGDocumentCore createContent(WGStructEntry structEntry, WGLanguage language, java.lang.String title, int version)
WGDatabaseCorecreateContent in interface WGDatabaseCorestructEntry - The structentry for the contentlanguage - The language of the contenttitle - The title of the contentversion - The version of the content if this should explicitly be set (only in clone creation!). Leave null for normal creation.public WGDocumentCore createDesignDocument(int type, java.lang.String name, java.lang.String mediaKey)
WGDatabaseCorecreateDesignDocument in interface WGDatabaseCoretype - Design document type. Use constants WGDocument.TYPE_...name - Unique name of design object. Use only A-Z,a-z,0-9 and _mediaKey - Media key, if the document type is a TML modulepublic WGDocumentCore createStructEntry(java.lang.Object key, WGDocument reference, WGContentType contentType)
WGDatabaseCorecreateStructEntry in interface WGDatabaseCorekey - Key of the struct entry if the implementation supports using explicit keys. Leave null otherwise.reference - Reference document, which can be an WGArea (struct will be root in this area) or another WGStructEntry (struct will be child of that)contentType - Content type for this struct entrypublic java.lang.Class getDedicatedWorkflowEngine()
WGDatabaseCoregetDedicatedWorkflowEngine in interface WGDatabaseCorepublic boolean isMemberOfUserList(java.util.List userList)
WGDatabaseCoreisMemberOfUserList in interface WGDatabaseCorepublic WGDocumentCore createCopy(WGDocumentCore original)
WGDatabaseCorecreateCopy in interface WGDatabaseCorepublic boolean beginTransaction()
WGDatabaseCorebeginTransaction in interface WGDatabaseCorepublic boolean commitTransaction()
WGDatabaseCorecommitTransaction in interface WGDatabaseCorepublic boolean rollbackTransaction()
WGDatabaseCorerollbackTransaction in interface WGDatabaseCorepublic java.lang.String getServerName()
throws WGAPIException
WGDatabaseCoregetServerName in interface WGDatabaseCoreWGAPIExceptionpublic boolean resultIsFalse(java.lang.Object result,
WGDocument doc)
WGDatabaseCoreresultIsFalse in interface WGDatabaseCoreresult - The expression result, retrieved by a call to evaluateExpressiondoc - The document, against which the expression was evaluatedpublic boolean resultIsTrue(java.lang.Object result,
WGDocument doc)
WGDatabaseCoreresultIsTrue in interface WGDatabaseCoreresult - The expression result, retrieved by a call to evaluateExpressiondoc - The document, against which the expression was evaluatedpublic WGACLCore getACL()
WGDatabaseCoregetACL in interface WGDatabaseCorepublic java.lang.Object getNativeObject()
throws WGBackendException
WGDatabaseCoregetNativeObject in interface WGDatabaseCoreWGBackendExceptionpublic void refresh()
WGDatabaseCorerefresh in interface WGDatabaseCorepublic void clearSessionCache()
throws WGAPIException
WGDatabaseCoreclearSessionCache in interface WGDatabaseCoreWGClosedSessionException - If currently no session is openWGAPIExceptionpublic java.util.List getUpdateLogs(java.lang.Comparable cutoff)
WGDatabaseCoregetUpdateLogs in interface WGDatabaseCoreWGUpdateLogpublic int getContentCount(WGStructEntry entry) throws WGNotSupportedException
WGDatabaseCoregetContentCount in interface WGDatabaseCoreentry - The entry to testWGNotSupportedException - If the database implementation does not support this operationpublic boolean moveStructEntry(WGStructEntry entry, WGDocument newParent)
WGDatabaseCoremoveStructEntry in interface WGDatabaseCoreentry - The entry to movenewParent - The new parent document, which can be either an WGStructEntry or a WGArea objectpublic void setCurrentSession(WGSessionContext context)
WGDatabaseCoresetCurrentSession in interface WGDatabaseCorepublic java.lang.String convertFileNameForAttaching(java.lang.String name)
WGDatabaseCoreconvertFileNameForAttaching in interface WGDatabaseCorepublic java.util.List queryUserProfileNames(java.lang.String type,
java.lang.String query,
java.util.Map params)
WGPersonalisationDatabaseCorequeryUserProfileNames in interface WGPersonalisationDatabaseCoretype - Type of query. WGAPI implementations may define different profile query types.query - Query to use for searching user profilesparams - Parameters for the query.public java.util.Iterator<java.lang.String> getAllUserProfileNames()
throws WGAPIException
WGPersonalisationDatabaseCoregetAllUserProfileNames in interface WGPersonalisationDatabaseCoreWGAPIExceptionpublic java.util.List getAllContentKeys(boolean includeArchived)
throws WGAPIException
WGDatabaseCoregetAllContentKeys in interface WGDatabaseCoreincludeArchived - Specifies if archived content should be included in the listWGContentKeyWGAPIExceptionpublic java.util.Date getRevisionDate(java.lang.Comparable lastChanged)
throws WGAPIException,
WGWrongRevisionException
WGDatabaseCoreWGDatabaseCore.getRevision().
This method is obliged to throw a WGWrongRevisionException if the revision type does not match this database
of the given revision is not known.getRevisionDate in interface WGDatabaseCorelastChanged - A revision indicator returned by WGDatabaseCore.getRevision()WGAPIExceptionWGWrongRevisionException - if the given revision is no revision of the current databasepublic double getContentStoreVersion()
throws WGAPIException
WGDatabaseCoregetContentStoreVersion in interface WGDatabaseCoreWGAPIExceptionpublic int getContentStorePatchLevel()
throws WGAPIException
WGDatabaseCoregetContentStorePatchLevel in interface WGDatabaseCoreWGAPIExceptionpublic java.util.Set getDeletions(java.util.Set documentKeys)
throws WGAPIException
WGAPIExceptionpublic WGDocumentCore getStructEntryByName(java.lang.String strName) throws WGAPIException
WGDatabaseCoregetStructEntryByName in interface WGDatabaseCorestrName - The unique nameWGAPIExceptionpublic void writeExtensionData(java.lang.String name,
java.lang.Object value)
throws WGAPIException
WGDatabaseCorewriteExtensionData in interface WGDatabaseCorename - The name of the field.value - The value to storeWGAPIExceptionpublic void removeExtensionData(java.lang.String name)
throws WGAPIException
WGDatabaseCoreremoveExtensionData in interface WGDatabaseCorename - The name of the field to removeWGAPIExceptionpublic java.util.List<java.lang.String> getExtensionDataNames()
throws WGAPIException
WGDatabaseCoregetExtensionDataNames in interface WGDatabaseCoreWGAPIExceptionpublic java.util.List<WGRelationData> getIncomingRelations(java.lang.Object structKey, java.lang.String language, java.lang.String contentClass, java.lang.String relName, java.lang.String relGroupName, java.lang.Boolean includeUnreleased, WGColumnSet order) throws WGAPIException
WGDatabaseCoregetIncomingRelations in interface WGDatabaseCorestructKey - The structkey of the contentlanguage - The language of the contentcontentClass - content class of the content owning the relation. null for contents of all content classesrelName - Name of the relation coming in. null should retrieve relations of all namesrelGroupName - Group name of the relation coming in. null should retrieve relations of all groupsincludeUnreleased - Specify true to also retrieve documents in draft or approval state. False will retrieve only published documents.order - Optionally order in which to return relations, evaluated against the relation source documents, null for no orderWGAPIException