input
stringlengths
10
828
output
stringlengths
5
107
public void add identity identity string email identity get user get property user constants email null identi emails put key from email identity
contribute a contact as an identity
public void unbind string name throws naming exception vfsitem file resolve file name if file null throw new naming exception smgr get string resources not found name vfsstatus status file delete if status vfsconstants no throw new naming exception smgr get string resources unbind failed name
unbinds the named object
public string get rfc2822 name return name
contact list name as string formatted according to a href
public string get rfc2822 name with addresses return name to string
contact list name and e mail adresses as string formatted according to
public void add contact list email list string emails put all email list get string emails identi emails put all email list get identi emails
add members of another contact list to this contact list
public string to string string ret val string sep array list emails get emails as strings iterator iter emails iterator while iter has next ret val sep string iter next sep return ret val
a comma separated list of e mail addresses
public void add all identites list list of identity iterator iter list of identity iterator while iter has next add identity iter next
add all identity objects in the provided list
private int read sbits int num bits throws ioexception get the number as an unsigned value long u bits read ubits num bits is the number negative if u bits 1 l num bits 1 0 yes extend the sign u bits 1 l num bits return int u bits
read a signed value from the given number of bits
static public object deep copy object old obj throws runtime exception object output stream oos null object input stream ois null try byte array output stream bos new byte array output stream oos new object output stream bos serialize and pass the object oos write object old obj oos flush byte array input stream bin new byte array input stream bos to byte array ois new object input stream bin return the new object return ois read object catch exception e throw new runtime exception exception in object cloner e finally try oos close ois close catch exception e
returns a deep copy of an object must all be serializable
public naming enumeration list string name throws naming exception vfsitem file resolve file name if file null throw new naming exception smgr get string resources not found name return new naming context enumeration list file iterator
enumerates the names bound in the named context along with the class names
public void synch bits bit buf 0 bit pos 0
reset the bit buffer
public controller execute folder component fc user request ureq window control w control translator trans this set translator trans if fc get current container can write vfsconstants yes throw new assert exception illegal attempt to create folder in fc get current container path this folder component fc main vc this create velocity container create folder panel main vc put foldercomp folder component create folder form new create folder form ureq w control trans this listen to create folder form main vc put create folder form create folder form get initial component this put initial panel main vc return this
create a folder
public naming enumeration list bindings string name throws naming exception return list name
enumerates the names bound in the named context along with the objects
public void set collect comments boolean new value collect comments new value
specify whether textual comments are supposed to be extracted from input
private boolean validate folder name string name boolean is valid true check if there are any unwanted path denominators in the name if name index of 1 name index of 1 name index of 1 is valid false return is valid
checks if the input name is a valid folder name
public void set determine image number boolean new value determine number of images new value
specify whether the number of images in a file is to be determined
public void destroy subcontext string name throws naming exception unbind name
destroys the named context and removes it from the namespace
public object lookup link string name throws naming exception note links are not supported return lookup name
retrieves the named object following links except for the terminal atomic
public string get name in namespace throws naming exception return doc base
retrieves the full name of this context within its own namespace
public attributes get attributes string name string attr ids throws naming exception building attribute list vfsitem file resolve file name if file null throw new naming exception smgr get string resources not found name return new vfsresource attributes file
retrieves selected attributes associated with a named object
public void modify attributes string name int mod op attributes attrs throws naming exception not implemented
modifies the attributes associated with a named object
public void modify attributes string name modification item mods throws naming exception not implemented
modifies the attributes associated with a named object using an an ordered
private boolean validate file name string name boolean is valid true check if there are any unwanted path denominators in the name if name index of 1 name index of 1 name index of 1 is valid false return is valid
checks if filename contains any prohibited chars
private void parse user request ureq string s files ureq get http req get parameter values form id if s files null s files length 0 return files arrays as list s files
parse paths and build briefcase path wrappers
public string render as html string builder sb new string builder sb append ul for iterator iter files iterator iter has next sb append li sb append current container rel path iter next sb append li sb append ul return sb to string
render pathset as html
private string get canonical meta path olat rel path impl olat rel path impl file f get origin file olat rel path impl if f exists return null if f is directory return folder config get canonical meta root olat rel path impl get rel path xml else return folder config get canonical meta root olat rel path impl get rel path xml
get the canonical path to the files meta file
public void rename string new name rename meta info file name if is directory rename the directory which is the parent of the actual xml file file meta file directory meta file get parent file meta file directory rename to new file meta file directory get parent file new name else rename the file meta file rename to new file meta file get parent file new name xml
rename the given meta info file
public void move copy to dir olat rel path impl target boolean move file f source meta file file f target new file get canonical meta path target if is directory move copy whole meta directory f source f source get parent file f target f target get parent file if move file utils move file to dir f source f target else file utils copy file to dir f source f target
move copy the given meta info to the target directory
public void delete all if is directory delete whole meta directory where the xml resides within file utils delete dirs and files meta file get parent file true true else delete this single meta file meta file delete
delete all associated meta info including sub files directories
public void copy values meta info from meta author from meta author comment from meta comment
copy values from fro meta into this object except name
public boolean write if meta file null return false try file output stream fos new file output stream meta file output stream writer writer new output stream writer fos charset for name utf 8 writer write xml version 1 0 encoding utf 8 writer write meta writer write author cdata author author writer write comment cdata comment comment writer write meta writer close catch exception e return false return true
writes the meta data to file
public list get current container children return current container children
return the children of the folder of this folder component
public boolean delete if meta file null return false return meta file delete
delete this meta info
private boolean parse xmldom file f meta if f meta null return false file input stream in try in new file input stream f meta catch file not found exception e return false xmlparser xmlp new xmlparser document doc xmlp parse in false if doc null return false extract data from xml element root doc get root element element n n root element author author n null n get text n root element comment comment n null n get text return true
parse xml from file with sax and fill in meta info attributes
public dir context get schema string name throws naming exception throw new operation not supported exception
retrieves the schema associated with the named object
public vfscontainer create child container string name vfsitem result super create child container name if result null return null return new olat root folder impl folder rel path name this
wrapp all local impls to olat root impls
public vfsleaf create child leaf string name vfsitem result super create child leaf name if result null return null return new olat root file impl folder rel path name this
wrapp all local impls to olat root impls
public list get items list children super get items list wrapped children new array list children size now wrapp all local impls to olat root impls for iterator iter children iterator iter has next vfsitem child vfsitem iter next if child instanceof local folder impl wrapped children add new olat root folder impl folder rel path child get name this else if child instanceof local file impl wrapped children add new olat root file impl folder rel path child get name this return wrapped children
wrapp all local impls to olat root impls
public dir context get schema class definition string name throws naming exception throw new operation not supported exception
retrieves a context containing the schema objects of the named objects
private string get form action user request ureq enumeration params ureq get http req get parameter names while params has more elements string key string params next element if key starts with action pre return key substring action pre length return null
special treatment of forms with multiple submit actions
public naming enumeration search string name attributes matching attributes string attributes to return throws naming exception return null
searches in a single context for objects that contain a specified set of
public void allow page editing edit link link factory create custom link command edit command edit link nontranslated my content this edit link set custom enabled link css b content edit edit link set tooltip trans translate command edit false
when you call this method the edit mode will be enabled
public naming enumeration search string name attributes matching attributes throws naming exception return null
searches in a single context for objects that contain a specified set of
public naming enumeration search string name string filter search controls cons throws naming exception return null
searches in the named context or object for entries that satisfy the given
public naming enumeration search string name string filter expr object filter args search controls cons throws naming exception return null
searches in the named context or object for entries that satisfy the given
protected vfsitem resolve file string name if name null name if name length 0 name char at 0 name name substring 1 return base resolve name
resolve a file relative to this base
public void set content controller creator controller creator content controller creator this content controller creator content controller creator
used by spring
protected array list list vfsitem file array list entries new array list if file instanceof vfscontainer return entries list children vfscontainer file get items naming entry entry null for int i 0 i children size i vfsitem current file vfsitem children get i object object if current file instanceof vfscontainer vfsdir context temp context new vfsdir context env temp context set virtual doc base current file object temp context else object new vfsresource current file entry new naming entry current file get name object naming entry entry entries add entry return entries
list the resources which are members of a collection
public custom media chooser controller get custom media chooser controller return custom media chooser controller
get the custom media chooser that is added to the default media choosers
public boolean get movie viewer enabled return movie viewer enabled
the movie viewer adds streaming video support to the tiny mce editor
public void set movie viewer enabled boolean movie viewer enabled this movie viewer enabled movie viewer enabled
the movie viewer adds streaming video support to the tiny mce editor
public object create service return new clipboard service impl
must return an instance of a clipboardservice
public long get content length if content length 1 l return content length if is collection content length 0 else vfsleaf leaf vfsleaf vfs item content length leaf get size return content length
get content length
public long get creation if creation 1 l return creation if is collection creation 0 else creation vfs item get last modified return creation
get creation time
public long get last modified if last modified 1 l return last modified if is collection last modified 0 else last modified vfs item get last modified return last modified
get last modified time
private void release lock if lock null coordinator manager get coordinator get locker release lock lock lock null
releases the lock for this page if set
public void close session get data reset access counter if inactiv return if has transaction get transaction is in transaction get transaction is rolled back tracing log debug call commit get class get transaction commit tracing log debug commit done has transaction has transaction get class dbsession s get dbsession if s null s close
close the database session
public dbquery create query string query begin transaction query return get dbmanager create query query
create a dbquery
public string get resource type if accessed is collection needed to initialize return super get resource type
get resource type
public list find string query object value type type begin transaction query return get dbmanager find get transaction query value type
find objects based on query
public void clear database if olatcontext is junit test throw new assert exception clear database only allowed in j unit test cases delete from database tables
delete all data from database when used by an olattest case
public list find string query object values type types begin transaction query return get dbmanager find get transaction query values types
find objects based on query
public list find string query begin transaction query return get dbmanager find get transaction query
find objects based on query
public object find object class the class long key begin transaction key return get dbmanager find object the class key
find an object
public object load object class the class long key begin transaction key return get dbmanager load object get transaction the class key
load an object
public void update object object object begin transaction object get dbmanager update object get transaction object
update an object
public exception get error if has transaction return get transaction get error else return get dbmanager get last error
get any errors from a previous db call
public persistable load object persistable persistable boolean force reload from db if persistable null throw new assert exception persistable must not be null begin transaction persistable persistable ret class the class persistable get class if force reload from db contains persistable if the obj is not yet in the hibernate cache of the current hibernate session load it if force reload from db get dbmanager evict persistable ret persistable load object the class persistable get key else nothing to do return the same object ret persistable return ret
loads an object if needed
protected void set error and rollback exception exception error exception tracing log warn hibernate error rolling back error dbtransaction class rollback
set the exception to the transaction object
public void rollback tracing log debug rollback start get class try if has transaction get transaction is in transaction tracing log debug call rollback get class get transaction rollback catch exception ex tracing log warn could not rollback transaction ex get class throw new dbruntime exception rollback failed ex
call this to rollback current changes
public statistics get statistics return session factory get statistics
statistics must be enabled first when you want to use it
public object next throws naming exception return next element
retrieves the next element in the enumeration
private void set creation date date date creation date date
for hibernate only
private void set last modified date date last modified date
for hibernate only
private void set key long key this key key
for hibernate only
public boolean has more throws naming exception return iterator has next
determines whether there are any more elements in the enumeration
public void close throws naming exception
closes this enumeration
public void activate get window control push to main area preview vc
activate this preview workflow
public void add disposable child controller controller to bedisposed controller on dispose listen to to bedisposed controller on dispose
add a controller to this layout controller that should be cleaned up when
public void add css class to main string css class if main css classes contains css class do nothing and report as error to console but no gui error for user get logger error tried to add css class css class to b main but css class was already added else main css classes add css class add new css classes for main container string main css calculate main css classes main css classes layout main vc context put main css classes main css
add a css class to the b main wrapper div e
public void remove css class from main string css class if main css classes contains css class main css classes remove css class add new css classes for main container string main css calculate main css classes main css classes layout main vc context put main css classes main css else do nothing and report as error to console but no gui error for user get logger error tried to remove css class css class from b main but css class was not there
remove a css class from the b main wrapper div
private void hide col boolean hide int column if hide if columns column 1 null return else main css classes add b hidecol column else if columns column 1 null return else main css classes remove b hidecol column add new css classes for main container string main css calculate main css classes main css classes layout main vc context put main css classes main css
internal method to hide a column without removing the component
private void remove col resizer int column switch column case 1 layout main vc remove resize col1 compress layout main vc remove resize col1 clear layout main vc remove resize col1 expand break default layout main vc remove resize col2 compress layout main vc remove resize col2 clear layout main vc remove resize col2 expand break
internal method to remove the manual column resizer object
public void activate get window control push to main area back vc
activate this back workflow
public void set service creators map string service creator service creators this service creators service creators
used by spring
public core settings get core settings return core settings
used by spring
public void destroy if web davmanager null web davmanager destroy cache
finalize this servlet
public void do get http servlet request request http servlet response response throws servlet exception ioexception do post request response
called when the http request method is get
public void do post http servlet request request http servlet response response throws servlet exception ioexception dispatcher execute request response null
called when the http request method is post
public boolean is site active site instance si return cur site null si cur site
used by velocity helper for velocity
public void destroy no actions necessary
finalize this servlet
protected string get relative path http servlet request request no extract the desired path directly from the request string path request get path info return normalize path true
return the relative path associated with this servlet
protected string get relative path http servlet request request are we being processed by a request dispatcher include if request get attribute javax servlet include request uri null string result string request get attribute javax servlet include path info if result null result string request get attribute javax servlet include servlet path if result null result equals result return result no extract the desired path directly from the request string result request get path info if result null result request get servlet path if result null result equals result return normalize result
return the relative path associated with this servlet
private void get path try input stream logprop new file input stream webapp helper get context root web inf log4j properties properties p new properties p load logprop logfilepath p get property log4j appender syslog file if tracing is debug enabled log file class tracing log debug reading log4j properties log4j appender syslog file logfilepath log file class catch ioexception e throw new startup exception error reading log4j properties file e
looks for a logfile which is defined in the log properties
public void debug string log msg string user obj tracing log debug log msg user obj logging clazz
add debug log entry
public void audit string log msg string user obj tracing log audit log msg user obj logging clazz
add audit log entry with a user object
protected string get etag resource info resource info if resource info strong etag null return resource info strong etag else if resource info weak etag null return resource info weak etag else return w resource info length resource info date
get the etag associated with a file
protected void display size string builder buf int filesize int leftside filesize 1024 int rightside filesize 1024 103 makes 1 digit to avoid 0 0 for non zero file we bump to 0 1 if leftside 0 rightside 0 filesize 0 rightside 1 buf append leftside append append rightside buf append kb
display the size of a file
private string generate namespace declarations return xmlns default namespace
generate the namespace declarations
private boolean is locked http servlet request req string path get relative path req string if header req get header if if if header null if header string lock token header req get header lock token if lock token header null lock token header return is locked path if header lock token header
check to see if a resource is currently write locked