Class CostComputationTreeHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.contentstree.ContentsTreeHelper
org.ametys.odf.tree.ODFContentsTreeHelper
org.ametys.plugins.odfpilotage.helper.CostComputationTreeHelper
- All Implemented Interfaces:
LogEnabled
,Component
,Contextualizable
,Serviceable
This component handle the content of the cost modeling tool
-
Field Summary
Modifier and TypeFieldDescriptionprotected ContentWorkflowHelper
Workflow helper componentprotected Context
The contextprotected CostComputationComponent
The cost computation componentprotected CurrentUserProvider
The current user providerprotected OdfReferenceTableHelper
The ODF enumeration helperFields inherited from class org.ametys.odf.tree.ODFContentsTreeHelper
_odfHelper, _shareableCourseHelper, _shareableStatusHelper, _workflowProvider, ROLE
Fields inherited from class org.ametys.plugins.contentstree.ContentsTreeHelper
_ametysResolver, _contentTypesEP, _contentTypesHelper, _treeExtensionPoint
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
_addEffectif
(Map<String, Object> json, Content content, String contentPath, CostComputationData costData) Retrieve the effective and add it to the JSON structureprotected void
_addEqTD
(Map<String, Object> json, Content content, String contentPath, CostComputationData costData) Retrieve the TD equivalent value and add it to the JSON structureprotected void
Retrieve the number of groups and add it to the JSON structureprotected void
_addNorm
(Map<String, Object> json, NormDetails normDetails) Add norm informationsprotected void
_addRapportHE
(Map<String, Object> json, Content content, String contentPath, CostComputationData costData) Compute the H/E report and add it to the JSON structureprotected void
_addVolumeHoraire
(Map<String, Object> json, Content content, CostComputationData costData) Retrieve hourly volume of a content and add it to the JSON structureprotected CostComputationData
Get the cost data from user sessionprotected void
_handleContainer
(Content content, Map<String, Object> json, String contentPath, CostComputationData costData) Fill data in JSON describing the year containerprotected void
_handleCoursePart
(Content content, Map<String, Object> json, String contentPath, CostComputationData costData) Handle coursePart informationsprotected void
_handleODFElement
(Content content, Map<String, Object> json, String contentPath, CostComputationData costData) Fill data in JSON describing an ODF Elementprotected void
_handleOrgUnit
(Content content, Map<String, Object> json, String contentPath, CostComputationData costData) Handle orgUnit informationsprotected void
_handleProgram
(Content content, Map<String, Object> json, String contentPath, CostComputationData costData) Handle program informationsprotected void
_handleSubProgram
(Content content, Map<String, Object> json, String contentPath, CostComputationData costData) Handle sub program informationscontent2Json
(Content content, String contentPath) Get the default JSON representation of a content of the treevoid
contextualize
(Context context) getChildrenContent
(String contentId, String treeId, String contentPath, String catalog, String lang) Get the children contents according the tree configurationgetChildrenContent
(Content parentContent, TreeConfiguration treeConfiguration, String catalog, String lang) Get the children contents according the tree configurationgetNodeInformations
(String contentId, String catalog, String lang, Map<String, Map<String, String>> overriddenData) Get the node informationsRetrieve old data to compare with the new computed onegetRootNodeInformations
(String contentId, String catalog, String lang, Map<String, Map<String, String>> overriddenData) Get the root node informationsvoid
launchProgram
(Content content, String catalog, String lang, OverriddenData overriddenData) Launch the cost computation component algorithmrefresh
(Map<String, String> contentsToRefresh, String contentId, String catalog, String lang, Map<String, Map<String, String>> overridenData) Launch the cost computation component algorithm with overridden data by the userSave overridden data to the contentsvoid
service
(ServiceManager smanager) protected void
setCostData
(CostComputationData costData) Set the cost data to user sessionMethods inherited from class org.ametys.odf.tree.ODFContentsTreeHelper
content2Json, getProgramItemDisplayCode, getRootNodeInformations, getShareableStatus, getWorkflowStep, isContentMatching, isShared, isSharedByParents
Methods inherited from class org.ametys.plugins.contentstree.ContentsTreeHelper
_getParentContent, _getTreeConfiguration, childContent2Json, filterChildrenContentByRegExp, getChildrenContent, getChildrenContent, getNodeInformations, hasChildrenContent
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_costComputationComponent
The cost computation component -
_contentWorkflowHelper
Workflow helper component -
_refTableHelper
The ODF enumeration helper -
_currentUserProvider
The current user provider -
_context
The context
-
-
Constructor Details
-
CostComputationTreeHelper
public CostComputationTreeHelper()
-
-
Method Details
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classODFContentsTreeHelper
- Throws:
ServiceException
-
_getCostData
Get the cost data from user session- Returns:
- the cost data
-
setCostData
Set the cost data to user session- Parameters:
costData
- the cost data
-
launchProgram
public void launchProgram(Content content, String catalog, String lang, OverriddenData overriddenData) Launch the cost computation component algorithm- Parameters:
content
- the content to computecatalog
- the cataloglang
- the langoverriddenData
- overridden data by the user
-
getChildrenContent
public Map<String,List<Content>> getChildrenContent(Content parentContent, TreeConfiguration treeConfiguration, String catalog, String lang) Get the children contents according the tree configuration- Parameters:
parentContent
- the root contenttreeConfiguration
- the tree configurationcatalog
- the cataloglang
- the lang- Returns:
- the children content for each child attributes
-
getChildrenContent
public Map<String,Object> getChildrenContent(String contentId, String treeId, String contentPath, String catalog, String lang) Get the children contents according the tree configuration- Parameters:
contentId
- the parent contenttreeId
- the tree configurationcontentPath
- the content pathcatalog
- the cataloglang
- the lang- Returns:
- the children content
-
getRootNodeInformations
public Map<String,Object> getRootNodeInformations(String contentId, String catalog, String lang, Map<String, Map<String, String>> overriddenData) Get the root node informations- Parameters:
contentId
- The contentcatalog
- the cataloglang
- the langoverriddenData
- overridden data by the user- Returns:
- The informations
-
getNodeInformations
public Map<String,Object> getNodeInformations(String contentId, String catalog, String lang, Map<String, Map<String, String>> overriddenData) Get the node informations- Parameters:
contentId
- The contentcatalog
- the cataloglang
- the langoverriddenData
- Overridden data by the user- Returns:
- The informations
-
content2Json
Get the default JSON representation of a content of the tree- Parameters:
content
- the contentcontentPath
- the content path- Returns:
- the content as JSON
-
_addVolumeHoraire
protected void _addVolumeHoraire(Map<String, Object> json, Content content, CostComputationData costData) Retrieve hourly volume of a content and add it to the JSON structure- Parameters:
json
- the structurecontent
- the contentcostData
- the cost data
-
_addGroupe
Retrieve the number of groups and add it to the JSON structure- Parameters:
json
- the JSON structuregroupeAOuvrir
- groups to opengroupeCalcule
- calculated groups
-
_addEffectif
protected void _addEffectif(Map<String, Object> json, Content content, String contentPath, CostComputationData costData) Retrieve the effective and add it to the JSON structure- Parameters:
json
- the JSON structurecontent
- the contentcontentPath
- the content pathcostData
- the cost data
-
_addEqTD
protected void _addEqTD(Map<String, Object> json, Content content, String contentPath, CostComputationData costData) Retrieve the TD equivalent value and add it to the JSON structure- Parameters:
json
- the JSON structurecontent
- the contentcontentPath
- the content pathcostData
- the cost data
-
_addRapportHE
protected void _addRapportHE(Map<String, Object> json, Content content, String contentPath, CostComputationData costData) Compute the H/E report and add it to the JSON structure- Parameters:
json
- the JSON structurecontent
- the contentcontentPath
- the content pathcostData
- the cost data
-
_handleCoursePart
protected void _handleCoursePart(Content content, Map<String, Object> json, String contentPath, CostComputationData costData) Handle coursePart informations- Parameters:
content
- the contentjson
- the JSON structurecontentPath
- the content pathcostData
- the cost data
-
_addNorm
Add norm informations- Parameters:
json
- the JSON structurenormDetails
- the norm details
-
_handleSubProgram
protected void _handleSubProgram(Content content, Map<String, Object> json, String contentPath, CostComputationData costData) Handle sub program informations- Parameters:
content
- the contentjson
- the JSON structurecontentPath
- the current pathcostData
- the cost data
-
_handleProgram
protected void _handleProgram(Content content, Map<String, Object> json, String contentPath, CostComputationData costData) Handle program informations- Parameters:
content
- the contentjson
- the JSON structurecontentPath
- the current pathcostData
- the cost data
-
_handleOrgUnit
protected void _handleOrgUnit(Content content, Map<String, Object> json, String contentPath, CostComputationData costData) Handle orgUnit informations- Parameters:
content
- the contentjson
- the JSON structurecontentPath
- the current pathcostData
- the cost data
-
_handleContainer
protected void _handleContainer(Content content, Map<String, Object> json, String contentPath, CostComputationData costData) Fill data in JSON describing the year container- Parameters:
content
- the year containerjson
- the structurecontentPath
- the content pathcostData
- the cost data
-
_handleODFElement
protected void _handleODFElement(Content content, Map<String, Object> json, String contentPath, CostComputationData costData) Fill data in JSON describing an ODF Element- Parameters:
content
- the year containerjson
- the structurecontentPath
- the content pathcostData
- the cost data
-
refresh
public Map<String,Map<String, refreshObject>> (Map<String, String> contentsToRefresh, String contentId, String catalog, String lang, Map<String, Map<String, String>> overridenData) Launch the cost computation component algorithm with overridden data by the user- Parameters:
contentsToRefresh
- all open contents in the tool to refreshcontentId
- the root nodecatalog
- the cataloglang
- the langoverridenData
- overridden data by the user- Returns:
- new values associated with their path
-
getOldData
Retrieve old data to compare with the new computed one- Returns:
- all old data to compare
-
saveOverriddenData
public Boolean saveOverriddenData(Map<String, Map<String, throws AmetysRepositoryException, com.opensymphony.workflow.WorkflowExceptionString>> overriddenData) Save overridden data to the contents- Parameters:
overriddenData
- overridden data by the user- Returns:
- true if the saving is successful
- Throws:
com.opensymphony.workflow.WorkflowException
- if an error occurredAmetysRepositoryException
- if an error occurred
-