Class CMSCategoryUpdate

java.lang.Object
io.goobi.viewer.dao.update.CMSCategoryUpdate
All Implemented Interfaces:
IModelUpdate

public class CMSCategoryUpdate extends Object implements IModelUpdate
Converts all Tags and Classifications from previous viewer-cms versions to the CMSCategory system. This includes updating references in CMSPages CMSContentItems and CMSMediaItems to keep the existing structure intact
Author:
Florian Alpers
  • Field Details

  • Constructor Details

    • CMSCategoryUpdate

      public CMSCategoryUpdate()
  • Method Details

    • update

      public boolean update(IDAO dao, CMSTemplateManager templateManager) throws DAOException, SQLException
      update.
      Specified by:
      update in interface IModelUpdate
      Parameters:
      dao - a IDAO object.
      templateManager - CMS template manager used during update
      Returns:
      true if rows were updated; false otherwise
      Throws:
      DAOException - if any.
      SQLException - if any.
    • persistData

      public void persistData(IDAO dao) throws DAOException
      persistData.
      Parameters:
      dao - DAO used to persist categories, pages, and media items
      Throws:
      DAOException - if any.
    • loadData

      public void loadData(IDAO dao) throws DAOException, SQLException
      loadData.
      Parameters:
      dao - DAO used to query all CMS entities for conversion
      Throws:
      DAOException - if any.
      SQLException - if any.
    • convertData

      public boolean convertData() throws DAOException
      convertData.
      Returns:
      true if data was converted and written to the DAO, false if no update was required
      Throws:
      DAOException - if any.
    • createCategories

      protected List<CMSCategory> createCategories(Map<String,Map<String,List<Long>>> entityMap)
      createCategories.
      Parameters:
      entityMap - map of entity types to their category-name-to-ID mappings
      Returns:
      a list of new CMSCategory instances derived from the unique category names found across all entity types