Putting attribute value from java level into sessionScope variable?
Hallo,
is it possible to put an attribute value from java level into a sessionScope variable?
For example when i'am in prepareSession is it possible to fill a sessionScope variable which i can use in a jspx-Site? And when how i must do it?
Any help is appreciated.
At the java level i make this
private void setUserIdIntoUserDataHashtable() {
Integer userid = getUserIdForLoggedInUser();
Integer groupid = getGroupIdForLoggedInUser();
Hashtable userdata = getDBTransaction().getSession().getUserData();
if (userdata == null){
userdata = new Hashtable();
userdata.put(PBConstants.CURRENT_USER_ID, userid);
userdata.put(PBConstants.CURRENT_GROUP_ID, groupid);
And when i at the java level i can use the constants. But i don't have an interaction at this point. Thats why i don't now how to bring the values to a sessionScope variable i need later in a / some sites?
Similar Messages
-
Fetching Values From JAVA classes into ABAP report
Hi Experts,
I have a requirement, in which I need to fetch Java Roles/Groups from the portal to a ABAP report, for specific users. The roles inside of our project are not always in sync with the central system.
I could not find any link with talks about this. Could anybody guide me on how to proceed?
Regards,
TrishnaI have written a report which takes users and specific roles as the input. Eg, userID :12345 and role/profile :SAP_ALL, SAP_ADMIN..etc in a table. and gives back if the user 12345 has SAP_ALL or not.
Now I have used RFCs to fetch all the roles for the user from different SAP systems which i further compare .
What I am unable to do is fetch the portal roles .
PROBLEM : The portal roles also exist in the central system, but might not be always consistent since they get manually updated in the central system. Hence I want to directly fetch the data from the JAVA Portal.
WHAT I KNOW : I need to write a JAVA class in NW developer studio which will take the user as the input and give me all the roles/profiles for the same user as output.
How do I further pass the values to and from the Java class to my ABAP report?
I know that I need to use the UME in some way to have this work for me. But since i do not expertize in java I need guidance/steps as to how to proceed.
Regards
Trishna -
All values from associative array into one variable
Hello! Please:
I have, for example:
DECLARE
TYPE tb1 IS TABLE OF INTEGER INDEX BY PLS_INTEGER;
v4 tb1;
variable1 myType; --varray of integers
BEGIN
v4(1) := 34;
v4(2) := 46456;
v4(100) := 54217:
... --shortly -lot of values
END;
/How can I get all v4(x) values into variable1?
something like:
FOR i IN 1..v4.COUNT
variable1 :=...don't know
--to have this in the variable1: variable1:= myType(34, 46456, ..., 54217, ...);
END LOOP;Thank You for answer!Is this you are looking for?
create or replace type myType is varray(500) of number;
DECLARE
TYPE tb1 IS TABLE OF INTEGER INDEX BY PLS_INTEGER;
v4 tb1;
variable1 myType:=myType(); --varray of integers
BEGIN
v4(1) := 34;
v4(2) := 46456;
v4(3) := 54217;
FOR i IN 1..v4.COUNT loop
variable1.extend();
variable1(i) := v4(i);
END LOOP;
FOR i IN 1..variable1.COUNT loop
dbms_output.put_line(variable1(i));
end loop;
END;
/ -
How I can transfer data from the database into a variable (or array)?
I made my application according to the example (http://corlan.org/2009/06/12/working-in-flash-builder-4-with-flex-and-php/). Everything works fine. I changed one function to query the database - add the two parameters and get the value of the table in String format. A test operation shows that all is ok. If I want to display this value in the text area, I simply drag and drop service to this element in the design mode
(<s:TextArea x="153" y="435" id="nameText" text="{getDataMeanResult.lastResult[0].name}" width="296" height="89" />).
It also works fine, just a warning and encouraged to use ArrayCollection.getItemAt().
Now I want to send the value to a variable or array, but in both cases I get an error: TypeError: Error #1010: A term is undefined and has no properties..
How can I pass a value from the database into a variable? Thank you.
public var nameTemp:String;
getDataMeanResult.token = authors.getDataMean(arrayOfNumber[0], dir_id);
nameTemp = getDataMeanResult.lastResult[0].name;
public var nameArray:Array = new Array();
for (var i:uint=o; i<3; i++){
getDataMeanResult.token = authors.getDataMean(arrayOfNumber[i], dir_id);
nameArray[i] = getDataMeanResult.lastResult[0].name;
And how i can use syntax highlighting in this forum?Astraport2012 wrote:
I have to go back to the discussion. The above example works fine when i want to get a single value of the database. But i need to pass an array and get an array, because i want to get at once all the values for all pictures tooltips. I rewrote the proposed Matt PHP-script and it works. However, i can not display the resulting array.
yep, it won't work for Arrays, you'll have to do something slightly more intelligent for them.
easiest way would be to get your PHP to generate XML, then read that into something like an ArrayList on your HTTPService result event (depends what you're doing with it).
for example, you could have the PHP generate XML such as:
<pictures>
<location>test1.png</location>
<location>test2.png</location>
<location>test3.png</location>
<location>test4.png</location>
<location>test5.png</location>
<location>test6.png</location>
</pictures>
then you'll read that in as the ResultEvent, and perform something like this on it
private var tempAC:ArrayList = new ArrayList
protected function getStuff_resultHandler(event:ResultEvent):void
for each(var item:Object in event.result.pictures)
var temp:String = (item.@location).toString();
tempAC.addItem(temp);
in my example on cookies
http://www.mattlefevre.com/viewExample.php?tut=flash4PHP&proj=Using%20Cookies
you'll see an example of how to format an XML structure containing multiple values:
if($_COOKIE["firstName"])
print "<stored>true</stored>";
print "<userInfo>
<firstName>".$_COOKIE["firstName"]."</firstName>
<lastName>".$_COOKIE["lastName"]."</lastName>
<userAge>".$_COOKIE["userAge"]."</userAge>
<gender>".$_COOKIE["gender"]."</gender>
</userInfo>";
else
print "<stored>false</stored>";
which i handle like so
if(event.result.stored == true)
entryPanel.title = "Welcome back " + event.result.userInfo.firstName + " " + event.result.userInfo.lastName;
firstName.text = event.result.userInfo.firstName;
lastName.text = event.result.userInfo.lastName;
userAge.value = event.result.userInfo.userAge;
userGender.selectedIndex = event.result.userInfo.gender;
depends on what type of Array you're after
from the sounds of it (with the mention of picture tooltips) you're trying to create a gallery with an image, and a tooltip.
so i'd probably adopt something like
<picture>
<location>example1.png</location>
<tooltip>tooltip for picture #1</tooltip>
</picture>
<picture>
<location>example2.png</location>
<tooltip>tooltip for picture #2</tooltip>
</picture>
<picture>
<location>example3.png</location>
<tooltip>tooltip for picture #3</tooltip>
</picture>
etc...
or
<picture location="example1.png" tooltip="tooltip for picture #1"/>
<picture location="example2.png" tooltip="tooltip for picture #2"/>
<picture location="example3.png" tooltip="tooltip for picture #3"/>
etc... -
Sample Applescript: scraping values from numbers files into a master file
Hi, I have programming experience in c and other languages, but am new to applescript and so am learning a lot from this forum.
My goal is to make a timesheet system for my Dad (for a bday present) where every time he helps a client, he fills out a newly created numbers file - and after a week or so, he can run a script that scrapes certain values from each numbers file and places it into a master numbers file. Then saving and closing the file.
Vince, it sounds like you've written a script that does this feature of looping through all numbers files in a folder and putting select values from each numbers file into a master numbers file (after clearing the previous values of the master file).
Specifically, I'm looking for a sample script that opens up a numbers file, clears its table, then fills this table by scraping one value from a particular cell in every numbers file in a folder.
If anyone has a similar script they would be willing to post or email to me, for me to use as a foundation and to learn from, I would be very very very grateful. My email is forman.jq at gmail dot com.I guess that this script may be a good starting point.
--[SCRIPT fromfolder_2spreadsheet1]
The target spreadsheet must be open at front and must contain the sheet sheet_destination which much contain the table table_destination.
Choose the folder supposed to store the source sopreadsheets.
Yvan KOENIG (VALLAURIS, France)
2010/08/18
--=====
(* Edit these height properties to fit your needs *)
property destination : "destinationDoc.numbers"
property sheet_destination : "destination"
property table_destination : "insert here"
property premierelignedestination : 2
property colonne_destination : 2
property ledossierhabituel : "Macintosh HD Maxtor:Users:yvan_koenig:Desktop:dossier habituel:"
property ligne_source : 2
property colonne_source : 2
--=====
on run
my activateGUIscripting()
Select the folder storing the spreadsheets from which we will extract values *)
set dossier_source to choose folder with prompt "Choose folder storing the Numbers documents…" default location (ledossierhabituel as alias)
Build a list of disk items available in the selected folder *)
tell application "System Events"
set les_elements to every disk item of folder (dossier_source as text) --whose (get type identifier) is in
set les_tableurs to {}
Extracts the list of the Numbers spreadsheets available in the selected folder *)
repeat with refsurelement in les_elements
if type identifier of refsurelement is in {"com.apple.iwork.numbers.numbers", "com.apple.iwork.numbers.sffnumbers"} then
copy path of refsurelement to end of les_tableurs
end if
end repeat
end tell -- System Events
if les_tableurs is {} then
No Numbers documents available so we stop the process. *)
set rapport to "The folder “" & dossier_source & "” doesn’t contain Numbers documents !"
else
set rapport to {}
end if
Check that the target Numbers document is open at front
and that it embed the defined sheet embedding the defined table. *)
tell application "Numbers"
activate
set existants to name of documents
if destination is not in existants then
copy "The document " & destination & " is not open !" to end of rapport
else
tell document destination
if sheet_destination is not in (name of sheets) then
copy "the sheet " & sheet_destination & " is unavailable in the document " & destination & " !" to end of rapport
else
tell sheet sheet_destination
if table_destination is not in (name of tables) then copy "The table " & table_destination & " is unavailable in the sheet " & sheet_destination & " of the document " & destination & " !" to end of rapport
end tell -- sheetSource
end if
end tell --document destination
end if
If target document is not at front or if it doesn't match the defined requirements,
we quit the process. *)
if rapport is not {} then error my recolle(rapport, return)
Clean the target table, minus row 1 supposed to be storing columns headers *)
tell document destination to tell sheet sheet_destination to tell table table_destination
set selection range to range ("A2 : " & name of last cell)
end tell --document destination
end tell -- Numbers
my selectMenu("Numbers", 4, 9) (* Suppress *)
set liste_valeurs to {}
tell application "Numbers"
repeat with un_tableur in les_tableurs
Open the spreadsheets and extract from each of them the wanted value *)
open un_tableur
tell document 1 to tell sheet 1 to tell table 1
set une_valeur to value of cell 2 of column 2
end tell
if une_valeur is 0.0 then
copy "empty" to end of liste_valeurs
else
copy une_valeur as text to end of liste_valeurs
end if
close document 1
end repeat
Now, it's time to insert the values in the target table *)
set ligne_destination to premierelignedestination
tell document destination to tell sheet sheet_destination to tell table table_destination
repeat with une_valeur in liste_valeurs
if not (exists row ligne_destination) then add row below last row
if une_valeur is not "empty" then
set value of cell ligne_destination of column colonne_destination to une_valeur
end if
set ligne_destination to ligne_destination + 1
end repeat
end tell -- document destination
save document destination
end tell -- Numbers
end run
--=====
on recolle(l, d)
local oTIDs, t
set oTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to d
set t to l as text
set AppleScript's text item delimiters to oTIDs
return t
end recolle
--=====
on activateGUIscripting()
(* to be sure than GUI scripting will be active *)
tell application "System Events"
if not (UI elements enabled) then set (UI elements enabled) to true
end tell
end activateGUIscripting
--=====
my selectMenu("Pages",5, 12)
==== Uses GUIscripting ====
on selectMenu(theApp, mt, mi)
tell application theApp
activate
tell application "System Events" to tell process theApp to tell menu bar 1 to ¬
tell menu bar item mt to tell menu 1 to click menu item mi
end tell -- application theApp
end selectMenu
--=====
--[/SCRIPT]
I apologize, I'm too busy to write more explanations.
Yvan KOENIG (VALLAURIS, France) mercredi 18 août 2010 21:38:04 -
How to get attribute value from an object inside an object in Xpress
Does anyone know how to get an attribute value from an object in Xpress in a workflow? I have an object structured as follows:
<ResourceInfo accountId='mj628' tempId='3483372b787ce7dd:-5d99a0c5:130cb238483:-3600'>
<ObjectRef type='Resource' name='Google Apps'/>
</ResourceInfo>
I need if possible to get the name='Google Apps', which is inside the ObjectRef, so I guess its an attribute value of an object inside an object.If the ResourceInfo object is accessible in a variable, i.e. named "myResInfo", you just have to check the Java API and call the relevant method:
<invoke name='getResourceName'>
<ref>myResInfo</ref>
</invoke> -
Issues In Reading Attribute Values From Master Data
Hi All,
I have a requirement where, i need to read an attribute value from master data. I have a characteristic YCSTATMCG (AT Cost Group Code) which is the master data from where i have to read the attribute, 0PROFIT_CTR (Profit Center). The attribute thus read, has to be populated into another characteristic, YPROFIT_C. But YCSTATMCG referes to another characteristic, YCSTCG. Here is the FOX Code I wrote with YPROFIT_C as the changing characteristic and 0AMOUNT as keyfigure.
DATA V_ATCP TYPE YCSTATMCG.
DATA V_PROFIT TYPE YPROFIT_C.
DATA V_PROFITC TYPE YPROFIT_C.
DATA V_AMOUNT TYPE F.
V_ATCP = OBJV().
MESSAGE I020(YCO_CFT) WITH V_ATCP.
V_AMOUNT = {0AMOUNT, # }.
V_PROFIT = ATRV('0PROFIT_CTR' , V_ATCP).
MESSAGE I020(YCO_CFT) WITH V_PROFIT.
{0AMOUNT, V_PROFIT} = V_AMOUNT.
But this is not working. The ATRV() function is not reading the attribute values at all. Any solutions and suggestions is highly valued.
Thanks in advance
SwaroopHi,
even i have the same situation.
i just want the attribute value of a char to be populated into another characteristic in the planning query.
my question is whether i should populate the keyfigure field also in the FOX code.
if so should i populate both 0amount and 0quantity fields as i have 2 keyfigure fields.
Thanks for your help
Nishanth -
Can we Return values from Java Bean to Form
Hi All,
I have a Bean area defined on a Form. The Bean Area consists of a Text field which gets populated by path of a file selected using Browse button.
Can I return this path as a parameter from the Java Bean to the form? Is there any function for this?
Regards,
Prathima.If you designed your bean to offer the ability to exact info/data from it, then yes you can get a value from the bean into the form (pl/sql) - using Get_Custom_Property
Refer to the following which is a good example of how to build a bean. Specifically look at page 12 where is shows how to use Get_Custom_Property.
This is NOT an Oracle supported or provided document or web site, but it is a very good example.
http://forms.pjc.bean.over-blog.com/ext/http://sheikyerbouti.developpez.com/forms-pjc-bean/first-bean/first_bean.pdf -
How To Concatenate Column Values from Multiple Rows into a Single Column?
How do I create a SQL query that will concatenate column values from multiple rows into a single column?
Last First Code
Lesand Danny 1
Lesand Danny 2
Lesand Danny 3
Benedi Eric 7
Benedi Eric 14
Result should look like:
Last First Codes
Lesand Danny 1,2,3
Benedi Eric 7,14
Thanks,
David JohnsonStarting with Oracle 9i
select last, first, substr(max(sys_connect_by_path(code,',')),2) codes
from
(select last, first, code, row_number() over(partition by last, first order by code) rn
from a)
connect by last = prior last and first = prior first and prior rn = rn -1
start with rn = 1
group by last, first
LAST FIRST CODES
Lesand Danny 1,2,3
Benedi Eric 7,14Regards
Dmytro -
How to get attribute value from standard page ?
Hi,
How to get attribute value from standard page ?
String str = (String)vo.getCurrentRow().getAttrbute("RunId");
But this value is returning a null value ....
Can anyone help me to get this attribute value which is actually having a actual value .getCurrentRow() would always return null if no setCurrentRow() is used.
Please check the page design and understand how many rows of VO are there. You can also use the following to get the row:
vo.reset();
vo.next();
Regards
Sumit -
How can i store values from my String into Array
Hi guys
i wants to store all the values from my string into an array,,,, after converting them into intergers,,,, how i can do this becs i have a peice of code which just give me a value of a character at time,,,,charat(2)...BUT i want to the values from String to store in an Array
here is my peice of code which i m using for 1 char at time
int[] ExampleArray2 = new int[24];
String tempci = "Battle of Midway";
for(int i=0;i>=tempci.length();i++)
int ascii = tempci.charAt(i); //Get ascii value for the first character.public class d1
public static final void main( String args[] )
int[] ExampleArray2 = new int[24];
String tempci = "Battle of Midway";
for(int i=0;i<tempci.length();i++)
int ascii = tempci.charAt(i);
ExampleArray2=ascii;
for(int i=0;i<ExampleArray2.length;i++)
System.out.println(ExampleArray2[i]); -
How to get return value from java and read by other application?
i want to read return value from java and the other application read it.
for example:
public class test_return {
test_return(){
public int check(){
return 1;
public static void main(String args[]){
new test_return().check();
}from that class i make as jar file. How to read the return value (1) by other application?
thx..If your installer is requiring some process it invokes to return a particular value on failure, then the installer is seriously broken. There are a bazillion commands your installer could invoke, and any of them could fail, which in turn could invalidate the entire install process, and any of them could return any value on failure. The only value that's consistent (in my experience) is that zero means success and non-zero means failure, with specific non-zero values being different in different programs.
About the only control you have over the JVM's exit code is that if your main method completes without throwing an exception, the JVM will have an exit code of 0, and if main throws an exception (either explicitly or by not catching one thrown from below), it will be non-zero. I'm not even sure if that's guaranteed, but I would guess that's the case.
EDIT: I'm kind of full of crap here. If you're writing the Java code, you can call System.exit(whatever). But nonetheless, if your installer requires certain exit codes from any app--java or otherwise--you have a problem.
Edited by: jverd on Oct 29, 2009 1:27 AM -
How to get a value from one item into another
How can i get value from one item into another item.
Ex: I have a report, in there i have check boxes, and when i have checked some rows, and press submitt, a prosses computates it into a item on another page, and a branche redirects to page 3. Then i'm going to use the value in the item into a PL/SQL script in an report to show the submittet items.
How can i do this?
Computation script, pages and all that is fixed. But i dont know which PL/SQL statement to use to get th value from the item.Hi Fredr1k,
Use the V() function from pl/sql.
e.g. V('P3_MY_ITEM')
will return the value of that page item.
As long as the pl/sql is called from within the Apex environment.
Regards
Michael -
How can I access the Attribute Values from the Search Region
Hi all,
I have a table which contains Company id, department id, and PositonId. For a particular Company and Department there may be multiple records.
I have to pupulate a table which contains the position and other details that comes under a particular Department and Position based on the selection in the Three comboBoxes.
Also I have to populate a select many Shuttle to add new postions and records under a particular Department.
I created a query panel *(Search Region)* for the serch and a table to display the data. That is working fine.
Now the issue is I am using a view criteria to populate the shuttle with two bind variables ie, DepartmentId and CompanyId.
If the serach will return a resuktant set in the table it will also pupulate the correct records, otherwise ie, if the if the serch result is empty the corresponding iterator and the attribute is setting as null.
SO I want to access the attribute values from the Search Region itsef to populate the shuttle.
I don't know how can I access the data from the Search Region.
Please Help.
Regards,
Ranjithyou could access the parameters entered in search region by the user as follows:
You can get handle to the value entered by the user using queryListener method in af:query.
You can intercept the values entered as described
public void onQueryList(QueryEvent queryEvent) {
// The generated QueryListener replaced by this method
//#{bindings.ImplicitViewCriteriaQuery.processQuery}
QueryDescriptor qdes = queryEvent.getDescriptor();
//get the name of the QueryCriteria
System.out.println("NAME "+qdes.getName());
List<Criterion> searchList = qdes.getConjunctionCriterion().getCriterionList();
for ( Criterion c : searchList) {
if (c instanceof AttributeCriterion ) {
AttributeCriterion a = (AttributeCriterion) c;
a.getValues();
for ( Object o : a.getValues()){
System.out.println(o.toString());
//call default Query Event
invokeQueryEventMethodExpression("#{bindings.ImplicitViewCriteriaQuery.processQuery}",queryEvent);
public void onQueryTable(QueryEvent queryEvent) {
// The generated QueryListener replaced by this method
//#{bindings.ImplicitViewCriteriaQuery.processQuery}
QueryDescriptor qdes = queryEvent.getDescriptor();
//get the name of the QueryCriteria
System.out.println("NAME "+qdes.getName());
invokeQueryEventMethodExpression("#{bindings.ImplicitViewCriteriaQuery.processQuery}",queryEvent);
private void invokeQueryEventMethodExpression(String expression, QueryEvent queryEvent){
FacesContext fctx = FacesContext.getCurrentInstance();
ELContext elctx = fctx.getELContext();
ExpressionFactory efactory = fctx.getApplication().getExpressionFactory();
MethodExpression me = efactory.createMethodExpression(elctx,expression, Object.class, new Class[]{QueryEvent.class});
me.invoke(elctx, new Object[]{queryEvent});
Thanks,
Navaneeth -
How to get attribute values from one view to another
HI all,
Thx in Advance..
I have 2 view like v1,v2.In v1 i used one attribute values from "get single attribute" method.And i need the same values in v2 screen.For this i did in v1 outbound plugs , i mentioned the parameter name . How can i get the same values in v2.Hi chandru ,
you said you declare the parameters in the Outbound Plug of V1. now go to view V2 inbound plug Tab and creat one inbound plug
double click on the plug name .it will navigate you to the event handeler method . Now add the outbound parameter variables in the
parameters
For example : V1firing the navigation plug
a type string " defined in parameter
wd_this->fire_out_to_view2_plg(
a = 'ABCD' " string
you can retrive the value freely in v2 inbound event handeler
a type string " defined in parameter
* set single attribute
lo_el_context->set_attribute(
name = `TEXT`
value = a )." here you will get the 'ABCD'.
regards
Chinnaiya P
Edited by: chinnaiya pandiyan on Jun 23, 2010 7:12 PM
Maybe you are looking for
-
For All Entries is NOT better than INNER JOIN in most cases
I quote from Siegfried Boes' excellent post here: Will writing an inner join be better or creating a view? For all the FOR ALL ENTRIES lovers ... there is no proof for these reappearing recommendation. There is nearly nobody who receives forum points
-
I disabled Autorun/Autoplay on iPod 160....
...and I solved all the problem i had when I wanted to unplug ipod from my pc. 4 times out of 5 ipod was "busy" and i could not safely remove it, even using iTunes. Now it works, I can rapidly unplug iPod with or without iTunes. M.
-
ALV GRID (add_protocol_entry)
Dear SDN, I'm using edit grid. How could I use the method call method p_data_changed->add_protocol_entry, outside event data_changed? I need to check the data (all lines of te grid) at an (Z) user-comand. Thanks! Best regards, Maria João Rocha
-
After Effects CS4 install on Win XP 64bit OS
I am trying to install the After Effects CS4 trial unto a Win XP 64bit OS. There was only one trial download available and figure that if there is a 64-bit trial versions, it would be packaged with this also. The installer designates installation lo
-
Camera Raw will not assist in sharpening
Camera raw used to have a feature in the sharpening menu where pressing the 'alt/option' key while sliding the sharpening 'amount' would grayscale the image and make it much easier to view what was being sharpened. Has this feature been removed or ha