com.groiss.dms
Interface RemoteDMS

All Superinterfaces:
java.rmi.Remote
All Known Subinterfaces:
DMS

public interface RemoteDMS
extends java.rmi.Remote

Utility class for DMS related operations.


Field Summary
static short COPY
          Determines that a DMSObject should be copied from one folder to another
static char[] invalidChars
          holds the characters which are not allowed within the name of a DMSObject
static short LINK
          Determines that a link to a DMSObject should be created
static short MOVE
          Determines that a DMSObject should be moved from one folder to another
 
Method Summary
<P extends DMSObject>
P
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.
<P extends DMSForm>
P
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.
<P extends DMSDocForm>
P
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.
<P extends DMSFolder>
P
createFolder(FormType ft, java.lang.String name, P template, User u, PermissionList acl)
          Create a folder of a given type.
<P extends DMSForm>
P
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.
<P extends DMSNote>
P
createNote(java.lang.String subject, java.lang.String content, User u, PermissionList acl)
          Creates a new note
<P extends DMSWebLink>
P
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 checkEdit(User, DMSObject), checkView(User, DMSObject), mayEdit(User, DMSObject) and mayView(User, DMSObject) are deactivated in the current thread.
 void enableRightChecks()
          enables the right checks if they were previously disabled using method 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.
<P extends DMSObject>
P
getDMSObject(long oid)
          Get a DMSObject by oid.
<P extends DMSObject>
P
getDMSObject(java.lang.String classname, long oid)
          Get a DMSObject by classname and oid.
<P extends DMSFolder>
P
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
<P extends DMSForm>
P
getMainForm(DMSForm f)
          Returns the main form of the passed form (or null if there is none)
<P extends DMSFolder>
P
getPublicRootFolder()
          Returns the public root folder in the DMS.
<P extends DMSFolder>
P
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
<P extends DMSForm>
java.util.List<P>
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
<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)
          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.
<P extends DMSForm>
java.util.List<P>
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
<P extends Keyword>
java.util.List<P>
listKeywords()
          Returns a list of all keywords known to the system
<P extends Keyword>
java.util.List<P>
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
<P extends DMSFolder>
java.util.List<P>
listSubfolders(DMSFolder startFolder)
          Returns a list of all folders which are subfolders of the given folder.
<P extends DMSForm>
java.util.List<P>
listSubforms(DMSForm f, int id)
          Returns a list of subforms of the passed form (which is empty if there are none)
<P extends DMSForm>
java.util.List<P>
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.
<P extends DMSObject>
P
move(DMSFolder src, DMSFolder dest, P doc, short type, User u)
          Moves an object from one folder to another.
<P extends DMSDocForm>
P
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.
<P extends DMSObject>
P
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.
 

Field Detail

MOVE

static final short MOVE
Determines that a DMSObject should be moved from one folder to another

See Also:
Constant Field Values

COPY

static final short COPY
Determines that a DMSObject should be copied from one folder to another

See Also:
Constant Field Values

LINK

static final short LINK
Determines that a link to a DMSObject should be created

See Also:
Constant Field Values

invalidChars

static final char[] invalidChars
holds the characters which are not allowed within the name of a DMSObject

Method Detail

createFolder

<P extends DMSFolder> P createFolder(FormType ft,
                                     java.lang.String name,
                                     P template,
                                     User u,
                                     PermissionList acl)
                                 throws java.rmi.RemoteException
Create a folder of a given type.

Parameters:
ft - the folder's formtype
name - the name for the folder
template - specifies the template which should be used for creating the folder (may be null)
u - the user who wants to create the folder
acl - the acl attached to the new folder (may be null)
Throws:
java.rmi.RemoteException

createDocForm

<P extends DMSDocForm> P createDocForm(FormType ft,
                                       java.lang.String name,
                                       java.lang.String extension,
                                       P template,
                                       User u,
                                       PermissionList acl)
                                   throws java.rmi.RemoteException
Creates a new document of the specified formtype.

