@Service(value=FormsFoundationUtils.class) @Property(name="connectors.jsoninvoker",boolValue=true) @Property(name="connectors.jsoninvoker.alias",value="ff.FormsFoundationUtils") public class FormsFoundationUtils extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CM_MIXIN |
static java.lang.String |
FORM_PAGE_ROOT_PATH |
static java.lang.String |
FORM_ROOT_PATH |
static java.lang.String |
STR_NT_FOLDER |
static java.lang.String |
STR_SLING_ORDERED_FOLDER |
Constructor and Description |
---|
FormsFoundationUtils() |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,CopiedAssetInfo> |
generateCopiedAssetNames(java.lang.String[] selectedItemsPath,
java.lang.String destinationFolderPath)
Generating default name for multiple assets.
|
java.lang.String |
getAssetTitle(java.lang.String path)
This function returns the title of the given asset path.
|
FormsAssetType |
getAssetType(Node node) |
FormsAssetType |
getAssetType(java.lang.String assetId) |
java.util.List<java.lang.String> |
getChildAssetsPath(java.lang.String folderPath,
int depth,
boolean includeChildFolderPath)
This function returns list of node path of all child nodes present at folderpath.
|
java.lang.String |
getContainingAssetPagePath(Page page)
Given a page path under /content/forms/af, return the top level asset cq page
path e.g.
|
java.lang.String |
getCorrespondingShadowNodePath(java.lang.String assetPagePath)
returns corresponding shadow node path under /content/dam/formsanddocuments.
|
java.lang.String |
getCQPagePath(java.lang.String assetPath) |
Session |
getCurrentSession() |
java.lang.String[] |
getResolvedAssetTags(Node node) |
java.lang.String[] |
getResolvedAssetTags(java.lang.String assetId) |
java.lang.String |
getRootPath(java.lang.String assetPath)
This method returns the root path of given asset.
|
boolean |
nodeExists(java.lang.String assetName,
java.lang.String destinationPath)
Check whether assetName is present at destinationPath.
|
void |
propagatePropertyToShadowNode(Page page,
java.lang.String propName,
java.lang.Object propValue,
ResourceResolver resolver,
boolean commit)
Tries to set the property change specified by
propName and
propValue on shadow node i.e. |
java.lang.String[] |
resolveTags(java.lang.String[] tagNames) |
void |
updateReferences(java.lang.String sourcePath,
java.lang.String destinationPath,
java.lang.String[] referencesPath)
update source path to destination path in all references path
|
public static final java.lang.String STR_SLING_ORDERED_FOLDER
public static final java.lang.String STR_NT_FOLDER
public static final java.lang.String CM_MIXIN
public static final java.lang.String FORM_ROOT_PATH
public static final java.lang.String FORM_PAGE_ROOT_PATH
public FormsAssetType getAssetType(java.lang.String assetId) throws FormsFoundationException
FormsFoundationException
public FormsAssetType getAssetType(Node node) throws FormsFoundationException
FormsFoundationException
public java.lang.String[] getResolvedAssetTags(Node node) throws FormsFoundationException
FormsFoundationException
public java.lang.String[] getResolvedAssetTags(java.lang.String assetId) throws FormsFoundationException
FormsFoundationException
public java.lang.String[] resolveTags(java.lang.String[] tagNames) throws FormsFoundationException
FormsFoundationException
public Session getCurrentSession() throws FormsFoundationException
FormsFoundationException
public java.lang.String getAssetTitle(java.lang.String path) throws FormsFoundationException
path
- FormsFoundationException
public boolean nodeExists(java.lang.String assetName, java.lang.String destinationPath)
assetName
- destinationPath
- public java.util.Map<java.lang.String,CopiedAssetInfo> generateCopiedAssetNames(java.lang.String[] selectedItemsPath, java.lang.String destinationFolderPath) throws FormsFoundationException
selectedItemsPath
- destinationFolderPath
- FormsFoundationException
public java.util.List<java.lang.String> getChildAssetsPath(java.lang.String folderPath, int depth, boolean includeChildFolderPath) throws FormsFoundationException
folderPath
- depth
- includeFolderPath
- FormsFoundationException
public void updateReferences(java.lang.String sourcePath, java.lang.String destinationPath, java.lang.String[] referencesPath) throws FormsFoundationException
sourcePath
- destinationPath
- referencesPath
- FormsFoundationException
public java.lang.String getCQPagePath(java.lang.String assetPath)
public java.lang.String getRootPath(java.lang.String assetPath) throws FormsFoundationException
assetPath
- FormsFoundationException
public java.lang.String getCorrespondingShadowNodePath(java.lang.String assetPagePath)
assetPagePath
- public java.lang.String getContainingAssetPagePath(Page page)
page
- a page path under /content/forms/afpublic void propagatePropertyToShadowNode(Page page, java.lang.String propName, java.lang.Object propValue, ResourceResolver resolver, boolean commit) throws FormsFoundationException
propName
and
propValue
on shadow node i.e. the node under
/content/dam/formsanddocuments This method should be used to propagate
changes to any property to the shadow node e.g. when lastModifiedTime changes
under /content/forms/af/ic1/channels/web, then
/content/dam/formsanddocuments/ic1 can be notified of the same changepage
- a page in the hierarchy of a forms and documents asset
representation under /content/forms/afpropName
- e.g. jcr:lastModifiedTimepropValue
- e.g. a Calendar instanceresolver
- commit
- true if commit should be done, false otherwiseFormsFoundationException
- if commit
is true and commit failsCopyright © 2010 - 2020 Adobe. All Rights Reserved