Manage this page

Display

Feedback

Others

Previous questions

You can post questions related to any of the following technologies

Java
J2EE
XML
Dotnet
Programming
SQL
Html
CSS

Ramesh - Wednesday, October 26, 2005 9:24:33 AM

I am having trouble with some scheduler stuff in the latest aspire jar file.

Getting a no class found from the basicschedular class

Satya - Wednesday, October 26, 2005 9:25:31 AM

Ramesh see what your settings are for the following

request.AppObjects.connectionManager.className=\
com.ai.db.ConnectionPoolConnectionManager1

request.AppObjects.scheduler.className=\
com.ai.scheduler.BasicScheduler

AppObjects.scheduler.timer_interval_in_milli_secs=20000

Ramesh - Wednesday, October 26, 2005 11:29:39

aspire properties

This is what I have:

request.AppObjects.connectionManager.className=\
com.ai.db.ConnectionPoolConnectionManager1

request.AppObjects.scheduler.className=\
com.ai.scheduler.BasicScheduler
AppObjects.scheduler.timer_interval_in_milli_secs=60000

Satya - Thursday, October 27, 2005 10:12:17 AM

Ramesh could you send me some more log file around the error

Ramesh paste here in the feedback a few lines above and below the scheduler exception error.

The error seem to suggest it can not find the class

com/ai/scheduler/BasicScheduler$SchedulableTaskThread

Open the aspire.jar with winzip and see if you see the class in that path. I do see it here. If this is the class that it is not able to load check to the jdk enviornment and its security settings.

Also tell me what app server you are using and what is the jdk level and whose jdk you are using.

Satya - Thursday, October 27, 2005 10:14:08 AM

When you paste the log file here ...

Ramesh when you post here, start your paragraphs are new line with with a "p" tag. For posting the log file put the whole content inside of two "pre" tags. If you want to see an example, view source of this document and locate the section above and see how I have used "p" and "pre" tags.

Ramesh - Saturday, October 29, 2005 20:24:08

Error

Satya,

Yeah...I should have checked this before. You are right. When I looked at the jar file, the class seems to be there.

833 Tue Aug 16 06:31:52 PDT 2005
com/ai/scheduler/BasicScheduler$SchedulableTaskThread.class

I am using Tomcat 4.1.29 and Sun's JVM

ava version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

Not sure what's happening.

Satya - Sunday, October 30, 2005 7:48:04 AM

See if you can post the log file ..

Ramesh, see if you can post the part of the log file that has about 10 lines above and below the exception.

And you can also place your log file somewhere on your website and put a link to that file from here.

Ramesh - Sunday, November 13, 2005 17:30:06

Upgraded my jdk and Tomcat

Hi Satya,

Upgraded my jdk..
java version "1.5.0_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)

And Tomcat
jakarta-tomcat-5.0.28

I don't see the error with this configuration.
I will test further and let you know.
thanks.

GQ - Friday, November 18, 2005 15:31:15

Class Hierarchy Properties

I was wondering if there was any updated document summarizing the different classes available in aspire and what they can do.

docs/aspire_annotated_app_properties_file.html is a good file unfortunately it's dated.

Satya - Friday, November 18, 2005 10:35:25 AM

Thanks for the feedback

Hi, I have thought about multiple times presenting this information. But I could not come up with a reasonable quick way of doing it. I am continuing to think about it and probably I will put something up.

The annotated property file is quite old. So I will make an attempt to publish something on this sometime next week.

Everytime I develop something new, I usually post an article about how to use it in one of the "howto" folders on the left hand side. You can use this list to gaze what is possible with aspire.

To know the latest properties file, in my release notes, there is a login application that I have uploaded a couple of months ago. This application has an aspire.properties file that is more recent.

Nevertheless if you have any specific questions post it here, I will try to answer them fairly quickly.

GQ - Monday, November 28, 2005 08:03:13

Some sample code pls

