|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object be.re.repo.Tools
public class Tools
Public utilities which are targeted to module developers.
Constructor Summary | |
---|---|
Tools()
|
Method Summary | |
---|---|
static boolean |
canRead(URLConnection connection)
Checks the read access right. |
static String |
generateContextUrl(Context context)
Returns the context URL of the request. |
static String |
generateFullPath(String localPath,
Context context)
Takes into account a possible context path. |
static String |
generateLocalUrl(String localPath)
Returns a URL with the "local" protocol constructed from localPath . |
static String |
generateUrl(String localPath,
Context context)
Returns the absolute URL constructed from localPath . |
static String |
generateVcrUrl(String vcr,
Context context)
Returns the absolute URL constructed from vcr . |
static String |
getEnv(String name)
Returns an environment setting from the configuration. |
static Locale |
getLocale(Context context)
Returns the locale in which the request was made. |
static String[] |
getMetaPropertyValues(String property,
Context context)
Returns the property values that exist for property . |
static ResourceBundle |
getResourceBundle(String name,
Context context)
Selects the resource bundle based on the locale derived from context . |
static String |
getUsername(Context context)
Returns the username corresponding to the request. |
static String |
labelToName(String propertyLabel,
Context context)
Returns the property name for the given label. |
static String |
nameToLabel(String propertyName,
Context context)
Returns the property label for the given name. |
static void |
retainNewest(Set<Property> newProperties,
Set<Property> oldProperties,
Set<String> singleValued,
Context context)
If a single-valued property occurs more than once, the new value is retained. |
static void |
setAtom(Set<Property> properties,
String key,
String value)
Sets the property in properties with the "atom:" prefix if
value is not null and not an empty string or a
string with only whitespace. |
static void |
setDublinCoreElement(Set<Property> properties,
String element,
String value)
Sets the property in properties with the "dc:" prefix if
value is not null and not an empty string or a
string with only whitespace. |
static void |
setDublinCoreTerm(Set<Property> properties,
String term,
String value)
Sets the property in properties with the "dcterms:" prefix if
value is not null and not an empty string or a
string with only whitespace. |
static void |
setKeywords(Set<Property> properties,
String keywords)
Sets the keywords in properties under the name "re:keyword" if
keywords is not null and not an empty string or a
string with only whitespace. |
static void |
setRe(Set<Property> properties,
String key,
String value)
Sets the property in properties with the "re:" prefix if
value is not null and not an empty string or a
string with only whitespace. |
static void |
setUserDefined(Set<Property> properties,
String name,
String value,
Context context)
Sets the property in properties if value is not
null and not an empty string or a string with only
whitespace. |
static void |
setWarning(String message,
Context context)
Sets a warning on the HTTP response. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Tools()
Method Detail |
---|
public static boolean canRead(URLConnection connection)
public static String generateContextUrl(Context context)
public static String generateFullPath(String localPath, Context context)
public static String generateLocalUrl(String localPath)
localPath
.
public static String generateUrl(String localPath, Context context)
localPath
.
public static String generateVcrUrl(String vcr, Context context)
vcr
. Takes into
account the current view. If there is a view, the view path will be
prepended to the vcr
.
public static String getEnv(String name)
public static Locale getLocale(Context context)
public static String[] getMetaPropertyValues(String property, Context context) throws IOException
property
.
IOException
public static ResourceBundle getResourceBundle(String name, Context context)
context
. The name
is the name of a resource
bundle.
public static String getUsername(Context context)
unauthenticated
.
public static String labelToName(String propertyLabel, Context context)
public static String nameToLabel(String propertyName, Context context)
public static void retainNewest(Set<Property> newProperties, Set<Property> oldProperties, Set<String> singleValued, Context context)
newProperties
- the property set that will be modified.oldProperties
- the properties a document currently has.singleValued
- the set of property names that should be treated as
single-valued.context
- the context of the repository.public static void setAtom(Set<Property> properties, String key, String value)
properties
with the "atom:" prefix if
value
is not null
and not an empty string or a
string with only whitespace.
public static void setDublinCoreElement(Set<Property> properties, String element, String value)
properties
with the "dc:" prefix if
value
is not null
and not an empty string or a
string with only whitespace.
public static void setDublinCoreTerm(Set<Property> properties, String term, String value)
properties
with the "dcterms:" prefix if
value
is not null
and not an empty string or a
string with only whitespace.
public static void setKeywords(Set<Property> properties, String keywords)
properties
under the name "re:keyword" if
keywords
is not null
and not an empty string or a
string with only whitespace. The keywords
argument may be a
comma-separated or space-separated list of words.
public static void setRe(Set<Property> properties, String key, String value)
properties
with the "re:" prefix if
value
is not null
and not an empty string or a
string with only whitespace. The supported properties are "company",
"keyword", "manager" and "status".
public static void setUserDefined(Set<Property> properties, String name, String value, Context context)
properties
if value
is not
null
and not an empty string or a string with only
whitespace.
An attempt is made to treat name
as a label of a built-in
property (DublinCore, Atom or Re). The locale of the request is used for
this. If the attempt fails name
is used as such.
public static void setWarning(String message, Context context)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |