| java.lang.Object org.tigris.scarab.tools.ScarabGlobalTool
ScarabGlobalTool | public class ScarabGlobalTool implements ApplicationTool(Code) | | This scope is an object that is made available as a global
object within the system.
This object must be thread safe as multiple
requests may access it at the same time. The object is made
available in the context as: $scarabG
The design goals of the Scarab*API is to enable a pull based
methodology to be implemented.
author: Jon S. Stevens author: Douglas B. Robertson version: $Id: ScarabGlobalTool.java 10198 2006-07-03 23:33:30Z dabbous $ |
Method Summary | |
public Date | addApproxOneHour(Date date) | public String | getActivityTypeLabelResource(String code) Remap Activity code to resource id. | public List | getAllAttributes() Gets a List of all of the data (non-user) Attribute objects. | public List | getAllAttributes(String attributeType, boolean includeDeleted, String sortColumn, String sortPolarity) Gets a List of all of the data (non-user) Attribute objects. | public List | getAllAttributes(String sortColumn, String sortPolarity) Gets a List of all of the data (non-user) Attribute objects. | public List | getAllIssueTypes() | public List | getAllIssueTypes(boolean deleted) | public List | getAllIssueTypes(boolean deleted, String sortColumn, String sortPolarity) Gets a List of all of the Attribute objects. | public List | getAllNotificationTypeCodes() Get the list of available activityType codes. | public List | getAllPermissions() Returns a list of all the permissions in use by scarab. | public List | getAttributes(String attributeType) Gets a List of all of the Attribute objects by type. | public List | getAttributes(String attributeType, boolean includeDeleted, String sortColumn, String sortPolarity) Gets a List of all of user Attribute objects. | public String | getBuildVersion() returns Scarab's build version. | public int | getCALENDAR_DAY_FIELD() | public int | getCALENDAR_HOUR_FIELD() | public int | getCALENDAR_MONTH_FIELD() | public int | getCALENDAR_YEAR_FIELD() | public SkipFiltering | getCommentText(String text, ScarabLink link, Module currentModule) | public FieldMethodizer | getConstant() holds the Scarab constants. | public List | getCustomization(Object moduleId, Object userId, Object activityCode) | public int | getInt(Object obj) Returns an int representation of the given
Object whose toString method should be a valid integer. | public MITListManager | getMITListManager() | public static synchronized int | getModuleCodeLength() | public static int | getModuleCodeLengthPadded() | public List | getModulesFromIssueList(List issues) Create a list of Modules from the given list of issues. | public static NotificationFilter | getNotificationFilter(Integer moduleId, Integer userId, String activityCode) | public Date | getNow() Get a new Date object initialized to the current time. | public GlobalParameterManager | getParameter() | public FieldMethodizer | getParameterName() holds the names of parameters that are configurable through the ui. | public FieldMethodizer | getPermission() holds the Scarab permission constants. | public int | getPublicModulesDisplayCount() Provides the maximum number of public modules to be shown on the
login screen. | public List | getSearchUsers(String searchField, String searchCriteria) Returns a List of users based on the given search criteria. | public List | getSearchUsers(String searchField, String searchCriteria, String orderByField, String ascOrDesc) Describe getSearchUsers method here. | public String | getSiteLogo() Provides the site logo for the top banner. | public String | getSiteName() Provides the site name for the top banner. | public org.apache.commons.configuration.Configuration | getTurbineConfiguration() | public List | getUserAttributes() Gets a List of all of user Attributes. | public List | getUserAttributes(String sortColumn, String sortPolarity) Gets a List of all of the Attribute objects. | public List | getUserAttributes(boolean includeDeleted, String sortColumn, String sortPolarity) Gets a List of all of the Attribute objects. | public static Workflow | getWorkflow() Makes the workflow tool accessible. | public void | init(Object data) | public boolean | isString(Object obj) | public List | linkIssueIds(Module module, String text) | public void | log(String s) Logs a message at the debug level. | public void | log(String category, String s) Logs a message at the debug level. | public void | print(String s) Prints a message to standard out. | public void | refresh() | public String | replace(String text, String a, String b) | public Object[] | reverse(Object[] a) Creates a new array with elements reversed from the given array. | public List | reverse(List a) Creates a new List with elements reversed from the
given List . | public int | sizeOfArray(Object[] obj) Velocity has no way of getting the size of an Object[]
easily. | public List | subset(List a, Integer fromIndex, Integer toIndex) Creates a view of the portion of the given
List between the specified fromIndex , inclusive, and
toIndex , exclusive. | public Object[] | subset(Object[] a, Integer fromIndex, Integer toIndex) | public boolean | templateExists(String template) Delegates to Velocity's templateExists() method. | public SkipFiltering | textToHTML(String text, ScarabLink link, Module currentModule) Converts a text string to HTML by:
- replacing reserved characters with equivalent HTML entities
- adding hyperlinks for URLs
- adding hyperlinks for issue references
Parameters: text - The text string to convert. Parameters: link - Parameters: currentModule - The active module. | public Enumeration | tokenize(String text, String delimiters) Breaks text into a list of Strings. |
ScarabGlobalTool | public ScarabGlobalTool()(Code) | | Constructor does initialization stuff
|
getActivityTypeLabelResource | public String getActivityTypeLabelResource(String code)(Code) | | Remap Activity code to resource id. Necessary due to
incompatible name conventions.
Parameters: code - |
getAllAttributes | public List getAllAttributes() throws Exception(Code) | | Gets a List of all of the data (non-user) Attribute objects.
|
getAllAttributes | public List getAllAttributes(String attributeType, boolean includeDeleted, String sortColumn, String sortPolarity) throws Exception(Code) | | Gets a List of all of the data (non-user) Attribute objects.
Passes in sort criteria.
|
getAllAttributes | public List getAllAttributes(String sortColumn, String sortPolarity) throws Exception(Code) | | Gets a List of all of the data (non-user) Attribute objects.
Passes in sort criteria.
|
getAllIssueTypes | public List getAllIssueTypes(boolean deleted) throws Exception(Code) | | gets a list of all Issue Types
|
getAllIssueTypes | public List getAllIssueTypes(boolean deleted, String sortColumn, String sortPolarity) throws Exception(Code) | | Gets a List of all of the Attribute objects.
|
getAllNotificationTypeCodes | public List getAllNotificationTypeCodes()(Code) | | Get the list of available activityType codes.
|
getAllPermissions | public List getAllPermissions()(Code) | | Returns a list of all the permissions in use by scarab.
a List of String s |
getAttributes | public List getAttributes(String attributeType) throws Exception(Code) | | Gets a List of all of the Attribute objects by type.
|
getAttributes | public List getAttributes(String attributeType, boolean includeDeleted, String sortColumn, String sortPolarity) throws Exception(Code) | | Gets a List of all of user Attribute objects.
|
getBuildVersion | public String getBuildVersion()(Code) | | returns Scarab's build version.
|
getCALENDAR_DAY_FIELD | public int getCALENDAR_DAY_FIELD()(Code) | | |
getCALENDAR_HOUR_FIELD | public int getCALENDAR_HOUR_FIELD()(Code) | | |
getCALENDAR_MONTH_FIELD | public int getCALENDAR_MONTH_FIELD()(Code) | | |
getCALENDAR_YEAR_FIELD | public int getCALENDAR_YEAR_FIELD()(Code) | | |
getConstant | public FieldMethodizer getConstant()(Code) | | holds the Scarab constants. it will be available to the template system
as $scarabG.Constant.CONSTANT_NAME.
|
getCustomization | public List getCustomization(Object moduleId, Object userId, Object activityCode) throws TorqueException(Code) | | Return the list of available NotificationFilters for
the given user in the given module
Parameters: moduleId - Parameters: userId - Parameters: activityCode - throws: TorqueException - |
getInt | public int getInt(Object obj)(Code) | | Returns an int representation of the given
Object whose toString method should be a valid integer.
If the String cannot be parsed 0 is returned.
Parameters: obj - the object the int representation of the Object if possible or 0 . |
getModuleCodeLength | public static synchronized int getModuleCodeLength()(Code) | | |
getModuleCodeLengthPadded | public static int getModuleCodeLengthPadded()(Code) | | |
getModulesFromIssueList | public List getModulesFromIssueList(List issues) throws TorqueException(Code) | | Create a list of Modules from the given list of issues. Each
Module in the list of issues will only occur once in the list of
Modules.
|
getNow | public Date getNow()(Code) | | Get a new Date object initialized to the current time.
a Date value |
getParameterName | public FieldMethodizer getParameterName()(Code) | | holds the names of parameters that are configurable through the ui.
|
getPermission | public FieldMethodizer getPermission()(Code) | | holds the Scarab permission constants. It will be available to
the template system as $scarabG.PERMISSION_NAME.
|
getPublicModulesDisplayCount | public int getPublicModulesDisplayCount()(Code) | | Provides the maximum number of public modules to be shown on the
login screen. the number is stored in the property
scarab.public.modules.display.count
If no number is specified, this method returns -1
the number specified in scarab.public.modules.display.count |
getSearchUsers | public List getSearchUsers(String searchField, String searchCriteria) throws Exception(Code) | | Returns a List of users based on the given search criteria. This method
is an overloaded function which returns an unsorted list of users.
Parameters: searchField - the name of the database attribute to search on Parameters: searchCriteria - the search criteria to use within the LIKE command a List of users matching the specifed criteria |
getSearchUsers | public List getSearchUsers(String searchField, String searchCriteria, String orderByField, String ascOrDesc) throws Exception(Code) | | Describe getSearchUsers method here.
Parameters: searchField - a String value Parameters: searchCriteria - a String value Parameters: orderByField - a String value Parameters: ascOrDesc - a String value a List value exception: Exception - if an error occurs |
getSiteLogo | public String getSiteLogo()(Code) | | Provides the site logo for the top banner.
the configured site logo |
getSiteName | public String getSiteName()(Code) | | Provides the site name for the top banner.
the configured site name |
getTurbineConfiguration | public org.apache.commons.configuration.Configuration getTurbineConfiguration()(Code) | | Return the current turbine configuration with all keys included |
getUserAttributes | public List getUserAttributes() throws Exception(Code) | | Gets a List of all of user Attributes.
|
getUserAttributes | public List getUserAttributes(boolean includeDeleted, String sortColumn, String sortPolarity) throws Exception(Code) | | Gets a List of all of the Attribute objects.
|
log | public void log(String s)(Code) | | Logs a message at the debug level. Useful for "I am here" type
messages. The category is "org.tigris.scarab".
Parameters: s - message to log |
log | public void log(String category, String s)(Code) | | Logs a message at the debug level. Useful for "I am here" type
messages. The category in which to log is also specified.
Parameters: category - log4j Category Parameters: s - message to log |
print | public void print(String s)(Code) | | Prints a message to standard out. Useful for "I am here" type
messages.
Parameters: s - message to log |
refresh | public void refresh()(Code) | | |
reverse | public Object[] reverse(Object[] a)(Code) | | Creates a new array with elements reversed from the given array.
Parameters: a - the orginal Object[] a new Object[] with values reversed from the original |
reverse | public List reverse(List a)(Code) | | Creates a new List with elements reversed from the
given List .
Parameters: a - the orginal List a new List with values reversed from the original |
sizeOfArray | public int sizeOfArray(Object[] obj)(Code) | | Velocity has no way of getting the size of an Object[]
easily. Usually this would be done by calling obj.length
but this doesn't work in Velocity.
Parameters: obj - the Object[] the number of objects in the Object[] or -1 if obj is null |
subset | public List subset(List a, Integer fromIndex, Integer toIndex)(Code) | | Creates a view of the portion of the given
List between the specified fromIndex , inclusive, and
toIndex , exclusive.
The list returned by this method is backed by the original, so changes
to either affect the other.
Parameters: a - the orginal List Parameters: fromIndex - the start index of the returned subset Parameters: toIndex - the end index of the returned subset a derived List with a view of the original |
subset | public Object[] subset(Object[] a, Integer fromIndex, Integer toIndex)(Code) | | Creates a new array with a view of the portion of the given array
between the specified fromIndex, inclusive, and toIndex, exclusive
Parameters: a - the orginal Object[] Parameters: fromIndex - the start index of the returned subset Parameters: toIndex - the end index of the returned subset a new Object[] with a view of the original |
templateExists | public boolean templateExists(String template)(Code) | | Delegates to Velocity's templateExists() method.
|
textToHTML | public SkipFiltering textToHTML(String text, ScarabLink link, Module currentModule)(Code) | | Converts a text string to HTML by:
- replacing reserved characters with equivalent HTML entities
- adding hyperlinks for URLs
- adding hyperlinks for issue references
Parameters: text - The text string to convert. Parameters: link - Parameters: currentModule - The active module. A SkipFiltering object which contains the generated HTML. |
tokenize | public Enumeration tokenize(String text, String delimiters)(Code) | | Breaks text into a list of Strings. Text is separated into tokens
at characters given in delimiters. The delimiters are not part
of the resulting tokens. if delimiters is empty or null, "\n" is used.
Parameters: text - a String value Parameters: delimiters - a String value a List value |
|
|