Class SqlStatementGeneratorUtils
- java.lang.Object
-
- org.craftercms.studio.api.v2.utils.SqlStatementGeneratorUtils
-
public final class SqlStatementGeneratorUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEPENDENCIES_DELETE
static String
DEPENDENCIES_DELETE_SOURCE
static String
DEPENDENCIES_INSERT
static String
GITLOG_INSERT_IGNORE
static String
ITEM_DELETE
static String
ITEM_INSERT
static String
ITEM_MOVE
static String
ITEM_UPDATE
static String
ITEM_UPDATE_PARENT_ID
static String
ITEM_UPDATE_PARENT_ID_SIMPLE
static String
UPDATE_DELETED_PAGE_CHILDREN
static String
UPDATE_NEW_PAGE_CHILDREN
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
deleteDependencyRows(String siteId, String sourcePath)
static String
deleteDependencySourcePathRows(String siteId, String sourcePath)
static String
deleteItemRow(Long siteId, String path)
static String
insertDependencyRow(String siteId, String sourcePath, String targetPath, String type)
static String
insertGitLogRow(String siteId, String commitId, boolean processed, boolean audited)
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)
static String
moveItemRow(String site, String oldPath, String newPath, long onStatesBitMap, long offStatesBitMap)
static String
updateDeletedPageChildren(long siteId, String folderPath)
Generates the sql statements to update a deleted page children.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)
static String
updateNewPageChildren(long siteId, String path)
Generates the sql statements to update a new page children.static String
updateParentId(long siteId, String itemPath, String parentPath)
static String
updateParentIdSimple(long parentId, long itemId)
-
-
-
Field Detail
-
ITEM_INSERT
public static final String ITEM_INSERT
- See Also:
- Constant Field Values
-
ITEM_UPDATE
public static final String ITEM_UPDATE
- See Also:
- Constant Field Values
-
ITEM_DELETE
public static final String ITEM_DELETE
- See Also:
- Constant Field Values
-
ITEM_MOVE
public static final String ITEM_MOVE
- See Also:
- Constant Field Values
-
ITEM_UPDATE_PARENT_ID
public static final String ITEM_UPDATE_PARENT_ID
- See Also:
- Constant Field Values
-
UPDATE_NEW_PAGE_CHILDREN
public static final String UPDATE_NEW_PAGE_CHILDREN
- See Also:
- Constant Field Values
-
UPDATE_DELETED_PAGE_CHILDREN
public static final String UPDATE_DELETED_PAGE_CHILDREN
- See Also:
- Constant Field Values
-
ITEM_UPDATE_PARENT_ID_SIMPLE
public static final String ITEM_UPDATE_PARENT_ID_SIMPLE
- See Also:
- Constant Field Values
-
DEPENDENCIES_INSERT
public static final String DEPENDENCIES_INSERT
- See Also:
- Constant Field Values
-
DEPENDENCIES_DELETE_SOURCE
public static final String DEPENDENCIES_DELETE_SOURCE
- See Also:
- Constant Field Values
-
DEPENDENCIES_DELETE
public static final String DEPENDENCIES_DELETE
- See Also:
- Constant Field Values
-
GITLOG_INSERT_IGNORE
public static final String GITLOG_INSERT_IGNORE
- See Also:
- Constant Field Values
-
-
Method Detail
-
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)
-
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 idpath
- 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 idfolderPath
- 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)
-
-