public class DocumentsWebService extends CoselmarWebServiceSupport
| Modifier and Type | Field and Description |
|---|---|
static List<String> |
DOCUMENT_CREATE_ALLOWED_USER_ROLES |
static List<String> |
DOCUMENT_SUPER_USER_ROLES
Kind of admin role
|
static List<String> |
DOCUMENT_VIEW_ALLOWED_USER_ROLES |
| Constructor and Description |
|---|
DocumentsWebService() |
| Modifier and Type | Method and Description |
|---|---|
DocumentBean |
addDocument(DocumentBean document,
org.debux.webmotion.server.call.UploadFile uploadFile) |
void |
addDocumentFile(String documentId,
org.debux.webmotion.server.call.UploadFile uploadFile) |
protected void |
deleteAttachedFile(Document document)
Delete physically Document File, and update Document entity setting
filePath and fileName to null and withFile boolean to false
|
void |
deleteDocument(String documentId) |
DocumentBean |
getDocument(String documentId) |
org.debux.webmotion.server.render.Render |
getDocumentFile(String documentId) |
protected String |
getDocumentFullId(String documentId) |
List<DocumentBean> |
getDocuments(List<String> searchKeywords) |
protected List<String> |
getDocumentsFullId(List<String> documentShortIds) |
List<String> |
getKeywords() |
List<String> |
getTypes() |
protected String |
getUserDocumentPath(CoselmarUser user) |
protected boolean |
isAllowedToAccessDocument(CoselmarUser user,
Document document)
Check if an user can access to a document metadata, according to its
privacy settings and the user grant.
|
protected org.apache.commons.lang3.tuple.Pair<String,String> |
managerDocumentFile(org.debux.webmotion.server.call.UploadFile uploadFile,
CoselmarUser owner)
When a Document is sent, it could have a File part : this manage the
upload file.
|
protected Set<CoselmarUser> |
retrieveUsers(Collection<UserBean> userBeans) |
void |
saveDocument(DocumentBean document) |
checkAuthentication, checkUserAuthentication, commit, getCleanMail, getCoselmarServicesConfig, getCoselmarUserDao, getCoselmarUserGroupDao, getDocumentDao, getDocumentsService, getFullIdFromShort, getFullUserIdFromShort, getLocale, getNow, getPersistenceContext, getQuestionDao, getServicesContext, getShortIdFromFull, newService, rollback, setServicesContextgetContext, renderAction, renderAtom, renderContent, renderContent, renderDownload, renderDownload, renderError, renderError, renderFailure, renderForward, renderForward, renderJSON, renderJSONP, renderLastPage, renderRedirect, renderRSS, renderStatus, renderStream, renderStream, renderStringTemplate, renderSuccess, renderTemplate, renderURL, renderView, renderXML, setContextable, toMappublic static final List<String> DOCUMENT_CREATE_ALLOWED_USER_ROLES
public static final List<String> DOCUMENT_SUPER_USER_ROLES
public DocumentBean getDocument(String documentId) throws InvalidCredentialException, UnauthorizedException
public List<DocumentBean> getDocuments(List<String> searchKeywords) throws InvalidCredentialException
InvalidCredentialExceptionpublic DocumentBean addDocument(DocumentBean document, org.debux.webmotion.server.call.UploadFile uploadFile) throws InvalidCredentialException, UnauthorizedException
public void addDocumentFile(String documentId, org.debux.webmotion.server.call.UploadFile uploadFile) throws InvalidCredentialException, UnauthorizedException
public org.debux.webmotion.server.render.Render getDocumentFile(String documentId) throws NoResultException
NoResultExceptionpublic void saveDocument(DocumentBean document) throws InvalidCredentialException, UnauthorizedException
public void deleteDocument(String documentId) throws InvalidCredentialException, UnauthorizedException
public List<String> getKeywords() throws InvalidCredentialException, UnauthorizedException
public List<String> getTypes() throws InvalidCredentialException, UnauthorizedException
protected org.apache.commons.lang3.tuple.Pair<String,String> managerDocumentFile(org.debux.webmotion.server.call.UploadFile uploadFile, CoselmarUser owner)
protected String getUserDocumentPath(CoselmarUser user)
protected boolean isAllowedToAccessDocument(CoselmarUser user, Document document)
user - : Current User,
containing CoselmarUserRole as Stringdocument - : the document user trying to access.protected void deleteAttachedFile(Document document)
protected Set<CoselmarUser> retrieveUsers(Collection<UserBean> userBeans)
Copyright © 2014–2015 Ifremer. All rights reserved.