Class Files2DocsLinkDocument
java.lang.Object
fr.paris.lutece.plugins.files2docs.service.Files2DocsLinkDocument
Link class with document services
-
Method Summary
Modifier and TypeMethodDescriptioncreateDocument(fr.paris.lutece.plugins.document.business.Document document, fr.paris.lutece.portal.business.user.AdminUser user) Creates a new documentgetAllAttributes(String strDocumentTypeCode, int nIdMapping, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the collection of all document attributes that are mandatory or type file/image.Collection<fr.paris.lutece.plugins.document.business.attributes.AttributeTypeParameter>getAttributeParametersValues(int nAttributeId, Locale locale) Gets parameters valuesCollection<fr.paris.lutece.plugins.document.business.attributes.AttributeTypeParameter>getAttributeTypeParameterList(String strAttributeTypeCode, Locale locale) Gets attribute type parameters listfr.paris.lutece.plugins.document.business.attributes.DocumentAttributegetDocumentAttributeById(int nKey) Returns an instance of a documentAttribute whose identifier is specified in parameterfr.paris.lutece.plugins.document.business.DocumentgetDocumentById(int nKey) Returns an instance of a document whose identifier is specified in parameterfr.paris.lutece.plugins.document.business.DocumentTypegetDocumentTypeByCode(String strCode) Returns an instance of a documentType whose identifier is specified in parameterstatic Files2DocsLinkDocumentGets the unique instance of Files2DocsLinkDocumentCollection<fr.paris.lutece.plugins.document.business.DocumentType>getListDocumentTypeFile(Collection<String> listAttributeTypeFile, boolean bIsForCreate) Gets the document types filtered by fields of type filegetListRegularExpressionKeyByIdAttribute(int nIdAttribute) Gets all regular expression key associated to the attributefr.paris.lutece.plugins.document.business.attributes.DocumentAttributegetMandatoryAttributeFileImage(String strDocumentTypeCode) Get the mandatory attribute file/image from a given document typeCollection<fr.paris.lutece.plugins.document.business.attributes.DocumentAttribute>getMandatoryAttributes(String strDocumentTypeCode) Gets mandatory attributes for the document typegetSpacesBrowser(jakarta.servlet.http.HttpServletRequest request, fr.paris.lutece.portal.business.user.AdminUser user, Locale locale, String strActionUrl) Gets the HTML code to display the spaces browserbooleanisAuthorizedAdminDocument(int nIdSpace, String strDocumentTypeId, fr.paris.lutece.portal.business.user.AdminUser user) Checks that a given user is allowed to access a document type for a given permission in a document space specified in parameter.booleanisDocumentAttributeFile(fr.paris.lutece.plugins.document.business.attributes.DocumentAttribute attribute) Check if the given document attribute is an attribute type filebooleanisDocumentAttributeImage(fr.paris.lutece.plugins.document.business.attributes.DocumentAttribute attribute) Check if the given document attribute is an attribute type image
-
Method Details
-
getInstance
Gets the unique instance of Files2DocsLinkDocument- Returns:
- The unique instance of Files2DocsLinkDocument
-
getListDocumentTypeFile
public Collection<fr.paris.lutece.plugins.document.business.DocumentType> getListDocumentTypeFile(Collection<String> listAttributeTypeFile, boolean bIsForCreate) Gets the document types filtered by fields of type file- Parameters:
listAttributeTypeFile- The list of document attributes types (codes) with a field of type file- Returns:
- A collection of document types filtered by fields of type file
-
getSpacesBrowser
public String getSpacesBrowser(jakarta.servlet.http.HttpServletRequest request, fr.paris.lutece.portal.business.user.AdminUser user, Locale locale, String strActionUrl) Gets the HTML code to display the spaces browser- Parameters:
request- The HTTP requestuser- The current userlocale- The current localestrActionUrl- The URL the browser posts to when it opens a space- Returns:
- The HTML form
-
isAuthorizedAdminDocument
public boolean isAuthorizedAdminDocument(int nIdSpace, String strDocumentTypeId, fr.paris.lutece.portal.business.user.AdminUser user) Checks 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- Parameters:
nIdSpace- The document space identifierstrDocumentTypeId- The identifier of the type document being considereduser- The user trying to access the resource- Returns:
- True if the user can access the given resource with the given permission, otherwise false
-
getMandatoryAttributes
public Collection<fr.paris.lutece.plugins.document.business.attributes.DocumentAttribute> getMandatoryAttributes(String strDocumentTypeCode) Gets mandatory attributes for the document type- Parameters:
strDocumentTypeCode- The document type code- Returns:
- A collection of mandatory attributes
-
getMandatoryAttributeFileImage
public fr.paris.lutece.plugins.document.business.attributes.DocumentAttribute getMandatoryAttributeFileImage(String strDocumentTypeCode) Get the mandatory attribute file/image from a given document type- Parameters:
strDocumentTypeCode- the document type code- Returns:
- the mandatory attribute file/image
-
getAttributeTypeParameterList
public Collection<fr.paris.lutece.plugins.document.business.attributes.AttributeTypeParameter> getAttributeTypeParameterList(String strAttributeTypeCode, Locale locale) Gets attribute type parameters list- Parameters:
strAttributeTypeCode- The attribute type codelocale- The current locale- Returns:
- A collection of attribute type parameters
-
getAttributeParametersValues
public Collection<fr.paris.lutece.plugins.document.business.attributes.AttributeTypeParameter> getAttributeParametersValues(int nAttributeId, Locale locale) Gets parameters values- Parameters:
nAttributeId- The attribute identifierlocale- The current locale- Returns:
- A collection of attribute type parameters
-
createDocument
public String createDocument(fr.paris.lutece.plugins.document.business.Document document, fr.paris.lutece.portal.business.user.AdminUser user) Creates a new document- Parameters:
document- The documentuser- The user doing the action- Returns:
- null if document is created, otherwise the error message
-
getDocumentById
public fr.paris.lutece.plugins.document.business.Document getDocumentById(int nKey) Returns an instance of a document whose identifier is specified in parameter- Parameters:
nKey- The primary key of the document- Returns:
- An instance of document
-
getDocumentTypeByCode
Returns an instance of a documentType whose identifier is specified in parameter- Parameters:
strCode- The document type code (primary key)- Returns:
- An instance of documentType
-
getDocumentAttributeById
public fr.paris.lutece.plugins.document.business.attributes.DocumentAttribute getDocumentAttributeById(int nKey) Returns an instance of a documentAttribute whose identifier is specified in parameter- Parameters:
nKey- The primary key of the documentAttribute- Returns:
- An instance of documentAttribute
-
getListRegularExpressionKeyByIdAttribute
Gets all regular expression key associated to the attribute- Parameters:
nIdAttribute- The identifier of the document attribute- Returns:
- A collection of regular expression key
-
getAllAttributes
public List<Attribute> getAllAttributes(String strDocumentTypeCode, int nIdMapping, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the collection of all document attributes that are mandatory or type file/image.
This method will also get the attributes even if they are not stored in the db.
The format of the attribute will be formatted in HTML.- Parameters:
strDocumentTypeCode- the document type codenIdMapping- the id mappingplugin- the plugin- Returns:
- the collection of attributes
-
isDocumentAttributeFile
public boolean isDocumentAttributeFile(fr.paris.lutece.plugins.document.business.attributes.DocumentAttribute attribute) Check if the given document attribute is an attribute type file- Parameters:
attribute- then attribute- Returns:
- true if it is an attribute type file, false otherwise
-
isDocumentAttributeImage
public boolean isDocumentAttributeImage(fr.paris.lutece.plugins.document.business.attributes.DocumentAttribute attribute) Check if the given document attribute is an attribute type image- Parameters:
attribute- then attribute- Returns:
- true if it is an attribute type image, false otherwise
-