Package org.javlo.data.taxonomy
Class TaxonomyService
- java.lang.Object
-
- org.javlo.data.taxonomy.TaxonomyService
-
public class TaxonomyService extends Object
-
-
Constructor Summary
Constructors Constructor Description TaxonomyService()
-
Method Summary
-
-
-
Field Detail
-
KEY
public static final String KEY
- See Also:
- Constant Field Values
-
SESSION_KEY
public static final String SESSION_KEY
-
ROOT_ID
public static final String ROOT_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static final TaxonomyService getInstance(ContentContext ctx)
-
getMasterInstance
public static final TaxonomyService getMasterInstance(ContentContext ctx) throws IOException
- Throws:
IOException
-
getInstance
public static final TaxonomyService getInstance(ContentContext ctx, int renderMode)
-
getRoot
public TaxonomyBean getRoot()
-
getLinkedRoot
public TaxonomyBean getLinkedRoot()
-
isActive
public boolean isActive()
-
getAllBeans
public List<TaxonomyBean> getAllBeans()
-
getAllSources
public Map<String,TaxonomyBean> getAllSources()
get all source bean, key of map is target name (start with '>')- Returns:
-
delete
public boolean delete(String id)
-
getTaxonomyBeanPathMap
public Map<String,TaxonomyBean> getTaxonomyBeanPathMap()
-
getTaxonomyDisplayBeanPathMap
public Map<String,TaxonomyDisplayBean> getTaxonomyDisplayBeanPathMap(ContentContext ctx)
-
getTaxonomyBean
public TaxonomyBean getTaxonomyBean(String id, boolean resolveLink)
-
getTaxonomyBeanMap
public Map<String,TaxonomyBean> getTaxonomyBeanMap()
-
setImage
public void setImage(ContentContext ctx, TaxonomyBean bean) throws IOException
- Throws:
IOException
-
getTaxonomyBeanMap
public Map<String,TaxonomyBean> getTaxonomyBeanMap(boolean resolveLink)
-
clearCache
public void clearCache()
-
getSelectHtml
public String getSelectHtml()
-
getSelectHtml
public String getSelectHtml(Collection<String> selection)
-
getSelectHtml
public String getSelectHtml(String name, String cssClass, Collection<String> selection)
-
isAllMatch
public boolean isAllMatch(ITaxonomyContainer container, ITaxonomyContainer filter)
-
isAllMatch
public boolean isAllMatch(ITaxonomyContainer container, ITaxonomyContainer filter, int depth)
-
isMatchWidthParent
public boolean isMatchWidthParent(ITaxonomyContainer container, ITaxonomyContainer filter)
add all parent of the selection in the list- Parameters:
container
-filter
-- Returns:
-
getDepth
public int getDepth(TaxonomyBean bean)
-
addParentsToContainer
public ITaxonomyContainer addParentsToContainer(ITaxonomyContainer container, int minDepth)
-
isMatch
public boolean isMatch(ITaxonomyContainer container, ITaxonomyContainer filter)
-
isMatch
public boolean isMatch(ITaxonomyContainer container, ITaxonomyContainer filter, int minDepth)
check if a taxonomy group match- Parameters:
container
-filter
-minDepth
- : min depth of the latest node (0=root, 1=child of root...)- Returns:
-
convert
public List<TaxonomyBean> convert(Collection<String> ids)
convert list of taxonomybean id to a list of taxonomybean instance.- Parameters:
ids
-- Returns:
-
getSessionFilter
public static ITaxonomyContainer getSessionFilter(ContentContext ctx)
-
getSessionFilter
public static String getSessionFilter(ContentContext ctx, String key)
-
setSessionFilter
public static void setSessionFilter(ContentContext ctx, String key, String value)
add a taxonomy filter in the session- Parameters:
ctx
-key
- a reference to the component or the filter generatorvalue
- the reference to a taxonomy entry
-
getList
public List<IListItem> getList(ContentContext ctx, String path)
-
updateId
public void updateId(TaxonomyBean bean, String newId)
-
getContext
public String getContext()
-
getAsJson
public String getAsJson()
-
getAsJsonLinked
public String getAsJsonLinked()
-
exportAsText
public String exportAsText()
-
importText
public void importText(String text)
-
reset
public void reset()
-
__main
public static void __main(String[] args)
-
main
public static void main(String[] args)
-
_main
public static void _main(String[] args)
-
___main
public static void ___main(String[] args)
-
-