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.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 I18nUtils
The I18N utilsFields 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 TypeMethodDescription_getChildrenContent
(Content parentContent, TreeConfiguration treeConfiguration, String catalog, String lang) Get the children contents according the tree configurationprotected CostComputationData
Get the cost data from user sessionprotected void
_launchCostComputation
(Content content, String catalog, String lang, OverriddenData overriddenData) Launch the cost computation component algorithmprotected void
_setCostData
(CostComputationData costData) Set the cost data to user sessioncontent2Json
(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 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 informationsrefresh
(Map<String, String> contentsToRefresh, String contentId, String catalog, String lang, Map<String, Map<String, String>> overriddenData) Launch the cost computation component algorithm with overridden data by the userSave overridden data to the contentsvoid
service
(ServiceManager smanager) Methods inherited from class org.ametys.plugins.odfpilotage.helper.ODFContentsTreeHelper
content2Json
Methods inherited from class org.ametys.odf.tree.ODFContentsTreeHelper
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 -
_i18nUtils
The I18N utils -
_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
-
_launchCostComputation
protected void _launchCostComputation(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
protected 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
-
refresh
public Map<String,Map<String, refreshObject>> (Map<String, String> contentsToRefresh, String contentId, String catalog, String lang, Map<String, Map<String, String>> overriddenData) 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 langoverriddenData
- 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
Save overridden data to the contents- Parameters:
overriddenData
- overridden data by the user- Returns:
- true if the saving is successful
-