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
-
Field Summary
-
Constructor Summary
-
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 itemsboolean
isPartOfEducationalPath
(String... programItemIds) Determines if program items is part of a same educational path valueboolean
isPartOfEducationalPath
(ProgramItem... programItems) Determines if program items is part of a same educational path valuevoid
removeAllRepeatersWithEducationalPath
(ProgramItem programItem) Remove all repeaters with a educational path in their modelvoid
removeEducationalPathReferences
(int workflowActionId, String... programItemIds) Remove all repeater entries with a educational path that reference the given program itemsvoid
removeEducationalPathReferences
(List<String> programItemIds) Remove all repeater entries with a educational path that reference the given program itemsvoid
removeEducationalPathReferences
(ProgramItem... programItems) Remove all repeater entries with a educational path that reference the given program itemsvoid
service
(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:
service
in 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
-