| Home >> All >> org >> apache >> turbine >> [ util Javadoc ] |
Page 1 2
org.apache.turbine.util: Javadoc index of package org.apache.turbine.util.
Package Samples:
org.apache.turbine.util.mail: Various utilities used in Turbine and for Turbine based applications.
org.apache.turbine.util.db
org.apache.turbine.util.db.map
org.apache.turbine.util.parser
org.apache.turbine.util.pool
org.apache.turbine.util.security
org.apache.turbine.util.template
org.apache.turbine.util.upload
org.apache.turbine.util.uri
org.apache.turbine.util.hibernate
org.apache.turbine.util.jsp
org.apache.turbine.util.db.statement
org.apache.turbine.util.db.nqm
Classes:
BaseSql: This class contains default methods to construct SQL statements using method calls. Subclasses should specialize the methods to the SQL dialect of a specific database. This class defines methods that construct String fragments of SQL statements. Chaining the methods allows the creation of arbitrarily complex statements. getInsert --> insert into left ( item1 ,..., itemN ) getValues --> values ( item1 ,..., itemN ) getUpdate --> update left item1 ,..., itemN getSet --> set left = right getDelete --> delete from left getSelect --> select item1 ,..., itemN getSelectDistinct --> select distinct item1 ...
HtmlPageAttributes: Template context tool that can be used to set various attributes of a HTML page. This tool does not automatically make the changes in the HTML page for you. You must use this tool in your layout template to retrieve the attributes. The set/add methods are can be used from a screen template, action, screen class, layour template, or anywhere else. The get methods should be used in your layout template(s) to construct the appropriate HTML tags. Example usage of this tool to build the HEAD and BODY tags in your layout templates: ## Set defaults for all pages using this layout. Anything set here can ...
Sql: This interface defines methods to construct String fragments of SQL statements. BaseSql provides a base implementation of this interface. Chaining the methods allows the creation of arbitrarily complex statements. getInsert --> insert into left ( item1 ,..., itemN ) getValues --> values ( item1 ,..., itemN ) getUpdate --> update left item1 ,..., itemN getSet --> set left = right getDelete --> delete from left getSelect --> select item1 , item2 ,..., itemN getFrom --> from item1 , item2 ,..., itemN getWhere --> where tree getEqual --> ( left = right ) getNotEqual --> ( left != right ) getGreaterThan ...
VelocityEmail: This is a simple class for sending email from within Velocity. Essentially, the body of the email is processed with a Velocity Context object. The beauty of this is that you can send email from within your Velocity template or from your business logic in your Java code. The body of the email is just a Velocity template so you can use all the template functionality of Velocity within your emails! Example Usage (This all needs to be on one line in your template): Setup your context: context.put ("VelocityEmail", new VelocityEmail() ); Then, in your template: $VelocityEmail.setTo("Jon Stevens", "jon@latchkey.com") ...
MultipartStream: This class can be used to process data streams conforming to MIME 'multipart' format as defined in RFC 1251 . Arbitrary large amouns of data in the stream can be processed under constant memory usage. The format of the stream is defined in the following way: multipart-body := preamble 1*encapsulation close-delimiter epilogue encapsulation := delimiter body CRLF delimiter := "--" boundary CRLF close-delimiter := "--" boudary "--" preamble := <ignore> epilogue := <ignore> body := header-part CRLF body-part header-part := 1*header CRLF header := header-name ":" header-value header-name ...
TurbineException: The base class of all exceptions thrown by Turbine. It is intended to ease the debugging by carrying on the information about the exception which was caught and provoked throwing the current exception. Catching and rethrowing may occur multiple times, and provided that all exceptions except the first one are descendands of TurbineException , when the exception is finally printed out using any of the printStackTrace() methods, the stacktrace will contain the information about all exceptions thrown and caught on the way. Running the following program 1 import org.apache.turbine.util.TurbineException; ...
VelocityHtmlEmail: This is a simple class for sending html email from within Velocity. Essentially, the bodies (text and html) of the email are a Velocity Context objects. The beauty of this is that you can send email from within your Velocity template or from your business logic in your Java code. The body of the email is just a Velocity template so you can use all the template functionality of Velocity within your emails! This class allows you to send HTML email with embedded content and/or with attachments. You can access the VelocityHtmlEmail instance within your templates trough the $mail Velocity variable. ...
SelectorBox: This class is for generating a SelectorBox. It is good when used with WM because you can stuff it into the context and then just call it to generate the HTML. It can be used in other cases as well, but WM is the best case for it right now. For example code showing the usage for this module, please see the toString() method below to see how it would be refered to from WM. // get the roles for a user RoleSet userRoles = new DefaultAccessControl().getRoles(loginid, null); if ( userRoles != null ) { context.put("hasRoleSet", Boolean.TRUE); // get an array of the users roles Role[] usersRoles = userRoles.getRolesArray(); ...
FileItem: This class represents a file that was received by Turbine using multipart/form-data POST request. After retrieving an instance of this class from the ParameterParser (see ParameterParser.getFileItem(String) 55 and ParameterParser.getFileItems(String) 55 ) you can use it to acces the data that was sent by the browser. You may either request all contents of file at once using get() 55 or request an InputStream with getStream() 55 and process the file without attempting to load it into memory, which may come handy with large files. Implements the javax.activation.DataSource interface (which allows ...
IDBroker: This method of ID generation is used to ensure that code is more database independent. For example, MySQL has an auto-increment feature while Oracle uses sequences. It caches several ids to avoid needing a Connection for every request. This class uses the table ID_TABLE defined in conf/master/id-table-schema.xml. The columns in ID_TABLE are used as follows: ID_TABLE_ID - The PK for this row (any unique int). TABLE_NAME - The name of the table you want ids for. NEXT_ID - The next id returned by IDBroker when it queries the database (not when it returns an id from memory). QUANTITY - The number of ...
UUIdGenerator: This class generates universally unique id's in the form of a String. The id has three parts. The first is supposed to be location dependent. The preferred location parameter is an ethernet (MAC) address, but an IP can be used as well. if none is supplied a Math.random generated number will be used. This part of the key will be 48 bits in length. The second part of the key is time related and will be the lower 48 bits of the long used to signify the time since Jan. 1, 1970. This will cause key rollover in the year 6429. The preceding 12 bytes are Base64 encoded with the characters / and * replaced ...
TimeSelector: TimeSelector is a utility class to handle the creation of a set of time drop-down menus. The code is broken into a set of static methods for quick and easy access to the individual select objects: ElementContainer ec timeSelect = new ElementContainer(); String myName = "mytime"; ec.addElement(TimeSelector.getHourSelector(myName)); ec.addElement(TimeSelector.getMinuteSelector(myName)); ec.addElement(TimeSelector.getAMPMSelector(myName)); There are also methods which will use attributes to build a complete time selector in the default 12hr format (eg HH:MM am/pm): TimeSelector ts = new TimeSelector(myName); ...
MailMessage: Creates a very simple text/plain message and sends it. MailMessage creates a very simple text/plain message and sends it. It can be used like this: MailMessage sm = new MailMessage("mail.domain.net", "toYou@domain.net", "fromMe@domain", "this is the subject", "this is the body"); Another example is: MailMessage sm = new MailMessage(); sm.setHost("mail.domain.net"); sm.setHeaders("X-Mailer: Sendmail class, X-Priority: 1(Highest)"); sm.setFrom("Net Freak1 user1@domain.com"); sm.setReplyTo("Net Freak8 user8@domain.com"); sm.setTo("Net Freak2 user2@domain.com, Net Freak3 user3@domain.com"); sm.setCc("Net ...
TurbineXmlConfig: A class used for initialization of Turbine without a servlet container. If you need to use Turbine outside of a servlet container, you can use this class for initialization of the Turbine servlet. TurbineXmlConfig config = new TurbineXmlConfig(".", "conf/TurbineResources.properties"); All paths referenced in TurbineResources.properties and the path to the properties file itself (the second argument) will be resolved relative to the directory given as the first argument of the constructor, here - the directory where application was started. Don't worry about discarding the references to objects ...
TurbineConfig: A class used for initialization of Turbine without a servlet container. If you need to use Turbine outside of a servlet container, you can use this class for initialization of the Turbine servlet. TurbineConfig config = new TurbineConfig(".", "conf/TurbineResources.properties"); All paths referenced in TurbineResources.properties and the path to the properties file itself (the second argument) will be resolved relative to the directory given as the first argument of the constructor, here - the directory where application was started. Don't worry about discarding the references to objects created ...
BrowserDetector: This class parses the user agent string and sets javasciptOK and cssOK following the rules described below. If you want to check for specific browsers/versions then use this class to parse the user agent string and use the accessor methods in this class. JavaScriptOK means that the browser understands JavaScript on the same level the Navigator 3 does. Specifically, it can use named images. This allows easier rollovers. If a browser doesn't do this (Nav 2 or MSIE 3), then we just assume it can't do any JavaScript. Referencing images by load order is too hard to maintain. CSSOK is kind of sketchy ...
CookieParser: CookieParser is an interface to a utility to to get and set values of Cookies on the Client Browser. You can use CookieParser to convert Cookie values to various types or to set Bean values with setParameters(). Servlet Spec for more information on Cookies. Use set() or unset() to Create or Destroy Cookies. NOTE: The name= portion of a name=value pair may be converted to lowercase or uppercase when the object is initialized and when new data is added. This behaviour is determined by the url.case.folding property in TurbineResources.properties. Adding a name/value pair may overwrite existing name=value ...
CookieParser: CookieParser is an interface to a utility to to get and set values of Cookies on the Client Browser. You can use CookieParser to convert Cookie values to various types or to set Bean values with setParameters(). Servlet Spec for more information on Cookies. Use set() or unset() to Create or Destroy Cookies. NOTE: The name= portion of a name=value pair may be converted to lowercase or uppercase when the object is initialized and when new data is added. This behaviour is determined by the url.case.folding property in TurbineResources.properties. Adding a name/value pair may overwrite existing name=value ...
DefaultCookieParser: CookieParser is used to get and set values of Cookies on the Client Browser. You can use CookieParser to convert Cookie values to various types or to set Bean values with setParameters(). See the Servlet Spec for more information on Cookies. Use set() or unset() to Create or Destroy Cookies. NOTE: The name= portion of a name=value pair may be converted to lowercase or uppercase when the object is initialized and when new data is added. This behaviour is determined by the url.case.folding property in TurbineResources.properties. Adding a name/value pair may overwrite existing name=value pairs if ...
SequencedHashtable: A java.util.Hashtable whose keys are sequenced. The sequencing of the keys allow easy access to the values in the order which they were added in. This class is thread safe. Implementing the List interface is not possible due to a instance method name clash between the Collection and the List interface: Collections boolean remove(Object o) Lists Object remove(Object o) So one cannot implement both interfaces at the same, which is unfortunate because the List interface would be very nice in conjuction with Velocity. A slightly more complex implementation and interface could involve the use of a list ...
DateSelector: DateSelector is a utility class to handle the creation of a set of date popup menus. The code is broken into a set of static methods for quick and easy access to the individual select objects: ElementContainer ec dateSelect = new ElementContainer(); String myName = "mydate"; ec.addElement(DateSelector.getMonthSelector(myName)); ec.addElement(DateSelector.getDaySelector(myName)); ec.addElement(DateSelector.getYearSelector(myName)); There are also methods which will use attributes to build a complete month,day,year selector: DateSelector ds = new DateSelector(myName); dateSelect = ds.ecsOutput(); ...
BaseValueParser: BaseValueParser is a base class for classes that need to parse name/value Parameters, for example GET/POST data or Cookies (DefaultParameterParser and DefaultCookieParser). It can also be used standalone, for an example see DataStreamParser. NOTE: The name= portion of a name=value pair may be converted to lowercase or uppercase when the object is initialized and when new data is added. This behaviour is determined by the url.case.folding property in TurbineResources.properties. Adding a name/value pair may overwrite existing name=value pairs if the names match: ValueParser vp = new BaseValueParser(); ...
RelativeDynamicURI: This creates a Dynamic URI for use within the Turbine system If you use this class to generate all of your href tags as well as all of your URI's, then you will not need to worry about having session data setup for you or using HttpServletRequest.encodeUrl() since this class does everything for you. This class generates relative URI's which can be used in environments with firewalls and gateways for outgoing connections. RelativeDynamicURI dui = new RelativeDynamicURI (data, "UserScreen" ); dui.setName("Click Here").addPathInfo("user","jon"); dui.getA(); The above call to getA() would return the ...
HtmlEmail: An HTML multipart email. This class is used to send HTML formatted email. A text message can also be set for HTML unaware email clients, such as text-based email clients. This class also inherits from MultiPartEmail, so it is easy to add attachents to the email. To send an email in HTML, one should create a HtmlEmail, then use the setFrom, addTo, etc. methods. The HTML content can be set with the setHtmlMsg method. The alternate text content can be set with setTextMsg. Either the text or HTML can be omitted, in which case the "main" part of the multipart becomes whichever is supplied rather than ...
ParameterParser: ParameterParser is an interface to a utility to handle parsing and retrieving the data passed via the GET/POST/PATH_INFO arguments. NOTE: The name= portion of a name=value pair may be converted to lowercase or uppercase when the object is initialized and when new data is added. This behaviour is determined by the url.case.folding property in TurbineResources.properties. Adding a name/value pair may overwrite existing name=value pairs if the names match: ParameterParser pp = data.getParameters(); pp.add("ERROR",1); pp.add("eRrOr",2); int result = pp.getInt("ERROR"); In the above example, result ...
| Home | Contact Us | Privacy Policy | Terms of Service |