|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.attributes.AttributeServiceImpl
public class AttributeServiceImpl
Implementation of the AttributeService interface.
Constructor Summary | |
---|---|
AttributeServiceImpl()
|
Method Summary | |
---|---|
void |
addAttribute(java.util.List keys,
Attribute value)
Add an attribute to a list. |
void |
addAttribute(java.lang.String path,
Attribute value)
Add an attribute to a list. |
void |
addAttributes(java.util.List keys,
java.util.List values)
Add a list of attributes to the end of a list. |
void |
addAttributes(java.lang.String path,
java.util.List values)
Add a list of attributes to the end of a list. |
boolean |
exists(java.util.List keys)
Does an attribute exist. |
boolean |
exists(java.lang.String path)
Does an attribute exist. |
Attribute |
getAttribute(java.util.List keys)
Get an attribute using a list of keys. |
Attribute |
getAttribute(java.lang.String path)
Get an Attribute using a path. |
int |
getCount(java.util.List keys)
Get the size of a map or list. |
int |
getCount(java.lang.String path)
Get the size of a map or list. |
java.util.List |
getKeys(java.util.List keys)
Get all the keys at a given attribute path as specified by a list of path components. |
java.util.List |
getKeys(java.lang.String path)
Get all the keys at a given attribute path. |
java.util.List |
query(java.util.List keys,
AttrQuery query)
Query for a list of attributes which are contained in a map defined by the given path and meet the query criteria. |
java.util.List |
query(java.lang.String path,
AttrQuery query)
Query for the list of attributes that is contained in the map defined by the given path and meet the query criteria. |
void |
removeAttribute(java.util.List keys,
int index)
Remove an attribute from a list. |
void |
removeAttribute(java.util.List keys,
java.lang.String name)
Remove an Attribute. |
void |
removeAttribute(java.lang.String path,
int index)
Remove an attribute from a list. |
void |
removeAttribute(java.lang.String path,
java.lang.String name)
Remove an Attribute. |
void |
removeEntries(java.util.List keys,
AttrQuery query)
Remove entries from the designated map which match the given query. |
void |
removeEntries(java.lang.String path,
AttrQuery query)
Remove entries from the designated map which match the given query. |
void |
setAttribute(java.util.List keys,
int index,
Attribute value)
Set an attribute in a list. |
void |
setAttribute(java.util.List keys,
java.lang.String name,
Attribute value)
Set an attribute, overwriting its prior value if it already existed. |
void |
setAttribute(java.lang.String path,
int index,
Attribute value)
Set an attribute in a list. |
void |
setAttribute(java.lang.String path,
java.lang.String name,
Attribute value)
Set an attribute, overwriting its prior value if it already existed. |
void |
setAttributeConverter(AttributeConverter converter)
|
void |
setAttributeDao(AttributeDAO dao)
|
void |
setAttributes(java.util.List keys,
java.util.Map entries)
Set a set of attributes on a map. |
void |
setAttributes(java.lang.String path,
java.util.Map entries)
Set a set of attributes on a map. |
void |
setGlobalAttributeEntryDao(GlobalAttributeEntryDAO dao)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AttributeServiceImpl()
Method Detail |
---|
public void setGlobalAttributeEntryDao(GlobalAttributeEntryDAO dao)
public void setAttributeDao(AttributeDAO dao)
public void setAttributeConverter(AttributeConverter converter)
public Attribute getAttribute(java.lang.String path)
AttributeService
getAttribute
in interface AttributeService
path
- The path of the Attribute
public java.util.List query(java.lang.String path, AttrQuery query)
AttributeService
Example 1:
Find all attributes within the nested namespace "a/b"
that are lexically greater than or equal to the string "v":
query("a/b", new AttrQueryGTE("v"))
Example 2:
Find all attributes within the namespace "xyz" that are
either lexically less than the string "d" or greater than
the string "w":
query("xyz", new AttrOrQuery(new AttrQueryLT("d"), new AttrQueryGT("w")))
query
in interface AttributeService
public void removeAttribute(java.lang.String path, java.lang.String name)
AttributeService
removeAttribute
in interface AttributeService
name
- The name of the Attribute.public void setAttribute(java.lang.String path, java.lang.String name, Attribute value)
AttributeService
setAttribute
in interface AttributeService
name
- The name of the Attribute.value
- The value to set.public java.util.List getKeys(java.lang.String path)
AttributeService
setAttribute
has associated a path with a
MAP
, you can fetch the
keys for that map via this function.
Example:
Suppose AttribSvc
is an attribute service object:
MapAttribute x = new MapAttributeValue(); x.put("cow", new StringAttributeValue("moo"); x.put("bird", new StringAttributeValue("tweet"); MapAttribute y = new MapAttributeValue(); y.put("pekingese", new StringAttributeValue("yip-yip-yip"); y.put("blood hound", new StringAttributeValue("Aroooooooooooo"); y.put("labrador", new StringAttributeValue("Hello, kind stranger!"); AttribSvc.setAttribute("", "x", x); AttribSvc.setAttribute("x", "y", y); List<String> x_keys = AttribSvc.getKeys("x"); // cow, bird List<String> y_keys = AttribSvc.getKeys("x/y"); // pekingese, blood hound, labrador
getKeys
in interface AttributeService
path
- The attribute path.
public Attribute getAttribute(java.util.List keys)
AttributeService
getAttribute
in interface AttributeService
keys
- List of attribute path keys (path components).
public java.util.List getKeys(java.util.List keys)
AttributeService
getKeys
in interface AttributeService
keys
- List of attribute path keys (path components).
public void setAttribute(java.util.List keys, java.lang.String name, Attribute value)
AttributeService
setAttribute
in interface AttributeService
keys
- List of attribute path keys (path components).name
- The name of the attribute to set.value
- The Attribute to set.public java.util.List query(java.util.List keys, AttrQuery query)
AttributeService
query
in interface AttributeService
keys
- List of attribute path keys (path components).
public void removeAttribute(java.util.List keys, java.lang.String name)
AttributeService
removeAttribute
in interface AttributeService
keys
- List of attribute path keys (path components).name
- The name of the attribute to remove.public void addAttribute(java.util.List keys, Attribute value)
AttributeService
addAttribute
in interface AttributeService
keys
- List of attribute path keys (path components).value
- The Attribute to add to the ListAttribute
public void addAttribute(java.lang.String path, Attribute value)
AttributeService
addAttribute
in interface AttributeService
path
- The path to the list.value
- The Attribute to add to the ListAttribute
public void removeAttribute(java.util.List keys, int index)
AttributeService
removeAttribute
in interface AttributeService
keys
- List of attribute path keys (path components).index
- The index to remove from the
ListAttribute
public void removeAttribute(java.lang.String path, int index)
AttributeService
removeAttribute
in interface AttributeService
path
- The path to the list.index
- The index to remove from the
ListAttribute
public void removeEntries(java.util.List keys, AttrQuery query)
AttributeService
removeEntries
in interface AttributeService
keys
- The list of attribute path entries.query
- The attribute query.public void removeEntries(java.lang.String path, AttrQuery query)
AttributeService
removeEntries
in interface AttributeService
path
- The path to the map.query
- The attribute query.public void setAttribute(java.util.List keys, int index, Attribute value)
AttributeService
setAttribute
in interface AttributeService
keys
- List of attribute path keys (path components).index
- The list index.value
- The Attribute to set within the ListAttribute
public void setAttribute(java.lang.String path, int index, Attribute value)
AttributeService
setAttribute
in interface AttributeService
path
- The path to the ListAttribute
.index
- The list index.value
- The Attribute to set.public boolean exists(java.util.List keys)
AttributeService
exists
in interface AttributeService
keys
- List of attribute path keys.
public boolean exists(java.lang.String path)
AttributeService
exists
in interface AttributeService
path
- The path to the attribute.
public int getCount(java.util.List keys)
AttributeService
getCount
in interface AttributeService
keys
- List of attribute path keys.
public int getCount(java.lang.String path)
AttributeService
getCount
in interface AttributeService
path
- The path to the map or list.
public void addAttributes(java.util.List keys, java.util.List values)
AttributeService
addAttributes
in interface AttributeService
keys
- The List of path keys to the list.values
- The values to add.public void addAttributes(java.lang.String path, java.util.List values)
AttributeService
addAttributes
in interface AttributeService
path
- The path to the list.values
- The values to add.public void setAttributes(java.util.List keys, java.util.Map entries)
AttributeService
setAttributes
in interface AttributeService
keys
- The List of path keys to the map.entries
- The entries to set.public void setAttributes(java.lang.String path, java.util.Map entries)
AttributeService
setAttributes
in interface AttributeService
path
- The path to the map.entries
- The entries to set.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |