Class SetContentAttributeClientSideElement

All Implemented Interfaces:
ClientSideElement, ClientSideRelation, LogEnabled, PluginAware, Component, Configurable, Serviceable

Set the attribute of type 'content' of a content, with another content. If content is a ProgramItem, additional check will be done on catalog and content language
  • Field Details

  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager manager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Overrides:
      service in class SetContentAttributeClientSideElement
      Throws:
      ServiceException
    • setContentAttribute

      public Map<String,Object> setContentAttribute(List<String> contentIdsToReference, Map<String,Integer> contentIdsToEdit, List<Map<String,String>> contentsToEditToRemove, String attributePath, List<String> workflowActionIds, Map<String,Object> additionalParams)
      Description copied from class: SetContentAttributeClientSideElement
      Set the attribute at path 'attributePath' of contents 'contentIdsToEdit' with value 'contentIdsToReference'
      Overrides:
      setContentAttribute in class SetContentAttributeClientSideElement
      Parameters:
      contentIdsToReference - The list of content identifiers that will be added as values in the content field
      contentIdsToEdit - The map {key: content identifiers to edit and that will have an attribute of type content modified; value: the new position if attribute is multiple and it is a reorder of values. May be null or equals to -1 if it is not a reorder}
      contentsToEditToRemove - The list of content to edit to remove currently referenced content. Keys are "contentId" and "valueToRemove"
      attributePath - The attribute path selected to do modification in the contents to edit
      workflowActionIds - The identifiers of workflow actions to use to edit the attribute. Actions will be tested in this order and first available action will be used
      additionalParams - the map of additional parameters
      Returns:
      A map with key success: true or false. if false, it can be due to errors (list of error messages)
    • _notifyObserverIfHierarchyChanged

      protected void _notifyObserverIfHierarchyChanged(List<String> contentIdsToReference, Map<String,Integer> contentIdsToEdit, List<Map<String,String>> contentsToEditToRemove, List<String> contentsInError)
      Notify observers if the hierarchy of program item has been changed
      Parameters:
      contentIdsToReference - The list of content identifiers that will be added as values in the content field
      contentIdsToEdit - The map {key: content identifiers to edit and that will have an attribute of type content modified; value: the new position if attribute is multiple and it is a reorder of values. May be null or equals to -1 if it is not a reorder}
      contentsToEditToRemove - The list of content to edit to remove currently referenced content. Keys are "contentId" and "valueToRemove"
      contentsInError - the ids of contents in error
    • getEducationalPathReferences

      public Map<String,Object> getEducationalPathReferences(List<String> contentIdsToReference, List<Map<String,String>> contentsToEditToRemove)
      Get the educational paths that reference the program items to removed
      Parameters:
      contentIdsToReference - The list of content identifiers that will be added as values in the content field
      contentsToEditToRemove - The list of content to edit to remove currently referenced content. Keys are "contentId" and "valueToRemove"
      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
    • _filterContentsToEdit

      protected Map<WorkflowAwareContent,Integer> _filterContentsToEdit(Map<WorkflowAwareContent,Integer> contentsToEdit, List<String> contentIdsToReference, List<I18nizableText> errorMessages, List<String> errorIds, Map<String,Object> additionalParams)
      Description copied from class: SetContentAttributeClientSideElement
      Filter the list of contents to edit
      Overrides:
      _filterContentsToEdit in class SetContentAttributeClientSideElement
      Parameters:
      contentsToEdit - the map of contents to edit
      contentIdsToReference - The list of content ids that will be added as values in the content field
      errorMessages - the error messages
      errorIds - the error content ids
      additionalParams - the map of additional parameters
      Returns:
      the list of filtered contents