How to use Model in GP
Iam new to GP.I have created a Model.Now how to define the parameters in the getDescription,getComplete,execute.
Please help me in this way or anyone can explain the functions in getDescription.How to pass values.
try {
IWDTextAccessor textAccessor = wdComponentAPI.getTextAccessor(); //To retrieve Messages from Message Pool
GPWebDynproResourceAccessor resourceAccessor = new GPWebDynproResourceAccessor(textAccessor);
IGPTechnicalDescription technicalDescription = GPCallableObjectFactory.createTechnicalDescription("CO_NAME","CO_DESCRIPTION",resourceAccessor,locale);
// Pre-existing structure for output parameters
IGPStructureInfo output = technicalDescription.getOutputStructureInfo();
// Create the attributes in the output structure
IGPAttributeInfo userId = output.addAttribute("UserID", IGPAttributeInfo.BASE_STRING);
userId.setMultiplicity(IGPAttributeInfo.MULITIPLICITY_1_1);
// add result state
IGPCOResultStateInfo success = technicalDescription.addResultState("Success");
success.setDescriptionKey("Success_desc");
return technicalDescription;
} catch (GPInvocationException e) {
return null;
Hi,
in getDescription you must declare the input, output and the states of the co. Smth like that:
// Description of the future callable object
IGPTechnicalDescription technicalDescription =
GPCallableObjectFactory.createTechnicalDescription(
"SelectUserCO",
"Select from available users",
resourceAccessor,
locale);
// input structure
IGPStructureInfo input =
technicalDescription.getInputStructureInfo();
IGPStructureInfo providerProfileEntryInput =
input.addStructure("user1");
providerProfileEntryInput.setMultiplicity(IGPStructureInfo.MULITIPLICITY_0_N);
providerProfileEntryInput.addAttribute("name", IGPAttributeInfo.BASE_STRING);
// structure for output parameters
IGPStructureInfo output =
technicalDescription.getOutputStructureInfo();
IGPStructureInfo providerProfileEntryOutput =
output.addStructure("User2");
providerProfileEntryOutput.setMultiplicity(IGPStructureInfo.MULITIPLICITY_0_N);
providerProfileEntryOutput.addAttribute("name", IGPAttributeInfo.BASE_STRING);
//add result state
IGPCOResultStateInfo success =
technicalDescription.addResultState("Success");
success.setDescriptionKey("Success_desc");
Then in execute you should map your input to our context. You have node elements for your structure nodes and you can add the new elements you create/map to the user.
Important are maybe:
executionContext and the wdContext variables. Declare them under (//@@begin others, //@@end provided by SAP):
//@@begin others
private IGPExecutionContext executionContext;
IWDTextAccessor textAccessor;
GPWebDynproResourceAccessor resourceAccessor;
//@@end
and then instantiation in the constructor:
this.wdThis = wdThis;
this.wdContext = wdThis.wdGetContext();
this.wdControllerAPI = wdThis.wdGetAPI();
this.wdComponentAPI = wdThis.wdGetAPI().getComponent();
this help page can help:
http://help.sap.com/saphelp_nwce10/helpdata/en/fd/afb4429027da11e10000000a155106/content.htm
best regards,
v s
Similar Messages
-
How to use model clause without hard coding the values in it?
Query
select acct_no,
gl_code,
CASE
WHEN entry_type_label IN ('Earned Revenue') THEN
'Earned Revenue'
ELSE
'Deferred Revenue Credit'
END AS entry_type_label,
CASE
WHEN entry_type_label IN ('Opening Balance') THEN
'Opening Balance'
WHEN entry_type_label IN ('Deferred Revenue Credit') THEN
'Invoice Amount'
WHEN entry_type_label IN ('Earned Revenue') THEN
'Earned Revenue'
WHEN entry_type_label IN ('Closing Balance') THEN
'Closing Balance'
ELSE
'Deferred Revenue Credit'
END AS label,
entry_type_no,
orig_chg_start_date,
period_no,
-amt as amt
from revrec_test
WHERE acct_no = 1788562
AND entry_type_no IN (2, 4) model dimension by(acct_no,
gl_code,
entry_type_label,
entry_type_no,
orig_chg_start_date,
period_no) measures(amt) rules upsert
all(amt 1788562,
'UNEARNED-10011561',
'Opening Balance',
2,
'02-OCT-17 08.30.00 AM',
190 = 0,
amt 1788562,
'UNEARNED-10011561',
'Closing Balance',
2,
'02-OCT-17 08.30.00 AM',
190 = amt 1788562,
'UNEARNED-10011561',
'Deferred Revenue Credit',
2,
'02-OCT-17 08.30.00 AM',
190 - amt 1788562,
'EARNED-10011561',
'Earned Revenue',
4,
'02-OCT-17 08.30.00 AM',
190,
amt 1788562,
'UNEARNED-10011561',
'Opening Balance',
2,
'02-OCT-17 08.30.00 AM',
191 = amt 1788562,
'UNEARNED-10011561',
'Closing Balance',
2,
'02-OCT-17 08.30.00 AM',
190,
amt 1788562,
'UNEARNED-10011561',
'Deferred Revenue Credit',
2,
'02-OCT-17 08.30.00 AM',
191 = 0,
amt 1788562,
'UNEARNED-10011561',
'Closing Balance',
2,
'02-OCT-17 08.30.00 AM',
191 =
(amt 1788562, 'UNEARNED-10011561', 'Opening Balance', 2,
'02-OCT-17 08.30.00 AM', 191 + amt 1788562, 'UNEARNED-10011561',
'Deferred Revenue Credit', 2, '02-OCT-17 08.30.00 AM', 191) - amt
1788562,
'EARNED-10011561',
'Earned Revenue',
4,
'02-OCT-17 08.30.00 AM',
191,
amt 1788562,
'UNEARNED-10011561',
'Opening Balance',
2,
'02-OCT-17 08.30.00 AM',
192 = amt 1788562,
'UNEARNED-10011561',
'Closing Balance',
2,
'02-OCT-17 08.30.00 AM',
191,
amt 1788562,
'UNEARNED-10011561',
'Deferred Revenue Credit',
2,
'02-OCT-17 08.30.00 AM',
192 = 0,
amt 1788562,
'UNEARNED-10011561',
'Closing Balance',
2,
'02-OCT-17 08.30.00 AM',
192 =
(amt 1788562, 'UNEARNED-10011561', 'Opening Balance', 2,
'02-OCT-17 08.30.00 AM', 192 + amt 1788562, 'UNEARNED-10011561',
'Deferred Revenue Credit', 2, '02-OCT-17 08.30.00 AM', 192) - amt
1788562,
'EARNED-10011561',
'Earned Revenue',
4,
'02-OCT-17 08.30.00 AM',
192,
amt 1788562,
'UNEARNED-10011561',
'Opening Balance',
2,
'02-OCT-17 08.30.00 AM',
193 = amt 1788562,
'UNEARNED-10011561',
'Closing Balance',
2,
'02-OCT-17 08.30.00 AM',
192,
amt 1788562,
'UNEARNED-10011561',
'Deferred Revenue Credit',
2,
'02-OCT-17 08.30.00 AM',
193 = 0,
amt 1788562,
'UNEARNED-10011561',
'Closing Balance',
2,
'02-OCT-17 08.30.00 AM',
193 =
(amt 1788562, 'UNEARNED-10011561', 'Opening Balance', 2,
'02-OCT-17 08.30.00 AM', 193 + amt 1788562, 'UNEARNED-10011561',
'Deferred Revenue Credit', 2, '02-OCT-17 08.30.00 AM', 193) - amt
1788562,
'EARNED-10011561',
'Earned Revenue',
4,
'02-OCT-17 08.30.00 AM',
193)
ORDER BY period_no, entry_type_no;
The above query works fine. But i have hard coded the values. I want to do the same operation for different account number which is going to have different periodic no. How can I achieve it?
Thanks in advance.Create Statement
CREATE TABLE table_one(
ACCT_NO NUMBER(38),
GL_CODE VARCHAR2(300),
ENTRY_TYPE_LABEL CHAR(50),
ENTRY_TYPE_NO NUMBER,
ORIG_CHG_START_DATE TIMESTAMP(0) WITH LOCAL TIME ZONE,
ORIG_CHG_END_DATE TIMESTAMP(0) WITH LOCAL TIME ZONE,
PERIOD_NO NUMBER(38),
AMT NUMBER(38,10)
Insert Statement
INSERT ALL
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1001,'U-11561','Deferred Revenue Debit',3,'02-OCT-17 08.30.00 AM','01-JAN-18 01.30.00 PM',100,13.87)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1001,'E-11561','Earned Revenue',4,'02-OCT-17 08.30.00 AM','01-JAN-18 01.30.00 PM',102,-14.83)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1001,'E-11561','Earned Revenue',4,'02-OCT-17 08.30.00 AM','01-JAN-18 01.30.00 PM',101,-14.35)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1001,'E-11561','Earned Revenue',4,'02-OCT-17 08.30.00 AM','01-JAN-18 01.30.00 PM',100,-13.87)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1001,'U-11561','Deferred Revenue Debit',3,'02-OCT-17 08.30.00 AM','01-JAN-18 01.30.00 PM',103,0.95)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1001,'U-11561','Deferred Revenue Debit',3,'02-OCT-17 08.30.00 AM','01-JAN-18 01.30.00 PM',102,14.83)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1001,'U-11561','Deferred Revenue Debit',3,'02-OCT-17 08.30.00 AM','01-JAN-18 01.30.00 PM',101,14.35)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1001,'E-11561','Earned Revenue',4,'02-OCT-17 08.30.00 AM','01-JAN-18 01.30.00 PM',103,-0.95)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1001,'U-11561','Deferred Revenue Credit',2,'02-OCT-17 08.30.00 AM','01-JAN-18 01.30.00 PM',100,-44)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Deferred Revenue Debit',3,'17-NOV-13 09.30.00 AM','16-FEB-14 09.30.00 AM',106,44.91)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Accounts Receivable',1,'17-NOV-13 09.30.00 AM','16-FEB-14 09.30.00 AM',104,60)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Deferred Revenue Debit',3,'20-DEC-13 09.30.00 AM','16-FEB-14 09.30.00 AM',105,3.93)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Deferred Revenue Debit',3,'20-DEC-13 09.30.00 AM','16-FEB-14 09.30.00 AM',106,11.75)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Deferred Revenue Debit',3,'20-DEC-13 09.30.00 AM','16-FEB-14 09.30.00 AM',107,6.86)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Deferred Revenue Debit',3,'20-DEC-13 09.30.00 AM','16-FEB-14 09.30.00 AM',105,-7.82)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Deferred Revenue Debit',3,'20-DEC-13 09.30.00 AM','16-FEB-14 09.30.00 AM',106,-23.47)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Deferred Revenue Debit',3,'20-DEC-13 09.30.00 AM','16-FEB-14 09.30.00 AM',107,-13.69)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Earned Revenue',4,'20-DEC-13 09.30.00 AM','16-FEB-14 09.30.00 AM',107,-6.86)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Earned Revenue',4,'20-DEC-13 09.30.00 AM','16-FEB-14 09.30.00 AM',105,7.82)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Earned Revenue',4,'20-DEC-13 09.30.00 AM','16-FEB-14 09.30.00 AM',106,23.47)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Earned Revenue',4,'20-DEC-13 09.30.00 AM','16-FEB-14 09.30.00 AM',107,13.69)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Earned Revenue',4,'17-NOV-13 09.30.00 AM','16-FEB-14 09.30.00 AM',104,-9.13)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Earned Revenue',4,'17-NOV-13 09.30.00 AM','16-FEB-14 09.30.00 AM',105,-44.91)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Earned Revenue',4,'17-NOV-13 09.30.00 AM','16-FEB-14 09.30.00 AM',106,-44.91)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Earned Revenue',4,'17-NOV-13 09.30.00 AM','16-FEB-14 09.30.00 AM',107,-35.91)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Earned Revenue',4,'20-DEC-13 09.30.00 AM','16-FEB-14 09.30.00 AM',105,-3.93)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Deferred Revenue Debit',3,'17-NOV-13 09.30.00 AM','16-FEB-14 09.30.00 AM',105,44.91)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Deferred Revenue Debit',3,'17-NOV-13 09.30.00 AM','16-FEB-14 09.30.00 AM',104,9.13)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Earned Revenue',4,'20-DEC-13 09.30.00 AM','16-FEB-14 09.30.00 AM',106,-11.75)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Deferred Revenue Credit',2,'20-DEC-13 09.30.00 AM','16-FEB-14 09.30.00 AM',105,38.48)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Deferred Revenue Credit',2,'20-DEC-13 09.30.00 AM','16-FEB-14 09.30.00 AM',105,-19.24)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Deferred Revenue Credit',2,'17-NOV-13 09.30.00 AM','16-FEB-14 09.30.00 AM',104,-60)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Accounts Receivable',1,'20-DEC-13 09.30.00 AM','16-FEB-14 09.30.00 AM',105,38.48)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Accounts Receivable',1,'20-DEC-13 09.30.00 AM','16-FEB-14 09.30.00 AM',105,19.24)
INTO table_one(acct_no, gl_code, entry_type_label, entry_type_no, orig_chg_start_date, orig_chg_end_date, period_no, amt) VALUES(1002,'Recurring Flat Fees COA Code','Deferred Revenue Debit',3,'17-NOV-13 09.30.00 AM','16-FEB-14 09.30.00 AM',107,35.91)
SELECT * FROM dual;
Expected Result
S.NO
ACCT_NO
GL_CODE
ENTRY_TYPE_LABEL
ENTRY_TYPE_NO
ORIG_CHG_START_DATE
PERIOD_NO
AMT
DESCRIPTION
1
1001
U-11561
Deferred Revenue Credit
2
02-OCT-17 08.30.00 AM
100
0
Opening Account
2
1001
U-11561
Deferred Revenue Credit
2
02-OCT-17 08.30.00 AM
100
44
Invoice
3
1001
E-11561
Earned Revenue
4
02-OCT-17 08.30.00 AM
100
13.87
Invoice Paid
4
1001
U-11561
Deferred Revenue Credit
2
02-OCT-17 08.30.00 AM
100
30.13
Closing Account
5
1001
U-11561
Deferred Revenue Credit
2
02-OCT-17 08.30.00 AM
101
30.13
Opening Account
6
1001
U-11561
Deferred Revenue Credit
2
02-OCT-17 08.30.00 AM
101
0
Invoice
7
1001
E-11561
Earned Revenue
4
02-OCT-17 08.30.00 AM
101
14.35
Invoice Paid
8
1001
U-11561
Deferred Revenue Credit
2
02-OCT-17 08.30.00 AM
101
15.78
Closing Account
9
1001
U-11561
Deferred Revenue Credit
2
02-OCT-17 08.30.00 AM
102
15.78
Opening Account
10
1001
U-11561
Deferred Revenue Credit
2
02-OCT-17 08.30.00 AM
102
0
Invoice
11
1001
E-11561
Earned Revenue
4
02-OCT-17 08.30.00 AM
102
14.83
Invoice Paid
12
1001
U-11561
Deferred Revenue Credit
2
02-OCT-17 08.30.00 AM
102
0.95
Closing Account
13
1001
U-11561
Deferred Revenue Credit
2
02-OCT-17 08.30.00 AM
103
0.95
Opening Account
14
1001
U-11561
Deferred Revenue Credit
2
02-OCT-17 08.30.00 AM
103
0
Invoice
15
1001
E-11561
Earned Revenue
4
02-OCT-17 08.30.00 AM
103
0.95
Invoice Paid
16
1001
U-11561
Deferred Revenue Credit
2
02-OCT-17 08.30.00 AM
103
0
Closing Account
Description
We must start opening account as zero and end with closing account as zero by doing manipulation with invoice and invoice paid.
Process
Initial Stage
Subsequent stage
Opening Account
0
(=closing Account)
Invoice
max value of account no which has entry type no 2
0
Invoice Paid
taken from the field amount which has entry type no 4
taken from the field amount which has entry type no 4
Closing Account
(=[opening account + invoice] - invoice paid)
(=[opening account + invoice] - invoice paid)
Note
1) Each account may have different periodic no.
2) Some account may have more than 4 distinct period no and less than 4 distinct periodic no.
3) Description column from expected result is not an part of table. It is been added for easier understanding. -
Re: [SunONE-JATO] Re: How to use a tiled view without a model
I'm not sure what is different for you now. You still parse the string
and put it into a data structure. Before the data structure was a
vector, in JATO its just a model with a "hidden" data structure (a hash
map).
MVC only really comes into play when you talk about where your write
this code, and where the data structure is being stored. So really, JATO
takes care of half of the MVC'ness of it all (where the data is store).
You just decide where to be the code to populate the model.
Make sense?
Is there something different required of you in JATO in this scenario
that I am not grasping?
c
Hoskins, John D. wrote:
Thanks for the feedback.
The problem I was solving involved a single string, which contained
delimited subsets of information.
The string looked like
this:"time|analyst|description|time|analyst|description|..."
In ND, I parsed it apart into it's components (time vector, analyst vector,
description vector), populated the repeated.
With JATO, how would I make a model for something that doesn't have a
database component like this?
I'm pretty new to this MVC thing, so bear with me.
John D. Hoskins
Telephone & Data Systems
Application Development & Support
Voice: 608.664.8263
Fax: 608.664.8288
Email: john.hoskins@t...
-----Original Message-----
From: Craig V. Conover [mailto:<a href="/group/SunONE-JATO/post?protectID=219212113009229091025149066024064239039098031198039130252055210">craig.conover@s...</a>]
Sent: 6/26/2002 3.22 PM
Subject: Re: [SunONE-JATO] Re: How to use a tiled view without a model
I guess the only thing "weird" (for lack of a better term) about what
you are doing is that your are populating the model on the "display
cycle". Typically, the cycle goes like this:
Request -> populate model -> update data store -> retrieve data to
populate model -> display data
some of the above steps are optional but hopefully you get the point I
am making.
So what you are doing is:
Request -> populate model/display data
If it works for you, then it's not necessarilly wrong. But I would
probably have my model populated before I forwarded to the target
(displaying view bean) or at a minimum, in the begin display event of
the view bean or the tiled view, but not during the iteration of the
tiled view.
c
jhoskins wrote:
Craig,
Thanks for the pointers. I ended up doing something else. I set the
models setSize() method to set the max size, and as the tiles fields
iterated, populated the value from some vectors I had the data in
already. Is this solution fraught with peril and will ultimately fail,
or should I try your way?
John
--- Craig V. Conover wrote:
John,
Check out the docs for DefaultModel. There is an appendRow() method.
So get your tiledview's primary model (the tiledview's primary model
should be set to use an instance of DefaultModel), model.appendRow(),
then model.setValue("fieldname", value) for each value.
Rinse, repeat as needed.
c
jhoskins wrote:
I would like to use a tiled view, but populate the fields manually.
Any pointers about where I can set the size of the tiled view? I tried
setMaxDisplayTiles() in the beginDisplay, but it won't get down and
generate the rows.
John Hoskins
To download the latest version of JATO, please visit:
http://www.sun.com/software/download/developer/5102.html
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
To download the latest version of JATO, please visit:
http://www.sun.com/software/download/developer/5102.html
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
To download the latest version of JATO, please visit:
http://www.sun.com/software/download/developer/5102.html
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
To download the latest version of JATO, please visit:
http://www.sun.com/software/download/developer/5102.html
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jspCraig,
Thanks for the pointers. I ended up doing something else. I set the
models setSize() method to set the max size, and as the tiles fields
iterated, populated the value from some vectors I had the data in
already. Is this solution fraught with peril and will ultimately fail,
or should I try your way?
John
--- "Craig V. Conover" wrote:
John,
Check out the docs for DefaultModel. There is an appendRow() method.
So get your tiledview's primary model (the tiledview's primary model
should be set to use an instance of DefaultModel), model.appendRow(),
then model.setValue("fieldname", value) for each value.
Rinse, repeat as needed.
c
jhoskins wrote:
I would like to use a tiled view, but populate the fields manually.
Any pointers about where I can set the size of the tiled view? I tried
setMaxDisplayTiles() in the beginDisplay, but it won't get down and
generate the rows.
John Hoskins
To download the latest version of JATO, please visit:
http://www.sun.com/software/download/developer/5102.html
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp -
OS41: data modeler, how to use it?
Hi,
I'd like to know how to use T-code OS41: data modeler, when do I need to use it? and How to use? Please kindly help.
Thanks and Regards.Hi Steve
<b>SD11-Data Modeler</b> is used, as its name implies, to model your processes.
You can create entity types, connect tables or views to those entities, implement connections between entities and if needed, you can also insert business objects all in a hierarchical way. You can connect data models to each other as well.
By this way, you document your own processes containing also some technical perspective.
Hope this small piece will give some basic understanding.
*--Serdar -
How to use Script in ADF model?
Hi!
I don't know how to use Script in ADF model. Help me, please!
Detail: javaScript.
Thanks so much!You can put your Javascript code in the Onmouseover property of the column.
I don't have the Javascript code for changing the color but for example the following will pop up an alert
<af:outputText value="#{row.DepartmentId}" onmouseover="alert(\'Unload event fired!\')"> -
Hi,
We are evaluating the Adobe Captivate software and we are in
the process of identifying on how to use the Object model to record
the screen Programmatically. Do you have any idea on how to do this
using the captivate object model? We have a custom application and
we want to activate the recording by clicking a button in our page.
Kindly help. Thanks.
EricHi Captiv8r / Rick,
Thanks for your answer,
Actually, we have a web application that utilize the WME
(Windows Media Encoder) to record a video from the client side by
just clicking a button on our web page. That button has the
application logic to start the recording of his screen via calling
some "methods" on the WME dll files via object model (API). Now, we
are looking for some possible solutions on how we can implement the
same thing using the Adobe Captivate software or how we can utilize
adobe captivate to be able to integrate this software within our
web application.
Do you have any suggestions on how we can leverage the
benefits of adobe captivate in a custom web application? Thanks.
Eric -
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. -
How to use Adaptive WebService Model with CAF WebService and Complex Type
Hi All,
I am trying to use the Adaptive Web Service Model and call a WebService generated by the CAF. The return type of the WebService is a Complex Type.. I receive an exception when trying to instantiate the Model Node.
Does anybody know how to use the Adpative Web Service Model with CAF WebServices and Complex Types as return type?
Help is appreciated..
Thanks, JohannesThanks Mukesh.
It is not possible to apply the Service Controller Template on Enterprise Java Bean Models as described in the Document. When I try to aply the template on the EJB Model, NWDS says: Only Webservice Models and RFC Models are supported...???
I did not find any information about how to return complex types in AWS.. in this document???
Is there such information available? Has anybody ever done that? There must be a way to do that.. Is is the standard approach, isn't it...? Please help me out there.. I need to get this running..
Thanks, Johannes -
How to use Simulate model in product configuration?
Hi,
May i know how to use (step by step) simulate model in product configuration?
and what is the function of simulate model?
Regards,
Rhesa SyahrialHi Rhesa,
You can simulate your product right from the product master in CRM.
Execute transaction: COMMPR01
Select the configurable material.
Go to tab 'Configuration'.
You will see the list of Models.
Select the Model and click on Simulate Model.
Best Regards,
Pratik Patel
<b>Reward with Points!</b> -
How to use multiple selection parameters in the data model
Hi, after have looked all the previous threads about how to use multiple selection parameters , I still have a problem;
I'm using Oracle BI Publisher 10.1.3.3.2 and I'm tried to define more than one multiple selection parameters inside the data template;
Inside a simple SQL queries they work perfectly....but inside the data template I have errors.
My data template is the following (it's very simple...I am just testing how the parameters work):
<dataTemplate name="Test" defaultPackage="bip_departments_2_parameters">
<parameters>
<parameter name="p_dep_2_param" include_in_output="false" datatype="character"/>
<parameter name="p_loc_1_param" include_in_output="false" datatype="character"/>
</parameters>
<dataTrigger name="beforeReport" source="bip_departments_2_parameters.beforeReportTrigger"/>
<dataQuery>
<sqlStatement name="Q2">
<![CDATA[
select deptno, dname,loc
from dept
&p_where_clause
]]>
</sqlStatement>
</dataQuery>
<dataStructure>
<group name="G_DEPT" source="Q2">
<element name="deptno" value="deptno"/>
<element name="dname" value="dname"/>
<element name="loc" value="loc"/>
</group>
</dataStructure>
</dataTemplate>
The 2 parameters are based on these LOV:
1) select distinct dname from dept (p_dep_2_param)
2) select distinct loc from dept (p_loc_1_param)
and both of them have checked the "Multiple selection" and "Can select all" boxes
The package I created, in order to use the lexical refence is:
CREATE OR REPLACE package SCOTT.bip_departments_2_parameters
as
p_dep_2_param varchar2(14);
p_loc_1_param varchar2(20);
p_where_clause varchar2(100);
function beforereporttrigger
return boolean;
end bip_departments_2_parameters;
CREATE OR REPLACE package body SCOTT.bip_departments_2_parameters
as
function beforereporttrigger
return boolean
is
l_return boolean := true;
begin
if (p_dep_2_param is not null) --and (p_loc_1_param is not null)
then
p_where_clause := 'where (dname in (' || replace (p_dep_1_param, '''') || ') and loc in (' || replace (p_loc_1_param, '''') || '))';
else
p_where_clause := 'where 1=1';
end if;
return (l_return);
end beforereporttrigger;
end bip_departments_2_parameters;
As you see, I tried to have only one p_where_clause (with more than one parameter inside)....but it doesn't work...
Using only the first parameter (based on deptno (which is number), the p_where_clause is: p_where_clause := 'where (deptno in (' || replace (p_dep_2_param, '''') || '))';
it works perfectly....
Now I don't know if the problem is the datatype, but I noticed that with a single parameter (deptno is number), the lexical refence (inside the data template) works.....with a varchar parameter it doesn't work....
So my questions are these:
1) how can I define the p_where_clause (inside the package) with a single varchar parameter (for example, the department location name)
2) how can I define the p_where_clause using more than one parameter (for example, the department location name and the department name) not number.
Thanks in advance for any suggestion
AlexAlex,
the missing thing in your example is the fact, that if only one value is selected, the parameter has exact this value like BOSTON. If you choose more than one value, the parameter includes the *'*, so that it looks like *'BOSTON','NEW YORK'*. So you need to check in the package, if there's a *,* in the parameter or not. If yes there's more than one value, if not it's only one value or it's null.
So change your package to (you need to expand your variables)
create or replace package bip_departments_2_parameters
as
p_dep_2_param varchar2(1000);
p_loc_1_param varchar2(1000);
p_where_clause varchar2(1000);
function beforereporttrigger
return boolean;
end bip_departments_2_parameters;
create or replace package body bip_departments_2_parameters
as
function beforereporttrigger
return boolean
is
l_return boolean := true;
begin
p_where_clause := ' ';
if p_dep_2_param is not null then
if instr(p_dep_2_param,',')>0 then
p_where_clause := 'WHERE DNAME in ('||p_dep_2_param||')';
else
p_where_clause := 'WHERE DNAME = '''||p_dep_2_param||'''';
end if;
if p_loc_1_param is not null then
if instr(p_loc_1_param,',')>0 then
p_where_clause := p_where_clause || ' AND LOC IN ('||p_loc_1_param||')';
else
p_where_clause := p_where_clause || ' AND LOC = '''||p_loc_1_param||'''';
end if;
end if;
else
if p_loc_1_param is not null then
if instr(p_loc_1_param,',')>0 then
p_where_clause := p_where_clause || 'WHERE LOC in ('||p_loc_1_param||')';
else
p_where_clause := p_where_clause || 'WHERE LOC = '''||p_loc_1_param||'''';
end if;
end if;
end if;
return (l_return);
end beforereporttrigger;
end bip_departments_2_parameters;
I've written a similar example at http://www.oracle.com/global/de/community/bip/tipps/Dynamische_Queries/index.html ... but it's in german.
Regards
Rainer -
How to use UndoableEditSupport in undo model?
The undo example of Java Tutorials just use UndoManager and UndoableEditListener. It didn't use the class UndoableSupport, How to use it?
thanks for any replier.You can put your Javascript code in the Onmouseover property of the column.
I don't have the Javascript code for changing the color but for example the following will pop up an alert
<af:outputText value="#{row.DepartmentId}" onmouseover="alert(\'Unload event fired!\')"> -
How to use tree tables with CRUD operation for begineers ADF 11g
This is Friday night call for help.
This is only few sample ressources on the web for tree table and only one with CRUD operation.
I used this one http://jobinesh.blogspot.com/2010/05/crud-operations-on-tree-table.html because this is the only one that address CRUD.
And it is shaky. Deletion works fine but insertion not very well. This is working using custom code provided below.
Depending if the user selection in the tree, the code insert from the master node to the children node.
Any other options because it is not working well.
Also where Oracle describes how to use the row, rowset, itorator API? This is really hard to understand like almost if we should not use it.
then if not how can I insert in tree with two nodes and insert in the parent or children depending the users selection.
Lately I 'been posting questions on this forum with no response. This hurts. I understand developers cannot spend their time on this but People from Oracle, please help. We pay licenses...
public void createChildren(RowIterator ri, Key selectedNodeKey) {
final String deptViewDefName = "model.DepartmentsView";
final String empViewDefName = "model.EmployeesView";
if (ri != null && selectedNodeKey != null) {
Row last = ri.last();
Key lastRowKey = last.getKey();
// if the select row is not the last row in the row iterator...
Row[] found = ri.findByKey(selectedNodeKey, 1);
if (found != null && found.length == 1) {
Row foundRow = found[0];
String nodeDefname =
foundRow.getStructureDef().getDefFullName();
if (nodeDefname.equals(deptViewDefName)) {
RowSet parents =
(RowSet)foundRow.getAttribute("EmployeesView");
Row childrow = parents.createRow();
parents.insertRow(childrow);
} else {
RowSet parents =
(RowSet)foundRow.getAttribute("EmployeesView");
Row childrow = parents.createRow();
childrow.setAttribute("DepartmentId",
foundRow.getAttribute("DepartmentId"));
parents.insertRow(childrow);
} else {
System.out.println("Node not Found for " + selectedNodeKey);
}I am looking for a sample that describe how to design a jsf page with a tree table.
So you have Department and employees. In the tree first comes Department and if you click the node you see the employees assigned to this department.
I need to be able to insert a new department or a new employee from the tree table by clicking on a insert button in the panel collection toolbar depending on user selection in the tree.
I got part of it working but not good enough.
By problem is the get insertion working
I have a createChildren method in my AM implementation that get in input a RowIterator and selected node key.
To goal is to create new records depending of the user selection and the input parameters get populated by the binding like this:
#{backing_treeSampleBean.selectedNodeRowIterator} #{backing_TreeSampleBean.selectedNodeRowkey} via method binding with parameters.
Is it the right approach?
First to be able to insert a parent record, I select nothing in the tree and ri and selectedNodeKey comes to null
we run this code
ViewObjectImpl vo = getSchHolidaySchedExceptionsView1();
//ViewObjectImpl vo = getDepartmentsView1();
Row foundRow = vo.first();
Row childrow = vo.createRow();
vo.insertRow(childrow);
A new blank entry appears in the parent node and we enter a value.
The the problem starts when we want to add a child to this parent.
We select the created parent and press the insert button, this code get executed
if (nodeDefname.equals(deptViewDefName))
//list of the children of the parent and create an new row
RowSet childRows = (RowSet)foundRow.getAttribute("SchHolidayExceptionDatesView");
Row childrow = childRows.createRow();
childRows.insertRow(childrow);
But the new entry does not appear, it is almost like it would be created for a different parent because this is a mandatory field that is not feel in yet and the interface complaints of a missing value. It is created somewhere just not a the right place... This is my guess.
Do you see something wrong with the code?
The full code og my create children method is there below
I am using jdeveloper 11.1.1.3.0 any issues with tree table to know about with this version?
Thanks for your help
public void createChildren(RowIterator ri, Key selectedNodeKey) {
final String deptViewDefName = "com.bcferries.app.pdfroutesched.model.SchHolidaySchedExceptionsView";
final String empViewDefName = "com.bcferries.app.pdfroutesched.model.SchHolidayExceptionDatesView";
if (ri != null && selectedNodeKey != null) {
// last row
Row last = ri.last();
Key lastRowKey = last.getKey();
// if the select row is not the last row in the row iterator...
Row[] found = ri.findByKey(selectedNodeKey, 1);
if (found != null && found.length == 1) {
// foundRow is the row selected
Row foundRow = found[0];
// The row selected can be the parent node or the child node
String nodeDefname = foundRow.getStructureDef().getDefFullName();
// if parent row
if (nodeDefname.equals(deptViewDefName))
//list of the children of the parent and create an new row
//works but we try to resolve the creation of a parent
RowSet childRows = (RowSet)foundRow.getAttribute("SchHolidayExceptionDatesView");
Row childrow = childRows.createRow();
//childrow.setAttribute("HolidayDate", new java.util.Date().getDate());
System.out.println("insert child row from master");
childRows.insertRow(childrow);
} else
//RowSet ParentRow = (RowSet)foundRow.getAttribute("SchHolidaySchedExceptionsView");
//RowSet childRows = (RowSet)ParentRow.first().getAttribute("SchHolidayExceptionDatesView");
Row childrow = ri.createRow();
System.out.println("insert child row from child ");
} else {
System.out.println("Node not Found for " + selectedNodeKey);
} else {
System.out.println(" param null try creating for first row : " +
ri + " * " + selectedNodeKey);
ViewObjectImpl vo = getSchHolidaySchedExceptionsView1();
Row foundRow = vo.first();
Row childrow = vo.createRow();
vo.insertRow(childrow);
} -
How to use single installation of Nokia Ovi Suite ...
I want to help my adult son set up his (different model-) Nokia Smartphone.
How to use the Nokia Ovi Suit already installed for a different user?Hey,
If i hav understood ur issue correctly, u want to share the same nokia ovi suite(Contacts, Messages, Calendar and tasks etc) of ur entire family with single nokia ovi suite? If my understaning is wrong, please do correct/educate me.
AFAIK, nokia ovi suite does not work the same way how pc suite works at least when it comes to PIM sync like Contacts, Messages, calendar and tasks etc.,
In case of PC Suite, u can connect more than a device and u can sync/store messages/contacts/calendar etc separately and u can switch to the next device, there is no dedicated database to store any of ur data, if u r synching with pc suite.
In case of Ovi Suite, it has got a database where it stores user's info in a database, so u cannot sync multiple phone's data with single nokia ovi suite.
If this is what u xpct from our forum, read my signature and do the needful
If my post helped you, click on Kudos button and if my solution provided is opt 2 u, accpt my solution -
How to use one commandButton to execute two task in JSF
I have a form in JSF page which contains different faces components. These faces bind to ADF BC to insert one row in the database when the user press commandButton. Also I need to bind the value of one inputText in that form to managed bean to execute another task in the application when the user press the same commandButton.
The code of the inputText:
<h:inputText value="#{bindings.ProjectNumber.inputValue}"
id="pn"
size="10"
required="#{bindings.ProjectNumber.mandatory}">
The code of commandButton:
<h:commandButton actionListener="#{bindings.Commit.execute}"
value="Save"
disabled="#{bindings.Commit.actionEnabled}"/>
The managed bean is “findInspector”. I tried to insert inputHidden inside commandButton tag and assign the value of the inputText to the inputHidden as follows:
<h:commandButton actionListener="#{bindings.Commit.execute}"
value="Save"
disabled="#{bindings.Commit.actionEnabled}">
<h:inputHidden value="#{bindings.ProjectNumber.inputValue}" binding="#{findInspector.project}"/>
</h:commandButton>
But it was not work
Please how can I write the code to use the value of the inputText more than one time in the JSF(one to insert one row by using ADF BC and another to use the same value to bind to a managed bean) and how to use one commandButton to execute two task in JSF.
Thank you
WaheedYes I did
<managed-bean>
<description>The bean for get project No</description>
<managed-bean-name>projectBean</managed-bean-name>
<managed-bean-class>
mcscm.model.ProjectBean
</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>bindings</property-name>
<value>#{bindings}</value>
</managed-property>
</managed-bean>
Also I changed the method in the managed bean as follows:
public String commandButton_action() {
FacesContext fctx = FacesContext.getCurrentInstance();
ValueBinding vb = fctx.getApplication().createValueBinding("#{bindings}");
DCBindingContainer dcb = (DCBindingContainer) vb.getValue(fctx);
OperationBinding operation = (OperationBinding) dcb.get("projectNumber");
operation.execute();
return null;
where projectNumber is my method in the java class of the application module "TaskInformationImpl". I made this method to be accessed from outside of ADF BC.
I just create a sample code for projectNumber method for testing only as:
public void projectNumber (String data){
System.out.print(data);
In the page Pagedef file I added this :
<methodAction id="projectNumber"
InstanceName="TaskInformationDataControl.dataProvider"
DataControl="TaskInformationDataControl"
MethodName="projectNumber" RequiresUpdateModel="true"
Action="999" IsViewObjectMethod="false">
<NamedData NDName="data" NDValue = "#{bindings.ProjectNumber.inputValue}" NDType="java.lang.String"/>
After I did all of this I get a new error like:
javax.faces.FacesException: #{projectBean.commandButton_action}: javax.faces.el.EvaluationException: java.lang.ClassCastException: oracle.adfinternal.view.faces.model.binding.FacesCtrlAttrsBinding cannot be cast to oracle.adf.model.OperationBinding
Is it very difficult to do this in JDeveloper?. yes ADF BC provide me a lot of facilities, but when I want to do a specific task I face a lot of troubles -
How to use Oracle partitioning with JPA @OneToOne reference?
Hi!
A little bit late in the project we have realized that we need to use Oracle partitioning both for performance and admin of the data. (Partitioning by range (month) and after a year we will move the oldest month of data to an archive db)
We have an object model with an main/root entity "Trans" with @OneToMany and @OneToOne relationships.
How do we use Oracle partitioning on the @OneToOne relationships?
(We'd rather not change the model as we already have millions of rows in the db.)
On the main entity "Trans" we use: partition by range (month) on a date column.
And on all @OneToMany we use: partition by reference (as they have a primary-foreign key relationship).
But for the @OneToOne key for the referenced object, the key is placed in the main/source object as the example below:
@Entity
public class Employee {
@Id
@Column(name="EMP_ID")
private long id;
@OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="ADDRESS_ID")
private Address address;
EMPLOYEE (table)
EMP_ID FIRSTNAME LASTNAME SALARY ADDRESS_ID
1 Bob Way 50000 6
2 Sarah Smith 60000 7
ADDRESS (table)
ADDRESS_ID STREET CITY PROVINCE COUNTRY P_CODE
6 17 Bank St Ottawa ON Canada K2H7Z5
7 22 Main St Toronto ON Canada L5H2D5
From the Oracle documentation: "Reference partitioning allows the partitioning of two tables related to one another by referential constraints. The partitioning key is resolved through an existing parent-child relationship, enforced by enabled and active primary key and foreign key constraints."
How can we use "partition by reference" on @OneToOne relationsships or are there other solutions?
Thanks for any advice.
/MatsCrospost! How to use Oracle partitioning with JPA @OneToOne reference?
Maybe you are looking for
-
What's 'best-practice' with external hard drives?
Hello folks, I just got myself a 500GB LaCie d2 'Quadra' hard drive, and it works great - just as I was led to expect. Now I've connected it to my iMac with a FW400 cable. I've a few questions regarding general usage and 'best practice' when using an
-
HI, We will be trying on the TEST system to do Goods Issues and Receipts to change the Last Purchase Price but because we use FIFO this may not give the result that we want ie in FIFO it is the the earlier price we want i presume? I have heard anothe
-
Dear sir, Please advise from where do we get the pricing procedure ,condition types in Me47.since pricing procedure in PO comes from vendor.but if we maintain same vendor in RFQ,it shows different condition types there. Pls suggest. Thanks
-
In MM03, missing space in Barcode
Dear ABAPERS, I have an issue with MM03 in which the user is executing in the following way to get the barcode. MM03 > Enter material number > Basic data 1 and continue > goto additional data > click on tab Additional EANS In this Additional EANS we
-
Is there a way to connect a camera to your mac to run live video without using firewire? Is it possible to use airport express and the USB connections? I want to be able to move away from my mac and firewire doesn't give the distance I need. I have a