public class JCRRepositoryData extends Object implements ModifiableRepositoryData, ModifiableCommentableRepositoryData
Modifier and Type | Field and Description |
---|---|
private static Map<Integer,String> |
__DATA_TYPES |
private String |
_defaultPrefix |
private boolean |
_lockAlreadyChecked |
private Node |
_node |
DATA_NAME_PATTERN
BOOLEAN_REPOSITORY_DATA_TYPE, CALENDAR_REPOSITORY_DATA_TYPE, DOUBLE_REPOSITORY_DATA_TYPE, LONG_REPOSITORY_DATA_TYPE, STREAM_REPOSITORY_DATA_TYPE, STRING_REPOSITORY_DATA_TYPE
Constructor and Description |
---|
JCRRepositoryData(Node node)
Creates a JCR repository data from the given node
|
JCRRepositoryData(Node node,
String defaultPrefix)
Creates a JCR repository data from the given node
|
Modifier and Type | Method and Description |
---|---|
private void |
_checkDataName(String name,
String prefix) |
private void |
_checkLock() |
private String |
_getFullName(String name,
String prefix) |
private String |
_getPathForLogs() |
private Value |
_getValue(String name,
String prefix) |
private Value[] |
_getValues(String name,
String prefix) |
void |
addComment(String name,
String text,
String author,
Date date)
Add a comment on the data stored in the repository with the given name
|
ModifiableRepositoryData |
addRepositoryData(String name,
String dataTypeName,
String prefix)
Creates a repository data and stores it in the repository with the given name
|
void |
deleteComment(String name,
int index)
Delete a comment on the data stored in the repository with the given name
|
void |
editComment(String name,
int index,
String text,
String author,
Date date)
Edit the text of a comment on the data stored in the repository with the given name
|
Boolean |
getBoolean(String name,
String prefix)
Retrieves the value of the boolean data stored in the repository with the given name
|
Boolean[] |
getBooleans(String name,
String prefix)
Retrieves the values of the multiple boolean data stored in the repository with the given name
|
List<DataComment> |
getComments(String name)
Retrieves the comments of the data stored in the repository with the given name
|
Set<String> |
getDataNames(String prefix)
Retrieves the names of data in this repository data with the given prefix
|
Calendar |
getDate(String name,
String prefix)
Retrieves the value of the date data stored as calendar in the repository with the given name
|
Calendar[] |
getDates(String name,
String prefix)
Retrieves the values of the multiple date data as calendar stored in the repository with the given name
|
String |
getDefaultPrefix()
Retrieves the default prefix
|
Double |
getDouble(String name,
String prefix)
Retrieves the value of the double data stored in the repository with the given name
|
Double[] |
getDoubles(String name,
String prefix)
Retrieves the values of the multiple double data stored in the repository with the given name
|
String |
getFullName()
Retrieves the full name of the current repository data, including its prefix
|
Long |
getLong(String name,
String prefix)
Retrieves the value of the long data stored in the repository with the given name
|
Long[] |
getLongs(String name,
String prefix)
Retrieves the values of the multiple long data stored in the repository with the given name
|
Node |
getNode()
Retrieves the underlying node.
|
String |
getPath()
Retrieves the path of the repository data.
|
ModifiableRepositoryData |
getRepositoryData(String name,
String prefix)
Retrieves the value of the repository data stored in the repository with the given name
|
Session |
getSession()
Retrieves the current session
|
InputStream |
getStream(String name,
String prefix)
Retrieves the value of the stream data stored in the repository with the given name
|
Long |
getStreamLength(String name,
String prefix)
Retrieves the length of the value of the stream data stored in the repository with the given name
|
InputStream[] |
getStreams(String name,
String prefix)
Retrieves the values of the multiple stream data stored in the repository with the given name
|
String |
getString(String name,
String prefix)
Retrieves the value of the string data stored in the repository with the given name
|
String[] |
getStrings(String name,
String prefix)
Retrieves the values of the multiple string data stored in the repository with the given name
|
String |
getType(String name,
String prefix)
Retrieves the type of the value for the data stored in the repository with the given name
|
boolean |
hasComment(String name,
int index)
Indicates if the data stored in the repository with the given name has a comment
|
boolean |
hasComments(String name)
Indicates if the data stored in the repository with the given name has any comments
|
boolean |
hasValue(String name,
String prefix)
Checks if there is a value for the data stored in the repository with the given name
|
boolean |
isMultiple(String name,
String prefix)
Checks if the value for the data stored in the repository with the given name is multiple
|
void |
removeValue(String name,
String prefix)
Removes the value of the data stored in the repository with the given name
|
void |
rename(String newName,
String prefix)
Rename the current repository data
|
void |
setValue(String name,
Boolean value,
String prefix)
Sets the value of the boolean data stored in the repository with the given name
|
void |
setValue(String name,
Calendar value,
String prefix)
Sets the value of the date data stored in the repository with the given name
|
void |
setValue(String name,
Double value,
String prefix)
Sets the value of the double data stored in the repository with the given name
|
void |
setValue(String name,
InputStream value,
String prefix)
Sets the value of the input stream data stored in the repository with the given name
|
void |
setValue(String name,
Long value,
String prefix)
Sets the value of the long data stored in the repository with the given name
|
void |
setValue(String name,
String value,
String prefix)
Sets the value of the string data stored in the repository with the given name
|
void |
setValues(String name,
Boolean[] values,
String prefix)
Sets the values of the multiple boolean data stored in the repository with the given name
|
void |
setValues(String name,
Calendar[] values,
String prefix)
Sets the values of the multiple date data stored in the repository with the given name
|
void |
setValues(String name,
Double[] values,
String prefix)
Sets the values of the multiple double data stored in the repository with the given name
|
void |
setValues(String name,
InputStream[] values,
String prefix)
Sets the values of the multiple input stream data stored in the repository with the given name
|
void |
setValues(String name,
Long[] values,
String prefix)
Sets the values of the multiple long data stored in the repository with the given name
|
void |
setValues(String name,
String[] values,
String prefix)
Sets the values of the multiple string data stored in the repository with the given name
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addRepositoryData, getRepositoryData, removeValue, rename, setValue, setValue, setValue, setValue, setValue, setValue, setValues, setValues, setValues, setValues, setValues, setValues
getAllDataNames, getBoolean, getBooleans, getDataNames, getDate, getDates, getDouble, getDoubles, getLong, getLongs, getName, getStream, getStreamLength, getStreams, getString, getStrings, getType, hasValue, isMultiple
private static final Map<Integer,String> __DATA_TYPES
private boolean _lockAlreadyChecked
private String _defaultPrefix
public JCRRepositoryData(Node node)
node
- the Node supporting this repository datapublic JCRRepositoryData(Node node, String defaultPrefix)
node
- the Node supporting this repository datadefaultPrefix
- prefix to use for properties and child nodespublic String getString(String name, String prefix)
RepositoryData
getString
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public String[] getStrings(String name, String prefix)
RepositoryData
getStrings
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public Calendar getDate(String name, String prefix)
RepositoryData
getDate
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public Calendar[] getDates(String name, String prefix)
RepositoryData
getDates
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public Long getLong(String name, String prefix)
RepositoryData
getLong
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public Long[] getLongs(String name, String prefix)
RepositoryData
getLongs
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public Double getDouble(String name, String prefix)
RepositoryData
getDouble
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public Double[] getDoubles(String name, String prefix)
RepositoryData
getDoubles
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public Boolean getBoolean(String name, String prefix)
RepositoryData
getBoolean
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public Boolean[] getBooleans(String name, String prefix)
RepositoryData
getBooleans
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public InputStream[] getStreams(String name, String prefix)
RepositoryData
getStreams
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public InputStream getStream(String name, String prefix)
RepositoryData
getStream
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public Long getStreamLength(String name, String prefix)
RepositoryData
getStreamLength
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.private Value[] _getValues(String name, String prefix)
public ModifiableRepositoryData getRepositoryData(String name, String prefix)
RepositoryData
getRepositoryData
in interface ModifiableRepositoryData
getRepositoryData
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public Set<String> getDataNames(String prefix) throws AmetysRepositoryException
RepositoryData
getDataNames
in interface RepositoryData
prefix
- prefix of the data names to retrieve. If null
, retrieves all the data names of this repository dataAmetysRepositoryException
public String getFullName()
RepositoryData
getFullName
in interface RepositoryData
public boolean hasValue(String name, String prefix)
RepositoryData
hasValue
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public String getType(String name, String prefix)
RepositoryData
getType
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public boolean isMultiple(String name, String prefix)
RepositoryData
isMultiple
in interface RepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.public void rename(String newName, String prefix)
ModifiableRepositoryData
rename
in interface ModifiableRepositoryData
newName
- the new nameprefix
- prefix of the data name, to use instead of the default one.public void setValue(String name, String value, String prefix)
ModifiableRepositoryData
setValue
in interface ModifiableRepositoryData
name
- name of the datavalue
- the value to setprefix
- prefix of the data name, to use instead of the default one.public void setValues(String name, String[] values, String prefix)
ModifiableRepositoryData
setValues
in interface ModifiableRepositoryData
name
- name of the datavalues
- the value to setprefix
- prefix of the data name, to use instead of the default one.public void setValue(String name, Calendar value, String prefix)
ModifiableRepositoryData
setValue
in interface ModifiableRepositoryData
name
- name of the datavalue
- the value to setprefix
- prefix of the data name, to use instead of the default one.public void setValues(String name, Calendar[] values, String prefix)
ModifiableRepositoryData
setValues
in interface ModifiableRepositoryData
name
- name of the datavalues
- the value to setprefix
- prefix of the data name, to use instead of the default one.public void setValue(String name, Long value, String prefix)
ModifiableRepositoryData
setValue
in interface ModifiableRepositoryData
name
- name of the datavalue
- the value to setprefix
- prefix of the data name, to use instead of the default one.public void setValues(String name, Long[] values, String prefix)
ModifiableRepositoryData
setValues
in interface ModifiableRepositoryData
name
- name of the datavalues
- the value to setprefix
- prefix of the data name, to use instead of the default one.public void setValue(String name, Double value, String prefix)
ModifiableRepositoryData
setValue
in interface ModifiableRepositoryData
name
- name of the datavalue
- the value to setprefix
- prefix of the data name, to use instead of the default one.public void setValues(String name, Double[] values, String prefix)
ModifiableRepositoryData
setValues
in interface ModifiableRepositoryData
name
- name of the datavalues
- the value to setprefix
- prefix of the data name, to use instead of the default one.public void setValue(String name, Boolean value, String prefix)
ModifiableRepositoryData
setValue
in interface ModifiableRepositoryData
name
- name of the datavalue
- the value to setprefix
- prefix of the data name, to use instead of the default one.public void setValues(String name, Boolean[] values, String prefix)
ModifiableRepositoryData
setValues
in interface ModifiableRepositoryData
name
- name of the datavalues
- the value to setprefix
- prefix of the data name, to use instead of the default one.public void setValue(String name, InputStream value, String prefix)
ModifiableRepositoryData
setValue
in interface ModifiableRepositoryData
name
- name of the datavalue
- the value to setprefix
- prefix of the data name, to use instead of the default one.public void setValues(String name, InputStream[] values, String prefix)
ModifiableRepositoryData
setValues
in interface ModifiableRepositoryData
name
- name of the datavalues
- the value to setprefix
- prefix of the data name, to use instead of the default one.public ModifiableRepositoryData addRepositoryData(String name, String dataTypeName, String prefix)
ModifiableRepositoryData
addRepositoryData
in interface ModifiableRepositoryData
name
- name of the datadataTypeName
- data type name to use on creationprefix
- prefix of the data name, to use instead of the default one.private void _checkDataName(String name, String prefix)
public void removeValue(String name, String prefix)
ModifiableRepositoryData
removeValue
in interface ModifiableRepositoryData
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.private String _getFullName(String name, String prefix)
public List<DataComment> getComments(String name)
CommentableRepositoryData
getComments
in interface CommentableRepositoryData
name
- name of the dataDataComment
public boolean hasComments(String name)
CommentableRepositoryData
hasComments
in interface CommentableRepositoryData
name
- name of the datapublic boolean hasComment(String name, int index)
CommentableRepositoryData
hasComment
in interface CommentableRepositoryData
name
- name of the dataindex
- the comment indexpublic void addComment(String name, String text, String author, Date date)
ModifiableCommentableRepositoryData
addComment
in interface ModifiableCommentableRepositoryData
name
- name of the datatext
- the text of the commentauthor
- the comment authordate
- the date of the comment (null to use the current date)public void editComment(String name, int index, String text, String author, Date date)
ModifiableCommentableRepositoryData
editComment
in interface ModifiableCommentableRepositoryData
name
- name of the dataindex
- the comment indextext
- the new text for the commentauthor
- the comment authordate
- the date of the comment (null to use the current date)public void deleteComment(String name, int index)
ModifiableCommentableRepositoryData
deleteComment
in interface ModifiableCommentableRepositoryData
name
- name of the dataindex
- the comment indexprivate void _checkLock() throws RepositoryException
RepositoryException
public Session getSession() throws AmetysRepositoryException
AmetysRepositoryException
- if an error occurspublic String getDefaultPrefix()
RepositoryData
getDefaultPrefix
in interface RepositoryData
public String getPath()
RepositoryData
AmetysObject
parentgetPath
in interface RepositoryData
private String _getPathForLogs()