Parameters:
ft - the document's formtype
name - the name of the new DocForm
extension - 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 action
acl - the acl if one should be set (otherwise pass null)
Returns:
the new Document
Throws:
java.rmi.RemoteException

createForm

<P extends DMSForm> P createForm(FormType ft,
                                 P template,
                                 User u,
                                 PermissionList acl)
                             throws java.rmi.RemoteException
Creates a new form of the specified formtype. The form will be inserted to the database and therefore contain an oid.

Parameters:
ft - the form's formtype
template - specifies the template which should be used for creating the folder (may be null)
u - the user who wants to perform this action
acl - the acl if one should be set (otherwise pass null)
Returns:
the new form
Throws:
java.rmi.RemoteException

createNote

<P extends DMSNote> P createNote(java.lang.String subject,
                                 java.lang.String content,
                                 User u,
                                 PermissionList acl)
                             throws java.rmi.RemoteException
Creates a new note

Parameters:
subject - the subject of the note
content - the content of the note
u - the user who wants to perform this action
acl - the acl if one should be set (otherwise pass null)
Returns:
the new form
Throws:
java.rmi.RemoteException

createWebLink

<P extends DMSWebLink> P createWebLink(java.lang.String name,
                                       java.lang.String url,
                                       java.lang.String description,
                                       User u,
                                       PermissionList acl)
                                   throws java.rmi.RemoteException
Creates a new link to an URL

Parameters:
name - the name of the weblink
url - the url of the weblink
description - a description text of the the weblink
u - the user who wants to perform this action
acl - the acl if one should be set (otherwise pass null)
Returns:
the new form
Throws:
java.rmi.RemoteException

getFormType

FormType getFormType(java.lang.String id,
                     int version)
                     throws java.rmi.RemoteException
Returns the formtype with the given id and version number

Throws:
java.rmi.RemoteException

getFormType

FormType getFormType(long oid)
                     throws java.rmi.RemoteException
Returns the formtpye with the given oid

Throws:
java.rmi.RemoteException

getTemplates

<P extends DMSForm> java.util.List<P> getTemplates(FormType ft)
                                               throws java.rmi.RemoteException
Returns the templates for the passed form type.

Parameters:
ft - the form type of which the templates are wanted
Returns:
a list of form objects
Throws:
java.rmi.RemoteException

listCreateableFormTypes

java.util.List<FormType> listCreateableFormTypes(java.lang.String searchCond,
                                                 java.lang.String order,
                                                 User user)
                                                 throws java.rmi.RemoteException
Returns the formtypes which meet the search condition and from which the passed user may create form objects.

Parameters:
searchCond - a sql where-clause
order - sql order attributes
user - the user for which the search should be performed
Throws:
java.rmi.RemoteException

move

<P extends DMSObject> P move(DMSFolder src,
                             DMSFolder dest,
                             P doc,
                             short type,
                             User u)
                         throws java.rmi.RemoteException
Moves an object from one folder to another.

Parameters:
src - the folder currently holding the object
dest - the folder to which the objects should be moved
doc - the object which should be moved
type - the type of move operation:
  • MOVE: the object should be moved (i.e. removed from src and added to dest)
  • COPY: the object should be copied (i.e. stays in src and a copy is added to dest)
  • 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
Throws:
java.rmi.RemoteException

add

<P extends DMSObject> P add(DMSFolder f,
                            P o,
                            User u)
                        throws java.rmi.RemoteException
Adds an Object to a folder. Use this method after creation of the object.

Parameters:
f - the folder to which the object should be added
o - the object which should be added to the folder
u - the user who wants to perform this action
Throws:
java.rmi.RemoteException

remove

void remove(DMSFolder f,
            DMSObject o,
            User u)
            throws java.rmi.RemoteException
Removes an Object from a folder. NOTE: this will not delete the passed object but only remove it from the folders contents

Parameters:
f - the folder from which the object should be removed
o - the object which should be removed from the folder
u - the user who wants to perform this action
Throws:
java.rmi.RemoteException

