Class SqlStatementGeneratorUtils

java.lang.Object
org.craftercms.studio.api.v2.utils.SqlStatementGeneratorUtils

public final class SqlStatementGeneratorUtils extends Object
  • Field Details

  • Method Details

    • insertItemRow

      public static String insertItemRow(long siteId, String path, String previewUrl, long state, Long lockedBy, Long createdBy, ZonedDateTime createdOn, Long lastModifiedBy, ZonedDateTime lastModifiedOn, ZonedDateTime lastPublishedOn, String label, String contentTypeId, String systemType, String mimeType, String localeCode, Long translationSourceId, Long size, Long parentId, String commitId, String previousPath)
    • updateItemRow

      public static String updateItemRow(long siteId, String path, String previewUrl, long onStatesBitMap, long offStatesBitMap, Long lastModifiedBy, ZonedDateTime lastModifiedOn, String label, String contentTypeId, String systemType, String mimeType, Long size, String commitId)
    • deleteItemRow

      public static String deleteItemRow(Long siteId, String path)
    • moveItemRow

      public static String moveItemRow(String site, String oldPath, String newPath, long onStatesBitMap, long offStatesBitMap)
    • updateParentId

      public static String updateParentId(long siteId, String itemPath, String parentPath)
    • updateNewPageChildren

      public static String updateNewPageChildren(long siteId, String path)
      Generates the sql statements to update a new page children. This should be called when a new page (index.xml) is created in an already existing folder
      Parameters:
      siteId - the site id
      path - the page to the content (including index.xml)
      Returns:
      the sql statement
    • updateDeletedPageChildren

      public static String updateDeletedPageChildren(long siteId, String folderPath)
      Generates the sql statements to update a deleted page children. This should be called when a page (index.xml) is deleted via git but its children still exists
      Parameters:
      siteId - the site id
      folderPath - the folder path to the deleted page
      Returns:
      the sql statement
    • updateParentIdSimple

      public static String updateParentIdSimple(long parentId, long itemId)
    • insertDependencyRow

      public static String insertDependencyRow(String siteId, String sourcePath, String targetPath, String type)
    • deleteDependencySourcePathRows

      public static String deleteDependencySourcePathRows(String siteId, String sourcePath)
    • deleteDependencyRows

      public static String deleteDependencyRows(String siteId, String sourcePath)
    • insertGitLogRow

      public static String insertGitLogRow(String siteId, String commitId, boolean processed, boolean audited)