Package org.ametys.odf
Class EducationalPathHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.odf.EducationalPathHelper
- All Implemented Interfaces:
LogEnabled,Component,Serviceable
Helper for manipulating
EducationalPath-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetEducationalPathReferences(String... programItemIds) Get the educational paths that reference the given program itemsgetEducationalPathReferences(ProgramItem... programItems) Get the educational paths that reference the given program itemsgetValuesByEducationalPath(List<Map<String, Object>> repeaterValues, RepeaterDefinition repeaterDefinition) Browse a repeater entries' values to reorganize values by educational pathgetValuesByEducationalPath(Content content, RepeaterDefinition repeaterDefinition) Browse entries of a repeater with educational path to get their values by educational pathbooleanisPartOfEducationalPath(String... programItemIds) Determines if program items is part of a same educational path valuebooleanisPartOfEducationalPath(ProgramItem... programItems) Determines if program items is part of a same educational path valuebooleanisRepeaterWithEducationalPath(RepeaterDefinition repeaterDefinition) Determines if this repeater is a repeater with a educational pathvoidremoveAllRepeatersWithEducationalPath(ProgramItem programItem) Remove all repeaters with a educational path in their modelvoidremoveEducationalPathReferences(int workflowActionId, String... programItemIds) Remove all repeater entries with a educational path that reference the given program itemsvoidremoveEducationalPathReferences(List<String> programItemIds) Remove all repeater entries with a educational path that reference the given program itemsvoidremoveEducationalPathReferences(ProgramItem... programItems) Remove all repeater entries with a educational path that reference the given program itemsvoidservice(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The avalon role -
PROGRAM_ITEM_ANCESTOR_PATH_REQUEST_ATTR
Constant to get/set the ancestor path (may be partial) of a program item in request attribute -
ROOT_PROGRAM_ITEM_REQUEST_ATTR
Constant to get/set the root program item in request attribute
-
-
Constructor Details
-
EducationalPathHelper
public EducationalPathHelper()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
isPartOfEducationalPath
public boolean isPartOfEducationalPath(ProgramItem... programItems) throws javax.jcr.RepositoryException Determines if program items is part of a same educational path value- Parameters:
programItems- the program items to search into a educational path value- Returns:
- true if the program items is part of a educational path value
- Throws:
javax.jcr.RepositoryException- if failed to get educational path nodes
-
isPartOfEducationalPath
public boolean isPartOfEducationalPath(String... programItemIds) throws javax.jcr.RepositoryException Determines if program items is part of a same educational path value- Parameters:
programItemIds- the id of program items to search into a educational path value- Returns:
- true if the program items is part of a educational path value
- Throws:
javax.jcr.RepositoryException- if failed to get educational path nodes
-
getEducationalPathReferences
public Map<ProgramItem,List<EducationalPathHelper.EducationalPathReference>> getEducationalPathReferences(ProgramItem... programItems) throws javax.jcr.RepositoryException Get the educational paths that reference the given program items- Parameters:
programItems- the referenced program items to search into a educational path- Returns:
- a Map with program items referencing the given program items in a educational path attribute as key and the list of educational path references as value
- Throws:
javax.jcr.RepositoryException- if an error occurred while retrieving educational path references
-
getEducationalPathReferences
public Map<ProgramItem,List<EducationalPathHelper.EducationalPathReference>> getEducationalPathReferences(String... programItemIds) throws javax.jcr.RepositoryException Get the educational paths that reference the given program items- Parameters:
programItemIds- the id of program items to search into a educational path- Returns:
- a Map with program items referencing the given program items in a educational path attribute as key and the list of educational path references as value
- Throws:
javax.jcr.RepositoryException- if an error occurred while retrieving educational path references
-
removeEducationalPathReferences
public void removeEducationalPathReferences(ProgramItem... programItems) throws javax.jcr.RepositoryException, com.opensymphony.workflow.WorkflowException Remove all repeater entries with a educational path that reference the given program items- Parameters:
programItems- the referenced program items to search into a educational path- Throws:
javax.jcr.RepositoryException- if an error occurred while retrieving educational path referencescom.opensymphony.workflow.WorkflowException- if failed to do workflow action on modified contents
-
removeEducationalPathReferences
public void removeEducationalPathReferences(List<String> programItemIds) throws javax.jcr.RepositoryException, com.opensymphony.workflow.WorkflowException Remove all repeater entries with a educational path that reference the given program items- Parameters:
programItemIds- the id program items to search into a educational path- Throws:
javax.jcr.RepositoryException- if an error occurred while retrieving educational path referencescom.opensymphony.workflow.WorkflowException- if failed to do workflow action on modified contents
-
removeEducationalPathReferences
public void removeEducationalPathReferences(int workflowActionId, String... programItemIds) throws javax.jcr.RepositoryException, com.opensymphony.workflow.WorkflowException Remove all repeater entries with a educational path that reference the given program items- Parameters:
workflowActionId- The id of the workflow action to doprogramItemIds- the ids of program items to search into a educational path- Throws:
javax.jcr.RepositoryException- if an error occurred while retrieving educational path referencescom.opensymphony.workflow.WorkflowException- if failed to do workflow action on modified contents
-
removeAllRepeatersWithEducationalPath
public void removeAllRepeatersWithEducationalPath(ProgramItem programItem) throws com.opensymphony.workflow.WorkflowException Remove all repeaters with a educational path in their model- Parameters:
programItem- the program item- Throws:
com.opensymphony.workflow.WorkflowException- if failed to do workflow action on modified contents
-
isRepeaterWithEducationalPath
Determines if this repeater is a repeater with a educational path- Parameters:
repeaterDefinition- the repeater definition- Returns:
- true if the repeater contains data related to specific an education path
-
getValuesByEducationalPath
public Map<EducationalPath,Map<String, getValuesByEducationalPathObject>> (Content content, RepeaterDefinition repeaterDefinition) Browse entries of a repeater with educational path to get their values by educational path- Parameters:
content- The contentrepeaterDefinition- The repeater definition- Returns:
- a Map of
EducationalPathwith related values by names
-
getValuesByEducationalPath
public Map<EducationalPath,Map<String, getValuesByEducationalPathObject>> (List<Map<String, Object>> repeaterValues, RepeaterDefinition repeaterDefinition) Browse a repeater entries' values to reorganize values by educational path- Parameters:
repeaterValues- The repeater entries' valuesrepeaterDefinition- The repeater definition- Returns:
- a Map of
EducationalPathwith related values by names
-