Class SqlStatementGeneratorUtils
java.lang.Object
org.craftercms.studio.api.v2.utils.SqlStatementGeneratorUtils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic 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, boolean valid) 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, String previousPath) static String
invalidateDependencies
(String siteId, String targetPath) Generate the necessary sql statements to invalidate dependencies for a given target pathstatic 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) static String
updateNewPageChildren
(long siteId, String path) Generates the sql statements to update a new page children.static String
validateDependencies
(String siteId, String targetPath) Generate the necessary sql statements to validate dependencies for a given target path
-
Field Details
-
ITEM_INSERT
- See Also:
-
ITEM_UPDATE
- See Also:
-
ITEM_DELETE
- See Also:
-
ITEM_MOVE
- See Also:
-
UPDATE_NEW_PAGE_CHILDREN
- See Also:
-
UPDATE_DELETED_PAGE_CHILDREN
- See Also:
-
DEPENDENCIES_INSERT
- See Also:
-
DEPENDENCIES_DELETE_SOURCE
- See Also:
-
DEPENDENCIES_DELETE
- See Also:
-
-
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, String previousPath) -
updateItemRow
-
deleteItemRow
-
moveItemRow
-
updateNewPageChildren
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
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
-
insertDependencyRow
-
deleteDependencySourcePathRows
-
deleteDependencyRows
-
invalidateDependencies
Generate the necessary sql statements to invalidate dependencies for a given target path- Parameters:
siteId
- the site idtargetPath
- the target path of the dependency records to mark as invalid- Returns:
- the sql statement
-
validateDependencies
Generate the necessary sql statements to validate dependencies for a given target path- Parameters:
siteId
- the site idtargetPath
- the target path of the dependency records to mark as valid- Returns:
- the sql statement
-