delete

void delete(DMSFolder f,
            DMSObject o,
            User u)
            throws java.rmi.RemoteException
Deletes the object o which resides in folder f. This will also remove the object from the folder.

Parameters:
f - the folder holding the object which should be deleted
o - the object which should be deleted
u - the user who wants to perform this action
Throws:
java.rmi.RemoteException

attachNote

void attachNote(DMSObject target,
                DMSNote note,
                User user)
                throws java.rmi.RemoteException
Attaches the passed note to the passed object.

Parameters:
target - the object to which the note should be attached
note - the note which should be attached
user - the user who wants to perform this action
Throws:
java.rmi.RemoteException

removeNote

void removeNote(DMSObject target,
                DMSNote note,
                User user)
                throws java.rmi.RemoteException
Removes the passed note from the passed document.

Parameters:
target - the object form which the note should be removed
note - the note which should be removed
user - the user who wants to perform this action
Throws:
java.rmi.RemoteException

listNotes

java.util.List<DMSNote> listNotes(DMSObject target,
                                  User user)
                                  throws java.rmi.RemoteException
Returns all the notes which are attached to target and which the user may view or edit

Parameters:
target - the object which notes are wanted
user - the user who wants to perform this action
Throws:
java.rmi.RemoteException

makeVersion

PersistentVersion makeVersion(DMSObject obj,
                              User user,
                              java.lang.String description)
                              throws java.rmi.RemoteException
Makes a version of the passed object.

Parameters:
obj - the object which should be versioned
user - the user who wants to make the version
description - the version description text
Throws:
java.rmi.RemoteException

deleteVersion

void deleteVersion(PersistentVersion version,
                   User user)
                   throws java.rmi.RemoteException
Deletes the passed version of an object.

Parameters:
version - the version to be deleted
user - the user who wants to delete the version
Throws:
java.rmi.RemoteException

listVersions

java.util.List<PersistentVersion> listVersions(DMSObject obj,
                                               User user)
                                               throws java.rmi.RemoteException
Returns the versions of the specified object in descending order of their creation date.

Parameters:
obj - the object which versions are requested
user - the user who performs this request
Throws:
java.rmi.RemoteException

backupToVersion

void backupToVersion(DMSForm form,
                     PersistentVersion version,
                     User user)
                     throws java.rmi.RemoteException
Makes the content of the passed version to the current content of the passed form.

Parameters:
form - the object which should be reset to the passed the version
version - the version which content should be used (it must be a version of the passed form)
user - the user who performs this request
Throws:
java.rmi.RemoteException

getRootFolder

<P extends DMSFolder> P getRootFolder(User user)
                                  throws java.rmi.RemoteException
Returns the root DMS folder (i.e. it has no parent) for a user.

Parameters:
user - the user who's root folder is requested.
Throws:
java.rmi.RemoteException

getPublicRootFolder

<P extends DMSFolder> P getPublicRootFolder()
                                        throws java.rmi.RemoteException
Returns the public root folder in the DMS.

Throws:
java.rmi.RemoteException

getDMSObject

<P extends DMSObject> P getDMSObject(java.lang.String classname,
                                     long oid)
                                 throws java.rmi.RemoteException
Get a DMSObject by classname and oid.

Parameters:
classname - the full qualified class name of the requested object
oid - the oid of the requested object
Throws:
java.rmi.RemoteException

getDMSObject

<P extends DMSObject> P getDMSObject(long oid)
                                 throws java.rmi.RemoteException
Get a DMSObject by oid. This method will only find DMSObjects which are elements of a DMSFolder.

Parameters:
oid - the oid of the requested object
Throws:
java.rmi.RemoteException

getFolder

<P extends DMSFolder> P getFolder(DMSObject obj)
                              throws java.rmi.RemoteException
Get the folder containing the passed object.

Parameters:
obj - the object which folder is wanted
Throws:
java.rmi.RemoteException

