Getting a particular Level Ancestor
Hi,
I have a class "Test " which extends JFrame,
and an "InternalTest" class which extends "JInternalFrame"
and a number of other classes called by and built on each other and on InternalTest ...
I can call any public variable within "Test" using :
((Test)getTopLevelAncestor()).variable;
How can i access variables within InternalTest in a similar way, and in the less messy way possible ? can i somehow give InternalTest a level 2 ancestry ? and say something like
((InternalTest)getLevelAncestor(2)).variable; ?
Thanks
Ellis
How about writing your own method that will go up the hierarchy (getParent()) according to the level number that you provide it?
Similar Messages
-
Listing attributes of a particular level in a dimension via API call
Hi,
We are using the Oracle OLAP Java api's to browse the metadata and contents of an OLAP schema. We need to be able to access an api that lists just the Attributes that are mapped to a particular Level within a dimension.
Note the following snippet of code can be added to the OLAP Java examples. This displays a list of key value pairs. The keys are the unique level identifier in the form "HIERARCHY::LEVEL::ID", the value is the contents of the specified attribute. The result would be suitable for input to a combo box control in a JSP or similar.
public static void getFilters(String dimension, String hierarchy, String level, String attribute) throws Exception {
MdmPrimaryDimension mdmDimension = getMdmPrimaryDimension(dimension);
MdmHierarchy mdmHierarchy = getContext().getHierarchyByName(mdmDimension, hierarchy);
MdmLevel mdmLevel = getContext().getLevelByName((MdmLevelHierarchy) mdmHierarchy, level);
MdmAttribute mdmAttribute = getContext().getAttributeByName( mdmDimension, attribute);
StringSource levelSource = (StringSource)mdmLevel.getSource();
StringSource attributeSource = (StringSource)mdmAttribute.getSource();
Source querySource = attributeSource.join(levelSource);
try {
prepareAndCommit();
getContext().displayResult(querySource);
} catch (oracle.olapi.data.source.UnmatchedInputsException e) {
System.out.println("UNMATCHED ID's " + e.getUnmatchedInputIDs());
Prior to calling this we need a way of prompting the user to select the appropriate attribute to display in the value field of the list. We can get the full list of attributes for the Dimension with the following code snippet:
MdmPrimaryDimension mdmDimension = getMdmPrimaryDimension(dimension);
List attributes = mdmDimension.getAttributes();
However calling the code below returns an empty attribute list.
MdmPrimaryDimension mdmDimension = getMdmPrimaryDimension(dimension);
MdmHierarchy mdmHierarchy = getContext().getHierarchyByName(mdmDimension, hierarchy);
MdmLevel mdmLevel = getContext().getLevelByName((MdmLevelHierarchy) mdmHierarchy, level);
List attributes = mdmLevel.getAttributes();
What api's can we call that would let us list just the attributes mapped to the Level in question?
Any help is appreciated.
Regards,
Ed<LINK (<IDESCENDANTS (PutMemberNameHere) AND <DIMBOTTOM (PutDimNameHere)
-
How to check whether a node exist in a Particular Level. (xmltype)
hi,
please help me to check whether a particular node exists in one level.
for eg
I have the following xml
<map>
<entry>
<key>
heading1
</key>
<map>
<entry>
<key> sub1 heading1</key>
<value> sub1 heading1 value </value>
</entry>
<entry>
<key> sub2 heading1 </key>
<value> sub2 heading1 value </value>
</entry>
</map>
</entry>
<entry>
<key>
heading2
</key>
<map>
<entry>
<key> sub1 heading2</key>
<value> sub1 heading2 value </value>
</entry>
<entry>
<key> sub2 heading2 </key>
<value> sub2 heading2 value </value>
</entry>
</map>
</entry>
</map>i need to check how many heading exists in this xml.
I am checking like
i:=1;
l_section := ip_xml.extract('//map/entry');
WHILE l_section.existsnode('entry[' || i|| ']') = 1 LOOP
// extract the key name within entry tag
// print the key name.
i:=i+1;
end loop;but iam getting all the key name like
heading1
sub1 heading1
sub2 heading1
heading2
sub1 heading2
sub2 heading2
I need only heading1 and heading2. how can I check whether a particular node exist in particular level.
first level , second level etc. Please helpbut iam getting all the key nameThat's because you're using a descendant axis : //map/entry
SQL> DECLARE
2
3 ip_xml xmltype := xmltype('<map>
4 <entry>
5 <key>
6 heading1
7 </key>
8 <map>
9 <entry>
10 <key> sub1 heading1</key>
11 <value> sub1 heading1 value </value>
12 </entry>
13 <entry>
14 <key> sub2 heading1 </key>
15 <value> sub2 heading1 value </value>
16 </entry>
17 </map>
18 </entry>
19 <entry>
20 <key>
21 heading2
22 </key>
23 <map>
24 <entry>
25 <key> sub1 heading2</key>
26 <value> sub1 heading2 value </value>
27 </entry>
28 <entry>
29 <key> sub2 heading2 </key>
30 <value> sub2 heading2 value </value>
31 </entry>
32 </map>
33 </entry>
34 </map>');
35
36 BEGIN
37
38 for r in (
39 select heading, headno
40 from xmltable( '/map/entry/key'
41 passing ip_xml
42 columns heading varchar2(30) path '.'
43 , headno for ordinality )
44 )
45 loop
46 dbms_output.put_line('Heading '||r.headno||' = '||r.heading);
47 end loop
48 ;
49
50 END;
51 /
Heading 1 =
heading1
Heading 2 =
heading2
PL/SQL procedure successfully completed -
How do I set the zoom at a particular level as the default to ensure pages are not too small and that i don't have to change the zoom for each page? in English
== This happened ==
Every time Firefox opened
== From the beginningSome add-ons:
Default FullZoom: https://addons.mozilla.org/en-US/firefox/addon/6965 (I use this one)
No Squint: http://urandom.ca/nosquint/
Also:
http://support.mozilla.com/en-US/kb/Page+Zoom
http://support.mozilla.com/en-US/kb/Text+Zoom
http://kb.mozillazine.org/Browser.zoom.siteSpecific -
How to get commerce item level taxAmount,shipTo details and etc?
Hi ,
How to get the commereceItem level taxAmount ,shipTo address details,price includes vat or not and discounts.
Regards,
Satya.Hi SatyaVenkat,
You can call commerceItem.getShippingGroupRelationships(). It will return a list of commerceItem shippingGroupsRelationships.
So, with it you will be able to get all commerceItem information, about shippingGroups (that contains shippingAddress), priceInfo (that contais tax and discounts) and so on.
Hope it helps -
Query to get the particular order in dyn admin.
Query to get the particular order in dyn admin.
In dyn/admin, goto /atg/commerce/order/OrderRepository
do the following query under "Run XML Operation Tags on the Repository"
<print-item item-descriptor="order" id="<your order id>" />
hit enter.
This should display your order's information.
~Gurvinder -
Doubt regarding No. of elements at a particular level of a dimension
Hi,
What does the No. of elements at a particular level of a dimension indicate?How do you calculate it? Suppose we have 10 years data and the time dimesion levels goes as Year----Quarter----Month----Date what would be the no of elemets at each level?
Kindly post a reply at the earliest.Hi..
see my reply here..
no of elements in a logical level.
Regards
Kishore Guggilla -
To calculate average of a measure for particular level of calendar hierarchy across all years
Hi All,
Let say Data is available for 10 years: from 2005 to 20015
Calendar Hierarchy: Year -> Quarter -> Month -> Week -> Day
Let say Measure Name is : SalesAmt
Now, I want to create a calculated measure for calculating: Average of SalesAmt for Calendar Hierarchy at particular level (for all the 10 years). Means, if somebody selects, Jan, 2014 it should show Average of all the January’s data (coming from all the 10
years like average of Jan -2000, Jan-2001, Jan-2002......Jan-2015), similarly if somebody selects 1st Quarter, 2012 it should show Average of all the 1st Quarter of all the 10 years (average of 1st quarter 2000, 1st Quarter 2002....1st Quarter 2015).
Kindly suggest.
Thanks in advance.You should use ParallelPeriod. Ex:
SELECT ParallelPeriod ([Date].[Calendar].[Calendar Quarter]
, 3
, [Date].[Calendar].[Month].[October 2003])
ON 0
FROM [Adventure Works -
Getting the volume level of a Microphone
Hi Everyone,
I've looked around and I haven't been able to figure this one out. Basically I need to get the volume level from the microphone as it is recording. For whatever reason, when I try and get the volume control from the TargetDataLine, it throws an exception. Is there a way to get around this or does this feature just plain not exist?
Thanks,
Robbiehi metaldrummer610, i have the same problem and look for a solution since a long time.
i only can manipulate the gain of my players like:
public void setGain(double value) {
try {
FloatControl gainControl =
(FloatControl) auline.getControl(FloatControl.Type.MASTER_GAIN);
float dB = (float)
(Math.log(value==0.0?0.0001:value)/Math.log(10.0)*20.0);
gainControl.setValue(dB);
} catch (Exception ex) {
ex.printStackTrace();
but in connection with my recorder it didn't work. i scanned many forums and try a lot, but i always get the exception like Unsupported control type: Mute , Volume etc.
at com.sun.media.sound.AbstractLine.getControl(Unknown Source)
at iax.audio.gsm.GSMRecorder.run(GSMRecorder.java:81)
at java.lang.Thread.run(Unknown Source)
have you find another idea? i decide to try it with jni, maybe i can find an api to control it via c, c++...
regards, Karen -
How to get the max(level)?
Hi,
The below query returns level and other selected columns.
I need to get the max(level) 2nd column value in the below example.How to modify the query?
Ex
Level max(level) id
1 5 101
1 5 102
1 5 103
2 5 104
2 5 105
3 5 107
4 5 120
5 5 134
5 5 280
SELECT DISTINCT level lvl
,form_frms.emp_id
,form_frms.ing_emp_id
,form_frms.prve_id
,CASE
WHEN (select div_dn
from epm_prod epm
where epm.emp_id= form_frms.ing_emp_id) ='Y' THEN DIV_DN
WHEN NVL((select distinct 'N'
from emp_pro_version prvv
where prvv.is_py='Y' and
prvv.IS_VERSION ='N' and
prvv.emp_id=form_frms.ing_emp_id) ,'Y')='N'
THEN 'Y'
WHEN NVL((select distinct 'Y'
from employee epm
where emp.emp_id=form_frms.ing_emp_id
and epm.status<>'NEW') ,'N') ='Y'
THEN 'Y'
ELSE 'N'
END
ELSE 'N'
END UN_KNOWN_ID
FROM (SELECT empvv1.prvv_id
FROM emp_view_version empvv1
WHERE empvv1.is_version = 'Y'
) form_frms
START WITH form_frms.emp_id = :lv_emp_id
CONNECT BY PRIOR form_frms.ing_emp_id = form_frms.emp_id
ORDER BY level DESC, form_frms.emp_id,UNKNOWN_ID ASC;
Edited by: shivasha on Feb 9, 2013 12:24 AMMaybe
select lvl,
max(lvl) over (order by null rows between unbounded preceding and unbounded following) max_level,
emp_id,
unknown_id
from (SELECT DISTINCT
level lvl,
form_frms.emp_id,
form_frms.ing_emp_id,
form_frms.prve_id,
CASE WHEN (select div_dn
from epm_prod epm
where epm.emp_id = form_frms.ing_emp_id
) = 'Y'
THEN DIV_DN
WHEN NVL((select distinct 'N'
from emp_pro_version prvv
where prvv.is_py = 'Y'
and prvv.IS_VERSION = 'N'
and prvv.emp_id=form_frms.ing_emp_id
),'Y'
) = 'N'
THEN 'Y'
WHEN NVL((select distinct 'Y'
from employee epm
where emp.emp_id = form_frms.ing_emp_id
and epm.status != 'NEW'
),'N'
) = 'Y'
THEN 'Y'
ELSE 'N'
END UNKNOWN_ID
FROM (SELECT empvv1.prvv_id
FROM emp_view_version empvv1
WHERE empvv1.is_version = 'Y'
) form_frms
START WITH form_frms.emp_id = :lv_emp_id
CONNECT BY PRIOR form_frms.ing_emp_id = form_frms.emp_id
ORDER BY lvl DESC,emp_id,UNKNOWN_IDRegards
Etbin -
Poweshell script to parse a XML document to get all Leaf level nodes with Node names in CSV
Hi Experts,
I want to write a Powershell script to parse a XML document to get all Leaf level nodes with Node names in CSV
<?xml version="1.0" encoding="UTF-8"?>
<CATALOG>
<CD>
<TITLE>Empire Burlesque</TITLE>
<ARTIST>Bob Dylan</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Columbia</COMPANY>
<PRICE>10.90</PRICE>
<YEAR>1985</YEAR>
</CD>
</CATALOG>
Need to display this as
CD_Tiltle, CD_ARTIST, CD_COUNTRY, CD_COMPANY, CD_PRICE, CD_YEAR
Empire Burlesque, Bob Dylan,USA,Columbia,10.90,1985
and so on..
I do not want to hard code the tag names in the script.
current example is 2 level hierarchy XML can be many level till 10 max I assume
in that case the csv file field name will be like P1_P2_P3_NodeName as so on..
Thanks in advance
PrajeshThankfully, I have writtenscript for ths same $node_name="";
$node_value="";
$reader = [system.Xml.XmlReader]::Create($xmlfile)
while ($reader.Read())
while ($reader.Read())
if ($reader.IsStartElement())
$node_name += "," + $reader.Name.ToString();
if ($reader.Read())
$node_value += "," + $reader.Value.Trim();
Thanks and Regards, Prajesh Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful. -
I was at level 111 on My Tom app, but when i've changed my i Phone it starts from 1st level. How can i get back my level?
"When you changed your iPhone". Do you mean you purchased a new phone? If that is the case, did you restore the new phone from a backup of the old phone? Is it possible that the app you are using does not save data in the iPhone backup? Have you contacted the app developer to ask them about it?
-
Hello all, I bouhgt a TV serial using my apple tv2 and my Apple ID information: all good. But then I got an e-mail from Apple saying that an "unknown" user downloaded content using my apple ID. Nobody stoled anything. How do I get my particular apple TV2 to recognize my apple ID account so it knows it is me who is buying. Thank you so much.
Dear AC,
Thank you so, so much for this answer. I did go into my Apple ID account through iTunes store and associated my devices to my Apple ID account. I did this by working on my computers (a mac mini and a mac air) and my two devices (iPhone and iPad). Thus there is a statemente saying "4 devices are associated with this apple ID and can download your purchases from iTunes in the iCloud". So whenever I use them to purchase anything, iCloud knows it is me through my devices so I do not get no e-mail warming me my account might be being used by a stranger.
So, how do I associate my apple Tv2 to my apple ID account? I went to its settings and could not find any way of doing it. Can you continue helpling me? Please.
Thank you so so much -
Can I get a higher level of os than what you can download?
Can you change cpu's to get a higher level of osx? I'm new to mac's and this laptop was given to me and the software I want to load requires a higher level of osx than 4.11. Is there anything physically I can do to update it?
10.5.8 is the latest OS that will run on a PPC Mac. You would need to purchase on the open market as Apple no longer sells this version of OS X.
Some source links:
http://hardcoremac.stores.yahoo.net/
http://www.welovemacs.com/apsyso.html
http://www.buycheapr.com/us/result.jsp?ga=us14&q=leopard+10.5+os+x
http://oldermac.hardsdisk.net/oldmac.html#hard -
How to get the inheritance level for an atribute value
hi,
i have to get the inheritance level for an attribute value for a given user in Org.struc.Hi,
Check out table T77OMATTUS for inheritance level for an attributes
Regards,
Neelima
Maybe you are looking for
-
Hi, I would like to impose a check on duplicate bank account number in IT9 so that a same bank account number cannot be used by other employees or mistakenly being double-keyed in by a HR personnel. Can anyone advise me how to do that? Thank you in a
-
openoffice has a own keboard settings file "current.xml" there is a manual how to modify that xml file, unfortunaltly Openoffice does not care much about that file, anyhow takes my local keyboard settings of utf8-DE_ch. How do I then adjust keyboard
-
Hi All, I have a date field in which when i enter the date and click on the button I should display the next day in another inputfield. Ex: If i enter 12th Nov 2008 (11/12/2008)i should get 13th Nov 2008 (11/13/2008) in the other input field. Thank
-
Apply settings to images upon import
I am using LR 5. Is there a way to apply settings to images upon import? For example, I want to set noise reduction to X if an imported image has a ISO setting between 1000 to 1250, from camera A with lens B. Right now I am applying the changes ma
-
JAVA & EXCEL using the POI API
Hi, I presently have a stand alone application that I need to redesign for a future use of excel. I created a spreadsheet with the following cell value: B5 = 1st value B6 = second value B9 = final value B11 is the total : SUM(B5:B9) My code is: try {