is it possible to structure a loop tag so that it acts like a FOR-NEXT loop?

is it also possible from a replacement tag to call a function with parameters?

or to embed a key within a replacement tag?

eg {{myfunction({{replacementtagparam.key}})}}

thanks

Satya - Monday, November 28, 2005 10:11:29 AM

You can use jsps instead of aspire tags if you find them limited ...

If you need complex logic on the screen you can use JSPs instead. Look in the howto section. You will see an article on how to use JSPs with aspire.

I am not clear on for-next. Call me on my cell 904-662-5427, as it might be easier to discuss this on the phone.

I believe I do have a facility where functions can be invoked on replacements. Let me look through my docs and I will post another item here later today.

Satya - Monday, November 28, 2005 10:17:58 AM

Here is a document on using function expressions

How to use function expressions

Satya - Monday, November 28, 2005 10:49:11 AM

Nevertheless ...

Nevertheless try using JSPs if you can as they offer more possibilities for complex pages.

GQ - Monday, December 26, 2005 2:16:05 AM

Current Record, Move Previous and Sizeof IHDS

I went the JSP route. Following the examples you gave, I used IHDS type. However, I cant figure out how to access the current record, move to previous (or to particular record) or size of the ihds data returned.

OR am i using the wrong type?

I am currently using randomtablehandler7 in the properties.

thanks

GQ - Monday, December 26, 2005 6:19:34 AM

...continued...

by sizeof, i meant number of rows returned. I notice there is a function written related to this... but i dont know how to access it.

Satya - Tuesday, December 27, 2005 9:43:12 AM

You can use the following article for working with ihds

How to use ihds

Satya - Tuesday, December 27, 2005 9:50:08 AM

RandomTableHandler7 is the right one to use

This class implements

public interface ILoopRandomIterator extends ILoopForwardIterator
{
   public boolean moveToFirstRow();
   public boolean moveToRow(int rownum);
   public int getNumberOfRows();
   public boolean isRowAvailable();
} 

When you get the "ihds" for that spelcific loop name, you can cast it to ILoopRandomIterator and use the getNumberOfRows() on that interface.

Please note that when you use RandomHandler you are increasing the load on the memory. If your intent is to walk forward, you don't want to use the Random one. It is there as a design choice but use it sparingly. If you have questions on that let me know.

Also in the feedback precede your comment paragraphs with a "p". You don't have to close the "p". Just do the view source for these comments and you will know what I mean.

Satya - Tuesday, December 27, 2005 2:07:21 PM

See the following url how I use aspire with jsps

Use this login application as a template for your applications

GQ - Monday, January 02, 2006 7:18:27 AM

Current Record Pointer?

Thanks. The examples were very helpful. How do I access the current record pointer though? (assuming there is an interface for it)

Satya - Monday, January 02, 2006 11:53:43 AM

The current record is implicit

See the following api

public interface ILoopForwardIterator
{
   /**
    * getValue from the current row matching the key
    */
   public String getValue(final String key);

   public void moveToFirst() throws DataException;

   public void moveToNext() throws DataException;

   public boolean isAtTheEnd() throws DataException;
}

ihds implements one of these. when moveToNext() is called and pointing to a specific row, the "getValue" will give the value for a given key on that record. That record is not directly exposed. You can use the IMetaData on the ihds to know what the column names or keys are for that row.

Or if you want a finer control you can use the "IDataCollection" interface from relational data access side of the fence.

Let me know what you are trying to do at a higher level. May be I will be able to suggest something.

GQ - Tuesday, January 03, 2006 9:52:51 AM

Row Number or Current Record Pointer

I was hoping that the row number of the current record was exposed. So i could just skip maintaining my own recordnumber variable and just do a call like:

recordnumber()-1 or recordnumber()+1

Of course, it is possible to do it another way just as you showed in one of your examples. It just seemed cleaner to just access the rownumber counter which seems internal to your code?