listSubfolders

<P extends DMSFolder> java.util.List<P> listSubfolders(DMSFolder startFolder)
                                                   throws java.rmi.RemoteException
Returns a list of all folders which are subfolders of the given folder. ATTENTION: the found folders are not filled, only their oids are set

Parameters:
startFolder - the folder which subfolders are requested
Throws:
java.rmi.RemoteException

getMainForm

<P extends DMSForm> P getMainForm(DMSForm f)
                              throws java.rmi.RemoteException
Returns the main form of the passed form (or null if there is none)

Parameters:
f - the form for which the mainform is needed
Throws:
java.rmi.RemoteException

listSubforms

<P extends DMSForm> java.util.List<P> listSubforms(DMSForm f,
                                                   int id)
                                               throws java.rmi.RemoteException
Returns a list of subforms of the passed form (which is empty if there are none)

Parameters:
f - the form of which the subforms are needed
id - the id of the wanted subforms
Throws:
java.rmi.RemoteException

listSubforms

<P extends DMSForm> java.util.List<P> listSubforms(DMSForm f,
                                                   int id,
                                                   java.lang.String cond,
                                                   java.lang.String order,
                                                   java.lang.Object[] vals)
                                               throws java.rmi.RemoteException
Returns a list of subforms of the passed form (which is empty if there are none)

Parameters:
f - the form of which the subforms are needed
id - the id of the wanted subforms
cond - 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 order
vals - the value objects for the condition if the condition is build with the syntax of a prepared statement
Throws:
java.rmi.RemoteException

countSubforms

int countSubforms(DMSForm f,
                  int id)
                  throws java.rmi.RemoteException
Counts the number of subforms in the subform-relation where f is the main form.

Parameters:
f - the form of which the subforms will be counted
id - the id of the subform relation
Throws:
java.rmi.RemoteException

removeSubform

void removeSubform(DMSForm main,
                   DMSForm sub)
                   throws java.rmi.RemoteException
Removes the passed subform from the passed mainform. NOTE: only the relation between the main- and the subform is removed, the subform will not be deleted by this method. Also the mainform will not be updated - so it may be the case that users can still see the removed subform in the browser if the mainform is gotten from the browser cache.

Parameters:
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 remove
Throws:
java.rmi.RemoteException

removeSubform

void removeSubform(DMSForm main,
                   DMSForm sub,
                   int id)
                   throws java.rmi.RemoteException
Removes the passed subform from the subform-relation identified by the passed id in the passed mainform. NOTE: only the relation between the main- and the subform is removed, the subform will not be deleted by this method. Also the mainform will not be updated - so it may be the case that users can still see the removed subform in the browser if the mainform is gotten from the browser cache.

Parameters:
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 remove
id - the id of the subform-relation from which the subform should be removed
Throws:
java.rmi.RemoteException

addSubform

void addSubform(DMSForm main,
                DMSForm sub,
                int id)
                throws java.rmi.RemoteException
Adds the passed subform to the mainform into the set of subforms identified by the passed id. NOTE: the mainform will not be updated - so it may be the case that users can't see the added subform in the browser if the mainform is gotten from the browser cache.

Parameters:
main - the mainform
sub - the subform to add
id - the id of the set of subform to which the passed subform should be added
Throws:
java.rmi.RemoteException

fetchSubForms

MultiMap<DMSForm,DMSForm> fetchSubForms(java.util.Collection<? extends DMSForm> mainForms,
                                        int subformid)
                                        throws java.rmi.RemoteException
Construct a mapping from mainform instances to (filled) subform instances.

Parameters:
mainForms - the referencing mainforms
subformid - the id of the subform (tablefield) to get
Returns:
the mapping from mainforms to subforms
Throws:
java.rmi.RemoteException

fetchMainForms

java.util.Map<DMSForm,DMSForm> fetchMainForms(java.util.Collection<? extends DMSForm> subForms)
                                              throws java.rmi.RemoteException
