Class PegaseHelper
java.lang.Object
org.ametys.plugins.odfsync.pegase.ws.PegaseHelper
- All Implemented Interfaces:
Initializable
,Component
,Serviceable
Helper for import and export from Ametys to Pégase.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription_getPegaseCodeOrCode
(Content content) Get the Pégase code of a content, defaults to the Ametys codegetEspaceId
(String structureCode) Retrieves the Id of the Pégase working space with the configured codegetEspaceIdByCode
(String structureCode, String code) Get the Id of an espace by its Pégase codeGet the espace Ids by Pégase codegetPegaseCodeForField
(Content content, String dataPath) Get the Pégase codes of the values of a content's field, defaults to the Ametys codegetPegaseCodeForFirstValue
(Content content, String dataPath) Get the Pégase code of the first value of a content's field, defaults to the Ametys codevoid
void
service
(ServiceManager manager)
-
Field Details
-
ROLE
Role
-
-
Constructor Details
-
PegaseHelper
public PegaseHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
getEspaceId
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 structurecode
- The code of the espace- Returns:
- The UUID of the espace
- Throws:
fr.pcscol.pegase.odf.ApiException
- If an error occursIOException
- 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
Get the Pégase codes of the values of a content's field, defaults to the Ametys code- Parameters:
content
- The contentdataPath
- The data path for the field- Returns:
- The Pégase codes for the values at given data path, joined by commas
-
getPegaseCodeForFirstValue
Get the Pégase code of the first value of a content's field, defaults to the Ametys code- Parameters:
content
- The contentdataPath
- The data path for the field- Returns:
- The Pégase code for the first value of the content's field
-