|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DMS
Utility class for DMS related operations.
Field Summary |
---|
Fields inherited from interface com.groiss.dms.RemoteDMS |
---|
COPY, invalidChars, LINK, MOVE |
Method Summary | ||
---|---|---|
|
add(DMSFolder f,
P o,
User u)
Adds an Object to a folder. |
|
void |
addKeyword(DMSObject obj,
Keyword keyword,
User user)
Adds the passed keyword to the passed DMSObject |
|
void |
addSubform(DMSForm main,
DMSForm sub,
int id)
Adds the passed subform to the mainform into the set of subforms identified by the passed id. |
|
void |
attachNote(DMSObject target,
DMSNote note,
User user)
Attaches the passed note to the passed object. |
|
void |
backupToVersion(DMSForm form,
PersistentVersion version,
User user)
Makes the content of the passed version to the current content of the passed form. |
|
|
changeType(DMSForm obj,
FormType newType,
DMSFolder folder,
User user)
This method changes the type of the passed DMSObject to the passed FormType. |
|
void |
checkDelete(User user,
DMSObject obj)
Throws ApplicationException Nr. |
|
void |
checkDuplicateNames(DMSFolder targetFolder,
DMSObject targetObject,
java.lang.String name,
java.lang.String extension)
Checks if the passed folder does not already contain an element with the same name as the passed one. |
|
void |
checkEdit(User user,
DMSObject obj)
Throws ApplicationException Nr. |
|
void |
checkValidName(DMSObject target,
java.lang.String name,
java.lang.String extension)
Checks if the name and extension do not contain any forbidden characters |
|
void |
checkView(User user,
DMSObject obj)
Throws ApplicationException Nr. |
|
int |
countSubforms(DMSForm f,
int id)
Counts the number of subforms in the subform-relation where f is
the main form. |
|
|
createDocForm(FormType ft,
java.lang.String name,
java.lang.String extension,
P template,
User u,
PermissionList acl)
Creates a new document of the specified formtype. |
|
|
createFolder(FormType ft,
java.lang.String name,
P template,
User u,
PermissionList acl)
Create a folder of a given type. |
|
|
createForm(FormType ft,
P template,
User u,
PermissionList acl)
Creates a new form of the specified formtype. |
|
Keyword |
createKeyword(java.lang.String word,
User user)
Creates a new Keyword for the passed word and returns this instance. |
|
|
createNote(java.lang.String subject,
java.lang.String content,
User u,
PermissionList acl)
Creates a new note |
|
|
createWebLink(java.lang.String name,
java.lang.String url,
java.lang.String description,
User u,
PermissionList acl)
Creates a new link to an URL |
|
void |
delete(DMSFolder f,
DMSObject o,
User u)
Deletes the object o which resides in folder f. |
|
void |
deleteKeyword(Keyword keyword,
User user)
Deletes the passed keyword. |
|
void |
deleteVersion(PersistentVersion version,
User user)
Deletes the passed version of an object. |
|
void |
disableRightChecks()
If this method is called all right checks done using methods RemoteDMS.checkEdit(User, DMSObject) , RemoteDMS.checkView(User, DMSObject) ,
RemoteDMS.mayEdit(User, DMSObject) and RemoteDMS.mayView(User, DMSObject) are deactivated in the current thread. |
|
void |
enableRightChecks()
enables the right checks if they were previously disabled using method RemoteDMS.disableRightChecks() . |
|
java.util.Map<DMSForm,DMSForm> |
fetchMainForms(java.util.Collection<? extends DMSForm> subForms)
Construct a mapping from sub form instances to (filled) main form instances |
|
MultiMap<DMSForm,DMSForm> |
fetchSubForms(java.util.Collection<? extends DMSForm> mainForms,
int subformid)
Construct a mapping from mainform instances to (filled) subform instances. |
|
byte[] |
getContent(DMSDocForm document)
Get the content of a document. |
|
|
getDMSObject(long oid)
Get a DMSObject by oid. |
|
|
getDMSObject(java.lang.String classname,
long oid)
Get a DMSObject by classname and oid. |
|
|
getFolder(DMSObject obj)
Get the folder containing the passed object. |
|
FormType |
getFormType(long oid)
Returns the formtpye with the given oid |
|
FormType |
getFormType(java.lang.String id,
int version)
Returns the formtype with the given id and version number |
|
java.lang.String |
getIcon(java.lang.String extension)
Returns the icon for the passed extension. |
|
java.lang.String |
getIconFromMimetype(java.lang.String mimetype)
Returns the icon for the passed mimetype. |
|
Keyword |
getKeyword(long oid)
Returns the keyword with the passed oid |
|
|
getMainForm(DMSForm f)
Returns the main form of the passed form (or null if there is none) |
|
|
getPublicRootFolder()
Returns the public root folder in the DMS. |
|
|
getRootFolder(User user)
Returns the root DMS folder (i.e. |
|
com.groiss.security.Signature |
getSignatureClass()
Returns an instance of the class which should be uses as Signature implementation |
|
|
getTemplates(FormType ft)
Returns the templates for the passed form type. |
|
boolean |
isDuplicateName(DMSFolder targetFolder,
DMSObject targetObject,
java.lang.String name,
java.lang.String extension)
Returns true if already an item of the passed folder has the passed name |
|
|
listContents(DMSFolder folder,
FormType ft,
java.lang.String cond,
java.lang.String order,
java.lang.Object[] vals,
boolean recursive)
Returns a list of dms objects which match the passed condition |
|
java.util.List<FormType> |
listCreateableFormTypes(java.lang.String searchCond,
java.lang.String order,
User user)
Returns the formtypes which meet the search condition and from which the passed user may create form objects. |
|
|
listForms(FormType ft,
java.lang.String cond,
java.lang.String order,
java.lang.Object[] vals)
Returns a list of forms of the given formtype which match the passed condition |
|
|
listKeywords()
Returns a list of all keywords known to the system |
|
|
listKeywords(DMSObject obj)
Returns a list of all keywords attached to the passed DMSObject |
|
java.util.List<DMSNote> |
listNotes(DMSObject target,
User user)
Returns all the notes which are attached to target and which the user may view or edit |
|
java.util.List<com.groiss.security.SignedObject> |
listSignatures(PersistentVersion version,
User user)
Returns the signatures of the passed version |
|
java.util.List<java.lang.String> |
listSignatureTypes()
Returns the available types of signatures |
|
|
listSubfolders(DMSFolder startFolder)
Returns a list of all folders which are subfolders of the given folder. |
|
|
listSubforms(DMSForm f,
int id)
Returns a list of subforms of the passed form (which is empty if there are none) |
|
|
listSubforms(DMSForm f,
int id,
java.lang.String cond,
java.lang.String order,
java.lang.Object[] vals)
Returns a list of subforms of the passed form (which is empty if there are none) |
|
java.util.List<PersistentVersion> |
listVersions(DMSObject obj,
User user)
Returns the versions of the specified object in descending order of their creation date. |
|
void |
lock(DMSDocForm document,
User user)
Locks the document. |
|
PersistentVersion |
makeVersion(DMSObject obj,
User user,
java.lang.String description)
Makes a version of the passed object. |
|
boolean |
mayDelete(User user,
DMSObject obj)
Returns true if the passed user may delete the passed object or if the right check is deactivated. |
|
boolean |
mayEdit(User user,
DMSObject obj)
Returns true if the passed user may edit the passed object or if the right check is deactivated. |
|
boolean |
mayView(User user,
DMSObject obj)
Returns true if the passed user may view the passed object or if the right check is deactivated. |
|
|
move(DMSFolder src,
DMSFolder dest,
P doc,
short type,
User u)
Moves an object from one folder to another. |
|
|
reloadDocument(DMSFolder folder,
P document,
java.lang.String newExtension,
java.io.InputStream is,
User user)
Reloads the document, i.e. |
|
void |
remove(DMSFolder f,
DMSObject o,
User u)
Removes an Object from a folder. |
|
void |
removeKeyword(DMSObject obj,
Keyword keyword,
User user)
Removes the passed keyword from the passed DMSObject |
|
void |
removeNote(DMSObject target,
DMSNote note,
User user)
Removes the passed note from the passed document. |
|
void |
removeSubform(DMSForm main,
DMSForm sub)
Removes the passed subform from the passed mainform. |
|
void |
removeSubform(DMSForm main,
DMSForm sub,
int id)
Removes the passed subform from the subform-relation identified by the passed id in the passed mainform. |
|
|
renameDocument(DMSFolder folder,
P obj,
java.lang.String newName,
java.lang.String newExtension,
User u)
Sets the name and extension of the passed object to newName. |
|
void |
setContent(User user,
DMSDocForm document,
byte[] barr)
Set the content of a document. |
|
void |
unlock(DMSDocForm document)
Unlocks the document. |
|
void |
update(DMSObject o)
Updates the passed object |
|
boolean |
verify(PersistentVersion version,
com.groiss.security.SignedObject signature)
Verifies the electronically signature of a document's version. |
Method Detail |
---|
<P extends DMSFolder> P createFolder(FormType ft, java.lang.String name, P template, User u, PermissionList acl)
createFolder
in interface RemoteDMS
ft
- the folder's formtypename
- the name for the foldertemplate
- specifies the template which should be used for creating the folder (may be null)u
- the user who wants to create the folderacl
- the acl attached to the new folder (may be null)<P extends DMSDocForm> P createDocForm(FormType ft, java.lang.String name, java.lang.String extension, P template, User u, PermissionList acl)
createDocForm
in interface RemoteDMS
ft
- the document's formtypename
- the name of the new DocFormextension
- the file extension of the new document (this parameter is ignored if
a template is passed because then the template determines the extension)template
- specifies the template which should be used for creating the folder (may be null)u
- the user who wants to perform this actionacl
- the acl if one should be set (otherwise pass null)
<P extends DMSForm> P createForm(FormType ft, P template, User u, PermissionList acl)
createForm
in interface RemoteDMS
ft
- the form's formtypetemplate
- specifies the template which should be used for creating the folder (may be null)u
- the user who wants to perform this actionacl
- the acl if one should be set (otherwise pass null)
<P extends DMSNote> P createNote(java.lang.String subject, java.lang.String content, User u, PermissionList acl)
createNote
in interface RemoteDMS
subject
- the subject of the notecontent
- the content of the noteu
- the user who wants to perform this actionacl
- the acl if one should be set (otherwise pass null)
<P extends DMSWebLink> P createWebLink(java.lang.String name, java.lang.String url, java.lang.String description, User u, PermissionList acl)
createWebLink
in interface RemoteDMS
name
- the name of the weblinkurl
- the url of the weblinkdescription
- a description text of the the weblinku
- the user who wants to perform this actionacl
- the acl if one should be set (otherwise pass null)
FormType getFormType(java.lang.String id, int version)
getFormType
in interface RemoteDMS
FormType getFormType(long oid)
getFormType
in interface RemoteDMS
<P extends DMSForm> java.util.List<P> getTemplates(FormType ft)
getTemplates
in interface RemoteDMS
ft
- the form type of which the templates are wanted
java.util.List<FormType> listCreateableFormTypes(java.lang.String searchCond, java.lang.String order, User user)
listCreateableFormTypes
in interface RemoteDMS
searchCond
- a sql where-clauseorder
- sql order attributesuser
- the user for which the search should be performed<P extends DMSObject> P move(DMSFolder src, DMSFolder dest, P doc, short type, User u)
move
in interface RemoteDMS
src
- the folder currently holding the objectdest
- the folder to which the objects should be moveddoc
- the object which should be movedtype
- the type of move operation:
RemoteDMS.MOVE
: the object should be moved (i.e. removed from src and added to dest)
RemoteDMS.COPY
: the object should be copied (i.e. stays in src and a copy is
added to dest)
RemoteDMS.LINK
: the object should be linked (i.e. stays in src and a link to the
object is added to dest)
u
- the user who wants to perform this action<P extends DMSObject> P add(DMSFolder f, P o, User u)
add
in interface RemoteDMS
f
- the folder to which the object should be addedo
- the object which should be added to the folderu
- the user who wants to perform this actionvoid remove(DMSFolder f, DMSObject o, User u)
remove
in interface RemoteDMS
f
- the folder from which the object should be removedo
- the object which should be removed from the folderu
- the user who wants to perform this actionvoid delete(DMSFolder f, DMSObject o, User u)
delete
in interface RemoteDMS
f
- the folder holding the object which should be deletedo
- the object which should be deletedu
- the user who wants to perform this actionvoid attachNote(DMSObject target, DMSNote note, User user)
attachNote
in interface RemoteDMS
target
- the object to which the note should be attachednote
- the note which should be attacheduser
- the user who wants to perform this actionvoid removeNote(DMSObject target, DMSNote note, User user)
removeNote
in interface RemoteDMS
target
- the object form which the note should be removednote
- the note which should be removeduser
- the user who wants to perform this actionjava.util.List<DMSNote> listNotes(DMSObject target, User user)
listNotes
in interface RemoteDMS
target
- the object which notes are wanteduser
- the user who wants to perform this actionPersistentVersion makeVersion(DMSObject obj, User user, java.lang.String description)
makeVersion
in interface RemoteDMS
obj
- the object which should be versioneduser
- the user who wants to make the versiondescription
- the version description textvoid deleteVersion(PersistentVersion version, User user)
deleteVersion
in interface RemoteDMS
version
- the version to be deleteduser
- the user who wants to delete the versionjava.util.List<PersistentVersion> listVersions(DMSObject obj, User user)
listVersions
in interface RemoteDMS
obj
- the object which versions are requesteduser
- the user who performs this requestvoid backupToVersion(DMSForm form, PersistentVersion version, User user)
backupToVersion
in interface RemoteDMS
form
- the object which should be reset to the passed the versionversion
- the version which content should be used (it must be a version of the passed
form)user
- the user who performs this request<P extends DMSFolder> P getRootFolder(User user)
getRootFolder
in interface RemoteDMS
user
- the user who's root folder is requested.<P extends DMSFolder> P getPublicRootFolder()
getPublicRootFolder
in interface RemoteDMS
<P extends DMSObject> P getDMSObject(java.lang.String classname, long oid)
getDMSObject
in interface RemoteDMS
classname
- the full qualified class name of the requested objectoid
- the oid of the requested object<P extends DMSObject> P getDMSObject(long oid)
getDMSObject
in interface RemoteDMS
oid
- the oid of the requested object<P extends DMSFolder> P getFolder(DMSObject obj)
getFolder
in interface RemoteDMS
obj
- the object which folder is wanted<P extends DMSFolder> java.util.List<P> listSubfolders(DMSFolder startFolder)
listSubfolders
in interface RemoteDMS
startFolder
- the folder which subfolders are requested<P extends DMSForm> P getMainForm(DMSForm f)
getMainForm
in interface RemoteDMS
f
- the form for which the mainform is needed<P extends DMSForm> java.util.List<P> listSubforms(DMSForm f, int id)
listSubforms
in interface RemoteDMS
f
- the form of which the subforms are neededid
- the id of the wanted subforms<P extends DMSForm> java.util.List<P> listSubforms(DMSForm f, int id, java.lang.String cond, java.lang.String order, java.lang.Object[] vals)
listSubforms
in interface RemoteDMS
f
- the form of which the subforms are neededid
- the id of the wanted subformscond
- the condition which must match. This allows additional filtering within the subform table,
e.g. 'amount > 10000' where 'amount' is a column in the database table of the subform class determined
by the passed id.order
- the sorting ordervals
- the value objects for the condition if the condition is build with the syntax
of a prepared statementint countSubforms(DMSForm f, int id)
f
is
the main form.
countSubforms
in interface RemoteDMS
f
- the form of which the subforms will be countedid
- the id of the subform relationvoid removeSubform(DMSForm main, DMSForm sub)
removeSubform
in interface RemoteDMS
main
- the mainform. If null is passed all main-subform-relations in which the passed subform
is referenced as subform will be removed.sub
- the subform to removevoid removeSubform(DMSForm main, DMSForm sub, int id)
removeSubform
in interface RemoteDMS
main
- the mainform. If null is passed all main-subform-relations in which the passed subform
is referenced as subform will be removed.sub
- the subform to removeid
- the id of the subform-relation from which the subform should be removedvoid addSubform(DMSForm main, DMSForm sub, int id)
addSubform
in interface RemoteDMS
main
- the mainformsub
- the subform to addid
- the id of the set of subform to which the passed subform should be addedMultiMap<DMSForm,DMSForm> fetchSubForms(java.util.Collection<? extends DMSForm> mainForms, int subformid)
fetchSubForms
in interface RemoteDMS
mainForms
- the referencing mainformssubformid
- the id of the subform (tablefield) to get
java.util.Map<DMSForm,DMSForm> fetchMainForms(java.util.Collection<? extends DMSForm> subForms)
fetchMainForms
in interface RemoteDMS
subForms
- the referencing subforms
<P extends DMSForm> java.util.List<P> listForms(FormType ft, java.lang.String cond, java.lang.String order, java.lang.Object[] vals)
listForms
in interface RemoteDMS
ft
- the formtype of the desired formscond
- the condition which must matchorder
- the sorting ordervals
- the value objects for the condition if the condition is build with the syntax
of a prepared statement<P extends DMSObject> java.util.List<P> listContents(DMSFolder folder, FormType ft, java.lang.String cond, java.lang.String order, java.lang.Object[] vals, boolean recursive)
listContents
in interface RemoteDMS
folder
- the folder whose content is wantedft
- the formtype of the desired objectscond
- the condition which must match. The following columns are available for parameter
cond and order:
order
- the sorting order (for available columns see parameter cond)vals
- the value objects for the condition if the condition is build with the syntax
of a prepared statementrecursive
- determines if the search should also include all subfolders<P extends DMSObject> P renameDocument(DMSFolder folder, P obj, java.lang.String newName, java.lang.String newExtension, User u)
renameDocument
in interface RemoteDMS
folder
- the folder the document belongs toobj
- the object which should be renamednewName
- the new name for the documentnewExtension
- the new extension for the document. This parameter is ignored if the passed
object is not a DMSDocForm
.u
- the user who wants to perform the renaming<P extends DMSDocForm> P reloadDocument(DMSFolder folder, P document, java.lang.String newExtension, java.io.InputStream is, User user)
reloadDocument
in interface RemoteDMS
folder
- the folder the document belongs todocument
- the document which should be reloadednewExtension
- the possibly new extension (if null or the empty string is passed the old
extension remains unchanged).is
- the inputstream holding the new contentuser
- the user who wants to perfom this actionvoid setContent(User user, DMSDocForm document, byte[] barr)
setContent
in interface RemoteDMS
user
- the user who performs this actiondocument
- the documentbarr
- a byte arraybyte[] getContent(DMSDocForm document)
getContent
in interface RemoteDMS
document
- the document
void lock(DMSDocForm document, User user)
lock
in interface RemoteDMS
document
- the documentuser
- the user who performs this actionvoid unlock(DMSDocForm document)
unlock
in interface RemoteDMS
document
- the document<P extends DMSForm> P changeType(DMSForm obj, FormType newType, DMSFolder folder, User user)
changeType
in interface RemoteDMS
obj
- the objects which type should be changednewType
- the new type for the passed objectfolder
- the folder of which the object is a content memberuser
- the user who performs the changevoid update(DMSObject o)
update
in interface RemoteDMS
o
- the object to be updatedKeyword createKeyword(java.lang.String word, User user)
createKeyword
in interface RemoteDMS
word
- the string representing the wanted keyworduser
- the user who creates the keyword
void deleteKeyword(Keyword keyword, User user)
deleteKeyword
in interface RemoteDMS
keyword
- the keyword which should be deleteduser
- the user who creates the keywordKeyword getKeyword(long oid)
getKeyword
in interface RemoteDMS
oid
- the oid the wanted keyword
<P extends Keyword> java.util.List<P> listKeywords()
listKeywords
in interface RemoteDMS
void addKeyword(DMSObject obj, Keyword keyword, User user)
addKeyword
in interface RemoteDMS
obj
- the object to which the keyword should be addedkeyword
- the keyword which should be addeduser
- the user who wants to perform this actionvoid removeKeyword(DMSObject obj, Keyword keyword, User user)
removeKeyword
in interface RemoteDMS
obj
- the object from which the keyword should be removedkeyword
- the keyword which should be removeduser
- the user who wants to perform this action<P extends Keyword> java.util.List<P> listKeywords(DMSObject obj)
listKeywords
in interface RemoteDMS
obj
- the object which the keywords should be returned
void disableRightChecks()
RemoteDMS.checkEdit(User, DMSObject)
, RemoteDMS.checkView(User, DMSObject)
,
RemoteDMS.mayEdit(User, DMSObject)
and RemoteDMS.mayView(User, DMSObject)
are deactivated in the current thread. But be aware to enable
the right check at the end of your actions because threads are reused in our system.
disableRightChecks
in interface RemoteDMS
void enableRightChecks()
RemoteDMS.disableRightChecks()
.
enableRightChecks
in interface RemoteDMS
void checkEdit(User user, DMSObject obj)
ApplicationException
Nr. 27 if the passed user may NOT edit the passed object
checkEdit
in interface RemoteDMS
user
- the user who wants to edit the objectobj
- the object which should be editedvoid checkView(User user, DMSObject obj)
ApplicationException
Nr. 27 if the passed user may NOT view the passed object
checkView
in interface RemoteDMS
user
- the user who wants to view the objectobj
- the object which should be viewedvoid checkDelete(User user, DMSObject obj)
ApplicationException
Nr. 27 if the passed user may NOT delete the passed object
checkDelete
in interface RemoteDMS
user
- the user who wants to delete the objectobj
- the object which should be deletedboolean mayEdit(User user, DMSObject obj)
mayEdit
in interface RemoteDMS
user
- the user who wants to edit the objectobj
- the object which should be editedboolean mayView(User user, DMSObject obj)
mayView
in interface RemoteDMS
user
- the user who wants to view the objectobj
- the object which should be viewedboolean mayDelete(User user, DMSObject obj)
mayDelete
in interface RemoteDMS
user
- the user who wants to delete the objectobj
- the object which should be deletedcom.groiss.security.Signature getSignatureClass()
Signature
implementation
getSignatureClass
in interface RemoteDMS
java.util.List<java.lang.String> listSignatureTypes()
listSignatureTypes
in interface RemoteDMS
java.util.List<com.groiss.security.SignedObject> listSignatures(PersistentVersion version, User user)
listSignatures
in interface RemoteDMS
version
- the document version which signatures are requesteduser
- the user who wants to get the signaturesboolean verify(PersistentVersion version, com.groiss.security.SignedObject signature)
verify
in interface RemoteDMS
version
- The document version which signature should be verifiedsignature
- The SignedObject holding the signature relevant data
java.lang.String getIcon(java.lang.String extension)
getIcon
in interface RemoteDMS
extension
- the extension for which the icon is wantedjava.lang.String getIconFromMimetype(java.lang.String mimetype)
getIconFromMimetype
in interface RemoteDMS
mimetype
- the mimetype for which the icon is wantedvoid checkValidName(DMSObject target, java.lang.String name, java.lang.String extension)
checkValidName
in interface RemoteDMS
target
- the object to which the name belongs to (or will belong to)name
- the name which should be checkedextension
- the extension which should be checkedvoid checkDuplicateNames(DMSFolder targetFolder, DMSObject targetObject, java.lang.String name, java.lang.String extension)
checkDuplicateNames
in interface RemoteDMS
targetFolder
- the folder in which should be checkedtargetObject
- the object the name belongs to (or will belong to)name
- the name which should be checkedextension
- the extension which should be checkedboolean isDuplicateName(DMSFolder targetFolder, DMSObject targetObject, java.lang.String name, java.lang.String extension)
isDuplicateName
in interface RemoteDMS
targetFolder
- the folder in which should be checkedtargetObject
- the object the name belongs to (or will belong to)name
- the name which should be checkedextension
- the extension which should be checked
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |