input
stringlengths
10
828
output
stringlengths
5
107
public group get group string group id group g get group from cache group id if g null try g new profile group group id catch illegal argument exception e return null add group to cache group id g return g
returns a group object with profile data for the given group or
public void close browser html clear browser clear cache
called when the section container ie notebook is being closed
public object read object input stream in throws ioexception return new user cache proxy
reads the object from the given stream
public string authenticate string user id string password return user id
authenticates the given user with the given password returning
public group get group string group id return get group from cache group id
returns a group object with profile data for the given group or
public vector get all groups vector groups get cached group list if groups null vector ids pc get all group ids groups new vector ids size for enumeration e ids elements e has more elements groups add element new profile group string e next element set cached group list groups return groups
returns a vector of group objects representing all groups in the
public boolean is multi user return all users null all users size 1
returns true if more than one user claims to be present
public vector get all users return vector get cached user list
returns a vector of user objects representing all users in the
public vector get all groups return vector get cached group list
returns a vector of group objects representing all groups in the
public string get admin group name return administrators return vsadmins
return the name of the super user group
public vector get all users if all users size 0 all users add element user return all users
returns a vector of all users who claim to be present
public string get admin group name return vsadmins
return the name of the super user group
public string get user id return id
returns the user login id of this user
public void clear cache uds clear cached user list uds clear cached group list
clears any cached data in the registry
public string get real name return prof get attr value profile properties fullname
returns the real full name of the user
public string get forwarding address return null
returns the forwarding address of the user
public string authenticate string user id string password return uds authenticate user id password
authenticates the given user with the given password returning
public string get home page return homepage
returns the home page
public image icon get icon16 if icon16 null if avatar null icon16 icon lookup get icon lookup get image icon avatar icon lookup icon 16 return icon16
returns a 16x16 icon for this user
public string get email address return prof get email
returns the email address of the user
public user get user string user id return uds get user user id
returns a user object with profile data for the given user or
public image icon get icon32 if icon32 null if avatar null icon32 icon lookup get icon lookup get image icon avatar icon lookup icon 32 return icon32
returns a 32x32 icon for this user
public string get forwarding address return prof get attr value profile properties mailforwards
returns the forwarding address of the user if one is defined
public group get group string group id return uds get group group id
returns a group object with profile data for the given group or
public string get group id return id
returns the id of this group
public image icon get icon16 if icon16 null string avatar prof get attr value profile properties avatar if avatar null icon16 icon lookup get icon lookup get image icon avatar icon lookup icon 16 return icon16
returns a 16x16 icon for this user
public vector get all users return uds get all users
returns a vector of user objects representing all users in the
public image icon get icon32 if icon32 null string avatar prof get attr value profile properties avatar if avatar null icon32 icon lookup get icon lookup get image icon avatar icon lookup icon 32 return icon32
returns a 32x32 icon for this user
public vector get all groups return uds get all groups
returns a vector of group objects representing all groups in the
public boolean is current return true
returns true if the user is a current active user
public void set user list model user list model user list model this user list model user list model
sets the replicated user list model
public user list model get user list model return user list model
returns the replicated user list model
public user get user string user id user u get user from cache user id if u null u new test user user id add user to cache user id u return u
returns a user object with profile data for the given user or
public group get group string group id group g get group from cache group id if g null g new test group group id add group to cache group id g return g
returns a group object with profile data for the given group or
public string get primary user return primary user
returns the primary user logged into this vm
public vector get all users vector v new vector for enumeration e users to groups keys e has more elements v add element e next element return v
returns a vector of user objects representing all users in the
public void set primary user string primary user this primary user primary user
sets the primary user
public vector get all groups vector v new vector for enumeration e groups to users keys e has more elements v add element e next element return v
returns a vector of group objects representing all groups in the
public vector get users return users
returns a vector of string ids of all users who claim to be
public boolean is current string year prof get attr value profile properties year this needs more thought do we want to tag all entries with a year or just the old ones return year null year length 0
returns true if the user is a current active user
public string get real name return id to upper case
returns the real full name of the user
public string get real name if group null return null group for id return group get real name
returns the real full name of the group
public string get primary group id string id get group id if id null vector groups get available groups if groups size 0 id string groups element at 0 return id
returns something that can be treated as a primary group id
public string get email address return id linc cs vt edu
returns the email address of the user
public boolean is single user return users size 1
returns true if there is only a single user present
public string get real name if name null if is single user name get user primary user get real name else if users null users size 0 string buffer sb new string buffer for enumeration e users elements e has more elements string user get user string e next element get real name sb append user if e has more elements sb append sb append string primary primary user to string sb append primary substring primary index of name sb to string else name return name
returns an appropriate real name for the person or persons logged
public string get home page return null
returns the users home page
public boolean is admin string user id group g get group uds get admin group name return g null g is in group user id
convenience method to see if the given user is an admin
public image icon get icon16 return null
returns a 16x16 icon for this user
public vector get available groups vector tmp uds get user primary user get groups if is single user return tmp vector v new vector for enumeration e tmp elements e has more elements group g uds get group string e next element boolean ok true for enumeration u users elements u has more elements ok ok g is in group string u next element if ok v add element g get group id return v
returns a list of group ids that all present users are in
public image icon get icon32 return null
returns a 32x32 icon for this user
public jcombo box get group combo box boolean allow private vector v vector get available groups clone if allow private is single user v insert element at private to primary user 0 jcombo box box new jcombo box v box set renderer new group cell renderer if is single user box set selected item group id else box set selected index 0 return box
convenience method that returns a combo box of groups available to the
public boolean is current string year group get attr value profile properties year this needs more thought do we want to tag all entries with a year or just the old ones return year null year length 0
returns true if the group is a current active group
public set criteria get retrievable criteria class cl if is single user return new retrievable criteria new simple principal primary user cl else group retrievable criteria crit new group retrievable criteria cl vector v new vector for enumeration e users elements e has more elements v add element new simple principal string e next element crit add users v return crit
this method returns a set criteria object that can be used to search
public string get email address return group get email
returns the email address of the group
public void init replicated object client client this client client set criteria crit new retrievable criteria client get user user cache proxy class try object id ids client get identifiers crit if ids length 0 cache proxy user cache proxy client get new object user cache proxy class null proxy id client get object id cache proxy else proxy id ids 0 cache proxy user cache proxy client get object proxy id cache proxy set user data source this catch exception e e print stack trace
initializes the cache by looking up an appropriate cache proxy object
public void init user cache proxy proxy object id proxy id this should be re invoked on each get user attempt on the server side to make sure the proxy hasn t been flushed from the cache this cache proxy proxy this proxy id proxy id cache proxy set user data source this
init method to be used by the server only
protected void add user to cache string user id user user users put user id user
adds a user object to the cache
protected void add group to cache string group id group group groups put group id group
adds a group object to the cache
public icon get icon if icon null icon path null java net url url notice class get resource icon path if url null string path icon path substring 0 icon path last index of icon path substring icon path last index of to upper case url notice class get resource path if url null icon new image icon url return icon
convenience method to return an icon instance
public void add notice notice n if list null list add notice n
usual method for adding a notice
protected vector get cached user list return user list
returns the possibly null cached list of user objects
public void add notice notice n change c changes put n c if list null list add notice n
method for adding a notice that will be sent with a custom change
public void add transient notice notice n changes put n new transient notice list change n if list null list add notice n
method for adding a notice that will be seen only by other users
protected void set cached user list vector user list this user list vector user list clone
sets the cached list of user objects
public void add local notice notice n changes put n new local notice change if list null list add notice n
method for adding a notice that will be seen only in the local
public string get display text return get text date format format get timestamp
returns the text to be displayed in the notice board
public string to string return get display text
returns get display text
protected vector get cached group list return group list
returns the possibly null cached list of group objects
protected void set cached group list vector group list this group list vector group list clone
sets the cached list of group objects
public void fire user changed string user id if client null try client broadcast change new user changed change user id proxy id catch exception e e print stack trace
notifies user data source objects in other vms that a user has changed
public void fire group changed string group id if client null try client broadcast change new group changed change group id proxy id catch exception e e print stack trace
notifies user data source objects in other vms that a group has changed
public string to string string buffer sb new string buffer notice list int sz contents size sb append sz sb append notices if sz 0 sb append sb append contents element at 0 sb append if sz 1 sb append sb append contents element at sz 1 sb append sb append return sb to string
notice lists are a source of considerable log bloat so im using
public boolean is type enabled string type jcheck box menu item item jcheck box menu item items get type return item null item is selected
called to determine if items of the given type are enabled
public void fire user list changed if client null try client broadcast change new user list changed change proxy id catch exception e e print stack trace
notifies user data source objects in other vms that the user list has
public void show component c int x int y action item set enabled false action item set label no selection super show c x y
shows the menu with no action on the first item
public void fire group list changed if client null try client broadcast change new group list changed change proxy id catch exception e e print stack trace
notifies user data source objects in other vms that the group list has
public void mark end of day fix last events
called to notify the semantic event producer that a day has ended
public boolean is valid log entry entry return group is in group entry get user id
returns true if the given log entry is valid based on this filter
public boolean is valid log entry entry int idx entry get description index of string return idx 1 require idx 1 require
returns true if the given log entry is valid based on this filter
public void mark end of week vector semantic events while msgs null msg index msgs length semantic events add element new mail event msgs msg index null
appends any remaining email messages to the end of the vector
private boolean is allowed int year int week boolean ok true if restricted year 1 ok year restricted year if ok restricted week 1 ok week restricted week return ok
returns true if the date is within the range specified by year and
public boolean is valid log entry entry boolean result last null last get description equals entry get description last entry return result
returns true if the given log entry is valid based on this filter
public semantic event get semantic event log entry entry semantic event event null if entry get operation log entry changed object id id entry get object id string cl id get classname if classes get cl null string code id to string substring 0 id to string index of string op added if entry get operation log entry removed op removed removals incr entry get user get organization else adds incr entry get user get organization event new semantic event entry get user op section code entry return event
returns a semantic event or null if this producer doesnt recognize
public boolean is valid log entry entry return entry get user null
returns true if the given log entry is valid based on this filter
public semantic event get semantic event log entry entry semantic event event null string desc entry get description int idx desc index of log entry if idx 1 if last null last equals desc event new semantic event entry get user desc substring idx 13 entry last desc return event
returns a semantic event or null if this producer doesnt recognize
public boolean is valid log entry entry boolean valid true for enumeration e filters elements e has more elements valid valid log entry filter e next element is valid entry return valid
returns true if the given log entry is valid based on this filter
private date get date string line date d null look for three colons int hour 1 int min 1 int sec 1 string tokenizer st new string tokenizer line try hour integer parse int st next token min integer parse int st next token sec integer parse int st next token d date format parse date d set hours hour d set minutes min d set seconds sec catch exception e return d
returns a date object if this appears to be a date otherwise
public semantic event get semantic event log entry entry semantic event event null string desc entry get description int idx desc index of chat message list change if idx 1 string msg desc substring desc index of 2 desc length 1 event new semantic event message from entry get user get real name msg entry event new semantic event entry get user sent message msg entry msgs incr entry get user get organization return event
returns a semantic event or null if this producer doesnt recognize
public semantic event get semantic event log entry entry semantic event event null if entry get operation log entry changed object id id entry get object id string cl id get classname if classes get cl null string code id to string substring 0 id to string index of string op added if entry get operation log entry removed op removed removals incr entry get user get organization else adds incr entry get user get organization event new semantic event entry get user op notebook code entry return event
returns a semantic event or null if this producer doesnt recognize
private string add paragraphs string text make sure we have r s or n s not sure this actually makes it faster if text index of r 1 text index of n 1 return text string buffer buf new string buffer int num found 0 boolean found one false for int i 0 i text length i char ch text char at i if ch r ch n num found if num found 2 buf append p else if num found 1 buf append br num found 0 buf append ch return buf to string
puts ps on double rs or ns
public void set date date d month set selected index d get month year set selected item integer to string d get year 1900 day set selected item integer to string d get date
sets the combo boxes to the given date
public date get date return new date integer parse int string year get selected item 1900 month get selected index day get selected index 1
returns the currently selected date
public void reset month fire contents changed this 0 30 if selected null int sz get size if integer parse int selected to string sz 1 selected integer to string sz 1
updates data based on a month change
private jcomponent make label field pair jcomponent label jcomponent value jpanel pair new jpanel pair set layout new border layout 5 5 pair add label border layout west pair add value border layout center return pair
format two components so that they are side by side
protected shared list get new shared list return new shared task list
subclasses should override this to return an empty instance of
protected boolean is changed task t return t get name null task name get text equals t get name null task name get text equals t get name start get date equals t get start date deadline get date equals t get due date t get percent done progress get value description get text equals t get description approved is selected t get approved by null t get approved by length 0 completed is selected t get status task incomplete
returns true if the contents of the panel have changed relative to
public void init from task task t task name set text t get name start set date t get start date deadline set date t get due date string approved by t get approved by approved set selected approved by null approved by length 0 completed set selected t get status task incomplete progress set value t get percent done description set text t get description
sets the fields on the panel from the given task
public void reset for enumeration e components elements e has more elements jcomponent jc jcomponent e next element dimension size jc get preferred size size height height jc set preferred size size jc set minimum size size
resets all components to have their prefered minimum height and the
public void check access thread g
throws a code security exception code if the