AspireWeb (A Java Web Project)

Welcome to Aspire Knowledge Central (AKC)

   Home   Public Library   Author Content

Choose a data format:   classic-xml   object-xml   embedded-xml   text   excel

Howto-Advanced

0) A way to construct hds on the fly: an example using Lucene (9-Aug-06)

A way to construct hds on the fly: an example using Lucene

1) DatabaseTM: log file for single select (14-Dec-06)

DatabaseTM: log file for single select

2) FULCopyFilePart: draft (24-Oct-07)

part of the upload file effort

3) How does aspire implement client side redirect (4-Nov-05)

During the early days of servlets I have used a trick to accomplish client side redirect after an update took place. This client side redirect will erase the update url from the browsers memory making the "back" and "refresh" buttons safe to the user.

4) How to add data retrieval parts to Aspire (20-Jan-06)

Aspire depends on two data abstractions. One is a relational abstraction representing a collection of rows and columns and the other a hierarchical abstraction which is a grouping of the relational abstraction with a context. The central class in relational abstraction is represented by a type called IDataCollection. The hierarchical abstraction is represented by a type called "ihds".

This artilce gives sample code for how to do this

5) How to do paging in Aspire using RandomTableHandler7 (4-Aug-04)

Aspire has facilities to allow for paging in large result sets coming from database. Usually rows from a database are listed as a table on the html page. In Aspire parlance this table is populated using a loop tag in the html file. The rows for that loop are retrieved using a loop definition in a properties file. The java class that usually does this work is called "GenericTableHandlerX". The nature of this handler is that it will retrieve the rows using a database cursor. This class does not allow to retrieve rows using a seek/get approach to retrieve a window of the result set. Such a pattern is necessary for effective paging. This facility is provided a java class called RandomTableHandlerX. This document explains this process using the RandomTableHandler7.

6) How to log messages from your JSP page? (10-Dec-04)

Description to be entered

7) How to redirect when a session expires in Aspire (9-Sep-04)


aspire.sessionSupport.applySessionManagement=yes
aspire.sessionSupport.mainpage=/webapp/your-page-that-says-session-doesn't exist

8) How to redirect when a session expires in Aspire for Build 20 and above (9-Sep-04)


aspire.authentication.userAuthorization=no
aspire.sessionSupport.applySessionManagement=yes
aspire.sessionSupport.mainpage=/webapp/your-page-that-says-session-doesn't exist
request.aspire.sessionSupport.sessionSupportObject.className=\
com.ai.servlets.ExternalSessionManager

9) How to schedule arbitrary requests for execution in Aspire (27-Oct-05)

Aspire has two features that work together in scheduling requests. A "request" in Aspire's parlance is a unit of work or at times called a task. So when you schedule a request, you are actually scheduling tasks at a given interval.

The scheduler that is available in Aspire is a very basic scheduler with minimal but sufficient-for-the-purpose capabilities. Using this scheduler you can schedule a task (a piece of java code) for every n number of timer ticks. A timer tick is defined as a certain number of seconds.

For a task to be invoked by a scheduler it had to be registered. This is where the initialization support in Aspire come into play. Initializers in Aspire allow you to run code at the start up time. You can read the document on initialization to learn more about the interfaces.

10) How to set aside secure variables? (10-Jun-03)

Describes what secure variables are and how to set them up in the properties file.

11) How to tell aspire if a URL is a public URL (18-Oct-04)

Choose a an authentication implementation that is appropriate in the aspire properties file. Here is an example with Trivial authentication.


request.aspire.authentication.authenticationObject.className=\
com.ai.aspire.authentication.TrivialAuthentication

request.aspire.authentication.authenticationObject.publicURLs=\
LoginPageURL,WelcomePublicJSPURL

request.aspire.authentication.authenticationObject.publicRequestNames=\
LoginRequest