Construct a mapping from sub form instances to (filled) main form instances

Parameters:
subForms - the referencing subforms
Returns:
the mapping from subforms to mainforms
Throws:
java.rmi.RemoteException

listForms

<P extends DMSForm> java.util.List<P> listForms(FormType ft,
                                                java.lang.String cond,
                                                java.lang.String order,
                                                java.lang.Object[] vals)
                                            throws java.rmi.RemoteException
Returns a list of forms of the given formtype which match the passed condition

Parameters:
ft - the formtype of the desired forms
cond - the condition which must match
order - the sorting order
vals - the value objects for the condition if the condition is build with the syntax of a prepared statement
Throws:
java.rmi.RemoteException

listContents

<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)
                                                 throws java.rmi.RemoteException
Returns a list of dms objects which match the passed condition

Parameters:
folder - the folder whose content is wanted
ft - the formtype of the desired objects
cond - the condition which must match. The following columns are available for parameter cond and order:
  • if the passed formtype is null:
    • t0.form the oid of the content element
    • t0.docname the name of the content element
    • t0.dept the oid of the department
    • t0.owner the oid of the owner (= creator)
    • t0.createdat the creation date
    • t0.changedat the date of the last change
  • if the passed formtype is not null you can use all columns of the specified form type's table. For those columns you must also use the table alias t0 as described in the listing above
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 statement
recursive - determines if the search should also include all subfolders
Throws:
java.rmi.RemoteException

renameDocument

<P extends DMSObject> P renameDocument(DMSFolder folder,
                                       P obj,
                                       java.lang.String newName,
                                       java.lang.String newExtension,
                                       User u)
                                   throws java.rmi.RemoteException
Sets the name and extension of the passed object to newName.

Parameters:
folder - the folder the document belongs to
obj - the object which should be renamed
newName - the new name for the document
newExtension - 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
Throws:
java.rmi.RemoteException

reloadDocument

<P extends DMSDocForm> P reloadDocument(DMSFolder folder,
                                        P document,
                                        java.lang.String newExtension,
                                        java.io.InputStream is,
                                        User user)
                                    throws java.rmi.RemoteException
Reloads the document, i.e. replaces the content of the document with the content of the passed file

Parameters:
folder - the folder the document belongs to
document - the document which should be reloaded
newExtension - the possibly new extension (if null or the empty string is passed the old extension remains unchanged).
is - the inputstream holding the new content
user - the user who wants to perfom this action
Throws:
java.rmi.RemoteException

setContent

void setContent(User user,
                DMSDocForm document,
                byte[] barr)
                throws java.rmi.RemoteException
Set the content of a document.

Parameters:
user - the user who performs this action
document - the document
barr - a byte array
Throws:
java.rmi.RemoteException

getContent

byte[] getContent(DMSDocForm document)
                  throws java.rmi.RemoteException
Get the content of a document.

Parameters:
document - the document
Returns:
a byte array
Throws:
java.rmi.RemoteException

lock

void lock(DMSDocForm document,
          User user)
          throws java.rmi.RemoteException
Locks the document.

Parameters:
document - the document
user - the user who performs this action
Throws:
java.rmi.RemoteException

unlock

void unlock(DMSDocForm document)
            throws java.rmi.RemoteException
Unlocks the document.

Parameters:
document - the document
Throws:
java.rmi.RemoteException

changeType

<P extends DMSForm> P changeType(DMSForm obj,
                                 FormType newType,
                                 DMSFolder folder,
                                 User user)
                             throws java.rmi.RemoteException
This method changes the type of the passed DMSObject to the passed FormType. All system definied metadata will be copied, all type specific metadata will not (except the name attribute). Only DMSFolders and DMSDocForms may change their types. Note: because the @enterprise persistence mechanism needs the oid and class name of instances of interfaces and abstract classes there are some changes to be done in other tables to correct the class name (the oid will stay the same when changing the type). If you have your own tables where you hold references to such objects you have to handle the change in these tables by yourself.

