OBEROn SDK

com.oberon.ooql.sdk
Class Assignment

java.lang.Object
  extended by com.oberon.ooql.sdk.OBBase
      extended by com.oberon.ooql.sdk.AdminBase
          extended by com.oberon.ooql.sdk.Assignment
All Implemented Interfaces:
java.io.Serializable

public class Assignment
extends AdminBase
implements java.io.Serializable

Assignment Admin Object: defines a User role for the application context.

Version:
5.0
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.oberon.ooql.sdk.AdminBase
bsOptions, HIDDEN_OPTION
 
Constructor Summary
Assignment()
           
Assignment(java.lang.String name)
           
 
Method Summary
 void addTeam(java.lang.String teamName)
          Add this Assignment to a Team; Users belonging to this Team will gain the access rights defined for this role
 void addUser(java.lang.String userName)
          Add this Assignment to a User; the User will gain the access rights defined for this role
 java.lang.String compareUpdate(Assignment refAssignment, boolean checkImage, boolean overwrite, boolean force, Framework framework)
          Return/apply the OOQL command to update this Assignment object and let it become equals to another reference object.
 void create(boolean force, Framework framework)
          Create a new Assignment object on the database
 void create(Framework framework)
          Create a new Assignment object on the database
 void destroy(Framework framework)
          Remove the Assignment object from the database
 void fromXML(org.jdom.Element rootElement)
          Load the Assignment object properties from XML element tree
 java.lang.String getCreateCommand(boolean force)
          Return the OOQL command to create this Assignment object with the settled properties
 java.lang.String getLanguage()
          Get the Language for this Assignment
 java.lang.String getMailAddress()
          Get the mail address for this Assignment
 java.util.Vector<java.lang.String> getOwnTeams()
          Return the list of Teams directly associated with this Assignment
 java.lang.String getOwnTeamsAsString(java.lang.String delim)
          Return the list of Teams, directly associated with this Assignment, as a String
 java.util.Vector<java.lang.String> getOwnUsers()
          Return the list of Users who have this Assignment
 java.lang.String getOwnUsersAsString(java.lang.String delim)
          Return the list of Users, who have this Assignment, as a String
 java.lang.String getProperty(java.lang.String propertyName, java.util.Vector<java.lang.Object> filterArgs, java.lang.String token, Framework framework)
          Get a property for this Assignment object by its OOQL identifier
 java.lang.String getSaveCommand(boolean force)
          Return the OOQL command to update this Assignment object with the modified properties.
 java.util.Vector<?> getTargetNames(java.lang.String composedName, java.util.Vector<java.lang.Object> filterArgs, Framework framework)
          Return a Vector of administrative object names extracted by using an OOQL selector
 void link(Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          Open the Assignment object: connect the memory instance with the database instance
static Assignment open(java.lang.String name, Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          Open an administrative object and read properties from the database or retrieve them from memory
 void removeTeam(java.lang.String teamName)
          Remove this Assignment for a Team; Users belonging to this Team will loose the access rights defined for this role
 void removeUser(java.lang.String userName)
          Remove this Assignment for a User; the User will loose the access rights defined for this role
 void setLanguage(java.lang.String language)
          Set the default Language for this Assignment
 void setMailAddress(java.lang.String emailAddress)
          Set the mail address for this Assignment
If the mail address is settled, the OBEROn e-mail will be sent to this address otherwise an internal and/or external e-mail will be sent to each user who has this Assignment
 java.lang.String toString()
          Return the Assignment object basic properties as a single String
 java.lang.String toString(Framework framework)
          Return the Assignment object extended properties as a single String
 org.jdom.Element toXML(boolean getImage, boolean fullDump, Framework framework)
          Return the Assignment object properties as XML element tree
 org.jdom.Element toXML(Framework framework)
          Return the Assignment object properties as XML element tree
 void unlink(Framework framework)
          Close the object: disconnect the memory instance from the database instance
 void updateTeams(java.util.Vector<java.lang.String> teams)
          Update the teams on the basis of a given list
 void updateUsers(java.util.Vector<java.lang.String> users)
          Update the users on the basis of a given list
 void write(boolean force, Framework framework)
          Update the Assignment object to the database
 void write(Framework framework)
          Update the Assignment object to the database
 
Methods inherited from class com.oberon.ooql.sdk.AdminBase
addFeature, changedApplication, checkChangeName, checkCounters, checkCounters, getAdminType, getApplication, getCommonProperty, getCommonTargetNames, getCounters, getCreateBasicCommand, getCreateCommand, getCrtDate, getDescription, getEditBasicCommand, getFeature, getFeatures, getFeaturesAsString, getImage, getImage, getImage, getImageData, getImageFile, getModDate, getModUser, getName, getOldName, getPlainFeatures, getSaveCommand, getSVNRevision, getXMLFeatureList, hasImage, isHidden, setApplication, setCounters, setCrtDate, setDescription, setHidden, setImage, setImageData, setImageFile, setModDate, setModUser, setName, setSVNRevision, show, show, toCommonXML, toXML
 
Methods inherited from class com.oberon.ooql.sdk.OBBase
addChange, addUniqueChange, ChangesFromXML, ChangesToXML, getChanges, getChangesAsString, getId, isLinked, removeChange, resetChanges, setId, setLinked
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Assignment

public Assignment()

Assignment

public Assignment(java.lang.String name)
           throws OberonException
Parameters:
name - the name of the administrative object
Throws:
OberonException - if the name contains invalid characters
Method Detail

open

public static Assignment open(java.lang.String name,
                              Framework framework,
                              java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
                       throws OberonException
Open an administrative object and read properties from the database or retrieve them from memory

Parameters:
name - the object name
framework - the current framework
counters - administrative object synch counters (if null read them from database)
Throws:
OberonException - usually due to DB SQL exceptions

link

public void link(Framework framework,
                 java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          throws OberonException
Open the Assignment object: connect the memory instance with the database instance

Specified by:
link in class AdminBase
Parameters:
framework - the current framework
counters - administrative object synch counters (if null read them from database)
Throws:
OberonException - usually due to DB SQL exceptions

create

public void create(Framework framework)
            throws OberonException
Create a new Assignment object on the database

Specified by:
create in class AdminBase
Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights

create

public void create(boolean force,
                   Framework framework)
            throws OberonException
Create a new Assignment object on the database

Parameters:
force - if true ignores optional properties
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights
Since:
1.6

write

public void write(Framework framework)
           throws OberonException
Update the Assignment object to the database

Specified by:
write in class AdminBase
Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights

write

public void write(boolean force,
                  Framework framework)
           throws OberonException
Update the Assignment object to the database

Parameters:
force - if true ignores optional features
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights
Since:
1.6

unlink

public void unlink(Framework framework)
            throws OberonException
Close the object: disconnect the memory instance from the database instance

Specified by:
unlink in class AdminBase
Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions

destroy

public void destroy(Framework framework)
             throws OberonException
Remove the Assignment object from the database

Specified by:
destroy in class AdminBase
Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights

setMailAddress

public void setMailAddress(java.lang.String emailAddress)
Set the mail address for this Assignment
If the mail address is settled, the OBEROn e-mail will be sent to this address otherwise an internal and/or external e-mail will be sent to each user who has this Assignment

Parameters:
emailAddress - the email address
See Also:
User.setMailAddress(String), User.setMailType(boolean, boolean), Mail.send(Framework)

getMailAddress

public java.lang.String getMailAddress()
Get the mail address for this Assignment

Returns:
the email address

setLanguage

public void setLanguage(java.lang.String language)
Set the default Language for this Assignment

Parameters:
language - the language abbreviation (max 3 chars)

getLanguage

public java.lang.String getLanguage()
Get the Language for this Assignment

Returns:
the language abbreviation

addUser

public void addUser(java.lang.String userName)
Add this Assignment to a User; the User will gain the access rights defined for this role

Parameters:
userName - the name of the User

removeUser

public void removeUser(java.lang.String userName)
Remove this Assignment for a User; the User will loose the access rights defined for this role

Parameters:
userName - the name of the User

updateUsers

public void updateUsers(java.util.Vector<java.lang.String> users)
Update the users on the basis of a given list

Parameters:
users - list of User's names
Since:
4.0

getOwnUsers

public java.util.Vector<java.lang.String> getOwnUsers()
Return the list of Users who have this Assignment

Returns:
Vector of User names

getOwnUsersAsString

public java.lang.String getOwnUsersAsString(java.lang.String delim)
Return the list of Users, who have this Assignment, as a String

Parameters:
delim - the separator item
Returns:
list of User names separated by the delim characters

addTeam

public void addTeam(java.lang.String teamName)
Add this Assignment to a Team; Users belonging to this Team will gain the access rights defined for this role

Parameters:
teamName - the name of the Team

removeTeam

public void removeTeam(java.lang.String teamName)
Remove this Assignment for a Team; Users belonging to this Team will loose the access rights defined for this role

Parameters:
teamName - the name of the Team

updateTeams

public void updateTeams(java.util.Vector<java.lang.String> teams)
Update the teams on the basis of a given list

Parameters:
teams - list of Team's names
Since:
4.0

getOwnTeams

public java.util.Vector<java.lang.String> getOwnTeams()
Return the list of Teams directly associated with this Assignment

Returns:
Vector of Team names

getOwnTeamsAsString

public java.lang.String getOwnTeamsAsString(java.lang.String delim)
Return the list of Teams, directly associated with this Assignment, as a String

Parameters:
delim - the separator item
Returns:
list of Team names separated by the delim characters

getProperty

public java.lang.String getProperty(java.lang.String propertyName,
                                    java.util.Vector<java.lang.Object> filterArgs,
                                    java.lang.String token,
                                    Framework framework)
Get a property for this Assignment object by its OOQL identifier

Specified by:
getProperty in class OBBase
Parameters:
propertyName - OOQL property identifier/name (example: language , email ...)
filterArgs - extra arguments used to compute properties
token - separator token for complex properties
framework - the current framework
Returns:
the property value

getTargetNames

public java.util.Vector<?> getTargetNames(java.lang.String composedName,
                                          java.util.Vector<java.lang.Object> filterArgs,
                                          Framework framework)
Return a Vector of administrative object names extracted by using an OOQL selector

Specified by:
getTargetNames in class OBBase
Parameters:
composedName - OOQL property identifier/name (example: user , team .. )
filterArgs - extra arguments used to compute properties
framework - the current framework
Returns:
a Vector of target names, used to extract their (sub)properties values

toString

public java.lang.String toString()
Return the Assignment object basic properties as a single String

Overrides:
toString in class AdminBase

toString

public java.lang.String toString(Framework framework)
Return the Assignment object extended properties as a single String

Overrides:
toString in class AdminBase
Parameters:
framework - the current framework

toXML

public org.jdom.Element toXML(Framework framework)
Return the Assignment object properties as XML element tree

Specified by:
toXML in class AdminBase
Parameters:
framework - the current framework

toXML

public org.jdom.Element toXML(boolean getImage,
                              boolean fullDump,
                              Framework framework)
Return the Assignment object properties as XML element tree

Specified by:
toXML in class AdminBase
Parameters:
getImage - true to include "imagedata" element with the base64 encoded image data
fullDump - true to include detailed information
framework - the current framework

fromXML

public void fromXML(org.jdom.Element rootElement)
Load the Assignment object properties from XML element tree

Overrides:
fromXML in class AdminBase

getCreateCommand

public java.lang.String getCreateCommand(boolean force)
Return the OOQL command to create this Assignment object with the settled properties

Specified by:
getCreateCommand in class AdminBase
Parameters:
force - if true append the "force" options at the end

getSaveCommand

public java.lang.String getSaveCommand(boolean force)
Return the OOQL command to update this Assignment object with the modified properties.
If the object is new, it returns the create command.

Specified by:
getSaveCommand in class AdminBase
Parameters:
force - if true append the "force" options at the end

compareUpdate

public java.lang.String compareUpdate(Assignment refAssignment,
                                      boolean checkImage,
                                      boolean overwrite,
                                      boolean force,
                                      Framework framework)
                               throws OberonException
Return/apply the OOQL command to update this Assignment object and let it become equals to another reference object.
This method is useful to import objects from an XML file.

Parameters:
refAssignment - the reference Assignment object
checkImage - if true compare also the image icon
overwrite - if true update the database object instance
force - if true ignores optional properties
framework - the current framework
Throws:
OberonException
See Also:
fromXML(Element)

OBEROn SDK

Copyright © 2008-2014 Mirko Solazzi. All Rights Reserved.