See how public urls are defined as a comma separated list aspire url names. Also see how aspires update requests can also be mentioned as public.

Notice that the lines are broken for clarity. You may want to put them on the sameline

12) How to upload a file to a database and bring it back (14-Nov-07)

1. You will be using commons file upload plugin or part

2. You will need to add a url rewrite filter that comes with aspire to convert extra path to url arguments

3. You will "singlefileuploadpart" to parse the multipart upload

4. You will use a PSExecutor2 part to save it as a blob in the database

5. You can BlobTransform to write it back to the browser

13) How to upload files: one annotated approach (16-Nov-07)

An example to use while trying to upload files. This is one possible approach with out saving blobs. You will use the file system to store the files and use a database table to hold references to them. You will also see here how one can display the files.

14) How to use and setup HttpEvents? (10-Jun-03)

HttpEvents is a concept where the application programmer can monitor what is happening in the application server. The programmer can monitor and responds to such events as session start, request begin, request end etc. The implementation is somewhat inspired by the global.asax file in the asp.net platform.

15) How to use AspireLoginPart (4-Nov-05)

Receives a username and password and if they are valid it succeeds. if not an exception with an identifier of INVALID_PASSWORD is raised. One can use this exception to reroute to the same page or a different page.

It also looks at an aspire_target_url parameter and if present, indicates a redirector target as aspir_target_url_key=LOGIN_TARGET_PRESENT.

16) How to use basic scheduler (21-Oct-03)

Aspire has a rudimentary scheduler in a package called com.ai.scheduler. This scheduler called BasicScheduler allows you to schedule tasks every 'n' number of intervals. Where an "interval" is defined as a time duration in milliseconds.

Here is a basic usage of the scheduler

17) How to use com.ai.parts.ReusablePart (21-Oct-04)

ReusablePart

Calls another part or business logic, by translating the input arguments to match the expected names of the receiver

Additional property file arguments

1. originalNames: comma separated list of key names that needs to be copied from

2. newNames: comma separated list of keys to which the above key values will be copied to

3. propagateParams: yes|no: yes

4. reuseRequestName: Name of the reusable target request

if Propagateparams is "yes", then the incomign map is passed down. if it is set to "no" then a freshmap is created for the receiver Use "no" with caution, as this will result in a new transaction if the called parts have any database calls.

Output

1.resultName: What ever the target request returns

18) How to use ConnectionEventDistributor for manipulating Aspire data base connections (18-Oct-05)

While programming databases it is important sometimes to prime the connection object. This is done by setting some additional attributes or parameters on a connection object using the "select" statements. As Aspire uses connection pools, the programmers rarely have control of the connection object directly (although it is possible). This facility is an attempt at providing a way to set these parameters using an event model.

19) How to use copyparameters part (24-Aug-06)

you can use this part for introducing or copying existing keys as new keys.

20) How to use Generic Mappers (9-Nov-07)

Generic mappers are a set of java classes used to quickly read key value pairs. For example the relationship between file extension and their content type is determined this way.

This mechanism is intended to be a general purpose mechanism for reading a dictionary of values

The current implementation is a bit inefficient but a future implementation can amend that.

21) How to use IfPart for conditional execution on serverside (7-Oct-05)

IfPart extends the functionality of the multi request executor (essentially an implementation of a sequential processing pipeline) for conditional purposes.

22) How to use initializers in Aspire (29-Aug-20)

Aspire during startup can load classes implementing the "IApplicationInitializer" interface. These classes will be loaded as per the factory specification. This means the loaded class can be a single instance or a multi-instance. Once these classes are loaded their "initialize method gets called".

23) How to use SessionHDSTransformerPart (28-Sep-06)

Description to be entered

24) How to use SessionVariablesPart (11-Sep-06)


request.putVariable2InSession.classname=com.ai.parts.SessionVariablesPart
request.putVariable2InSession.variableName=var1
request.putVariable2InSession.newVariableName=var2

