Using a Model in an Aggmap
I have an aggmap which contains a relation statement to aggregate a Line Item dimension, and it also contains a model statement which I intend to calculate some Line Items after the aggregation has occurred. However, in a very simple test of this approach, with only one equation in the model that assigns a constant to
one of the Line Items, I get the following error:
ORA-36910: In AGGMAP BULR!TEST_AGG, DYNAMIC MODEL BULR!BULR_PL_SUM_RL_MDL can only edit the top level of its matching relation hierarchy.
Does this mean model may only calculate on leaf level values in a AGGMAP? I really have no idea what how to interpret this message, nor can I find any restrictions in the documentation.
import javax.swing.*;
public class MyApplet extends JApplet {
public void init() {
//init stuff here
public void start() {
//start stuff here
public static void main(String[] args) {
JFrame f = new JFrame();
JApplet a = new MyApplet();
f.getContentPane().add(a);
f.setSize(600, 400);
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
a.init();
a.start();
}Excuse me, but is there a way to do this on Applet only instead of JApplet... I was told we need to use Applet only...
Similar Messages
-
Using the Model Facade Pattern in a Java EE 5 Web application
Hi,
Yutaka and I did a Tech tip
http://java.sun.com/mailers/techtips/enterprise/2006/TechTips_Nov06.html#2 on using a model facade pattern in Java EE 5 web-only applications recently. We got some questions about it, and these were some of the questions raised...
Question 1) the first part of the tech tip(it has two articles in it) http://java.sun.com/mailers/techtips/enterprise/2006/TechTips_Nov06.html showed how to access Java Persistence objects directly from a JSF managed bean, is this a good practice?
Question 2) when to use a facade(as mentioned in the second part of tech tip) ?
and maybe
Question 3) why doesn't the platform make this easier and provide the facade for you?
Briefly, I will take a shot at answering these three questions
Answer 1) You can access Java persistence directly from your managed beans, but as your application grows and you start to add more JSF managed beans or other web components(servlets, JSP pages etc) that also directly access Java Persistence objects, you will start to see that you are cutting/pasting similiar code to handle the transactions and to handle the Java Persistence EntityManager and other APIs in many places. So for larger applications, it is a good practice to introduce a model facade to centralize code and encapsulate teh details of the domain model management
Answer 2) IAs mentioned in answer 1, its good to use a model facade when your application starts to grow. For simple cases a spearate model facade class may not be needed and having managed beans do some of the work is a fast way to jumpstart you application development. But a facade can help keep the code clean and easier to maintain as the aplication grows.
Answer 3) First note that both of the articles in the tech tip were about pure web apps(not using any EJBs) and running on the Java EE5 platform. Yes it would be nice if a facility like this was made available for web-only applications(those not using EJBs). But for web-only applications you will need to use a hand-rolled facade as we outlined in the tech tip. The Java EE platform does provide a way to make implementing a facde easier though, and the solution for that is to use a Session Bean. This solution does require that you use ythe EJB container and have a Session Bean facade to access your Java Persistence objects and manage the transactions. The EJB Session Facade can do a lot of the work for you and you dont have to write code to manage the transactions or manage the EntityManager. This solution was not covered in this tech tip article but is covered in the Java BluePrints Solutions Catalog for Perssitence at
https://blueprints.dev.java.net/bpcatalog/ee5/persistence/facade.html in the section "Strategy 2: Using a Session Bean Facade" . Maybe we can cover that in a future tech tip.
Please ask anymore questions about the tech tip topic on this forum and we will try to answer.
hth,
SeanHi Sean,
I'm working on an implementation of the Model Facade pattern where you can possibly have many facades designed as services. Each service extends a basic POJO class which I'm calling CRUDService: its short code is provided below for your convenience.
The CRUDService class is meant to generalize CRUD operations regardless of the type of the object being used. So the service can be called as follows, for example:
Job flightAtt = new Job();
SERVICE.create(flightAtt);
Runway r = (Runway) SERVICE.read(Runway.class, 2);
Employee e = (Employee) SERVICE.read(Employee.class, 4);
SERVICE.update(e);
SERVICE.delete(r);SERVICE is a Singleton, the only instance of some service class extending CRUDService. Such a class will always include other methods encapsulating named queries, so the client won't need to know anything about the persistence layer.
Please notice that, in this scenario, DAOs aren't needed anymore as their role is now distributed among CRUDService and its subclasses.
My questions, then:
. Do you see any obvious pitfalls in what I've just described?
. Do you think traditional DAOs should still be used under JPA?
. It seems to me the Model Facade pattern isn't widely used because such a role can be fulfilled by frameworks like Spring... Would you agree?
Thanks so much,
Cristina Belderrain
Sao Paulo, Brazil
public class CRUDService {
protected static final Logger LOGGER = Logger.
getLogger(Logger.GLOBAL_LOGGER_NAME);
protected EntityManager em;
protected EntityTransaction tx;
private enum TransactionType { CREATE, UPDATE, DELETE };
protected CRUDService(String persistenceUnit) {
em = Persistence.createEntityManagerFactory(persistenceUnit).
createEntityManager();
tx = em.getTransaction();
public boolean create(Object obj) {
return execTransaction(obj, TransactionType.CREATE);
public Object read(Class type, Object id) {
return em.find(type, id);
public boolean update(Object obj) {
return execTransaction(obj, TransactionType.UPDATE);
public boolean delete(Object obj) {
return execTransaction(obj, TransactionType.DELETE);
private boolean execTransaction(Object obj, TransactionType txType) {
try {
tx.begin();
if (txType.equals(TransactionType.CREATE))
em.persist(obj);
else if (txType.equals(TransactionType.UPDATE))
em.merge(obj);
else if (txType.equals(TransactionType.DELETE))
em.remove(obj);
tx.commit();
} finally {
if (tx.isActive()) {
LOGGER.severe(txType + " FAILED: ROLLING BACK!");
tx.rollback();
return false;
} else {
LOGGER.info(txType + " SUCCESSFUL.");
return true;
} -
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] -
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] 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] -
How to use multiple models in one Function module?
Hi,
In my FM i am using 2 models and if i dont completely exit the Function and use the same fm for another query based on another
model it is giving error saying invalid type.
if iv_type_of_search = 'A'.
start the application BT
lv_bol_core = cl_crm_bol_core=>get_instance( ).
lv_bol_core->start_up( 'BP_APPL' ).
get an instance of dynamic opporunity query
lr_query = cl_crm_bol_dquery_service=>get_instance( 'BuilHeaderAdvancedSearch' ).
Contact Search
elseif iv_type_of_search = 'C'.
start the application BT
lv_bol_core = cl_crm_bol_core=>get_instance( ).
lv_bol_core->start_up( 'BP_APPL' ).
get an instance of dynamic opporunity query
lr_query = cl_crm_bol_dquery_service=>get_instance( 'BuilContactAdvancedSearch' ).
*Opportunity Search
elseif iv_type_of_search = 'O'.
start the application BT
lv_bol_core = cl_crm_bol_core=>get_instance( ).
lv_bol_core->start_up( 'BT' ).
get an instance of dynamic opporunity query
lr_query = cl_crm_bol_dquery_service=>get_instance( 'BTQOpp' ).
endif.
Any idea how to over come this or remove the instance of the old query and model every time its run?
it looks like the object of the last run is still there and i cant find any destructor method or way and
if i exit se37 it works fine....Hi George,
You can also set up your model (component set) with the components you need.
Check it on:
SPRO->CRM->CRM Cross-Application Components->Generic Interaction Layer/Object Layer->Basic Settings
Kind regards,
Garcia -
How to Use Same Models in Different DC's.
Hi Experts,
I want to use same Models in Different DC's. How I achieve it by adding Model to Public parts.
With Regards,
Roop Kumar.Hi Roop,
It's enough to reimport Only Parent DC. No need to change in Child DC
This depends on scenario according to my experience.
Changes to the model definition can be three ways
1)Addition: Adding new fields or structures to your model.
In this case "It's enough to reimport Only Parent DC. No need to change in Child DC", if you are not using the new fields or structures in child DC.
2)Modification: Modifying existing fields or structures (e.g. data types) in your model.
In this case "It's enough to reimport Only Parent DC. No need to change in Child DC", because fields or structures in child DC are reference to the Parent DC.
3)Deletion:Deleting fields or structures in your model.
In this case, "It's enough to reimport Only Parent DC. No need to change in Child DC", if you are not using the deleted fields or structures in child DC.
But this holds if you make your DC as a public part but not the model and the parent DC's Interface Controller must have the context that you are going to use in child DC. You will find more help [here |/docs/DOC-8661#section5]
Regards,
Siva -
Best Practice for using multiple models
Hi Buddies,
Can u tell me the best practices for using multiple models in single WD application?
Means --> I am using 3 RFCs on single application for my function. Each time i am importing that RFC model under
WD --->Models and i did model binding seperately to Component Controller. Is this is the right way to impliment multiple models in single application ?It very much depends on your design, but One RFC per model is definitely a no no.
Refer to this document to understand how should you use the model in most efficient way.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/705f2b2e-e77d-2b10-de8a-95f37f4c7022?quicklink=events&overridelayout=true
Thanks
Prashant -
Unable to use bean model in a Callable Object
Hello,
I'm trying to use a bean model in a callable object but at runtime I'm allways getting null pointer exception.
If I test it in a WebDynpro application everything goes right (I only have to add a sharing reference to my EJB Application). But if I Implement a Callable Object and I try to use a EJB bean model it doesn't works.
(I have added the sharing reference in the callable object DC)
I have made somes test and the command bean class never finds the EJB using home interface.
At the moment I would like to use a bean model instead Web Service model because of testing propouses.
Please, Do you know If I'm missing something? Do I have to add more reference or use DC?
Is possible to use bean models in Callable Objects?
Thanks in advance,
RegardsHi,
Not sure if it will work.
Try creating the view object with a single query, and once after creating it, edit the view object, and change the SQL query in the source.
Something like
<SQLQuery>
<![CDATA[select * from emp]]>
</SQLQuery>to
<SQLQuery>
<![CDATA[select * from emp where deptno=10 union all select * from emp where deptno=20]]>
</SQLQuery>-Arun
P.S : I am able to create the view object with union declaratively in JDev 11g. Probably you can upgrade to 11g ;) . -
I am using iphone model MC603B is factory unlocked and updated os 5.0 when i use any carrier in it there always on screen no service please hlep me out .
SadisticIron wrote:
i just baught my first iphone and it is a jalbroken
Buzz! Thank you for playing!
Discussing jailbroken devices is forbidden here by the Terms of Service.
You can not get help here. -
Unable to use PAS Model in Exclusive or share mode
Hi,
Iam getting the following error when i try to use the PAS Model in Exclusive mode.
DB-142:
Unexpected Sharing Violation during I/O to File PLANNING.
Check your Disk Drive or Network.
While iam able to access other PAS models in exclusive mode, this is happening only in two PAS Models.
Any clue why this is happening?
Thanks
PraveenPraveen,
The problem is open sessions in PAS which locks the model. If you are using a model in Exclusive mode, that means that no one else will be able to access that model while you have your session open. That is also why the suggestion of using the Exit Clear command when exiting PAS, because Clear closes the session, merely using Exit does not.
By restarting Extended Listener or JPIP (depending on your version of SSM) you are closing all these open sessions. In JPIP you can see which sessions are currently being used and stop one or all of them.
When you are in PAS, you can see in a box at the bottom what model and what mode are currently engaged. If you are using the sample data, typically you will see JUICE (read only) as the default model. When you click on a model or use one through a command line - like USE JUICE EXCLUSIVE - you will see the box changes to something like JUICE (exclusive) mode. The Juice model is now locked out to all other users. This is so you can modify the model without fear of others having open sessions accessing the model.
Restarting services - either Extended Listener or JPIP - is usually a good start with troubleshooting.
Regards,
Bob -
How to use JTable model listener???
Anyone got idea , how to use table model listener. Can explain in simple example with code?? how to pass back to resultset ??
Well, your pretty good at asking questions, but not very good at thanking people for the help given to you so I don't think I'll waste too much time helping this time.
A TableModelListener notifies you when the contents of a cell are changed. So simply take the data from the cell and update your ResultSet. You question is so general I don't know how you expect any more advice than that. -
Physical attributes for index on temp tables (using physical model)
I need create index on temp tables.
When I generate DDL, it includes physical attributes like ‘LOGGING NOCOMPRESS NOPARALLEL’.
I get error "ORA – 14451 (unsupported feature w/temporary tables)"
I’ve to use physical model in OSDM. How do I get rid of physical attributes in DDL for index?Hi,
Thanks for reporting this problem.
You can remove the LOGGING clause by opening the Properties dialog for the Index in the Physical model and setting its Logging property to the blank option.
However it's not possible to suppress the NOCOMPRESS and NOPARALLEL at the moment.
I've logged a bug on this.
As a workaround, you could do a global edit on the DDL file to remove all instances of NOCOMPRESS and NOPARALLEL.
David -
Hello All,
I was wondering whether there is a way to force users to become a model
node in a given environment rather than give them the choice of specifying
model node or an individual node name. What happens is that our
developers, all on the same identical platform and setup, at one time or
another log in with their machine name as the node name and we end up with
tons of nodes in the environment which slows everything down (according to
Forte).
If we could just turn off that option for clients and force the use of a
model node depending on platform that would be great.
Thanks in advance for any info!
Sincerely,
Joe Seeley
QAD, Inc.
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>Is anybody using MODEL in production?
How is the performance - is there any real problems?I used a MODEL query last year to simulate a FIFO queue and calculate average stock prices.
It performs pretty well, but the volume of data is small though (~200k rows processed per batch session). -
How can I restore a deleted directory in Subversion Repository to use Data Modeler?
Hello,
i search a solution to restore a deleted Directory in Subversion Repository. But i can't find a button, menu item or documentation.
I'm on WIN7 and use Data Modeler 4.0.3.853 and Developer 4.0.3.16.84.
Thanks for your help,
KathrinHi Philip,
thanks for your help. I know this solution on the command line. But ... i have to teach my co-workers to use data modeler, developer and Subversion. They have only these Software on their pc's and i hope for a uncomplicated solution directly in data modeler, because they are a menu item, which to click open the window. But you can't do anything.
The Folder "WoP" was deleted directly under root. My idea was as follows:
1. I use "Show log" to find the right revision.
2. I checked out the whole repository "Schulung" for the right revision.
3. Into my workind copy folder are "WoP" on the right revision (235).
4. I create a new folder "WoP" on "Schulung" and checkout it
5. I open the WoP.dmd and save it on checked out folder "WoP" to add version control.
Handicap: Subversion recognize "WoP" as "NEW" not as "RESTORE"
But i don't use the comand line for svn respectively i haven't to teach my data modeler user in command line svn.
Do you evaluate other problems or handicaps for "my way"?
Do you know if will there be more user-friendly option in the Data Modeler in the future?
Thanks and greets,
Kathrin
Maybe you are looking for
-
No longer able to access external hard drive
Since upgrading my MacBook Pro to Mountain Lion I can no longer mount either of my NAS (iomega and buffalo) I've tried connecting via finder, connecting via IP address. Nothing works it just times out or shows connection failed. I can connect fine on
-
Hello Can anyone assist me with installing ios7 on my ipad2 please ?
-
Sales Documents and Profit Centre and GL Accounts
Currently a when we create a sales document for a plant, that document is posting to a specific GL account (Cash on Hand account) and profit centre. In VKOA, the Account Assignment Group is assignment to a GL Account, and that AAG is assigned to the
-
DOCUMENT SET UP FOR LIGHTNING SOURCE POD BOOKS
Hi All, I am trying to set up my very first title with Lightning source for POD books. However I am confused on the bleed requirements and gutter they asked for and cannot set them up confidently. Their requirement are as follows A file with bleed sh
-
License Validity in Plant Maintenance
Is it possible in SAP-Plant maintenance to have a Pop-up or notification to be genretaed in case of expiry of license. The license may be of a piece of technical object or the business license to do business for a period of 1 year.. Please provide a