Satya - Tuesday, January 03, 2006 10:28:02 AM

I see your point

I might consider adding that in the future. For now as you may have guessed you may have to keep a local variable like "i". I actually have a pluggable class name to the ihds that can add columns on the fly and also aggregated values. But on the down side you have to write that class in java.

GQ - Tuesday, January 10, 2006 7:57:08 PM

JSP code for property change

I'm trying to do something like this... pageData.setAttribute("request.rtpageForm.dataloop.query_request.stmt","select * from phppos.sales"); in my JSP code. Can you show me how to do this properly?

I put values in the properties file...then midway i want to change the value and override the values read from the maindata section

Satya - Tuesday, January 10, 2006 9:37:13 AM

Are you saying ...

Are you saying depending on what is read in the main data, you want to change the sql executed for a particular loop?

There are a couple of ways you can go about it

On the previous page that is passing control to this display url, you could have retrived the main data values (essentially moving your main select to the previous page). And then in javascript redirect it to different display urls one for each variation.

Or you can use the whole select statement for your phppos.sales a substitution varialbe and use an if part in the maindata executor to insert sql statement dynamically. I personally think option 1 is cleaner.

Or you can do option 1 on the server side instead of in the java script and redirect the page based on an if part again.

Are you willing to write any java code on the server side? do you know how to write parts? Let me know if you need some help. If that is not the case your option 1 java script is a good bet.

Although the parts in aspire gives you some control on the execution logic, the real power is writing specialized java parts when needed.

Let me know ..

Satya - Tuesday, January 10, 2006 10:35:22 AM

Or you can also do this in the controller jsp ..

In this approach

1. You will let the main data execute and load up your page data

2. Let the jsp get control of that data

3. In the jsp make the decission as to which page you want to go to

4. Each page will be a separate url with its own data set

5. In this scernario your controller jsp page will just be a decission maker

6. You can use the request.redriect and go to the display url you want.

This is really option 3 in the above scenario.

GQ - Friday, January 13, 2006 9:59:35 AM

scenario for property change

maybe the following pseudo code scenario may make the question more defined:

 
         --for(i=0;i lt X;i ++ ) {
           --read from data source( newsqlstatement[i] ) 
                   --select   
             --for(z=0;z lt XX;z ++ ) {
                   --options
             }
                   -- end select
         }

I'm really hoping there was a way to use JSP code to overwrite/override the data/properties written within the properties file so that i can change the sqlstatement on the same page. Unless there is more capability in aspire i still do not know.. from my understanding properties files have to be written during design time and may not add additional loops on the fly..

or is it possible to add/define new loops on the fly?

Satya - Friday, January 13, 2006 3:27:37 PM

I will answer this tomorrow ..

I am a bit busy today. Let me think about this. I will let you know in a day or two

Satya - Friday, January 13, 2006 5:02:16 PM

Have you looked at this

How to retrieve tree structures from database

You can try using a substitution parameter for the sql statement.

Satya - Friday, January 13, 2006 5:07:40 PM

At the moment you can not define loops on the fly ..

The property files are static definitions. It is possible to change the values of those static definitions using substitutions at run time.

Satya - Friday, January 13, 2006 5:13:08 PM

If the data doesn't fit into a well known pattern you can always do this ..

Aspire's ihds is implemented by the pre defined aspire class as below

blogsURL=aspire:\\reports\\blogs\\blogs.html
blogsURL.formHandlerName=BUFH
Request.BUFH.form_handler.class_request.classname\
com.ai.htmlgen.DBHashTableFormHandler1

If the data gets too complicated you can do this

Request.BUFH.form_handler.class_request.classname\
com.MyPageDataGenerator

Where MyClass is derived from an AbstractPart and returns a java object like MyPageData. Inside the MyPageDataGenerator you can use the low level Aspire relational data access apis to construct your object.

And on the JSP page when you retrieve your data you will get this object instead. But you will have to write this java class though.