input
stringlengths 10
828
| output
stringlengths 5
107
|
|---|---|
private string create portlet scoped id string name string buffer buffer new string buffer buffer append portlet scope namespace buffer append namespace get namespace buffer append id name separator buffer append name return buffer to string
|
creates portlet scoped id for the specified attribute name
|
private boolean is in current portlet scope string name portlet scoped attribute names must start with javax portlet p and contain the id name separator if name starts with portlet scope namespace name index of id name separator 1 string id name substring portlet scope namespace length name index of id name separator return id equals namespace get namespace application scoped attribute names are not in portlet scope else return false
|
checks if the attribute name in application scope is in the current
|
public servlet response get response return servlet response get response
|
return the wrapped servlet response object
|
public void set property string key string value if key null throw new illegal argument exception property key can t be null list string values portlet properties get key to lower case if values null values new array list string portlet properties put key to lower case values else values clear values add value
|
sets a string property to be returned to the portal
|
public string get property string key if key null throw new illegal argument exception key can t be null list string values portlet properties get key to lower case if values null return values get 0 else return null
|
returns the value of the specified request property
|
public enumeration get properties string key if key null throw new illegal argument exception key can t be null list string values portlet properties get key to lower case if values null values collections empty list return collections enumeration values
|
returns all the values of the specified request property
|
public string get auth type if auth null return null return http servlet request form auth
|
returns the name of the authentication scheme used for the
|
public string decode namespace namespace string name if name starts with webmill prefix return null string builder buffer new string builder 50 buffer append webmill prefix buffer append namespace get namespace buffer append if name starts with buffer to string return null return name substring buffer length
|
decode name of http session attribute to portlet session attribute
|
public user get user not restricted long user id if user id null return null stateless session session hibernate utils get stateless session try user bean bean user bean session create query select user from org riverock webmill portal bean user bean as user where user user id user id set long user id user id unique result return bean finally session close
|
get user without restriction
|
public company get company not restricted long company id if company id null return null stateless session session hibernate utils get stateless session try company bean bean company bean session create query select company from org riverock webmill portal bean company bean as company where company is deleted false and company id companyid set long companyid company id unique result return bean finally session close
|
get company without restriction
|
public void process delete company not restricted company company if company null return session session hibernate utils get session try session begin transaction session create query delete org riverock webmill portal bean company bean as company where company id company id set long company id company get id execute update session flush session clear session get transaction commit finally session close
|
delete company without restriction
|
public servlet output stream get output stream throws ioexception if is using writer throw new illegal state exception get output stream can t be used after get writer was invoked if wrapped writer null wrapped writer servlet response get output stream is using stream true return wrapped writer
|
the default behavior of this method is to return get output stream
|
public output stream get portlet output stream throws ioexception return get output stream
|
returns a code output stream code suitable for writing binary
|
public print writer get writer throws ioexception if log is debug enabled log debug get writer is using stream is using stream is using writer is using writer log debug response servlet response get class get name if is using stream throw new illegal state exception get writer can t be used after get output stream was invoked is using writer true noinspection unnecessary local variable print writer writer servlet response get writer return writer
|
returns a print writer object that can send character
|
public locale get locale return render request get locale
|
returns the locale assigned to the response
|
public void set buffer size int size servlet response set buffer size size
|
current version of webmill portal does not support buffering
|
public int get buffer size return servlet response get buffer size
|
returns the actual buffer size used for the response
|
public void flush buffer throws ioexception servlet response flush buffer
|
forces any content in the buffer to be written to the client
|
public void reset buffer servlet response reset buffer
|
clears the content of the underlying buffer in the response without
|
public boolean is committed return servlet response is committed
|
returns a boolean indicating if the response has been
|
public portlet url create render url return new portlet urlimpl portal request render request false namespace request state portlet name portal context portlet container
|
creates a portlet url targeting the portlet
|
public portlet url create action url return new portlet urlimpl portal request render request true namespace request state portlet name portal context portlet container
|
creates a portlet url targeting the portlet
|
public string get namespace return namespace get namespace
|
the value returned by this method should be prefixed or appended to
|
public void set content type string type servlet response set content type type
|
sets the mime type for the render response
|
public string get character encoding return servlet response get character encoding
|
returns the name of the charset used for
|
public void update observable o object arg destroy
|
this method is called whenever the observed object is changed
|
public void set value string key string value throws read only exception if key null throw new illegal argument exception can t set value of preference key is null if is read only key throw new read only exception preference key is read only if value null portlet metadata remove key return array list string list new array list string list add value portlet metadata put key list if log is debug enabled log debug set new preference log debug key key value value log debug result portlet metadata get key
|
associates the specified string value with the specified key in this
|
public void set values string key string values throws read only exception if key null throw new illegal argument exception can t set value of preference key is null if is read only key throw new read only exception preference key is read only if values null return list string list new array list string values length for string value values if value null continue list add value if list is empty portlet metadata remove key return portlet metadata put key list
|
associates the specified string array value with the specified key in this
|
public enumeration get names set string set new hash set string if preferences null preferences get preference list is empty for preference preference preferences get preference list set add preference get name set add all portlet metadata key set return collections enumeration set
|
returns all of the keys that have an associated value
|
public void reset string key throws read only exception if key null throw new illegal argument exception can t reset preference key is null if is read only key throw new read only exception preference key is read only list string def default portlet metadata get key if def null portlet metadata put key def else portlet metadata remove key
|
resets or removes the value associated with the specified key
|
public long length throws sqlexception return bytes length
|
returns the number of bytes in the code blob code value
|
public template bean get template long template id for template bean template bean template beans if template bean get template id equals template id hibernate template dao impl prepare blob template bean return template bean return null
|
template data is initialized
|
public input stream get binary stream throws sqlexception byte array input stream result new byte array input stream bytes return result
|
retrieves the code blob code value designated by this
|
public template bean get template string template name long site language id return null
|
template data is initialized
|
public long position byte pattern long start throws sqlexception throw new illegal state exception not implemented
|
retrieves the byte position at which the specified byte array
|
public template bean get template long site id string template name string lang if site id null template name null lang null return null for template bean template bean template beans hack work only with site id 16 l and locale en if site id 16 l template name equals template bean get template name lang equals en return template bean return null
|
attention template data not initalized
|
public void store throws ioexception validator exception if is render request throw new illegal state exception can t store preference inside render request if is store processed throw new illegal state exception portlet preferences cannot be modified when they are being validated by a preferences validator if preferences get preferences validator null is store processed true try preferences get preferences validator validate this finally is store processed false persistencer store portlet metadata
|
commits all changes made to the preferences via the
|
public long position blob pattern long start throws sqlexception throw new illegal state exception not implemented
|
retrieves the byte position in the code blob code value
|
public void update observable o object arg invalidate cache long arg
|
this method is called whenever the observed object is changed
|
public int set bytes long pos byte bytes throws sqlexception throw new illegal state exception not implemented return 0 to change body of implemented methods use file settings file templates
|
writes the given array of bytes to the code blob code value that
|
public int set bytes long pos byte bytes int offset int len throws sqlexception throw new illegal state exception not implemented return 0 to change body of implemented methods use file settings file templates
|
writes all or part of the given code byte code array to the
|
public void truncate long len throws sqlexception throw new illegal state exception not implemented to change body of implemented methods use file settings file templates
|
truncates the code blob code value that this code blob code
|
public void set specific daos map string object specific daos this specific daos specific daos
|
in practice some daos could be put into this map using spring
|
protected entity manager em return entity manager
|
get the current entity manager
|
protected boolean remove by id class type serializable id if id null query query em create query select it id from get metadata util get type get entity name it where it id 1 set parameter 1 id if query get result list size 0 em remove em get reference type id return true return false
|
remove the entity of the specified class with the specified id from the
|
protected void remove by ids class type serializable ids for serializable id list serializable pull by ids select it id type ids em remove em get reference type id
|
remove all the entities of the given type from the datastore that have
|
protected boolean remove entity object entity if entity null if em contains entity em remove entity return true else serializable id get metadata util get id entity return remove by id entity get class id return false
|
remove the specified entity from the datastore
|
protected void remove entities object entities for object entity entities remove entity entity
|
remove the specified entities from the datastore
|
protected list search isearch search if search null throw new null pointer exception search is null if search get search class null throw new null pointer exception search class is null return get search processor search em search
|
search for objects based on the search parameters in the specified
|
protected list search class search class isearch search if search null throw new null pointer exception search is null if search class null throw new null pointer exception search class is null if search get search class null search get search class equals search class throw new illegal argument exception search class does not match expected type search class get name return get search processor search em search class search
|
same as code search isearch code except that it uses the specified
|
protected int count isearch search if search null throw new null pointer exception search is null if search get search class null throw new null pointer exception search class is null return get search processor count em search
|
returns the total number of results that would be returned using the
|
protected int count class search class isearch search if search null throw new null pointer exception search is null if search class null throw new null pointer exception search class is null if search get search class null search get search class equals search class throw new illegal argument exception search class does not match expected type search class get name return get search processor count em search class search
|
same as code count isearch code except that it uses the specified
|
protected int count class type return number em create query select count it from get metadata util get type get entity name it get single result int value
|
returns the number of instances of this entity in the datastore
|
public void test eager fetching paging error init db search s new search home class assert equals 3 target search s size s set max results 3 assert equals 3 target search s size s set max results 2 assert equals 2 target search s size s set max results 1 assert equals 1 target search s size s set max results 2 s set page 1 assert equals 1 target search s size
|
the building of joins to eagerly fetch collections can mess with result
|
protected search result search and count isearch search if search null throw new null pointer exception search is null if search get search class null throw new null pointer exception search class is null return get search processor search and count em search
|
returns a code search result code object that includes the list of
|
protected search result search and count class search class isearch search if search null throw new null pointer exception search is null if search class null throw new null pointer exception search class is null if search get search class null search get search class equals search class throw new illegal argument exception search class does not match expected type search class get name return get search processor search and count em search class search
|
same as code search and count isearch code except that it uses the
|
protected object search unique isearch search throws non unique result exception no result exception if search null throw new null pointer exception search is null if search get search class null throw new null pointer exception search class is null return get search processor search unique em search
|
search for a single result using the given parameters
|
protected boolean contains object o return em contains o
|
returns true if the object is connected to the current hibernate session
|
public int count entity manager entity manager isearch search if search null return 0 return count entity manager search get search class search
|
returns the total number of results that would be returned using the
|
protected void flush em flush
|
flushes changes in the hibernate cache to the datastore
|
public int count entity manager entity manager class search class isearch search if search class null search null return 0 list object param list new array list object string ql generate row count ql search class search param list if ql null special case where the query uses column operators return 1 query query entity manager create query ql add params query param list return number query get single result int value
|
returns the total number of results that would be returned using the
|
protected void refresh object entities for object entity entities if entity null em refresh entity
|
refresh the content of the given entity from the current datastore state
|
public object search unique entity manager entity manager isearch search throws non unique result exception if search null return null return search unique entity manager search get search class search
|
search for a single result using the given parameters
|
protected string generate from clause search context ctx boolean do eager fetching string builder sb new string builder from sb append get metadata util get ctx root class get entity name sb append sb append ctx get root alias sb append generate joins ctx do eager fetching return sb to string
|
internal method for generating from clause
|
public search add filter custom string expression search util add filter custom this expression return this
|
add a filter that uses a custom expression
|
public void set general dao general dao general dao this general dao general dao
|
general dao has default implementations for the standard dao methods
|
public search add filter custom string expression object values search util add filter custom this expression values return this
|
add a filter that uses a custom expression
|
public search add filter custom string expression collection values search util add filter custom this expression values return this
|
add a filter that uses a custom expression
|
protected session get session return session factory get current session
|
get the current hibernate session
|
protected hibernate metadata util get metadata util return metadata util
|
get the instance of hibernate metadata util associated with the session
|
protected hibernate search processor get search processor return search processor
|
get the instance of ejbsearch processor associated with the session
|
protected void save object entities for object entity entities save entity
|
persist the given transient instances and add them to the datastore
|
protected boolean delete by id class type serializable id if id null type metadata util get unproxied class type get the real entity class object entity get session get type id if entity null get session delete entity return true return false
|
remove the entity of the specified class with the specified id from the
|
public search add sort string property boolean desc search util add sort this property desc return this
|
add sort by property
|
public search add sort string property boolean desc boolean ignore case search util add sort this property desc ignore case return this
|
add sort by property
|
protected void delete by id class type serializable ids type metadata util get unproxied class type get the real entity class criteria c get session create criteria type c add restrictions in id ids for object entity c list get session delete entity
|
remove all the entities of the given type from the datastore that have
|
protected boolean delete entity object entity if entity null serializable id get metadata util get id entity if id null entity get session get metadata util get unproxied class entity id if entity null get session delete entity return true return false
|
remove the specified entity from the datastore
|
protected void delete entities object entities for object entity entities if entity null get session delete entity
|
remove the specified entities from the datastore
|
protected void load object transient entity serializable id get session load transient entity id
|
read the persistent state associated with the given identifier into the
|
protected list search isearch search if search null throw new null pointer exception search is null if search get search class null throw new null pointer exception search class is null return get search processor search get session search
|
search for objects based on the search parameters in the specified
|
protected list search class search class isearch search if search null throw new null pointer exception search is null if search class null throw new null pointer exception search class is null if search get search class null search get search class equals search class throw new illegal argument exception search class does not match expected type search class get name return get search processor search get session search class search
|
same as code search isearch code except that it uses the specified
|
protected int count isearch search if search null throw new null pointer exception search is null if search get search class null throw new null pointer exception search class is null return get search processor count get session search
|
returns the total number of results that would be returned using the
|
protected void append custom expression string builder sb search context ctx string expression matcher matcher pattern compile w matcher expression int last end 0 while matcher find sb append expression substring last end matcher start sb append get path ref ctx expression substring matcher start 1 matcher end 1 last end matcher end sb append expression substring last end
|
append a custom expression to the string builder replacing any
|
protected int count class search class isearch search if search null throw new null pointer exception search is null if search class null throw new null pointer exception search class is null if search get search class null search get search class equals search class throw new illegal argument exception search class does not match expected type search class get name return get search processor count get session search class search
|
same as code count isearch code except that it uses the specified
|
protected int count class type list counts get session create query select count it from get metadata util get type get entity name it list int sum 0 for object count counts sum long count int value return sum
|
returns the number of instances of this class in the datastore
|
protected search result search and count isearch search if search null throw new null pointer exception search is null if search get search class null throw new null pointer exception search class is null return get search processor search and count get session search
|
returns a code search result code object that includes the list of
|
protected object search unique isearch search throws non unique result exception if search null throw new null pointer exception search is null if search get search class null throw new null pointer exception search class is null return get search processor search unique get session search
|
search for a single result using the given parameters
|
protected object search unique class search class isearch search if search null throw new null pointer exception search is null if search class null throw new null pointer exception search class is null if search get search class null search get search class equals search class throw new illegal argument exception search class does not match expected type search class get name return get search processor search unique get session search class search
|
same as code search unique isearch code except that it uses the specified
|
protected boolean session contains object o return get session contains o
|
returns true if the object is connected to the current hibernate session
|
protected void flush get session flush
|
flushes changes in the hibernate cache to the datastore
|
protected void refresh object entities for object entity entities get session refresh entity
|
refresh the content of the given entity from the current datastore state
|
protected void security check property string property if property null return if injection check matcher property matches throw new illegal argument exception a property used in a search may only contain word characters alphabetic numeric and underscore and dot seperators this constraint was violated property
|
used by code security check code to check a property string for
|
public string get string name for properties p props string r p get property name if r null return r return null
|
returns value of a property with given name or code null code if
|
public string get string string name throws configuration exception string r get name if r null throw new configuration exception this cannot find property name return r
|
returns value of a property with given name or throws
|
public string get string string name string def for properties p props string r p get property name if r null return r return def
|
returns value of a property with given name or default value if property
|
public int get int string name throws configuration exception string r get string name try return integer parse int r catch number format exception nfex throw new configuration exception this value of property name r is not a valid integer nfex
|
returns value of a property with given name as integer or throws
|
public int get int string name int def string r get name if r null return def try return integer parse int r catch number format exception nfex logger warn this value of property name r is not a valid integer usign default value def return def
|
returns value of a property with given name as integer or default value
|
public string replace string str matcher m placeholder pattern matcher str string buffer sb new string buffer str length while m find string name m group 1 string value get name if value null logger debug this replaced m group with value m append replacement sb matcher quote replacement value else logger warn this no property for m group m append replacement sb matcher quote replacement m group m append tail sb return sb to string
|
replaces placeholders in a form of something with a values of
|
public void add byte buffer b buffers add b available b remaining if current buffer null current buffer buffers get 0
|
adds byte buffer to read from
|
public void add all list byte buffer buffers for byte buffer b buffers add b
|
add list of byte buffers to read from
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.