public class DocumentService extends Object
Modifier and Type | Method and Description |
---|---|
void |
archiveDocument(Document document,
fr.paris.lutece.portal.business.user.AdminUser user,
int nStateId)
Archive a document
|
void |
changeDocumentState(Document document,
fr.paris.lutece.portal.business.user.AdminUser user,
int nStateId)
Change the state of the document
|
void |
createDocument(Document document,
fr.paris.lutece.portal.business.user.AdminUser user)
Create a new document
|
void |
getActions(Document document,
Locale locale,
fr.paris.lutece.portal.business.user.AdminUser user)
Add to the document all permitted actions according to the current user
and
using the current locale
|
String |
getCreateForm(String strDocumentTypeCode,
Locale locale,
String strBaseUrl)
Build an HTML form for the document creation for a given document type
|
String |
getDocumentData(fr.paris.lutece.portal.web.upload.MultipartHttpServletRequest mRequest,
Document document,
Locale locale)
Return the data of a document object
|
static DocumentService |
getInstance()
Get the unique instance of the service
|
String |
getModifyForm(Document document,
Locale locale,
String strBaseUrl)
Build an HTML form for the document modification for a given document
|
String |
getModifyForm(String strDocumentId,
Locale locale,
String strBaseUrl)
Build an HTML form for the document modification for a given document ID.
|
void |
getPublishedStatus(Document document)
Get the published status of a document
|
boolean |
isAuthorizedAdminDocument(int nIdSpace,
String strDocumentTypeId,
String strPermission,
fr.paris.lutece.portal.business.user.AdminUser user)
Check that a given user is allowed to access a document type for a given
permission in a document space specified in parameter
If permission is document creation, check if document creation is allowed
for the specified space.
|
void |
modifyDocument(Document document,
fr.paris.lutece.portal.business.user.AdminUser user)
Modify a the content of a document
|
void |
moveDocument(Document document,
fr.paris.lutece.portal.business.user.AdminUser user,
int nNewSpace)
Move a document from a space to another
|
void |
validateDocument(Document document,
fr.paris.lutece.portal.business.user.AdminUser user,
int nStateId)
Validate a document
|
public static DocumentService getInstance()
public void changeDocumentState(Document document, fr.paris.lutece.portal.business.user.AdminUser user, int nStateId) throws DocumentException
document
- The documentuser
- The user doing the actionnStateId
- The new state IdDocumentException
- raise when error occurs in event or rulepublic void createDocument(Document document, fr.paris.lutece.portal.business.user.AdminUser user) throws DocumentException
document
- The documentuser
- The user doing the actionDocumentException
- raise when error occurs in event or rulepublic void modifyDocument(Document document, fr.paris.lutece.portal.business.user.AdminUser user) throws DocumentException
document
- The documentuser
- The user doing the actionDocumentException
- raise when error occurs in event or rulepublic void validateDocument(Document document, fr.paris.lutece.portal.business.user.AdminUser user, int nStateId) throws DocumentException
nStateId
- The new state id for a validated documentdocument
- The documentuser
- The user doing the actionDocumentException
- raise when error occurs in event or rulepublic void archiveDocument(Document document, fr.paris.lutece.portal.business.user.AdminUser user, int nStateId) throws DocumentException
nStateId
- The new state id for a validated documentdocument
- The documentuser
- The user doing the actionDocumentException
- raise when error occurs in event or rulepublic void moveDocument(Document document, fr.paris.lutece.portal.business.user.AdminUser user, int nNewSpace) throws DocumentException
document
- The documentuser
- The user doing the actionnNewSpace
- The Id of the destination spaceDocumentException
- raise when error occurs in event or rulepublic void getActions(Document document, Locale locale, fr.paris.lutece.portal.business.user.AdminUser user)
user
- The current userdocument
- The documentlocale
- The Localepublic void getPublishedStatus(Document document)
document
- The document to get the published status ofpublic String getCreateForm(String strDocumentTypeCode, Locale locale, String strBaseUrl)
strDocumentTypeCode
- The Document type codelocale
- The LocalestrBaseUrl
- The base Urlpublic String getModifyForm(String strDocumentId, Locale locale, String strBaseUrl)
strDocumentId
- The Id of the document to modifylocale
- The LocalestrBaseUrl
- The base urlpublic String getModifyForm(Document document, Locale locale, String strBaseUrl)
document
- The documentlocale
- The LocalestrBaseUrl
- The base urlpublic boolean isAuthorizedAdminDocument(int nIdSpace, String strDocumentTypeId, String strPermission, fr.paris.lutece.portal.business.user.AdminUser user)
nIdSpace
- the id of the document spacestrDocumentTypeId
- the id of the type document being consideredstrPermission
- the permission neededuser
- the user trying to access the ressourcepublic String getDocumentData(fr.paris.lutece.portal.web.upload.MultipartHttpServletRequest mRequest, Document document, Locale locale)
mRequest
- The MultipartHttpServletRequestdocument
- The document objectlocale
- The localeCopyright © 2020 City of Paris. All rights reserved.