Parameters:
obj - the objects which type should be changed
newType - the new type for the passed object
folder - the folder of which the object is a content member
user - the user who performs the change
Throws:
java.rmi.RemoteException

update

void update(DMSObject o)
            throws java.rmi.RemoteException
Updates the passed object

Parameters:
o - the object to be updated
Throws:
java.rmi.RemoteException

createKeyword

Keyword createKeyword(java.lang.String word,
                      User user)
                      throws java.rmi.RemoteException
Creates a new Keyword for the passed word and returns this instance.

Parameters:
word - the string representing the wanted keyword
user - the user who creates the keyword
Returns:
the new keyword
Throws:
java.rmi.RemoteException

deleteKeyword

void deleteKeyword(Keyword keyword,
                   User user)
                   throws java.rmi.RemoteException
Deletes the passed keyword.

Parameters:
keyword - the keyword which should be deleted
user - the user who creates the keyword
Throws:
java.rmi.RemoteException

getKeyword

Keyword getKeyword(long oid)
                   throws java.rmi.RemoteException
Returns the keyword with the passed oid

Parameters:
oid - the oid the wanted keyword
Returns:
the keyword if there exists one for the passed oid
Throws:
java.rmi.RemoteException

listKeywords

<P extends Keyword> java.util.List<P> listKeywords()
                                               throws java.rmi.RemoteException
Returns a list of all keywords known to the system

Returns:
a list of all keywords
Throws:
java.rmi.RemoteException

addKeyword

void addKeyword(DMSObject obj,
                Keyword keyword,
                User user)
                throws java.rmi.RemoteException
Adds the passed keyword to the passed DMSObject

Parameters:
obj - the object to which the keyword should be added
keyword - the keyword which should be added
user - the user who wants to perform this action
Throws:
java.rmi.RemoteException

removeKeyword

void removeKeyword(DMSObject obj,
                   Keyword keyword,
                   User user)
                   throws java.rmi.RemoteException
Removes the passed keyword from the passed DMSObject

Parameters:
obj - the object from which the keyword should be removed
keyword - the keyword which should be removed
user - the user who wants to perform this action
Throws:
java.rmi.RemoteException

listKeywords

<P extends Keyword> java.util.List<P> listKeywords(DMSObject obj)
                                               throws java.rmi.RemoteException
Returns a list of all keywords attached to the passed DMSObject

Parameters:
obj - the object which the keywords should be returned
Returns:
a list of all keywords of a given DMSObject
Throws:
java.rmi.RemoteException

disableRightChecks

void disableRightChecks()
                        throws java.rmi.RemoteException
If this method is called all right checks done using methods checkEdit(User, DMSObject), checkView(User, DMSObject), mayEdit(User, DMSObject) and 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.

Throws:
java.rmi.RemoteException

enableRightChecks

void enableRightChecks()
                       throws java.rmi.RemoteException
enables the right checks if they were previously disabled using method disableRightChecks().

Throws:
java.rmi.RemoteException

checkEdit

void checkEdit(User user,
               DMSObject obj)
               throws java.rmi.RemoteException
Throws ApplicationException Nr. 27 if the passed user may NOT edit the passed object

Parameters:
user - the user who wants to edit the object
obj - the object which should be edited
Throws:
java.rmi.RemoteException

checkView

void checkView(User user,
               DMSObject obj)
               throws java.rmi.RemoteException
Throws ApplicationException Nr. 27 if the passed user may NOT view the passed object

Parameters:
user - the user who wants to view the object
obj - the object which should be viewed
Throws:
java.rmi.RemoteException

checkDelete

void checkDelete(User user,
                 DMSObject obj)
                 throws java.rmi.RemoteException
Throws ApplicationException Nr. 27 if the passed user may NOT delete the passed object

Parameters:
user - the user who wants to delete the object
obj - the object which should be deleted
Throws:
java.rmi.RemoteException

mayEdit

boolean mayEdit(User user,
                DMSObject obj)
                throws java.rmi.RemoteException
