Package com.day.cq.dam.commons.util
Class SchemaFormHelper
- java.lang.Object
-
- com.day.cq.dam.commons.util.SchemaFormHelper
-
public class SchemaFormHelper extends java.lang.Objectthis is an internal class to be used by dam code.
-
-
Constructor Summary
Constructors Constructor Description SchemaFormHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.lang.String[]getBaseFormPaths(ResourceResolver resourceResolver)static java.util.List<Resource>getMasterForms(Resource currentForm)Deprecated.Use getPrimaryForms(Resource resource) insteadstatic java.util.List<Resource>getMasterForms(Resource currentForm, java.lang.String formsBaseDirPath)Deprecated.Use getMasterForms(Resource resource) insteadstatic java.util.List<Resource>getPrimaryForms(Resource currentForm)Given current form, returns a list of primary.static java.util.IteratorgetSchemaFormsIterator(ResourceResolver resolver, java.lang.String suffix, int rows, int offset)static java.util.IteratorgetSchemaFormsIterator(SlingHttpServletRequest request, int rows, int offset)static ResourcegetSchemaResource(SlingHttpServletRequest request)static ResourcemergeFormTabResource(Resource oneTabList, Resource otherTabList)Merge two list of tabs i.e.
-
-
-
Method Detail
-
getMasterForms
@Deprecated public static java.util.List<Resource> getMasterForms(Resource currentForm, java.lang.String formsBaseDirPath) throws RepositoryException
Deprecated.Use getMasterForms(Resource resource) insteadGiven current form, returns a list of master. Looks for master forms up in the path heirarchy, while traversing it takes into account any override available in apps- Parameters:
currentForm- current form resource- Returns:
- list of master form resource, empty list if no master is found
- Throws:
RepositoryException
-
getBaseFormPaths
public static java.lang.String[] getBaseFormPaths(ResourceResolver resourceResolver)
- Returns:
- Metadata Schema provides a OOTB form. And User can overlay this form as per use case. It returns list of form path homes (Overlay, OOTB) in the order. e.g. [/conf/metdataschema, /libs/metadataschema]
-
getMasterForms
public static java.util.List<Resource> getMasterForms(Resource currentForm) throws RepositoryException
Deprecated.Use getPrimaryForms(Resource resource) insteadGiven current form, returns a list of master. Looks for master forms up in the path heirarchy, while traversing it takes into account any override available in apps- Parameters:
currentForm- current form resource- Returns:
- list of master form resource, empty list if no master is found
- Throws:
RepositoryExceptionjava.lang.NullPointerException
-
getPrimaryForms
public static java.util.List<Resource> getPrimaryForms(Resource currentForm) throws RepositoryException
Given current form, returns a list of primary. Looks for primary forms up in the path heirarchy, while traversing it takes into account any override available in apps- Parameters:
currentForm- current form resource- Returns:
- list of primary form resource, empty list if no primary is found
- Throws:
RepositoryExceptionjava.lang.NullPointerException
-
mergeFormTabResource
public static Resource mergeFormTabResource(Resource oneTabList, Resource otherTabList)
Merge two list of tabs i.e. form/items/tabs- Parameters:
oneTabList- resource representing one tab listotherTabList- resource representing other tab list- Returns:
- merged tab list resource
-
getSchemaResource
public static Resource getSchemaResource(SlingHttpServletRequest request)
-
getSchemaFormsIterator
public static java.util.Iterator getSchemaFormsIterator(SlingHttpServletRequest request, int rows, int offset)
-
getSchemaFormsIterator
public static java.util.Iterator getSchemaFormsIterator(ResourceResolver resolver, java.lang.String suffix, int rows, int offset)
-
-