Re: [iPlanet-JATO] Sorting a resultset
Steve,
Todd will probably address this more, but to set the stage for the discussion,
I will chime in. As per your scenario "say a user wants to resort the results
by some other column" , I think there needs to be some clarification on the
life cycle of the model. You scenario implies that the user sees the data and
then submits a request to sort the data. This implies that the access to the
same data is spread across two HTTP requests.
Unless explicitly or implicitly stored in session, the Model is a per request
object. Therefore, under ordinary circumstances a new instance of Model is
constructed per request and populated as needed. This is done for scalability
reasons. Most applications would not scale properly if all model instances were
kept around in session per user. There is also the issue of data integrity, a
model stored in session may not reflect the current state of the RDBMS from
which the data was previously retrieved, perhaps minutes before. So, the
default action is to instantiate a new model and repopulate that model The
normal solution would be to apply the sort criteria to the data retrieval at
that point.
What I described above is the norm and the default.
If you have compelling reasons to prefer a single retrieval style, you have to
be prepared to store the Model data in session. There are several methods
within the ModelManager class which assist in this regard. You can see them
described in the java doc.
Also bear in mind that the SQLModelBase typically copies the data from the JDBC
result set into JATO specific local storage. This is done because the JDBC
result set is not as flexible as developer needs and requires the JDBC
connection to remain open while it is used.
I suspect that Todd will describe how you can manipulate the underlying JATO
specific local storage to change the order. I just wanted to make sure you
understood the life cycle issues involved and had justification for deviating
from the default.
Also, I'm still waiting for followup on the defaultCommandChild issue - we'd
like to fix it for JATO 1.2.1 if it is a problem and so far your case is the
only one we have heard of.
----- Original Message -----
From: stephen_winer
Sent: Wednesday, December 12, 2001 9:42 AM
Subject: [iPlanet-JATO] Sorting a resultset
If I want to sort a result set (Model) after the search has taken
place (say a user wants to resort the results by some other column),
can this be done without issuing another query? The reason I ask is
that the next() method in the ResultSetModelBase calls synchronizeRow
(), which resets the row, which sounds like a sort done outside of
the SQL would be reverted.
Steve
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
[Non-text portions of this message have been removed]
The hidden field was present in the page, but it looked like this:
<input type="hidden" name="jato.defaultCommand" value=""../search"">
Seems like there is a small bug in the code generating this tag.
FYI - I am using JATO1.2
What file displays this text? Maybe I can go in and fix it and rejar
it.
Steve
--- Mike Frisino wrote:
Steve,
Can you check the HTML source that shows up in the browser? Do you see an entry that looks like this at the bottom of the form in
question?
>
<input type="hidden" name="jato.defaultCommand" value="/search">
To answer your question - it should work as you described. Some of the JatoSample make use of the defaultCommandChild. Can you try
running the sample BasicSample->Field Types and let us know what you
see.
>
Failing this you can send me your jsp file , maybe there is some subtle issue there. michael.frisino@s...
>
>
----- Original Message -----
From: stephen_winer
Sent: Friday, December 07, 2001 8:05 AM
Subject: [iPlanet-JATO] Using the defaultCommandChild in a form
I am trying to set the defaultCommandChild in my jato:form tag to be
the searcg button. The search button definition is:
<jato:button name="search"/>.
The form tag definition is:
<jato:form name="PendingIA" defaultCommandChild="/search">
Clicking on the search button works fine, but hitting return in one
of the textFields (which submits the form) passes a value of "" to
the createChild method in my viewBean, which throws an error. Why
does this not just work as normal and trigger the handleSearchRequest
() method?
Steve
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
Service.
>
>
>
[Non-text portions of this message have been removed]
Similar Messages
-
Namburi,
When you said you used the Reg Exp tool, did you use it only as
preconfigured by the iMT migrate application wizard?
Because the default configuration of the regular expression tool will only
target the files in your ND project directories. If you wish to target
classes outside of the normal directory scope, you have to either modify the
"Source Directory" property OR create another instance of the regular
expression tool. See the "Tool" menu in the iMT to create additional tool
instances which can each be configured to target different sets of files
using different sets of rules.
Usually, I utilize 3 different sets of rules files on a given migration:
spider2jato.xml
these are the generic conversion rules (but includes the optimized rules for
ViewBean and Model based code, i.e. these rules do not utilize the
RequestManager since it is not needed for code running inside the ViewBean
or Model classes)
I run these rules against all files.
See the file download section of this forum for periodic updates to these
rules.
nonProjectFileRules.xml
these include rules that add the necessary
RequestManager.getRequestContext(). etc prefixes to many of the common
calls.
I run these rules against user module and any other classes that do not are
not ModuleServlet, ContainerView, or Model classes.
appXRules.xml
these rules include application specific changes that I discover while
working on the project. A common thing here is changing import statements
(since the migration tool moves ND project code into different jato
packaging structure, you sometime need to adjust imports in non-project
classes that previously imported ND project specific packages)
So you see, you are not limited to one set of rules at all. Just be careful
to keep track of your backups (the regexp tool provides several options in
its Expert Properties related to back up strategies).
----- Original Message -----
From: <vnamboori@y...>
Sent: Wednesday, August 08, 2001 6:08 AM
Subject: [iPlanet-JATO] Re: Use Of models in utility classes - Pease don't
forget about the regular expression potential
Thanks Matt, Mike, Todd
This is a great input for our migration. Though we used the existing
Regular Expression Mapping tool, we did not change this to meet our
own needs as mentioned by Mike.
We would certainly incorporate this to ease our migration.
Namburi
--- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
All--
Great response. By the way, the Regular Expression Tool uses thePerl5 RE
syntax as implemented by Apache OROMatcher. If you're doing lotsof these
sorts of migration changes manually, you should definitely buy theO'Reilly
book "Mastering Regular Expressions" and generate some rules toautomate the
conversion. Although they are definitely confusing at first,regular
expressions are fairly easy to understand with some documentation,and are
superbly effective at tackling this kind of migration task.
Todd
----- Original Message -----
From: "Mike Frisino" <Michael.Frisino@S...>
Sent: Tuesday, August 07, 2001 5:20 PM
Subject: Re: [iPlanet-JATO] Use Of models in utility classes -Pease don't
forget about the regular expression potential
Also, (and Matt's document may mention this)
Please bear in mind that this statement is not totally correct:
Since the migration tool does not do much of conversion for
these
utilities we have to do manually.Remember, the iMT is a SUITE of tools. There is the extractiontool, and
the translation tool, and the regular expression tool, and severalother
smaller tools (like the jar and compilation tools). It is correctto state
that the extraction and translation tools only significantlyconvert the
primary ND project objects (the pages, the data objects, and theproject
classes). The extraction and translation tools do minimumtranslation of the
User Module objects (i.e. they repackage the user module classes inthe new
jato module packages). It is correct that for all other utilityclasses
which are not formally part of the ND project, the extraction and
translation tools do not perform any migration.
However, the regular expression tool can "migrate" any arbitrary
file
(utility classes etc) to the degree that the regular expressionrules
correlate to the code present in the arbitrary file. So first andforemost,
if you have alot of spider code in your non-project classes youshould
consider using the regular expression tool and if warranted adding
additional rules to reduce the amount of manual adjustments thatneed to be
made. I can stress this enough. We can even help you write theregular
expression rules if you simply identify the code pattern you wish to
convert. Just because there is not already a regular expressionrule to
match your need does not mean it can't be written. We have notnearly
exhausted the possibilities.
For example if you say, we need to convert
CSpider.getDataObject("X");
To
RequestManager.getRequestContext().getModelManager().getModel(XModel.class);
Maybe we or somebody else in the list can help write that regularexpression if it has not already been written. For instance in thelast
updated spider2jato.xml file there is already aCSpider.getCommonPage("X")
rule:
<!--getPage to getViewBean-->
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[getViewBean($1ViewBean.class]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
Following this example a getDataObject to getModel would look
like this:
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[getModel($1Model.class]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
In fact, one migration developer already wrote that rule andsubmitted it
for inclusion in the basic set. I will post another upgrade to thebasic
regular expression rule set, look for a "file uploaded" posting.Also,
please consider contributing any additional generic rules that youhave
written for inclusion in the basic set.
Please not, that in some cases (Utility classes in particular)
the rule
application may be more effective as TWO sequention rules ratherthan one
monolithic rule. Again using the example above, it will convert
CSpider.getDataObject("Foo");
To
getModel(FooModel.class);
Now that is the most effective conversion for that code if that
code is in
a page or data object class file. But if that code is in a Utilityclass you
really want:
>
RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
So to go from
getModel(FooModel.class);
To
RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
You would apply a second rule AND you would ONLY run this rule
against
your utility classes so that you would not otherwise affect yourViewBean
and Model classes which are completely fine with the simplegetModel call.
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[getModel\(]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[getModel\(]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[RequestManager.getRequestContext().getModelManager().getModel(]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
A similer rule can be applied to getSession and other CSpider APIcalls.
For instance here is the rule for converting getSession calls toleverage
the RequestManager.
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[getSession\(\)\.]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[getSession\(\)\.]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[RequestManager.getSession().]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
----- Original Message -----
From: "Matthew Stevens" <matthew.stevens@e...>
Sent: Tuesday, August 07, 2001 12:56 PM
Subject: RE: [iPlanet-JATO] Use Of models in utility classes
Namburi,
I will post a document to the group site this evening which has
the
details
on various tactics of migrating these type of utilities.
Essentially,
you
either need to convert these utilities to Models themselves or
keep the
utilities as is and simply use the
RequestManager.getRequestContext.getModelManager().getModel()
to statically access Models.
For CSpSelect.executeImmediate() I have an example of customhelper
method
as a replacement whicch uses JDBC results instead of
CSpDBResult.
matt
-----Original Message-----
From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
Sent: Tuesday, August 07, 2001 3:24 PM
Subject: [iPlanet-JATO] Use Of models in utility classes
Hi All,
In the present ND project we have lots of utility classes.
These
classes in diffrent directory. Not part of nd pages.
In these classes we access the dataobjects and do themanipulations.
So we access dataobjects directly like
CSpider.getDataObject("do....");
and then execute it.
Since the migration tool does not do much of conversion forthese
utilities we have to do manually.
My question is Can we access the the models in the postmigration
sameway or do we need requestContext?
We have lots of utility classes which are DataObjectintensive. Can
someone suggest a better way to migrate this kind of code.
Thanks
Namburi
[email protected]
[email protected]
[Non-text portions of this message have been removed]
[email protected]
[email protected]Namburi,
When you said you used the Reg Exp tool, did you use it only as
preconfigured by the iMT migrate application wizard?
Because the default configuration of the regular expression tool will only
target the files in your ND project directories. If you wish to target
classes outside of the normal directory scope, you have to either modify the
"Source Directory" property OR create another instance of the regular
expression tool. See the "Tool" menu in the iMT to create additional tool
instances which can each be configured to target different sets of files
using different sets of rules.
Usually, I utilize 3 different sets of rules files on a given migration:
spider2jato.xml
these are the generic conversion rules (but includes the optimized rules for
ViewBean and Model based code, i.e. these rules do not utilize the
RequestManager since it is not needed for code running inside the ViewBean
or Model classes)
I run these rules against all files.
See the file download section of this forum for periodic updates to these
rules.
nonProjectFileRules.xml
these include rules that add the necessary
RequestManager.getRequestContext(). etc prefixes to many of the common
calls.
I run these rules against user module and any other classes that do not are
not ModuleServlet, ContainerView, or Model classes.
appXRules.xml
these rules include application specific changes that I discover while
working on the project. A common thing here is changing import statements
(since the migration tool moves ND project code into different jato
packaging structure, you sometime need to adjust imports in non-project
classes that previously imported ND project specific packages)
So you see, you are not limited to one set of rules at all. Just be careful
to keep track of your backups (the regexp tool provides several options in
its Expert Properties related to back up strategies).
----- Original Message -----
From: <vnamboori@y...>
Sent: Wednesday, August 08, 2001 6:08 AM
Subject: [iPlanet-JATO] Re: Use Of models in utility classes - Pease don't
forget about the regular expression potential
Thanks Matt, Mike, Todd
This is a great input for our migration. Though we used the existing
Regular Expression Mapping tool, we did not change this to meet our
own needs as mentioned by Mike.
We would certainly incorporate this to ease our migration.
Namburi
--- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
All--
Great response. By the way, the Regular Expression Tool uses thePerl5 RE
syntax as implemented by Apache OROMatcher. If you're doing lotsof these
sorts of migration changes manually, you should definitely buy theO'Reilly
book "Mastering Regular Expressions" and generate some rules toautomate the
conversion. Although they are definitely confusing at first,regular
expressions are fairly easy to understand with some documentation,and are
superbly effective at tackling this kind of migration task.
Todd
----- Original Message -----
From: "Mike Frisino" <Michael.Frisino@S...>
Sent: Tuesday, August 07, 2001 5:20 PM
Subject: Re: [iPlanet-JATO] Use Of models in utility classes -Pease don't
forget about the regular expression potential
Also, (and Matt's document may mention this)
Please bear in mind that this statement is not totally correct:
Since the migration tool does not do much of conversion for
these
utilities we have to do manually.Remember, the iMT is a SUITE of tools. There is the extractiontool, and
the translation tool, and the regular expression tool, and severalother
smaller tools (like the jar and compilation tools). It is correctto state
that the extraction and translation tools only significantlyconvert the
primary ND project objects (the pages, the data objects, and theproject
classes). The extraction and translation tools do minimumtranslation of the
User Module objects (i.e. they repackage the user module classes inthe new
jato module packages). It is correct that for all other utilityclasses
which are not formally part of the ND project, the extraction and
translation tools do not perform any migration.
However, the regular expression tool can "migrate" any arbitrary
file
(utility classes etc) to the degree that the regular expressionrules
correlate to the code present in the arbitrary file. So first andforemost,
if you have alot of spider code in your non-project classes youshould
consider using the regular expression tool and if warranted adding
additional rules to reduce the amount of manual adjustments thatneed to be
made. I can stress this enough. We can even help you write theregular
expression rules if you simply identify the code pattern you wish to
convert. Just because there is not already a regular expressionrule to
match your need does not mean it can't be written. We have notnearly
exhausted the possibilities.
For example if you say, we need to convert
CSpider.getDataObject("X");
To
RequestManager.getRequestContext().getModelManager().getModel(XModel.class);
Maybe we or somebody else in the list can help write that regularexpression if it has not already been written. For instance in thelast
updated spider2jato.xml file there is already aCSpider.getCommonPage("X")
rule:
<!--getPage to getViewBean-->
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[getViewBean($1ViewBean.class]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
Following this example a getDataObject to getModel would look
like this:
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[getModel($1Model.class]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
In fact, one migration developer already wrote that rule andsubmitted it
for inclusion in the basic set. I will post another upgrade to thebasic
regular expression rule set, look for a "file uploaded" posting.Also,
please consider contributing any additional generic rules that youhave
written for inclusion in the basic set.
Please not, that in some cases (Utility classes in particular)
the rule
application may be more effective as TWO sequention rules ratherthan one
monolithic rule. Again using the example above, it will convert
CSpider.getDataObject("Foo");
To
getModel(FooModel.class);
Now that is the most effective conversion for that code if that
code is in
a page or data object class file. But if that code is in a Utilityclass you
really want:
>
RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
So to go from
getModel(FooModel.class);
To
RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
You would apply a second rule AND you would ONLY run this rule
against
your utility classes so that you would not otherwise affect yourViewBean
and Model classes which are completely fine with the simplegetModel call.
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[getModel\(]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[getModel\(]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[RequestManager.getRequestContext().getModelManager().getModel(]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
A similer rule can be applied to getSession and other CSpider APIcalls.
For instance here is the rule for converting getSession calls toleverage
the RequestManager.
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[getSession\(\)\.]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[getSession\(\)\.]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[RequestManager.getSession().]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
----- Original Message -----
From: "Matthew Stevens" <matthew.stevens@e...>
Sent: Tuesday, August 07, 2001 12:56 PM
Subject: RE: [iPlanet-JATO] Use Of models in utility classes
Namburi,
I will post a document to the group site this evening which has
the
details
on various tactics of migrating these type of utilities.
Essentially,
you
either need to convert these utilities to Models themselves or
keep the
utilities as is and simply use the
RequestManager.getRequestContext.getModelManager().getModel()
to statically access Models.
For CSpSelect.executeImmediate() I have an example of customhelper
method
as a replacement whicch uses JDBC results instead of
CSpDBResult.
matt
-----Original Message-----
From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
Sent: Tuesday, August 07, 2001 3:24 PM
Subject: [iPlanet-JATO] Use Of models in utility classes
Hi All,
In the present ND project we have lots of utility classes.
These
classes in diffrent directory. Not part of nd pages.
In these classes we access the dataobjects and do themanipulations.
So we access dataobjects directly like
CSpider.getDataObject("do....");
and then execute it.
Since the migration tool does not do much of conversion forthese
utilities we have to do manually.
My question is Can we access the the models in the postmigration
sameway or do we need requestContext?
We have lots of utility classes which are DataObjectintensive. Can
someone suggest a better way to migrate this kind of code.
Thanks
Namburi
[email protected]
[email protected]
[Non-text portions of this message have been removed]
[email protected]
[email protected] -
Re: [iPlanet-JATO] Finding the database column length
This is the technique I would recommend. If you'd like to wrap this
mechanism up in the model class itself, create a subclass of QueryModelBase
that provides such a method and use that as the base class for all your
QueryModels.
Todd
----- Original Message -----
From: "Craig V. Conover" <craig.conover@S...>
Sent: Friday, October 19, 2001 12:15 PM
Subject: Re: [iPlanet-JATO] Finding the database column length
Chidu,
The result set that you get back is a JDBC ResultSet, not a "JATO" resultset. In ND, everything was wrapped in a "spider" data
structure, and therefore, difficult to get to the underlying datastructure, in many cases. In some case ND made it easier to do
certain things, and in other ways, made it more difficult or impossible(like seeing the SQL for an insert, update, delete).
>
Anyway, looking at the java.sql package, you can do this.
java.sql.ResultSet rs = <jata-model>.getResultSet();
java.sql.ResultSetMetaData rsMeta = rs.getMetaData();
// not sure if this is what you need, but it was the closest thing I couldfind
int colSize = rsMeta.getColumnDisplaySize(int column);
There are numerous other methods in the ResultSetMetaData interface thatmay be of use as well.
>
c
chidusv@y... wrote:
Hi,
How do I find out the length of a database column in a data model? In
NetDynamics, we can do dataobject.getDataField(<field
name>).getColumnLength(). Is it possible to achieve this in JATO
without using a resultset?
Thanks,
Chidu.
For more information about JATO, please visit
http://developer.iplanet.com/tech/appserver/framework/index.jsp
>>
>>
>>
>>
>
>
>
For more information about JATO, please visit
http://developer.iplanet.com/tech/appserver/framework/index.jsp
>
>
>
>
>
>
>This is the technique I would recommend. If you'd like to wrap this
mechanism up in the model class itself, create a subclass of QueryModelBase
that provides such a method and use that as the base class for all your
QueryModels.
Todd
----- Original Message -----
From: "Craig V. Conover" <craig.conover@S...>
Sent: Friday, October 19, 2001 12:15 PM
Subject: Re: [iPlanet-JATO] Finding the database column length
Chidu,
The result set that you get back is a JDBC ResultSet, not a "JATO" resultset. In ND, everything was wrapped in a "spider" data
structure, and therefore, difficult to get to the underlying datastructure, in many cases. In some case ND made it easier to do
certain things, and in other ways, made it more difficult or impossible(like seeing the SQL for an insert, update, delete).
>
Anyway, looking at the java.sql package, you can do this.
java.sql.ResultSet rs = <jata-model>.getResultSet();
java.sql.ResultSetMetaData rsMeta = rs.getMetaData();
// not sure if this is what you need, but it was the closest thing I couldfind
int colSize = rsMeta.getColumnDisplaySize(int column);
There are numerous other methods in the ResultSetMetaData interface thatmay be of use as well.
>
c
chidusv@y... wrote:
Hi,
How do I find out the length of a database column in a data model? In
NetDynamics, we can do dataobject.getDataField(<field
name>).getColumnLength(). Is it possible to achieve this in JATO
without using a resultset?
Thanks,
Chidu.
For more information about JATO, please visit
http://developer.iplanet.com/tech/appserver/framework/index.jsp
>>
>>
>>
>>
>
>
>
For more information about JATO, please visit
http://developer.iplanet.com/tech/appserver/framework/index.jsp
>
>
>
>
>
>
> -
Re: [iPlanet-JATO] Experiencing problem while executing model.
Hi Todd,
Thanks a lot for your input!
In the case , I found that "TO_CHAR(PLAN_DT, 'MM/DD/YYYY')" is alaised as a
column name in the resultset. So I am using this as a column in Jato
Descriptor for Plan_Dt. Now it is working fine.
Thanks and Regards,
Santa.
----- Original Message -----
From: Todd Fast <toddwork@c...>
Sent: Thursday, July 26, 2001 9:50 AM
Subject: Re: [iPlanet-JATO] Experiencing problem while executing model.
Santa--
I am experiencing a problem while executing a bounded model. I am usingQueryModelBase. Whenever the following query gets executed inonBeforeModel
execute of TiledView, it throws an exception describing "PLAN_DT not found
in ResultSet". If you execute this query on the SQL prompt then we getrows
of data. Please could you tell us how the mapping between model and
resultset works ? And what changes do we have to make to execute thisquery.
>>
SELECT PART_NM,NEWTXTDOLL
TO_CHAR(PLAN_DT, 'MM/DD/YYYY'),
FROM cpsselect
WHERE CHG_DT >= TO_DATE('2001-06-17', 'YYYY-MM-DD')The mapping of result set to model is done via JDBC, using the columnnames
you provide in your model's column descriptors. It sounds as if you are
providing the column name "PLAN_DT" in a descriptor, and when the model
tries to look up that column in the result set, there is no such columnand
the operation fails.
In order to debug this, you should try running your query with a JDBC
connection, not SQL*Plus or your command-line SQL tool. What you need to
find out is how the expresion "TO_CHAR(PLAN_DT, 'MM/DD/YYYY')" is aliasedas
a column name in the resut set. The easiest way to do this is to write a
simple class that does nothing but use your JDBC driver to connect the
database and execute this query. After execution, use theResultSetMetaData
information to find out the column names for the result set. Then, use
these column names in your JATO column descriptors.
Another Problem:We are not getting the values for NEWTXTDOLL column whenwe try to display it in a Tiled View.
I'm sorry, this isn't enough information for me to offer any suggestions.
Using the technique above, determine which columns are coming back in the
result set, and make sure your display fields in the TiledView are boundto
those column names. The problem could be something as simple as a typo in
the field's bound name, or something more complex like the column in the
result set being named something you don't expect.
Another approach might be to alias the columns yourself using the "AS
<alias>" expression, and assign them names that you choose instead ofusing
the names assigned by the database or JDBC driver.
Todd
[email protected]
The Information contained and transmitted by this E-MAIL is proprietary to
Wipro Limited and is intended for use only by the individual or entity to
which
it is addressed, and may contain information that is privileged, confidential
or
exempt from disclosure under applicable law. If this is a forwarded message,
the content of this E-MAIL may not have been sent with the authority of the
Company. If you are not the intended recipient, an agent of the intended
recipient or a person responsible for delivering the information to the named
recipient, you are notified that any use, distribution, transmission,
printing,
copying or dissemination of this information in any way or in any manner is
strictly prohibited. If you have received this communication in error, please
delete this mail & notify us immediately at mailadmin@w...
[Non-text portions of this message have been removed]Hi Todd,
Thanks a lot for your input!
In the case , I found that "TO_CHAR(PLAN_DT, 'MM/DD/YYYY')" is alaised as a
column name in the resultset. So I am using this as a column in Jato
Descriptor for Plan_Dt. Now it is working fine.
Thanks and Regards,
Santa.
----- Original Message -----
From: Todd Fast <toddwork@c...>
Sent: Thursday, July 26, 2001 9:50 AM
Subject: Re: [iPlanet-JATO] Experiencing problem while executing model.
Santa--
I am experiencing a problem while executing a bounded model. I am usingQueryModelBase. Whenever the following query gets executed inonBeforeModel
execute of TiledView, it throws an exception describing "PLAN_DT not found
in ResultSet". If you execute this query on the SQL prompt then we getrows
of data. Please could you tell us how the mapping between model and
resultset works ? And what changes do we have to make to execute thisquery.
>>
SELECT PART_NM,NEWTXTDOLL
TO_CHAR(PLAN_DT, 'MM/DD/YYYY'),
FROM cpsselect
WHERE CHG_DT >= TO_DATE('2001-06-17', 'YYYY-MM-DD')The mapping of result set to model is done via JDBC, using the columnnames
you provide in your model's column descriptors. It sounds as if you are
providing the column name "PLAN_DT" in a descriptor, and when the model
tries to look up that column in the result set, there is no such columnand
the operation fails.
In order to debug this, you should try running your query with a JDBC
connection, not SQL*Plus or your command-line SQL tool. What you need to
find out is how the expresion "TO_CHAR(PLAN_DT, 'MM/DD/YYYY')" is aliasedas
a column name in the resut set. The easiest way to do this is to write a
simple class that does nothing but use your JDBC driver to connect the
database and execute this query. After execution, use theResultSetMetaData
information to find out the column names for the result set. Then, use
these column names in your JATO column descriptors.
Another Problem:We are not getting the values for NEWTXTDOLL column whenwe try to display it in a Tiled View.
I'm sorry, this isn't enough information for me to offer any suggestions.
Using the technique above, determine which columns are coming back in the
result set, and make sure your display fields in the TiledView are boundto
those column names. The problem could be something as simple as a typo in
the field's bound name, or something more complex like the column in the
result set being named something you don't expect.
Another approach might be to alias the columns yourself using the "AS
<alias>" expression, and assign them names that you choose instead ofusing
the names assigned by the database or JDBC driver.
Todd
[email protected]
The Information contained and transmitted by this E-MAIL is proprietary to
Wipro Limited and is intended for use only by the individual or entity to
which
it is addressed, and may contain information that is privileged, confidential
or
exempt from disclosure under applicable law. If this is a forwarded message,
the content of this E-MAIL may not have been sent with the authority of the
Company. If you are not the intended recipient, an agent of the intended
recipient or a person responsible for delivering the information to the named
recipient, you are notified that any use, distribution, transmission,
printing,
copying or dissemination of this information in any way or in any manner is
strictly prohibited. If you have received this communication in error, please
delete this mail & notify us immediately at mailadmin@w...
[Non-text portions of this message have been removed] -
Re: [iPlanet-JATO] Re: Retrieving all Values from a Tiled View
Todd,
Let me try to explain you this time. I have a text field in a TiledViewBean.
When I display the page, the text field
html tag is created with the name="PageDetail.rDetail[0].tbFieldName" say
five times/rows with same name.
The html tags look like this.
<input type=text name="PageDetail.rDetail[0].tbFieldName" value=""
maxlength=9 size=13>
<input type=text name="PageDetail.rDetail[0].tbFieldName" value=""
maxlength=9 size=13>
<input type=text name="PageDetail.rDetail[0].tbFieldName" value=""
maxlength=9 size=13>
When the form is submitted, I want to get the text field values using the
method getTbFieldName().getValues() which
returns an array object[]. This is in case where my TiledViewBean is not
bound and it is working fine.
Now in case when my TiledView is bound to a model, it creates the html tags
as follows.
<input type=text name="PageDetail.rDetail[0].tbFieldName" value=""
maxlength=9 size=13>
<input type=text name="PageDetail.rDetail[1].tbFieldName" value=""
maxlength=9 size=13>
<input type=text name="PageDetail.rDetail[2].tbFieldName" value=""
maxlength=9 size=13>
Now when I say getTbFieldName().getValues() it returns only the first
element values in the object[] and the rest of the
values are null.
May be we need to create a utility method do get these values from
requestContext.
raju.
----- Original Message -----
From: Todd Fast <toddwork@c...>
Sent: Saturday, July 07, 2001 3:52 AM
Subject: Re: [iPlanet-JATO] Re: Retrieving all Values from a Tiled View
Raju.--
I wanted to know how the getValues() method works the reason being,
when the tiled view is NOT bound to a model, it populates all the
fields with the same name as some thing likeI'm afraid I don't understand your point--can you please clarify? Do you
mean "value" instead of "name"?
What are you trying to do? What behavior are you expecting but notseeing?
>
Without further clarification, I can say that the setValues() methodsNEVER
populates data on multiple rows of a (dataset) model, nor does it affect
multiple fields on the same row. Perhaps what you are seeing is theeffect
of default values. Model that derive from DefaulModel have the ability to
carry forward the values set on the first row to other rows in lieu ofdata
in those other rows. This behavior is for pure convenience and can be
turned off, and it is turned off for the SQL-based models.
Todd
[email protected]Hi,
I wanted to know how the getValues() method works the reason being,
when the tiled view is NOT bound to a model, it populates all the
fields with the same name as some thing like
PageDetail.rDetail[0].tbFieldValue
PageDetail.rDetail[0].tbFieldValue
in which case, the getValues() method works fine.
But in case where the tiled view is bound to a model, it populates
with different field names such as,
PageDetail.rDetail[0].tbFieldValue
PageDetail.rDetail[1].tbFieldValue
in this case, the getValues() doesn't work. Any soultion to this?
We are using Moko 1.1.1.
thanks in advance,
raju.
--- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
Does anyone know of is there a single method to get all values of a
display
field in a tiled view without having to iterate through all the
values ie
resetTileIndex() / nextTile() approach.
ie Something that returns an Object[] or Vector just like ND returned a
CspVector. I tried using the getValues() methods but that allways returns
a
single element array containing the first element.
(I think now, that method is used for multi selecteable ListBoxes)Actually, no. We can add this in the next patch, but for now, I'd recommend
creating a simple utility method to do the iteration on an arbitrary model
and build the list for you.
Todd -
Re: [iPlanet-JATO] Retrieving all Values from a Tiled View
Does anyone know of is there a single method to get all values of adisplay
field in a tiled view without having to iterate through all the values ie
resetTileIndex() / nextTile() approach.
ie Something that returns an Object[] or Vector just like ND returned a
CspVector. I tried using the getValues() methods but that allways returnsa
single element array containing the first element.
(I think now, that method is used for multi selecteable ListBoxes)Actually, no. We can add this in the next patch, but for now, I'd recommend
creating a simple utility method to do the iteration on an arbitrary model
and build the list for you.
ToddHi,
I wanted to know how the getValues() method works the reason being,
when the tiled view is NOT bound to a model, it populates all the
fields with the same name as some thing like
PageDetail.rDetail[0].tbFieldValue
PageDetail.rDetail[0].tbFieldValue
in which case, the getValues() method works fine.
But in case where the tiled view is bound to a model, it populates
with different field names such as,
PageDetail.rDetail[0].tbFieldValue
PageDetail.rDetail[1].tbFieldValue
in this case, the getValues() doesn't work. Any soultion to this?
We are using Moko 1.1.1.
thanks in advance,
raju.
--- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
Does anyone know of is there a single method to get all values of a
display
field in a tiled view without having to iterate through all the
values ie
resetTileIndex() / nextTile() approach.
ie Something that returns an Object[] or Vector just like ND returned a
CspVector. I tried using the getValues() methods but that allways returns
a
single element array containing the first element.
(I think now, that method is used for multi selecteable ListBoxes)Actually, no. We can add this in the next patch, but for now, I'd recommend
creating a simple utility method to do the iteration on an arbitrary model
and build the list for you.
Todd -
The problem is that you don't know what the target view is until it has
been forwarded to.
Think about it... the request handling view bean (or command object) has
the request handler that has the code that will ultimately forward to
another view bean. This is code that you have written. So, until that
forwardTo() is invoked, there is no notion of a "target page".
What you do know is which "page" (view bean) the request is coming from
(the handling view bean or command class). You can get this from the
HttpServletRequest. The attribute name is "viewBean".
So you can get the view bean name by doing the following in onBeforeRequest:
<HttpServletRequest>.getAttribute("viewBean");
But I suspect this is not going to solve your current issue.
You could add the target page name to the page session. If there is more
than one possible target page, it might get a little more involved.
Let me know if the use of page session needs further explanation.
c
nickmalthus wrote:
I am implementing a custom security model since the standard J2EE
security model does not allow me access to the users password, which I
need to log into a third party application. I have overriden the
onBeforeRequest() method to check to see if the user is logged in, and
if not, forward to the Login ViewBean. However, I need to determine
what page/viewbean the request is attempting to access so I can let it
pass through if it is accessing the Login viewbean and to forward to
the requested view once the user is logged in. What is the best way to
do this? I see no obvious uitility in the javadocs
TIA
For more information about JATO, including download information, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jspI guess what I am thinking about doing is capturing the requested URL,
i.e. /appname/modulename/RequestName. In the onBeforeRequest(). I
would then check to see if the user is logged in, and if not, set the
URL in the session(or page session of the Login bean) and forward to
the Login viewbean using the viewbean manager. Inside the login view
in the handleSubmit() method I would authenticate the user and then
get the URL out of the session (or pagesession). I would then
magically get the ViewBean/Command object for the URL or otherwise
"forward the request" as if the user had typed in
/appname/modulename/RequestName, which is the behavior I am trying to
acheive.
It turns out I cannot forward in the onBeforeRequest() as it will
output the viewbean and then continue to process the request which in
turn trys to do a RequestDispatcher().forward after data has been
written to the stream which does not bode well with the servlet
container. Thus, it appears I have no control of the request in the
onBeforeRequest() method. Is this correct?
In light of this new observation I am now going to create a base view
class that all views will extend from and override the
onSecurityCheck() method to forward to my login bean. If I can't find
any other way, I will get the URL from the page session and do a
response.sendRedirect() to the URL.
Thanks for the help!
--- In iPlanet-JATO@y..., "Craig V. Conover" <craig.conover@s...> wrote:
The problem is that you don't know what the target view is until it has
been forwarded to.
Think about it... the request handling view bean (or command object)has
the request handler that has the code that will ultimately forward to
another view bean. This is code that you have written. So, until that
forwardTo() is invoked, there is no notion of a "target page".
What you do know is which "page" (view bean) the request is coming from
(the handling view bean or command class). You can get this from the
HttpServletRequest. The attribute name is "viewBean".
So you can get the view bean name by doing the following inonBeforeRequest:
>
<HttpServletRequest>.getAttribute("viewBean");
But I suspect this is not going to solve your current issue.
You could add the target page name to the page session. If there ismore
than one possible target page, it might get a little more involved.
Let me know if the use of page session needs further explanation.
c -
If you want to stop a JATO request in its tracks, you have a little black
magic at your disposal: you can throw a CompleteRequestException. This
indicates to the JATO infrastructure that it should immeditately stop
handling the request, but not generate an error, as the develper has taken
full control. You can generally throw this error from anywhere, at any
point--it is a RuntimeException, and is "tunneled" through other exception
handlers where appropriate.
In your scenario, you want to check if the user is logged in, and if not,
save the target URL using the parsePathInfo() method. Then, forward to the
login page and then throw a CompleteRequestException.
Todd
----- Original Message -----
From: "nickmalthus" <nickmalthus@h...>
Sent: Monday, January 07, 2002 3:05 PM
Subject: [iPlanet-JATO] Re: onBeforeRequest(); Finding requested view from
requestContext
I guess what I am thinking about doing is capturing the requested URL,
i.e. /appname/modulename/RequestName. In the onBeforeRequest(). I
would then check to see if the user is logged in, and if not, set the
URL in the session(or page session of the Login bean) and forward to
the Login viewbean using the viewbean manager. Inside the login view
in the handleSubmit() method I would authenticate the user and then
get the URL out of the session (or pagesession). I would then
magically get the ViewBean/Command object for the URL or otherwise
"forward the request" as if the user had typed in
/appname/modulename/RequestName, which is the behavior I am trying to
acheive.
It turns out I cannot forward in the onBeforeRequest() as it will
output the viewbean and then continue to process the request which in
turn trys to do a RequestDispatcher().forward after data has been
written to the stream which does not bode well with the servlet
container. Thus, it appears I have no control of the request in the
onBeforeRequest() method. Is this correct?
In light of this new observation I am now going to create a base view
class that all views will extend from and override the
onSecurityCheck() method to forward to my login bean. If I can't find
any other way, I will get the URL from the page session and do a
response.sendRedirect() to the URL.
Thanks for the help!
--- In iPlanet-JATO@y..., "Craig V. Conover" <craig.conover@s...> wrote:
The problem is that you don't know what the target view is until it has
been forwarded to.
Think about it... the request handling view bean (or command object)has
the request handler that has the code that will ultimately forward to
another view bean. This is code that you have written. So, until that
forwardTo() is invoked, there is no notion of a "target page".
What you do know is which "page" (view bean) the request is coming from
(the handling view bean or command class). You can get this from the
HttpServletRequest. The attribute name is "viewBean".
So you can get the view bean name by doing the following inonBeforeRequest:
<HttpServletRequest>.getAttribute("viewBean");
But I suspect this is not going to solve your current issue.
You could add the target page name to the page session. If there ismore
than one possible target page, it might get a little more involved.
Let me know if the use of page session needs further explanation.
c
For more information about JATO, including download information, pleasevisit:
http://developer.iplanet.com/tech/appserver/framework/index.jspIf you want to stop a JATO request in its tracks, you have a little black
magic at your disposal: you can throw a CompleteRequestException. This
indicates to the JATO infrastructure that it should immeditately stop
handling the request, but not generate an error, as the develper has taken
full control. You can generally throw this error from anywhere, at any
point--it is a RuntimeException, and is "tunneled" through other exception
handlers where appropriate.
In your scenario, you want to check if the user is logged in, and if not,
save the target URL using the parsePathInfo() method. Then, forward to the
login page and then throw a CompleteRequestException.
Todd
----- Original Message -----
From: "nickmalthus" <nickmalthus@h...>
Sent: Monday, January 07, 2002 3:05 PM
Subject: [iPlanet-JATO] Re: onBeforeRequest(); Finding requested view from
requestContext
I guess what I am thinking about doing is capturing the requested URL,
i.e. /appname/modulename/RequestName. In the onBeforeRequest(). I
would then check to see if the user is logged in, and if not, set the
URL in the session(or page session of the Login bean) and forward to
the Login viewbean using the viewbean manager. Inside the login view
in the handleSubmit() method I would authenticate the user and then
get the URL out of the session (or pagesession). I would then
magically get the ViewBean/Command object for the URL or otherwise
"forward the request" as if the user had typed in
/appname/modulename/RequestName, which is the behavior I am trying to
acheive.
It turns out I cannot forward in the onBeforeRequest() as it will
output the viewbean and then continue to process the request which in
turn trys to do a RequestDispatcher().forward after data has been
written to the stream which does not bode well with the servlet
container. Thus, it appears I have no control of the request in the
onBeforeRequest() method. Is this correct?
In light of this new observation I am now going to create a base view
class that all views will extend from and override the
onSecurityCheck() method to forward to my login bean. If I can't find
any other way, I will get the URL from the page session and do a
response.sendRedirect() to the URL.
Thanks for the help!
--- In iPlanet-JATO@y..., "Craig V. Conover" <craig.conover@s...> wrote:
The problem is that you don't know what the target view is until it has
been forwarded to.
Think about it... the request handling view bean (or command object)has
the request handler that has the code that will ultimately forward to
another view bean. This is code that you have written. So, until that
forwardTo() is invoked, there is no notion of a "target page".
What you do know is which "page" (view bean) the request is coming from
(the handling view bean or command class). You can get this from the
HttpServletRequest. The attribute name is "viewBean".
So you can get the view bean name by doing the following inonBeforeRequest:
<HttpServletRequest>.getAttribute("viewBean");
But I suspect this is not going to solve your current issue.
You could add the target page name to the page session. If there ismore
than one possible target page, it might get a little more involved.
Let me know if the use of page session needs further explanation.
c
For more information about JATO, including download information, pleasevisit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp -
Re: [iPlanet-JATO] Re: Href click & tiled view display
Srinivas--
Remember, attachments don't come through on the forum. Please send them to
the jatoteam@e... alias.
Todd
----- Original Message -----
From: "Srinivas Chikkam" <srinivas.chikkam@w...>
Sent: Thursday, July 19, 2001 5:26 AM
Subject: [iPlanet-JATO] Re: Href click & tiled view display
Todd,
I'm calling resetTileIndex() in the begin display of the tiled views.
I'm attaching the code with this mail.
Outer tile: pgModelDistributionrMultiplePayeesTiledView
inner tile: pgModelDistributionrPayeeDetailsTiledView
Yes, Matt's mail helped me in resolving the first problem (submitting
the form on href click).
I have replaced the href from
<a
href="../Participant/pgModelDistribution?pgModelDistribution.linkNetDistribu
tion=&pageAttributes=">
$1,000 </a>
to
$1,000
and added a new javascript method as below:
function netDistFunc()
val = document.forms[0].elements["pageAttributes"].value;
_url =
"../Participant/pgModelDistribution?pgModelDistribution.linkNetDistribution=
&pageAttributes="+val;
>
document.forms[0].method = "post";
document.forms[0].action = _url;
document.forms[0].submit();
return false;
Now, I'm able to get the data entered by the user.
Thanks
Srinivas
Message: 2
Date: Wed, 18 Jul 2001 04:03:51 -0600
From: "Todd Fast" <toddwork@c...>
Subject: Re: Digest Number 157
Srinivas--
From where are you calling these methods, what event? Maybe you shouldsend
me the code for your nested tiled views--that's probably the easiest way
for
me to understand what's happening. Also, were any of Matt's
suppositions
correct?
Todd
The Information contained and transmitted by this E-MAIL is proprietary to
Wipro Limited and is intended for use only by the individual or entity towhich
it is addressed, and may contain information that is privileged,confidential or
exempt from disclosure under applicable law. If this is a forwardedmessage,
the content of this E-MAIL may not have been sent with the authority ofthe
Company. If you are not the intended recipient, an agent of the intended
recipient or a person responsible for delivering the information to thenamed
recipient, you are notified that any use, distribution, transmission,printing,
copying or dissemination of this information in any way or in any manneris
strictly prohibited. If you have received this communication in error,please
delete this mail & notify us immediately at mailadmin@w...
[Non-text portions of this message have been removed]
[email protected]Srinivas--
Remember, attachments don't come through on the forum. Please send them to
the jatoteam@e... alias.
Todd
----- Original Message -----
From: "Srinivas Chikkam" <srinivas.chikkam@w...>
Sent: Thursday, July 19, 2001 5:26 AM
Subject: [iPlanet-JATO] Re: Href click & tiled view display
Todd,
I'm calling resetTileIndex() in the begin display of the tiled views.
I'm attaching the code with this mail.
Outer tile: pgModelDistributionrMultiplePayeesTiledView
inner tile: pgModelDistributionrPayeeDetailsTiledView
Yes, Matt's mail helped me in resolving the first problem (submitting
the form on href click).
I have replaced the href from
<a
href="../Participant/pgModelDistribution?pgModelDistribution.linkNetDistribu
tion=&pageAttributes=">
$1,000 </a>
to
$1,000
and added a new javascript method as below:
function netDistFunc()
val = document.forms[0].elements["pageAttributes"].value;
_url =
"../Participant/pgModelDistribution?pgModelDistribution.linkNetDistribution=
&pageAttributes="+val;
>
document.forms[0].method = "post";
document.forms[0].action = _url;
document.forms[0].submit();
return false;
Now, I'm able to get the data entered by the user.
Thanks
Srinivas
Message: 2
Date: Wed, 18 Jul 2001 04:03:51 -0600
From: "Todd Fast" <toddwork@c...>
Subject: Re: Digest Number 157
Srinivas--
From where are you calling these methods, what event? Maybe you shouldsend
me the code for your nested tiled views--that's probably the easiest way
for
me to understand what's happening. Also, were any of Matt's
suppositions
correct?
Todd
The Information contained and transmitted by this E-MAIL is proprietary to
Wipro Limited and is intended for use only by the individual or entity towhich
it is addressed, and may contain information that is privileged,confidential or
exempt from disclosure under applicable law. If this is a forwardedmessage,
the content of this E-MAIL may not have been sent with the authority ofthe
Company. If you are not the intended recipient, an agent of the intended
recipient or a person responsible for delivering the information to thenamed
recipient, you are notified that any use, distribution, transmission,printing,
copying or dissemination of this information in any way or in any manneris
strictly prohibited. If you have received this communication in error,please
delete this mail & notify us immediately at mailadmin@w...
[Non-text portions of this message have been removed]
[email protected] -
RE: [iPlanet-JATO] Href click & tiled view display
Srinivas,
I hope that I am not oversimplifying your first question; repost if I do not
answer your question. Independent of JATO, HTML Form button sumbits will
include the scraping of data off the form input fields; the data will passed
as part of the body of the HTTP request. Therefore, you would expect to
receive all your inputs during the Button submit. In the case of a button,
a HTTP POST request is invoked. Href clicks, only submit the NVPs which are
encoded on the HREF URL. Therefore, it is impossible (under normal
circumstances) to retrieve the inputs from the FORM during the Href click.
In the case of a Href, a HTTP GET request is invoked. Some customers have
used a pattern in which Javascript is used to capture the Href onClick()
event to perform some runtime modifications to the HREF URL before the HTTP
GET request is submitted. I recommend to always have the LogProxy2 utility
running during development so that the HTTP requests and repsonses can be
debugged. If you setup the LogProxy2 (downloadable from this Group's Files
repository) then you would see the HTTP requests in the LogProxy2's console
window.
TiledView question: Remember, each TiledView requires a "primary
DatasetModel" which it uses for iteration of the tiles. It can be
confusing, but the API call of
<ContainerView>.getDefaultModel()
has no relation to the implementation class called DefaultModel. See the
Javadoc (excerp below)
/migtoolbox-1.1.1/doc/jato/api/com/iplanet/jato/view/ContainerView.html#getD
efaultModel()
"Returns this view's default model. The default model is typically used by
DisplayField children for default value storage (if they are not bound to
any other model). This method should always return a valid model instance.
Note that the default model need not be an actual instance of DefaultModel,
although this is usually the case."
Both of your TiledView's (inner and outer) are ContainerViews, each having
their own property for [get/set]DefaultModel(). Likewise, the ViewBean
parent of the outer TiledView is a ContainerView as well. With these facts
in mind, consider the behavior of the ModelManager. The ModelManager will
ensure that only once instance of specifically named model will be provided
during a request scope. Therefore, everytime that you make a call to
<ModelManager>.getModel(SomeModel.class)
no matter how many times you make this call during a request, the
ModelManager will ensure that you get the same object reference back.
Implicitly, you are asking for a Model with the exclusive name of
<ModelManager>.getDefaultModelInstanceName(SomeModel.class)
I believe that your problem is that you have the Primary Model of both the
inner and outer TiledView's set to the same instance of the DefaultModel
class. Therefore, the TiledViews are tripping over each other because they
are using the same Primary model. What I would do is change the constructor
of each TiledView to set an exclusive Primary model
// add to constructor of outer TileView
setPrimaryModel(getModelI(DefaultModel.class,"outer")
// add to constructor of inner TileView
setPrimaryModel(getModelI(DefaultModel.class,"inner")
remember to set the "size" of the Primary Model appropriately in the
beginDisplay() event of each TiledView before calling super.beginDisplay()
matt
-----Original Message-----
From: Srinivas Chikkam [mailto:<a href="/group/SunONE-JATO/post?protectID=061212020185082096169232190043244089032032196034013195172049230091142254099102">srinivas.chikkam@w...</a>]
Sent: Tuesday, July 17, 2001 7:36 AM
Subject: [iPlanet-JATO] Href click & tiled view display
Hi,
I'm facing the following two problems in JATO. Your help will be
appreciated.
1) Clicking a HREF.
I have a button and a href in a page. When I submit the page by
clicking the button, I'm able to
get all the user entered data (form elements) in handler method.
However, when I click
the href and I try to retrieve the data entered by the user in my
corresponding handler method, I'm
getting blank values.
How would I be able to get the user entered data upon clicking of a href
? I'm copying the sample
code for your reference.
// This returns me 5 values entered in the 5 tiles by the user.
public void handleBButtonRequest(RequestContext req)
throws ServletException, IOException
try
System.out.println("button clicked..");
pgSampleTiledView tiledView = getSampleTile();
System.out.println("\n\n\n\n@@@@@@@@@@@ No of tiles >>>
"+tiledView.getNumTiles());
int n = tiledView.getNumTiles();
for (int i=0; i<n; i++)
tiledView.setTileIndex(i);
System.out.println(i+".
"+tiledView.getTbValue().getValue().toString());
this.forwardTo(req);
catch (Exception ex)
ex.printStackTrace();
// This returns me 0 tiles and doesn't get into for loop
public void handleLinkModifyDistributionRequest(RequestContext req )
throws ServletException, IOException
try
System.out.println("href clicked..");
pgSampleTiledView tiledView = getSampleTile();
System.out.println("\n\n\n\n@@@@@@@@@@@ No of tiles >>>
"+tiledView.getNumTiles());
int n = tiledView.getNumTiles();
for (int i=0; i<n; i++)
tiledView.setTileIndex(i);
System.out.println(i+".
"+tiledView.getTbValue().getValue().toString());
this.forwardTo(req);
catch (Exception ex)
ex.printStackTrace();
2) Tiled view display
I have tiled view inside another tiled view. Based upon the data
retrieved from the database, lets say, the outer tile needs to be
displayed twice and the inner tile 3 times and 1 time.
For Ex: Lets say, the desired output from these tiled views is as
follows
STOCK INVESTMENT
stock name1
stock name2
stock name3
OTHER INVESTMENT
other investment1
The outer tiled view displays the investment type headings (STOCK
INVESTMENT or OTHER INVESTMENT) and inner tile
displays the actual stock names or the other investment names. Both
the tile views are bound to a default model. In the begin display
of these tiled view I'm setting the size of the model as
getPrimaryModel.setSize(requiredsize).
If i display 3 records in the inner tiled view in the first iteration
and i try to display 1 record in the second iteration, it displays 3
records
properly the first time but it doesn't display any records second
time. super.nextTile() returns false right away second time.
But If I try to display 1 record in the first iteration and 3 records in
the second iteration as below, it works fine.
STOCK INVESTMENT
stock name1
OTHER INVESTMENT
other investment1
other investment2
other investment3
Please let me know what could be the problem.
Thanks
~ Srinivas
The Information contained and transmitted by this E-MAIL is
proprietary to
Wipro Limited and is intended for use only by the individual or
entity to which
it is addressed, and may contain information that is privileged,
confidential or
exempt from disclosure under applicable law. If this is a
forwarded message,
the content of this E-MAIL may not have been sent with the
authority of the
Company. If you are not the intended recipient, an agent of the intended
recipient or a person responsible for delivering the information
to the named
recipient, you are notified that any use, distribution,
transmission, printing,
copying or dissemination of this information in any way or in any
manner is
strictly prohibited. If you have received this communication in
error, please
delete this mail & notify us immediately at mailadmin@w...
[Non-text portions of this message have been removed]
[email protected]should read
// add to constructor of outer TileView
setPrimaryModel(getModel(DefaultModel.class,"outer");
// add to constructor of inner TileView
setPrimaryModel(getModel(DefaultModel.class,"inner");
matt
-----Original Message-----
From: Matthew Stevens [mailto:<a href="/group/SunONE-JATO/post?protectID=029166114165042198028082000056130080177026031196061123241150194211220076086020224">matthew.stevens@e...</a>]
Sent: Tuesday, July 17, 2001 9:25 AM
Subject: RE: [iPlanet-JATO] Href click & tiled view display
Srinivas,
I hope that I am not oversimplifying your first question; repost
if I do not
answer your question. Independent of JATO, HTML Form button sumbits will
include the scraping of data off the form input fields; the data
will passed
as part of the body of the HTTP request. Therefore, you would expect to
receive all your inputs during the Button submit. In the case of
a button,
a HTTP POST request is invoked. Href clicks, only submit the
NVPs which are
encoded on the HREF URL. Therefore, it is impossible (under normal
circumstances) to retrieve the inputs from the FORM during the Href click.
In the case of a Href, a HTTP GET request is invoked. Some customers have
used a pattern in which Javascript is used to capture the Href onClick()
event to perform some runtime modifications to the HREF URL
before the HTTP
GET request is submitted. I recommend to always have the
LogProxy2 utility
running during development so that the HTTP requests and repsonses can be
debugged. If you setup the LogProxy2 (downloadable from this
Group's Files
repository) then you would see the HTTP requests in the
LogProxy2's console
window.
TiledView question: Remember, each TiledView requires a "primary
DatasetModel" which it uses for iteration of the tiles. It can be
confusing, but the API call of
<ContainerView>.getDefaultModel()
has no relation to the implementation class called DefaultModel. See the
Javadoc (excerp below)
/migtoolbox-1.1.1/doc/jato/api/com/iplanet/jato/view/ContainerView
.html#getD
efaultModel()
"Returns this view's default model. The default model is typically used by
DisplayField children for default value storage (if they are not bound to
any other model). This method should always return a valid model instance.
Note that the default model need not be an actual instance of
DefaultModel,
although this is usually the case."
Both of your TiledView's (inner and outer) are ContainerViews, each having
their own property for [get/set]DefaultModel(). Likewise, the ViewBean
parent of the outer TiledView is a ContainerView as well. With
these facts
in mind, consider the behavior of the ModelManager. The ModelManager will
ensure that only once instance of specifically named model will
be provided
during a request scope. Therefore, everytime that you make a call to
<ModelManager>.getModel(SomeModel.class)
no matter how many times you make this call during a request, the
ModelManager will ensure that you get the same object reference back.
Implicitly, you are asking for a Model with the exclusive name of
<ModelManager>.getDefaultModelInstanceName(SomeModel.class)
I believe that your problem is that you have the Primary Model of both the
inner and outer TiledView's set to the same instance of the DefaultModel
class. Therefore, the TiledViews are tripping over each other
because they
are using the same Primary model. What I would do is change the
constructor
of each TiledView to set an exclusive Primary model
// add to constructor of outer TileView
setPrimaryModel(getModelI(DefaultModel.class,"outer")
// add to constructor of inner TileView
setPrimaryModel(getModelI(DefaultModel.class,"inner")
remember to set the "size" of the Primary Model appropriately in the
beginDisplay() event of each TiledView before calling super.beginDisplay()
matt
-----Original Message-----
From: Srinivas Chikkam [mailto:<a href="/group/SunONE-JATO/post?protectID=061212020185082096169232190043244089032032196034013195172049230091142254099102">srinivas.chikkam@w...</a>]
Sent: Tuesday, July 17, 2001 7:36 AM
Subject: [iPlanet-JATO] Href click & tiled view display
Hi,
I'm facing the following two problems in JATO. Your help will be
appreciated.
1) Clicking a HREF.
I have a button and a href in a page. When I submit the page by
clicking the button, I'm able to
get all the user entered data (form elements) in handler method.
However, when I click
the href and I try to retrieve the data entered by the user in my
corresponding handler method, I'm
getting blank values.
How would I be able to get the user entered data upon clicking of a href
? I'm copying the sample
code for your reference.
// This returns me 5 values entered in the 5 tiles by the user.
public void handleBButtonRequest(RequestContext req)
throws ServletException, IOException
try
System.out.println("button clicked..");
pgSampleTiledView tiledView = getSampleTile();
System.out.println("\n\n\n\n@@@@@@@@@@@ No of tiles >>>
"+tiledView.getNumTiles());
int n = tiledView.getNumTiles();
for (int i=0; i<n; i++)
tiledView.setTileIndex(i);
System.out.println(i+".
"+tiledView.getTbValue().getValue().toString());
this.forwardTo(req);
catch (Exception ex)
ex.printStackTrace();
// This returns me 0 tiles and doesn't get into for loop
public void handleLinkModifyDistributionRequest(RequestContext req )
throws ServletException, IOException
try
System.out.println("href clicked..");
pgSampleTiledView tiledView = getSampleTile();
System.out.println("\n\n\n\n@@@@@@@@@@@ No of tiles >>>
"+tiledView.getNumTiles());
int n = tiledView.getNumTiles();
for (int i=0; i<n; i++)
tiledView.setTileIndex(i);
System.out.println(i+".
"+tiledView.getTbValue().getValue().toString());
this.forwardTo(req);
catch (Exception ex)
ex.printStackTrace();
2) Tiled view display
I have tiled view inside another tiled view. Based upon the data
retrieved from the database, lets say, the outer tile needs to be
displayed twice and the inner tile 3 times and 1 time.
For Ex: Lets say, the desired output from these tiled views is as
follows
STOCK INVESTMENT
stock name1
stock name2
stock name3
OTHER INVESTMENT
other investment1
The outer tiled view displays the investment type headings (STOCK
INVESTMENT or OTHER INVESTMENT) and inner tile
displays the actual stock names or the other investment names. Both
the tile views are bound to a default model. In the begin display
of these tiled view I'm setting the size of the model as
getPrimaryModel.setSize(requiredsize).
If i display 3 records in the inner tiled view in the first iteration
and i try to display 1 record in the second iteration, it displays 3
records
properly the first time but it doesn't display any records second
time. super.nextTile() returns false right away second time.
But If I try to display 1 record in the first iteration and 3 records in
the second iteration as below, it works fine.
STOCK INVESTMENT
stock name1
OTHER INVESTMENT
other investment1
other investment2
other investment3
Please let me know what could be the problem.
Thanks
~ Srinivas
The Information contained and transmitted by this E-MAIL is
proprietary to
Wipro Limited and is intended for use only by the individual or
entity to which
it is addressed, and may contain information that is privileged,
confidential or
exempt from disclosure under applicable law. If this is a
forwarded message,
the content of this E-MAIL may not have been sent with the
authority of the
Company. If you are not the intended recipient, an agent of the intended
recipient or a person responsible for delivering the information
to the named
recipient, you are notified that any use, distribution,
transmission, printing,
copying or dissemination of this information in any way or in any
manner is
strictly prohibited. If you have received this communication in
error, please
delete this mail & notify us immediately at mailadmin@w...
[Non-text portions of this message have been removed]
[email protected]
[email protected] -
Re: [iPlanet-JATO] TiledView - getting Values
Kostas--
This is because in TiledViewBase.mapRequestParameters(), calling
getChild(String name, int tile) before setting the values in the request,
will not set the location for the models other that the primary model-
effectively we are only setting one value (more that once if there aremany
values being submitted). So we get the value of the last value in thetiled
view. This is because getChild only changes the location on the primary
model. Which is why I the following code change worked.Ah, I admit I didn't connect the problem to this. Thanks ver much for
clarifying.
As you stated it might be better to add a place holder for all other
auxillary models and keep them in sync with the primary model.Agreed, this sounds like the correct approach. My unstated assumption was
that all location changes to the primary model would also occur on the
auxiliary models, so that would mean that the mapRequestParameters() method
would then work as intended.
How about making the primary model the controlling model. We would have to
"prime" the other models to ensure they all have the same number of rowsas
the highest model for the request. Otherwise we will the followingsituation
I detailed in the prevoius email:That works for me, but it will no doubt result in some strange behavior for
someone down the road. I'll see what's possible about syncing primary and
auxiliary models more explicitly, or at least checking for the situation
where the primary has more rows than the other models.
This way developers would not have to determine if a DisplayField is bound
to non primary model and do additional processing. I suppose it is aslight
design question as well. Enforcing a MVC approach is about going to the to
the Model to get you data. Onthe other hand NetDynamics just allowed youthe
get the value(s) of a field regardless of the Data Object it was or wasn't
bound to.Right, and I think it's important for JATO developers to preserve both techn
iques. The nice thing the technique of accessing the fields directly gives
you is the ability to obtain data in a non-model-specific way. This can be
just as valuable as providing model-only interactions.
Thanks for your feedback Todd. Let me know what you think.Same to you. I hope others on the list have similar suggestions that they
share with us. I think the above approach is sound and I'll be putting it in
for the next patch version, 1.1.2. If anyone has any final comments, please
let me know ASAP.
ToddHi,
I wanted to know how the getValues() method works the reason being,
when the tiled view is NOT bound to a model, it populates all the
fields with the same name as some thing like
PageDetail.rDetail[0].tbFieldValue
PageDetail.rDetail[0].tbFieldValue
in which case, the getValues() method works fine.
But in case where the tiled view is bound to a model, it populates
with different field names such as,
PageDetail.rDetail[0].tbFieldValue
PageDetail.rDetail[1].tbFieldValue
in this case, the getValues() doesn't work. Any soultion to this?
We are using Moko 1.1.1.
thanks in advance,
raju.
--- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
Does anyone know of is there a single method to get all values of a
display
field in a tiled view without having to iterate through all the
values ie
resetTileIndex() / nextTile() approach.
ie Something that returns an Object[] or Vector just like ND returned a
CspVector. I tried using the getValues() methods but that allways returns
a
single element array containing the first element.
(I think now, that method is used for multi selecteable ListBoxes)Actually, no. We can add this in the next patch, but for now, I'd recommend
creating a simple utility method to do the iteration on an arbitrary model
and build the list for you.
Todd -
RE: [iPlanet-JATO] Re: Use Of models in utility classes
Hi all,
if you add the following to your spider2jato.xml
It will automatically map your CSpDataObject.executeImmediate to use
ExecuteImmediateUtil.executeImmediateSelect with the arguments mapped as
well.
Kostas
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[CSpDataObject[.\s]*executeImmediate[\s]*\(([^,]*),([^)]*)\)]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[CSpDataObject[.\s]*executeImmediate[\s]*\(([^,]*),([^)]*)\)]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[ExecuteImmediateUtil.executeImmediateSelect($1,$2,
getRequestContext())]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
-----Original Message-----
From: Matthew Stevens
Cc: vnamboori@y...
Sent: 11/29/01 11:23 AM
Subject: RE: [iPlanet-JATO] Re: Use Of models in utility classes
Namburi,
I have included an example in the file ExecuteImmediateUtil.java
The Yahoo Group will not handle the attached file we will put it in the
Files section shortly.
matt
-----Original Message-----
From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100253094145066046167121181">vnamboori@y...</a>]
Sent: Thursday, November 29, 2001 12:29 PM
Subject: [iPlanet-JATO] Re: Use Of models in utility classes
Matt,
For CSpSelect.executeImmediate() I have an example of custom helpermethod as a replacement which uses JDBC results instead of
CSpDBResult.
Can you send me this example.
Thanks
Namburi
--- In iPlanet-JATO@y..., "Matthew Stevens" <matthew.stevens@E...>
wrote:
Namburi,
I will post a document to the group site this evening which has thedetails
on various tactics of migrating these type of utilities.Essentially, you
either need to convert these utilities to Models themselves or keepthe
utilities as is and simply use the
RequestManager.getRequestContext.getModelManager().getModel()
to statically access Models.
For CSpSelect.executeImmediate() I have an example of custom helpermethod
as a replacement whicch uses JDBC results instead of CSpDBResult.
matt
-----Original Message-----
From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
Sent: Tuesday, August 07, 2001 3:24 PM
Subject: [iPlanet-JATO] Use Of models in utility classes
Hi All,
In the present ND project we have lots of utility classes. These
classes in diffrent directory. Not part of nd pages.
In these classes we access the dataobjects and do the
manipulations.
So we access dataobjects directly like
CSpider.getDataObject("do....");
and then execute it.
Since the migration tool does not do much of conversion for these
utilities we have to do manually.
My question is Can we access the the models in the post migration
sameway or do we need requestContext?
We have lots of utility classes which are DataObject intensive.Can
someone suggest a better way to migrate this kind of code.
Thanks
Namburi
[email protected]
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
[Non-text portions of this message have been removed]
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
[Non-text portions of this message have been removed]Hi all,
if you add the following to your spider2jato.xml
It will automatically map your CSpDataObject.executeImmediate to use
ExecuteImmediateUtil.executeImmediateSelect with the arguments mapped as
well.
Kostas
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[CSpDataObject[.\s]*executeImmediate[\s]*\(([^,]*),([^)]*)\)]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[CSpDataObject[.\s]*executeImmediate[\s]*\(([^,]*),([^)]*)\)]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[ExecuteImmediateUtil.executeImmediateSelect($1,$2,
getRequestContext())]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
-----Original Message-----
From: Matthew Stevens
Cc: vnamboori@y...
Sent: 11/29/01 11:23 AM
Subject: RE: [iPlanet-JATO] Re: Use Of models in utility classes
Namburi,
I have included an example in the file ExecuteImmediateUtil.java
The Yahoo Group will not handle the attached file we will put it in the
Files section shortly.
matt
-----Original Message-----
From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100253094145066046167121181">vnamboori@y...</a>]
Sent: Thursday, November 29, 2001 12:29 PM
Subject: [iPlanet-JATO] Re: Use Of models in utility classes
Matt,
For CSpSelect.executeImmediate() I have an example of custom helpermethod as a replacement which uses JDBC results instead of
CSpDBResult.
Can you send me this example.
Thanks
Namburi
--- In iPlanet-JATO@y..., "Matthew Stevens" <matthew.stevens@E...>
wrote:
Namburi,
I will post a document to the group site this evening which has thedetails
on various tactics of migrating these type of utilities.Essentially, you
either need to convert these utilities to Models themselves or keepthe
utilities as is and simply use the
RequestManager.getRequestContext.getModelManager().getModel()
to statically access Models.
For CSpSelect.executeImmediate() I have an example of custom helpermethod
as a replacement whicch uses JDBC results instead of CSpDBResult.
matt
-----Original Message-----
From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
Sent: Tuesday, August 07, 2001 3:24 PM
Subject: [iPlanet-JATO] Use Of models in utility classes
Hi All,
In the present ND project we have lots of utility classes. These
classes in diffrent directory. Not part of nd pages.
In these classes we access the dataobjects and do the
manipulations.
So we access dataobjects directly like
CSpider.getDataObject("do....");
and then execute it.
Since the migration tool does not do much of conversion for these
utilities we have to do manually.
My question is Can we access the the models in the post migration
sameway or do we need requestContext?
We have lots of utility classes which are DataObject intensive.Can
someone suggest a better way to migrate this kind of code.
Thanks
Namburi
[email protected]
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
[Non-text portions of this message have been removed]
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
[Non-text portions of this message have been removed] -
Re: [iPlanet-JATO] JATO 1.2.1
Raji--
I sympathize with users trying to understand JATO internals--we do not have
sufficient (external) documentation for this. However, you do have the full
source code to view at your convenience. Our hope is that you will be able
to use the JATO sample application to better understand the range of JATO
features and how they work, and then be able to drill down to the source
code if you have implementation questions.
Have you looked at the JATO sample application? It is bundled with the JATO
distribution, and allows you to browse the sample source code online.
Todd
----- Original Message -----
From: "rajeswari pichai" <padmaraji@y...>
Sent: Wednesday, January 30, 2002 8:05 PM
Subject: Re: [iPlanet-JATO] JATO 1.2.1
>
--- padiyar <padiyar@y...> wrote:
Hi,
When is JATO 1.2.1 being released? Right now we are
using JATO 1.2EA
Thanks,
Divakar
hi all,
i want help for jato. I couldn't understand the
framework.is there any Document for that! in site they
have explained how to use but not what internally
happens !please help me!
Thanks in advance
raji
For more information about JATO, including download information, pleasevisit:
http://developer.iplanet.com/tech/appserver/framework/index.jspRaji--
I sympathize with users trying to understand JATO internals--we do not have
sufficient (external) documentation for this. However, you do have the full
source code to view at your convenience. Our hope is that you will be able
to use the JATO sample application to better understand the range of JATO
features and how they work, and then be able to drill down to the source
code if you have implementation questions.
Have you looked at the JATO sample application? It is bundled with the JATO
distribution, and allows you to browse the sample source code online.
Todd
----- Original Message -----
From: "rajeswari pichai" <padmaraji@y...>
Sent: Wednesday, January 30, 2002 8:05 PM
Subject: Re: [iPlanet-JATO] JATO 1.2.1
>
--- padiyar <padiyar@y...> wrote:
Hi,
When is JATO 1.2.1 being released? Right now we are
using JATO 1.2EA
Thanks,
Divakar
hi all,
i want help for jato. I couldn't understand the
framework.is there any Document for that! in site they
have explained how to use but not what internally
happens !please help me!
Thanks in advance
raji
For more information about JATO, including download information, pleasevisit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp -
Re: [iPlanet-JATO] Transaction in JATO
Jeff--
I have one thing to add. You can obtain a JDBC Connection in several ways.
First is to simply use a JNDI lookup on your own, as you would in any J2EE
application. The second it to use JATO's SQLConnectionManager (available in
the RequestContext), which provides some additional convenience by
interposing a level of datasource mapping indirection (see docs). Third,
you can obtain the connection that any given QueryModel would use by
default by calling its "getDefaultConnection()" method. This saves you from
worrying at all about the JDBC datasource name used to obtain the
connection.
Any one of these three techniques is perfectly fine; choose the one that
makes sense for the maintainability of the application in the long run.
Todd
Todd Fast
Senior Engineer
Sun/Netscape Alliance
todd.fast@s...
----- Original Message -----
From: "Mike Frisino" <Michael.Frisino@s...>
Sent: Wednesday, October 24, 2001 1:25 PM
Subject: Re: [iPlanet-JATO] Transaction in JATO
Jeff,
See the javadoc for DatasetSQLModelExecutionContext. It may seem a bitcounterintuitive, since for updates and inserts you do not need the full
dataset capability, but you don't use what you don't need.
>
In your case, what you do want to take advantage of is the ability tocontrol the "JDBC Connection" directly. Therein lies the transactional
control that you are looking for. NetD needed to rely on something like the
CSpTransaction class precisely because it did not allow developers direct
access to the JDBC Connection. That is no longer a restriction in JATO,
hence, there is no equivalent to CSpTransaction per se.
>
>
public class DatasetSQLModelExecutionContext
extends DatasetModelExecutionContextImpl
implements SQLModelExecutionContext
An execution context used to execute dataset operations on QueryModels(normally SQL SELECT operations). Developers can specify both the dataset
offset and size, as well as a JDBC connection or statement object, to be
used during execution of the model.
>
By providing a connection or statement object to the model via thiscontext, developers can maintain control of the transaction state of the
connection instead of relying on the default behavior (which is generally
equivalent to auto-commit semantics). However, such use also introduces a
measure of responsibilty on the developer--because providing these objects
to the model manually causes the model to avoid any connection lifecycle
management of its own, the developer is completely responsible for managing
the lifecycle of the connection, as well as the lifecycle of any
transactions that might be pending on that connection.
>
In general, if the developer supplies a connection object, he or she neednot also supply a statement object. Conversely, if the developer supplies a
statement object, he or she need not specify a connection object (though he
will need to keep a reference to the connection object used to create the
statement in order to close it after execution is complete). In both cases,
the developer is ultimately responsible for releasing the connection
manually when use of it is complete.
>
----- Original Message -----
From: jeffrey_smith@p...
Sent: Wednesday, October 24, 2001 12:52 PM
Subject: [iPlanet-JATO] Transaction in JATO
Does anyone have an example on how to do multiple updates/inserts using
various models in one transaction in JATO1.2. I am trying to migrate ND
code that uses a CSpTransaction object to do this and there does notappear
to be an equivalent object in JATO.
Thanks.
Jeff Smith
Senior Application Consultant
Software Engineering
Putnam Investments
voice: (617)760-3121
fax: (617)760-3850
Choose from 1000s of job listings!
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
[Non-text portions of this message have been removed]
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jspJeff--
I have one thing to add. You can obtain a JDBC Connection in several ways.
First is to simply use a JNDI lookup on your own, as you would in any J2EE
application. The second it to use JATO's SQLConnectionManager (available in
the RequestContext), which provides some additional convenience by
interposing a level of datasource mapping indirection (see docs). Third,
you can obtain the connection that any given QueryModel would use by
default by calling its "getDefaultConnection()" method. This saves you from
worrying at all about the JDBC datasource name used to obtain the
connection.
Any one of these three techniques is perfectly fine; choose the one that
makes sense for the maintainability of the application in the long run.
Todd
Todd Fast
Senior Engineer
Sun/Netscape Alliance
todd.fast@s...
----- Original Message -----
From: "Mike Frisino" <Michael.Frisino@s...>
Sent: Wednesday, October 24, 2001 1:25 PM
Subject: Re: [iPlanet-JATO] Transaction in JATO
Jeff,
See the javadoc for DatasetSQLModelExecutionContext. It may seem a bitcounterintuitive, since for updates and inserts you do not need the full
dataset capability, but you don't use what you don't need.
>
In your case, what you do want to take advantage of is the ability tocontrol the "JDBC Connection" directly. Therein lies the transactional
control that you are looking for. NetD needed to rely on something like the
CSpTransaction class precisely because it did not allow developers direct
access to the JDBC Connection. That is no longer a restriction in JATO,
hence, there is no equivalent to CSpTransaction per se.
>
>
public class DatasetSQLModelExecutionContext
extends DatasetModelExecutionContextImpl
implements SQLModelExecutionContext
An execution context used to execute dataset operations on QueryModels(normally SQL SELECT operations). Developers can specify both the dataset
offset and size, as well as a JDBC connection or statement object, to be
used during execution of the model.
>
By providing a connection or statement object to the model via thiscontext, developers can maintain control of the transaction state of the
connection instead of relying on the default behavior (which is generally
equivalent to auto-commit semantics). However, such use also introduces a
measure of responsibilty on the developer--because providing these objects
to the model manually causes the model to avoid any connection lifecycle
management of its own, the developer is completely responsible for managing
the lifecycle of the connection, as well as the lifecycle of any
transactions that might be pending on that connection.
>
In general, if the developer supplies a connection object, he or she neednot also supply a statement object. Conversely, if the developer supplies a
statement object, he or she need not specify a connection object (though he
will need to keep a reference to the connection object used to create the
statement in order to close it after execution is complete). In both cases,
the developer is ultimately responsible for releasing the connection
manually when use of it is complete.
>
----- Original Message -----
From: jeffrey_smith@p...
Sent: Wednesday, October 24, 2001 12:52 PM
Subject: [iPlanet-JATO] Transaction in JATO
Does anyone have an example on how to do multiple updates/inserts using
various models in one transaction in JATO1.2. I am trying to migrate ND
code that uses a CSpTransaction object to do this and there does notappear
to be an equivalent object in JATO.
Thanks.
Jeff Smith
Senior Application Consultant
Software Engineering
Putnam Investments
voice: (617)760-3121
fax: (617)760-3850
Choose from 1000s of job listings!
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
[Non-text portions of this message have been removed]
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp -
Re: [iPlanet-JATO] Use Of models in utility classes
Hi Matt,
Sounds like some of the stuff we need to migrate has a lot in common with
Namburi's project.
I would be very keen to get hold of a copy of the 'tactic' document you
mention below, as well as the sample code you mention to replace CspDBResult
stuff with JDBC results.
Thanks in advance,
Phil
----- Original Message -----
From: Matthew Stevens <matthew.stevens@E...>
Sent: Wednesday, August 08, 2001 7:56 AM
Subject: RE: [iPlanet-JATO] Use Of models in utility classes
Namburi,
I will post a document to the group site this evening which has thedetails
on various tactics of migrating these type of utilities. Essentially, you
either need to convert these utilities to Models themselves or keep the
utilities as is and simply use the
RequestManager.getRequestContext.getModelManager().getModel()
to statically access Models.
For CSpSelect.executeImmediate() I have an example of custom helper method
as a replacement whicch uses JDBC results instead of CSpDBResult.
matt
-----Original Message-----
From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100253094145066046167121181">vnamboori@y...</a>]
Sent: Tuesday, August 07, 2001 3:24 PM
Subject: [iPlanet-JATO] Use Of models in utility classes
Hi All,
In the present ND project we have lots of utility classes. These
classes in diffrent directory. Not part of nd pages.
In these classes we access the dataobjects and do the manipulations.
So we access dataobjects directly like
CSpider.getDataObject("do....");
and then execute it.
Since the migration tool does not do much of conversion for these
utilities we have to do manually.
My question is Can we access the the models in the post migration
sameway or do we need requestContext?
We have lots of utility classes which are DataObject intensive. Can
someone suggest a better way to migrate this kind of code.
Thanks
Namburi
[email protected]
[email protected]Hi Matt,
Sounds like some of the stuff we need to migrate has a lot in common with
Namburi's project.
I would be very keen to get hold of a copy of the 'tactic' document you
mention below, as well as the sample code you mention to replace CspDBResult
stuff with JDBC results.
Thanks in advance,
Phil
----- Original Message -----
From: Matthew Stevens <matthew.stevens@E...>
Sent: Wednesday, August 08, 2001 7:56 AM
Subject: RE: [iPlanet-JATO] Use Of models in utility classes
Namburi,
I will post a document to the group site this evening which has thedetails
on various tactics of migrating these type of utilities. Essentially, you
either need to convert these utilities to Models themselves or keep the
utilities as is and simply use the
RequestManager.getRequestContext.getModelManager().getModel()
to statically access Models.
For CSpSelect.executeImmediate() I have an example of custom helper method
as a replacement whicch uses JDBC results instead of CSpDBResult.
matt
-----Original Message-----
From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100253094145066046167121181">vnamboori@y...</a>]
Sent: Tuesday, August 07, 2001 3:24 PM
Subject: [iPlanet-JATO] Use Of models in utility classes
Hi All,
In the present ND project we have lots of utility classes. These
classes in diffrent directory. Not part of nd pages.
In these classes we access the dataobjects and do the manipulations.
So we access dataobjects directly like
CSpider.getDataObject("do....");
and then execute it.
Since the migration tool does not do much of conversion for these
utilities we have to do manually.
My question is Can we access the the models in the post migration
sameway or do we need requestContext?
We have lots of utility classes which are DataObject intensive. Can
someone suggest a better way to migrate this kind of code.
Thanks
Namburi
[email protected]
[email protected]
Maybe you are looking for
-
Photo slideshow app?...
Hi all, I'm after an app which can create some very simple photo slideshows, but with a few specific functions. a) I want to be able to change to the next photo manually by a click - I'm not interested in being able to set a certain time, but manuall
-
How can i set the date time year to my i pod
how can i set the date time year to my i pod touch
-
How do I stop pop up that asks me, Do you want to save changes to doc... before closing? I have made no changes only printed the file. Using Adobe Reader DC, Windows 7 64 bit. This is very annoying and we need this stopped as we have made no changes
-
Changing header information in pages made from templates
I am familiar with GoLive and using components for menus to accomodate universal changes. I am new to Dreamweaver (CS3). I am using templates for my menus so I can make universal changes. However, what do I do if I want to put a form on a page and ne
-
Problems in verifying connection to CF Administrator Mail Server
I need to send e-mails using CFMAIL, but am unable to verify the connection to the CF Administrator Mail Server, which presently is localhost. This question has been asked in other places, but I have checked the remedies suggested there (firewall bl