|
|
|
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.torweg.pulse.util.entity.AbstractBasicEntity
org.torweg.pulse.util.entity.Node
org.torweg.pulse.accesscontrol.attributes.AbstractAttribute<T>
T - the type of the attribute's value@Entity public abstract class AbstractAttribute<T>
base class for all attributes.
| Field Summary | |
|---|---|
protected static org.slf4j.Logger |
LOGGER
the logger. |
| Constructor Summary | |
|---|---|
protected |
AbstractAttribute()
Deprecated. |
protected |
AbstractAttribute(boolean isSystemAttribute)
protected constructor to be called by the constructors of all subclasses. |
| Method Summary | |
|---|---|
boolean |
addAdminEditRole(Role r)
adds a given Role to the admin-edit-roles. |
boolean |
addAdminViewRole(Role r)
adds a given Role to the admin-view-roles. |
boolean |
addSelfEditRole(Role r)
adds a given Role to the self-edit-roles. |
boolean |
addSelfViewRole(Role r)
adds a given Role to the self-view-roles. |
boolean |
addTriggeredRole(Role r)
adds a given Role to the triggered-roles. |
org.jdom.Element |
deserializeToJDOM()
returns a JDOM representation of the attribute. |
org.jdom.Element |
deserializeToJDOM(java.util.Map<java.lang.Long,AbstractValue<?>> valueMap)
used during deserialization of a User. |
java.util.Set<Role> |
getAdminEditRoles()
returns the Roles which allow editing the attribute for arbitrary
Users in the administration interface. |
java.util.Set<Role> |
getAdminViewRoles()
returns the Roles which allow viewing the attribute for arbitrary
Users in the administration interface. |
abstract AbstractAttribute<T> |
getAttributeInstance(java.lang.String name,
boolean isSystem)
creator-method. |
abstract AbstractTypedCheck<T> |
getCheck()
returns the attribute's check. |
abstract java.lang.String |
getName()
returns the name of the attribute. |
java.util.Set<Role> |
getSelfEditRoles()
returns the Roles which allow editing the attribute for one's own
User. |
java.util.Set<Role> |
getSelfViewRoles()
returns the Roles which allow viewing the attribute for one's own
User. |
java.util.Set<Role> |
getTriggeredRoles()
returns the Roles which get assigned to Users, when the
attribute and all its sub-attributes are valid. |
java.util.Set<java.lang.Class<AbstractTypedCheck<?>>> |
getTypedChecks()
returns a set with the available typed checks for the attribute. |
AbstractValue<T> |
getValue(User user)
returns the value of the attribute for the given user. |
boolean |
isRequired()
returns whether the attribute is required. |
boolean |
isSystemAttribute()
returns whether the attribute is a system attribute. |
boolean |
isValid(User user)
returns whether the value of the user's attribute is valid according to the attribute's check. |
boolean |
removeAdminEditRole(Role r)
removes a given Role from the admin-edit-roles. |
boolean |
removeAdminViewRole(Role r)
removes a given Role from the admin-view-roles. |
boolean |
removeSelfEditRole(Role r)
removes a given Role from the self-edit-roles. |
boolean |
removeSelfViewRole(Role r)
removes a given Role from the self-view-roles. |
boolean |
removeTriggeredRole(Role r)
removes a given Role from the triggered-roles. |
void |
setAdminEditRoles(java.util.Set<Role> r)
sets the Roles which allow editing the attribute for arbitrary
Users in the administration interface. |
void |
setAdminViewRoles(java.util.Set<Role> r)
sets the Roles which allow viewing the attribute for arbitrary
Users in the administration interface. |
abstract void |
setCheck(AbstractTypedCheck<T> c)
sets the attrubite's check. |
void |
setRequired(boolean r)
sets, whether the attribute is required. |
void |
setSelfEditRoles(java.util.Set<Role> r)
sets the Roles which allow editing the attribute for one's own
User. |
void |
setSelfViewRoles(java.util.Set<Role> r)
sets the Roles which allow viewing the attribute for one's own
User. |
void |
setTriggeredRoles(java.util.Set<Role> r)
sets the Roles which get assigned to Users, when the
attribute and all its sub-attributes are valid. |
User |
setValue(AbstractValue<T> value, User user)
sets the value of the attribute for the given user. |
net.sf.json.JSONObject |
toJSON()
returns a representation of the attribute for the attribute-tree in the web-site-administration. |
abstract AbstractAttribute<T> |
updateSettingsFromCommand(Command command,
org.hibernate.Session session)
updates the attribute's settings from the given command. |
abstract AbstractValue<T> |
valueFromCommand(Command c)
initialises a value of this attribute from the given command. |
| Methods inherited from class org.torweg.pulse.util.entity.Node |
|---|
addChild, addChild, getChild, getChildIndex, getChildren, getParent, hasChildren, removeChild, setChildren |
| Methods inherited from class org.torweg.pulse.util.entity.AbstractBasicEntity |
|---|
compareTo, equals, getFullQualifiedClassNameJAXB, getId, hashCode |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.slf4j.Logger LOGGER
| Constructor Detail |
|---|
@Deprecated protected AbstractAttribute()
protected AbstractAttribute(boolean isSystemAttribute)
isSystemAttribute - flag, indicating whether the attribute is a system attribute| Method Detail |
|---|
public final void setSelfViewRoles(java.util.Set<Role> r)
Roles which allow viewing the attribute for one's own
User.
r - the roles to setpublic final boolean addSelfViewRole(Role r)
Role to the self-view-roles.
r - the role to add
public final boolean removeSelfViewRole(Role r)
Role from the self-view-roles.
r - the role to remove
public final java.util.Set<Role> getSelfViewRoles()
Roles which allow viewing the attribute for one's own
User.
public final java.util.Set<Role> getSelfEditRoles()
Roles which allow editing the attribute for one's own
User.
public final void setSelfEditRoles(java.util.Set<Role> r)
Roles which allow editing the attribute for one's own
User.
r - the roles to setpublic final boolean addSelfEditRole(Role r)
Role to the self-edit-roles.
r - the role to add
public final boolean removeSelfEditRole(Role r)
Role from the self-edit-roles.
r - the role to remove
public final void setAdminViewRoles(java.util.Set<Role> r)
Roles which allow viewing the attribute for arbitrary
Users in the administration interface.
r - the roles to setpublic final boolean addAdminViewRole(Role r)
Role to the admin-view-roles.
r - the role to add
public final boolean removeAdminViewRole(Role r)
Role from the admin-view-roles.
r - the role to remove
public final java.util.Set<Role> getAdminViewRoles()
Roles which allow viewing the attribute for arbitrary
Users in the administration interface.
public final void setAdminEditRoles(java.util.Set<Role> r)
Roles which allow editing the attribute for arbitrary
Users in the administration interface.
r - the roles to setpublic final boolean addAdminEditRole(Role r)
Role to the admin-edit-roles.
r - the role to add
public final boolean removeAdminEditRole(Role r)
Role from the admin-edit-roles.
r - the role to remove
public final java.util.Set<Role> getAdminEditRoles()
Roles which allow editing the attribute for arbitrary
Users in the administration interface.
public final void setTriggeredRoles(java.util.Set<Role> r)
Roles which get assigned to Users, when the
attribute and all its sub-attributes are valid.
r - the roles to setpublic final boolean addTriggeredRole(Role r)
Role to the triggered-roles.
r - the role to add
public final boolean removeTriggeredRole(Role r)
Role from the triggered-roles.
r - the role to remove
public final java.util.Set<Role> getTriggeredRoles()
Roles which get assigned to Users, when the
attribute and all its sub-attributes are valid.
public final boolean isSystemAttribute()
true, if the attribute is a system attributepublic final boolean isRequired()
true, if the attribute is required.public final void setRequired(boolean r)
r - true, if the attribute is required.public final boolean isValid(User user)
If the AbstractTypedCheck is null, the value is
considered valid. A null value is considered invalid.
user - the user
public abstract java.lang.String getName()
getName in interface INamedpublic final AbstractValue<T> getValue(User user)
user - the user
public final User setValue(AbstractValue<T> value, User user)
value - the value to be setuser - the user
public final java.util.Set<java.lang.Class<AbstractTypedCheck<?>>> getTypedChecks()
public abstract void setCheck(AbstractTypedCheck<T> c)
c - the check to setpublic abstract AbstractTypedCheck<T> getCheck()
public abstract AbstractAttribute<T> getAttributeInstance(java.lang.String name,
boolean isSystem)
Used by AttributeFactory.
name - the name of the new attributeisSystem - indicates if new attribute is system-attribute
public abstract AbstractValue<T> valueFromCommand(Command c)
c - the command
public abstract AbstractAttribute<T> updateSettingsFromCommand(Command command,
org.hibernate.Session session)
This method assumes that it is part of a larger transaction, thus the changes to the session are neither encapsulated in a separate transaction nor commited.
command - the commandsession - the session for persisting the updates
public org.jdom.Element deserializeToJDOM()
Classes extending AbstractAttribute are recommended, but not
required to call this method via super.deserializeToJDOM() and
just add their result to the returned element in a separate
value-element.
If <T> is an instance of JDOMable, the value is also
added by this method.
deserializeToJDOM in interface JDOMableJDOMable.deserializeToJDOM()public org.jdom.Element deserializeToJDOM(java.util.Map<java.lang.Long,AbstractValue<?>> valueMap)
User.
Does not add the roles!
valueMap - maps attribute-ids a Users attribute-values
public net.sf.json.JSONObject toJSON()
toJSON in class NodeJSONObject
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||