|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ContentEngine
ContentEngine
| Method Summary | |
|---|---|
void |
convertContentType(FxPK contentPK,
long destinationTypeId,
boolean allowLossy,
boolean allVersions)
Convert (all versions of) a given content to another content type The destinationType must either be derived from the given content's type or must be the parent of the given content's type |
FxPK |
createNewVersion(FxContent content)
Create a new version for an existing content instance |
java.lang.String |
exportContent(FxContent content)
Export a content instance |
FxLock |
extendLock(FxLock lock,
long duration)
Extend an existing lock for the given duration (duration will be added to current expire time). |
FxLock |
extendLock(FxPK pk,
long duration)
Extend an existing lock for the given duration (duration will be added to current expire time). |
long |
getBinaryId(FxPK pk,
java.lang.String xpath,
FxLanguage language)
Get the binary id for the given XPath. |
long |
getBinaryId(FxPK pk,
java.lang.String xpath,
FxLanguage language,
boolean fallbackToDefault)
Get the binary id for the given XPath. |
java.lang.String |
getBinaryMetaData(long id)
Load binary meta data (only allowed for global supervisor!) |
FxContentSecurityInfo |
getContentSecurityInfo(FxPK pk)
Get all security relevant information about a content instance identified by its primary key |
FxContentVersionInfo |
getContentVersionInfo(FxPK id)
Get information about the versions used for a content id |
FxLock |
getLock(FxPK pk)
Get the lock for a primary key. |
java.util.List<FxLock> |
getLocks(FxLockType lockType,
long userId,
long typeId,
java.lang.String resource)
Query locks |
java.util.List<FxPK> |
getPKsForType(long typeId,
boolean onePkPerInstance)
Returns all primary keys for the given type. |
int |
getReferencedContentCount(FxPK pk)
Get the number of references that exist for the requested content |
FxContent |
importContent(java.lang.String xml,
boolean newInstance)
Import a content from XML |
FxContent |
initialize(long typeId)
Initialize a new FxContent instance for a type with default values. |
FxContent |
initialize(long typeId,
long mandatorId,
long prefACL,
long prefStep,
long prefLang)
Initialize a new FxContent instance with preferred acl, step and language |
FxContent |
initialize(java.lang.String typeName)
Initialize a new FxContent instance for a type with default values. |
FxContent |
load(FxPK pk)
Load a content |
FxContentContainer |
loadContainer(long id)
Load a content container (all versions of a content) |
FxLock |
lock(FxLockType lockType,
FxPK pk)
Lock an instance |
FxLock |
lock(FxLockType lockType,
FxPK pk,
long duration)
Lock an instance |
FxContent |
prepareSave(FxContent content)
Prepare a content for a save or create operation (resolves binaries for script processing, etc.). |
void |
remove(FxPK pk)
Remove a content |
int |
removeForType(long typeId)
Remove all instances of the given type. |
void |
removeVersion(FxPK pk)
Remove a content's version. |
FxPK |
save(FxContent content)
Store an existing content or create a new one |
FxLock |
takeOverLock(FxLock lock)
Take over a lock held by another user (if permitted) |
FxLock |
takeOverLock(FxPK pk)
Take over a lock held by another user (if permitted) |
void |
unlock(FxPK pk)
Unlock a locked instance. |
| Method Detail |
|---|
FxContent initialize(long typeId,
long mandatorId,
long prefACL,
long prefStep,
long prefLang)
throws FxApplicationException
typeId - type to usemandatorId - mandator to assign this content (has to be available for the type!)prefACL - preferred acl, if not applicable the best fit will be usedprefStep - preferred step, if not applicable the best fit will be usedprefLang - preferred language, if not applicable the best fit will be used
FxApplicationException - TODO
FxLoadException - on initialization errors
FxContent initialize(long typeId)
throws FxApplicationException
typeId - type to use
FxApplicationException - on errors
FxContent initialize(java.lang.String typeName)
throws FxApplicationException
typeName - type to use
FxApplicationException - on errors
FxContent load(FxPK pk)
throws FxApplicationException
pk - primary key to load
FxApplicationException - TODO
FxLoadException
FxNoAccessException
FxNotFoundException - if no instance for this primary key was found
FxContentContainer loadContainer(long id)
throws FxApplicationException
id - requested content id
FxApplicationException - on errors
FxPK save(FxContent content)
throws FxApplicationException
content - the content to persist
FxApplicationException - TODO
FxCreateException - on errors
FxUpdateException - on errors
FxNoAccessException
FxContent prepareSave(FxContent content)
throws FxApplicationException
content - the content to prepare
FxInvalidParameterException - on errors
FxDbException - on errors
FxApplicationException
FxPK createNewVersion(FxContent content)
throws FxApplicationException
content - the content to persist
FxApplicationException - TODO
FxCreateException - on errors
FxUpdateException - on errors
FxNoAccessException
void remove(FxPK pk)
throws FxApplicationException
pk - primary key of the content to remove
FxApplicationException - TODO
FxRemoveException - on errors
FxNoAccessException - on errors
void removeVersion(FxPK pk)
throws FxApplicationException
pk - primary key of a distinct version to remove
FxApplicationException - TODO
FxRemoveException - on errors
FxNoAccessException - on errors
int removeForType(long typeId)
throws FxApplicationException
typeId - affected FxType
FxApplicationException - TODO
FxRemoveException - on errors
FxContentSecurityInfo getContentSecurityInfo(FxPK pk)
throws FxApplicationException
pk - primary key to query security information for
FxApplicationException - TODO
FxContentVersionInfo getContentVersionInfo(FxPK id)
throws FxApplicationException
id - the id to query version information for
FxApplicationException - on errors
int getReferencedContentCount(FxPK pk)
throws FxApplicationException
pk - primary key of the requested content
FxApplicationException - on errors
java.util.List<FxPK> getPKsForType(long typeId,
boolean onePkPerInstance)
throws FxApplicationException
Returns all primary keys for the given type. Since this method does not implement security, it may only be called by the global supervisor. You can use the search engine to achieve the same, just with security enabled, with
final List<FxPK> folderPks = new SqlQueryBuilder().select("@pk").type("FOLDER").getResult().collectColumn(1);
typeId - the type to request the primary keys foronePkPerInstance - return one primary key per instance (with max version) or one per actual version?
FxApplicationException - on errors
long getBinaryId(FxPK pk,
java.lang.String xpath,
FxLanguage language)
throws FxApplicationException
pk - primary keyxpath - XPathlanguage - the language (if null, the user ticket language will be used)
FxApplicationException - on errors
long getBinaryId(FxPK pk,
java.lang.String xpath,
FxLanguage language,
boolean fallbackToDefault)
throws FxApplicationException
pk - primary keyxpath - XPathlanguage - the language (if null, the user ticket language will be used)fallbackToDefault - fall back to the default language if the requested language is not null and not found?
FxApplicationException - on errorsjava.lang.String getBinaryMetaData(long id)
id - id of the binary
FxContent importContent(java.lang.String xml,
boolean newInstance)
throws FxApplicationException
xml - the content as XMLnewInstance - modify the content to be treated like a new instance
FxApplicationException - on errors
java.lang.String exportContent(FxContent content)
throws FxApplicationException
content - content instance to export
FxApplicationException - on errors
FxLock lock(FxLockType lockType,
FxPK pk)
throws FxLockException
lockType - type of the lockpk - primary key
FxLockException - on errors
FxLock lock(FxLockType lockType,
FxPK pk,
long duration)
throws FxLockException
lockType - type of the lockpk - primary keyduration - duration in [ms] of the lock
FxLockException - on errors
FxLock takeOverLock(FxLock lock)
throws FxLockException
lock - the lock to take over
FxLockException - on errors
FxLock takeOverLock(FxPK pk)
throws FxLockException
pk - primary key of the instance whose lock should be taken over
FxLockException - on errors
FxLock extendLock(FxLock lock,
long duration)
throws FxLockException
lock - the lock to extendduration - duration in [ms] to extend the original expire time
FxLockException - on errors
FxLock extendLock(FxPK pk,
long duration)
throws FxLockException
pk - primary key of the instance whose lock should be extendedduration - duration in [ms] to extend the original expire time
FxLockException - on errorsFxLock getLock(FxPK pk)
FxLockType.None is returned
pk - primary key
FxLockType.None is returned
void unlock(FxPK pk)
throws FxLockException
pk - primary key
FxLockException - on errors
java.util.List<FxLock> getLocks(FxLockType lockType,
long userId,
long typeId,
java.lang.String resource)
throws FxLockException
lockType - type of the locks to return, if null all types will be returneduserId - id of the lock owner, if < 0 locks for all users will be returned,
if the calling user is not global or mandator supervisor, only locks held by the
calling user will be returnedtypeId - only return locks for contents of this type, if < 0 type is ignoredresource - name of the locked resources to find, will be ignored if empty or null.
Queries will be pre- and postfixed by wildcards (%)
FxLockException - on errors
void convertContentType(FxPK contentPK,
long destinationTypeId,
boolean allowLossy,
boolean allVersions)
throws FxApplicationException
contentPK - the given FxPK of the content to be converted (any version of the content)destinationTypeId - the id of the type to which the content instance should be convertedallowLossy - set to true for a "lossy" conversion, ie. fields which do not exist in the destination type will be skippedallVersions - set to true to convert ALL versions of the given content (PK), false otherwise
FxApplicationException - on errors
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||