Class PegaseHelper

java.lang.Object
org.ametys.plugins.odfsync.pegase.ws.PegaseHelper
All Implemented Interfaces:
Initializable, Component, Serviceable

public class PegaseHelper extends Object implements Component, Serviceable, Initializable
Helper for import and export from Ametys to Pégase.
  • Field Details

  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager manager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Throws:
      ServiceException
    • initialize

      public void initialize() throws Exception
      Specified by:
      initialize in interface Initializable
      Throws:
      Exception
    • getEspaceId

      public UUID getEspaceId(String structureCode) throws PegaseExportException
      Retrieves the Id of the Pégase working space with the configured code
      Parameters:
      structureCode - The structure code
      Returns:
      The espace Id
      Throws:
      PegaseExportException
    • getEspaceIdsByCodes

      Get the espace Ids by Pégase code
      Returns:
      the map of espaces ids by Pégase code
    • getEspaceIdByCode

      public UUID getEspaceIdByCode(String structureCode, String code) throws fr.pcscol.pegase.odf.ApiException, IOException
      Get the Id of an espace by its Pégase code
      Parameters:
      structureCode - The code of the structure
      code - The code of the espace
      Returns:
      The UUID of the espace
      Throws:
      fr.pcscol.pegase.odf.ApiException - If an error occurs
      IOException - If an error occurs
    • _getPegaseCodeOrCode

      Get the Pégase code of a content, defaults to the Ametys code
      Parameters:
      content - The content
      Returns:
      The Pégase code
    • getPegaseCodeForField

      public String getPegaseCodeForField(Content content, String dataPath)
      Get the Pégase codes of the values of a content's field, defaults to the Ametys code
      Parameters:
      content - The content
      dataPath - The data path for the field
      Returns:
      The Pégase codes for the values at given data path, joined by commas
    • getPegaseCodeForFirstValue

      public String getPegaseCodeForFirstValue(Content content, String dataPath)
      Get the Pégase code of the first value of a content's field, defaults to the Ametys code
      Parameters:
      content - The content
      dataPath - The data path for the field
      Returns:
      The Pégase code for the first value of the content's field