OBEROn SDK

com.oberon.ooql.sdk
Class Team

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

public class Team
extends AdminBase
implements java.io.Serializable

Team Admin Object: defines a group of Users.

Version:
5.0
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.oberon.ooql.sdk.AdminBase
bsOptions, HIDDEN_OPTION
 
Constructor Summary
Team()
           
Team(java.lang.String name)
           
 
Method Summary
 void addAssignment(java.lang.String assignmentName)
          Add a Assignment to this Team; Users belonging to this Team inherit the Assignment access rights
 void addSubTeam(java.lang.String teamName)
          Add a sub-Team to this Team
 void addUser(java.lang.String userName)
          Add a User to this Team; the User will gain the access rights defined for this Team
 java.lang.String compareUpdate(Team refTeam, boolean checkImage, boolean overwrite, boolean force, Framework framework)
          Return/apply the OOQL command to update this Team object and let it become equals to another reference object.
 void create(boolean force, Framework framework)
          Create a new Team object on the database
 void create(Framework framework)
          Create a new Team object on the database
 void destroy(Framework framework)
          Remove the Team object from the database.
 void fromXML(org.jdom.Element rootElement)
          Load the Team object from XML element tree
 java.util.Vector<java.lang.String> getAssignments()
          Get Assignments for this Team
 java.lang.String getAssignmentsAsString(java.lang.String delim)
          Get Assignments for this Team as String
 java.lang.String getCreateCommand(boolean force)
          Return the OOQL command to create this Team object with the settled properties
 java.lang.String getLanguage()
          Get the Language for this Team
 java.lang.String getLocalArea()
          Get the default LocalArea for this Team
 java.lang.String getMailAddress()
          Get the mail address for this Team
 java.util.Vector<java.lang.String> getOwnSubTeams()
          Get direct sub-Teams for this Team
 java.lang.String getOwnSubTeamsAsString(java.lang.String delim)
          Get direct sub-Teams for this Team as a String
 java.util.Vector<java.lang.String> getOwnUsers()
          Return the list of Users belonging to this Team
 java.lang.String getOwnUsersAsString(java.lang.String delim)
          Return the list of Users, belonging to this Team, 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 Team object by its OOQL identifier
 java.lang.String getSaveCommand(boolean force)
          Return the OOQL command to update this Team object with the modified properties.
 java.util.Vector<java.lang.String> getSubTeams(Framework framework)
          Get all sub-Teams for this Team
 java.lang.String getSubTeamsAsString(java.lang.String delim, Framework framework)
          Get all sub-Teams for this Team as a String
 java.lang.String getSuperTeam()
          Get the direct parent Team for this Team.
 java.util.Vector<java.lang.String> getSuperTeams(Framework framework)
          Get the parent Teams for this Team.
 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
 java.util.Vector<java.lang.String> getUsers(Framework framework)
          Return the list of Users belonging to this Team or to its sub-Teams
 java.lang.String getUsersAsString(java.lang.String delim, Framework framework)
          Return the list of Users, belonging to this Team or to its sub-Teams, as a String
 void link(Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          Open the Team object: connect the memory instance with the database instance
static Team 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 removeAssignment(java.lang.String assignmentName)
          Remove a Assignment for this Team; Users belonging to this Team loose the Assignment access rights
 void removeSubTeam(java.lang.String teamName)
          Remove a sub-Team from this Team
 void removeUser(java.lang.String userName)
          Remove a User from this Team; the User will loose the access rights defined for this Team
 void setLanguage(java.lang.String language)
          Set the default Language for this Team
 void setLocalArea(java.lang.String localAreaName)
          Set the default LocalArea for this Team
 void setMailAddress(java.lang.String emailAddress)
          Set the mail address for this Team.
 void setSuperTeam(java.lang.String teamName)
          Set the parent Team for this Team
 java.lang.String toString()
          Return the Team object basic properties as a single String
 java.lang.String toString(Framework framework)
          Return the Team object extended properties as a single String
 org.jdom.Element toXML(boolean getImage, boolean fullDump, Framework framework)
          Return the Team object properties as XML element tree
 org.jdom.Element toXML(Framework framework)
          Return the Team object properties as XML element tree
 void unlink(Framework framework)
          Close the object: disconnect the memory instance from the database instance
 void updateAssignments(java.util.Vector<java.lang.String> assignments)
          Update the assignments 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 Team object to the database
 void write(Framework framework)
          Update the Team 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

Team

public Team()

Team

public Team(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 Team 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 Team 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 Team 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 Team object on 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

write

public void write(Framework framework)
           throws OberonException
Update the Team 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 Team 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 Team 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 Team. 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 belonging to this Team

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 Team

Returns:
the email address

setLocalArea

public void setLocalArea(java.lang.String localAreaName)
Set the default LocalArea for this Team

Parameters:
localAreaName - the LocalArea name

getLocalArea

public java.lang.String getLocalArea()
Get the default LocalArea for this Team


setLanguage

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

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

getLanguage

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

Returns:
the language abbreviation

getSuperTeams

public java.util.Vector<java.lang.String> getSuperTeams(Framework framework)
Get the parent Teams for this Team. A Team can be recursively extended and included into other super-Teams


setSuperTeam

public void setSuperTeam(java.lang.String teamName)
Set the parent Team for this Team

Parameters:
teamName - then super-Team name

getSuperTeam

public java.lang.String getSuperTeam()
Get the direct parent Team for this Team. A Team can include one or more sub-Teams.


getSubTeams

public java.util.Vector<java.lang.String> getSubTeams(Framework framework)
Get all sub-Teams for this Team


getSubTeamsAsString

public java.lang.String getSubTeamsAsString(java.lang.String delim,
                                            Framework framework)
Get all sub-Teams for this Team as a String

Parameters:
delim - the Team name separator

addSubTeam

public void addSubTeam(java.lang.String teamName)
Add a sub-Team to this Team

Parameters:
teamName - then sub-Team name

removeSubTeam

public void removeSubTeam(java.lang.String teamName)
Remove a sub-Team from this Team

Parameters:
teamName - then sub-Team name

getOwnSubTeams

public java.util.Vector<java.lang.String> getOwnSubTeams()
Get direct sub-Teams for this Team


getOwnSubTeamsAsString

public java.lang.String getOwnSubTeamsAsString(java.lang.String delim)
Get direct sub-Teams for this Team as a String

Parameters:
delim - the Team name separator

addUser

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

Parameters:
userName - the name of the User

removeUser

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

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 belonging to this Team

Returns:
Vector of User names

getOwnUsersAsString

public java.lang.String getOwnUsersAsString(java.lang.String delim)
Return the list of Users, belonging to this Team, as a String

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

getUsers

public java.util.Vector<java.lang.String> getUsers(Framework framework)
Return the list of Users belonging to this Team or to its sub-Teams

Returns:
Vector of User names

getUsersAsString

public java.lang.String getUsersAsString(java.lang.String delim,
                                         Framework framework)
Return the list of Users, belonging to this Team or to its sub-Teams, as a String

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

addAssignment

public void addAssignment(java.lang.String assignmentName)
Add a Assignment to this Team; Users belonging to this Team inherit the Assignment access rights

Parameters:
assignmentName - the name of the Assignment

removeAssignment

public void removeAssignment(java.lang.String assignmentName)
Remove a Assignment for this Team; Users belonging to this Team loose the Assignment access rights

Parameters:
assignmentName - the name of the Assignment

updateAssignments

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

Parameters:
assignments - list of Assignment's names
Since:
4.0

getAssignments

public java.util.Vector<java.lang.String> getAssignments()
Get Assignments for this Team


getAssignmentsAsString

public java.lang.String getAssignmentsAsString(java.lang.String delim)
Get Assignments for this Team as String

Parameters:
delim - the separator item

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 Team object by its OOQL identifier

Specified by:
getProperty in class OBBase
Parameters:
propertyName - OOQL property identifier/name (example: language , superteam ...)
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, ownsubteam, .. )
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 Team object basic properties as a single String

Overrides:
toString in class AdminBase

toString

public java.lang.String toString(Framework framework)
Return the Team 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 Team 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 Team 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 Team object from XML element tree

Overrides:
fromXML in class AdminBase

getCreateCommand

public java.lang.String getCreateCommand(boolean force)
Return the OOQL command to create this Team 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 Team 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(Team refTeam,
                                      boolean checkImage,
                                      boolean overwrite,
                                      boolean force,
                                      Framework framework)
                               throws OberonException
Return/apply the OOQL command to update this Team object and let it become equals to another reference object.
This method is useful to import objects from an XML file.

Parameters:
refTeam - the reference Team 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.