The above code when embedded in a pipeline will take "var1" from the hashtable and places it in the session as "var2". If newVariableName is not mentioned then it will just put it as variableName

25) How to use SimpleDBAuthentication1 (16-Sep-04)

How to use SimpleDBAuthentication1 for login purposes.

26) How to use the SubstitutionPart and RecursiveSubstituionPart (27-Jan-06)

The following example shows how to use substitution parts in your server side pipelines.

27) Managing ViewState through Aspire (16-Dec-04)

when you are working with web forms on a web browser, what the user types in on a form is called view state. If you were to return back to the form from the server side, you don't want the user to loose that data and reenter again. The process of managing that interaction is called view state management.

28) Placing a context path in server.xml for Tomcat (14-Oct-04)

The context string looks like


<Context path="/akc" docBase="w:/satya/webapps/akc" debug="0"/>

The question is what is the parent node to the "Context" node. Here is the hierarchy in that xml file


<Server><Service><Engine><Host>
		<Context path="/akc" docBase="w:/satya/webapps/akc" debug="0"/>
</Host></Engine></Service></Server>

This is based on tomcat 5. Probably the same for earlier and later tomcats as well. But just check in case

29) Role of IAuthentication derived classes in Aspire (16-Sep-04)


public interface IAuthentication2 extends IAuthentication1
{
   //from original
   public boolean verifyPassword(final String userid, final String passwd ) 
      throws AuthorizationException;
      
   public boolean isAccessAllowed(final String userid, final String resource )
      throws AuthorizationException;
	  
   //from 1
   public boolean isAccessAllowed(final String userid
                                 , HttpServletRequest request
                                  ,HttpServletResponse response)
      throws AuthorizationException;

   //from 2	  
   public boolean isAPublicURL(HttpServletRequest request
                                  ,HttpServletResponse response)
      throws AuthorizationException;
}

30) SingleFileUPloadCommonsPart: Draft (24-Oct-07)

part of the upload file effort

31) Some important log search strings (14-Dec-06)

Some important log search strings

32) Some notes on updateservlet (6-Nov-04)

Description to be entered

33) Source code for AliasedFactory3 (4-Jan-05)

Description to be entered

34) Source code for DataUtils.java (5-Jan-05)

Description to be entered

35) Source code for ExternalSessionManager (3-Sep-04)

Description to be entered

36) Source code for ForeachPart (5-Jan-05)

Description to be entered

37) Source code of Aspires session management (2-Sep-04)

Source code of Aspires session management: DefaultSessionSupport1

38) Source code of com.ai.parts.URLStringReaderPart (3-Oct-04)

Use this part

39) Source code of IHttpEvents (10-Sep-04)

Description to be entered

40) Source code of LoginValidator (10-Sep-04)

Description to be entered

41) Source code of LoginValidator1 (29-Nov-04)

Supports the login process
Improves on the original version
Keeps the target url when directed
Further documentation will follow

42) Source code of ValueDecoderPart1 (8-Dec-04)

Works like an oracle decoder for field values including default values

43) Sourcecode for DBProcedure (10-Dec-04)

Description to be entered

44) Taking advantage of Parts, Pipelines, and declrative programming in Aspire/J2EE (6-Feb-04)

In this article I want to explain an architectural model that I use often called "parts and pipelines" using an example. This model is especially useful in declrative programming. This article will start by introducing an example where a web page will update some content on the server side. The quoted example will be analyzed to explain parts, pipelines, and declarative programming. To further understand the details of a Part the source code for a "HelloWorldPart" is presented followed by the source code of 2 real world parts.

45) Using Servlet Filters to convert extra path info to url query parameters (9-Nov-07)

This is an important read to configure aspire for uploading files

46) Writing a factory part: a sample (14-Apr-04)

1. Inheriting from an abstract factory part
2. Handling exceptions
3. Common mistakes
4. Closing collections