Returns true if the passed user may edit the passed object or if the right check is deactivated. Otherwise false is returned.

Parameters:
user - the user who wants to edit the object
obj - the object which should be edited
Throws:
java.rmi.RemoteException

mayView

boolean mayView(User user,
                DMSObject obj)
                throws java.rmi.RemoteException
Returns true if the passed user may view the passed object or if the right check is deactivated. Otherwise false is returned.

Parameters:
user - the user who wants to view the object
obj - the object which should be viewed
Throws:
java.rmi.RemoteException

mayDelete

boolean mayDelete(User user,
                  DMSObject obj)
                  throws java.rmi.RemoteException
Returns true if the passed user may delete the passed object or if the right check is deactivated. Otherwise false is returned.

Parameters:
user - the user who wants to delete the object
obj - the object which should be deleted
Throws:
java.rmi.RemoteException

getSignatureClass

com.groiss.security.Signature getSignatureClass()
                                                throws java.rmi.RemoteException
Returns an instance of the class which should be uses as Signature implementation

Throws:
java.rmi.RemoteException

listSignatureTypes

java.util.List<java.lang.String> listSignatureTypes()
                                                    throws java.rmi.RemoteException
Returns the available types of signatures

Returns:
a list of Strings where each String represents one type
Throws:
java.rmi.RemoteException

listSignatures

java.util.List<com.groiss.security.SignedObject> listSignatures(PersistentVersion version,
                                                                User user)
                                                                throws java.rmi.RemoteException
Returns the signatures of the passed version

Parameters:
version - the document version which signatures are requested
user - the user who wants to get the signatures
Throws:
java.rmi.RemoteException

verify

boolean verify(PersistentVersion version,
               com.groiss.security.SignedObject signature)
               throws java.rmi.RemoteException
Verifies the electronically signature of a document's version.

Parameters:
version - The document version which signature should be verified
signature - The SignedObject holding the signature relevant data
Returns:
true, if the signature is correct; false otherwise.
Throws:
java.rmi.RemoteException

getIcon

java.lang.String getIcon(java.lang.String extension)
                         throws java.rmi.RemoteException
Returns the icon for the passed extension. If no icon is found null is returned.

Parameters:
extension - the extension for which the icon is wanted
Throws:
java.rmi.RemoteException

getIconFromMimetype

java.lang.String getIconFromMimetype(java.lang.String mimetype)
                                     throws java.rmi.RemoteException
Returns the icon for the passed mimetype. If no icon is found null is returned.

Parameters:
mimetype - the mimetype for which the icon is wanted
Throws:
java.rmi.RemoteException

checkValidName

void checkValidName(DMSObject target,
                    java.lang.String name,
                    java.lang.String extension)
                    throws java.rmi.RemoteException
Checks if the name and extension do not contain any forbidden characters

Parameters:
target - the object to which the name belongs to (or will belong to)
name - the name which should be checked
extension - the extension which should be checked
Throws:
java.rmi.RemoteException

checkDuplicateNames

void checkDuplicateNames(DMSFolder targetFolder,
                         DMSObject targetObject,
                         java.lang.String name,
                         java.lang.String extension)
                         throws java.rmi.RemoteException
Checks if the passed folder does not already contain an element with the same name as the passed one.

Parameters:
targetFolder - the folder in which should be checked
targetObject - the object the name belongs to (or will belong to)
name - the name which should be checked
extension - the extension which should be checked
Throws:
java.rmi.RemoteException

isDuplicateName

boolean isDuplicateName(DMSFolder targetFolder,
                        DMSObject targetObject,
                        java.lang.String name,
                        java.lang.String extension)
                        throws java.rmi.RemoteException
Returns true if already an item of the passed folder has the passed name

Parameters:
targetFolder - the folder in which should be checked
targetObject - the object the name belongs to (or will belong to)
name - the name which should be checked
extension - the extension which should be checked
Throws:
java.rmi.RemoteException


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.