Class BeCPGJSONConversionComponent

java.lang.Object
org.alfresco.repo.jscript.app.JSONConversionComponent
fr.becpg.repo.jscript.app.BeCPGJSONConversionComponent

public class BeCPGJSONConversionComponent extends org.alfresco.repo.jscript.app.JSONConversionComponent

BeCPGJSONConversionComponent class.

Version:
$Id: $Id
Author:
matthieu
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final Map<org.alfresco.service.namespace.QName,AssociationDecorator>
    Registered decorators
     
    private static final String
     
    private static final String
     
    private static final String
    Constant CREATE_CHILDREN="CreateChildren"
    private static final org.apache.commons.logging.Log
    Constant logger
    private static final String
    Constant REPORT_DOWNLOAD_API_URL="becpg/report/node/{0}/{1}/{2}/content/{"{trunked}
     

    Fields inherited from class org.alfresco.repo.jscript.app.JSONConversionComponent

    contentService, fileFolderService, lockService, mimetypeService, namespacePrefixCache, namespaceService, nodeService, permissionService, propertyDecorators, publicServiceAccessService, userPermissions
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.json.simple.JSONObject
    associationsToJSON(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean useShortQNames)
    associationsToJSON.
    (package private) static String
    buildContentURL(String urlPattern, org.alfresco.service.cmr.model.FileInfo nodeInfo)
    Builds a content URL from a pattern whose placeholders are the store protocol, the store identifier, the node id and the encoded file name.
    private String
    qnameToString(org.alfresco.service.namespace.QName qname, boolean isShortName)
    Convert a qname to a string - either full or short prefixed named.
    void
    Register a property decorator;
    void
    Setter for the field associationService.
    protected void
    setRootValues(org.alfresco.service.cmr.model.FileInfo nodeInfo, org.json.simple.JSONObject rootJSONObject, boolean useShortQNames)
    Rebuilds the content URL so that file names outside the BMP (emojis) are encoded as valid UTF-8.
    void
    Setter for the field securityService.
    toJSON(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean useShortQNames)
    Convert a node reference to a JSON string.
    protected org.json.simple.JSONObject
    userPermissionsToJSON(org.alfresco.service.cmr.repository.NodeRef nodeRef)

    Methods inherited from class org.alfresco.repo.jscript.app.JSONConversionComponent

    allSetPermissionsToJSON, apsectsToJSON, permissionsToJSON, propertiesToJSON, propertyToJSON, registerPropertyDecorator, setContentService, setFileFolderService, setLockService, setMimetypeService, setNamespaceService, setNodeService, setPermissionService, setPublicServiceAccessService, setUserPermissions, toJSONObject

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CREATE_CHILDREN

      private static final String CREATE_CHILDREN
      Constant CREATE_CHILDREN="CreateChildren"
      See Also:
    • associationService

      private AssociationService associationService
    • securityService

      private SecurityService securityService
    • REPORT_DOWNLOAD_API_URL

      private static final String REPORT_DOWNLOAD_API_URL
      Constant REPORT_DOWNLOAD_API_URL="becpg/report/node/{0}/{1}/{2}/content/{"{trunked}
      See Also:
    • CONTENT_DOWNLOAD_API_URL

      private static final String CONTENT_DOWNLOAD_API_URL
      See Also:
    • CONTENT_URL

      private static final String CONTENT_URL
      See Also:
    • logger

      private static final org.apache.commons.logging.Log logger
      Constant logger
    • associationDecorators

      protected final Map<org.alfresco.service.namespace.QName,AssociationDecorator> associationDecorators
      Registered decorators
  • Constructor Details

    • BeCPGJSONConversionComponent

      public BeCPGJSONConversionComponent()
  • Method Details

    • setSecurityService

      public void setSecurityService(SecurityService securityService)

      Setter for the field securityService.

      Parameters:
      securityService - a SecurityService object.
    • setAssociationService

      public void setAssociationService(AssociationService associationService)

      Setter for the field associationService.

      Parameters:
      associationService - a AssociationService object.
    • registerAssociationDecorator

      public void registerAssociationDecorator(AssociationDecorator associationDecorator)
      Register a property decorator;
      Parameters:
      associationDecorator - a AssociationDecorator object.
    • toJSON

      public String toJSON(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean useShortQNames)
      Convert a node reference to a JSON string. Selects the correct converter based on selection implementation.
      Overrides:
      toJSON in class org.alfresco.repo.jscript.app.JSONConversionComponent
    • setRootValues

      protected void setRootValues(org.alfresco.service.cmr.model.FileInfo nodeInfo, org.json.simple.JSONObject rootJSONObject, boolean useShortQNames)
      Rebuilds the content URL so that file names outside the BMP (emojis) are encoded as valid UTF-8.
      Overrides:
      setRootValues in class org.alfresco.repo.jscript.app.JSONConversionComponent
    • buildContentURL

      static String buildContentURL(String urlPattern, org.alfresco.service.cmr.model.FileInfo nodeInfo)
      Builds a content URL from a pattern whose placeholders are the store protocol, the store identifier, the node id and the encoded file name.
      Parameters:
      urlPattern - the URL pattern
      nodeInfo - the node to build the URL for
      Returns:
      the content URL
    • associationsToJSON

      protected org.json.simple.JSONObject associationsToJSON(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean useShortQNames)

      associationsToJSON.

      Parameters:
      nodeRef - a NodeRef object.
      useShortQNames - a boolean.
      Returns:
      a JSONObject object.
    • qnameToString

      private String qnameToString(org.alfresco.service.namespace.QName qname, boolean isShortName)
      Convert a qname to a string - either full or short prefixed named.
      Parameters:
      qname - a QName object
      isShortName - a boolean
      Returns:
      a String object
    • userPermissionsToJSON

      protected org.json.simple.JSONObject userPermissionsToJSON(org.alfresco.service.cmr.repository.NodeRef nodeRef)
      Overrides:
      userPermissionsToJSON in class org.alfresco.repo.jscript.app.JSONConversionComponent