Looking for sample java code for dvt:hierarchyViewer
Hi.
We currently use Jdeveloper 11g Build JDEVADF_11.1.1.1.0_GENERIC_090615.0017.5407
Recently, we have seen some nice demos for Manager-Employees tree. Here is one @ http://jdevadf.oracle.com/dvt-faces-demo/faces/dvtTagGuide/ariaXml.jspx?_adf.ctrl-state=mmpgr9aco_4.
If I construct hierarchyViewer from master-detail view objects, I can't achieve dynamic levels. So I believe I need to create a treeModel binding to recursively generate the hierarchy.
Can someone kindly show me a working example for this implementation? Your help is highly appreciated. Now I have to reverse engineer it.
Sam
Edited by: user719281 on Sep 2, 2009 2:35 PM
Edited by: user719281 on Sep 2, 2009 2:35 PM
Hi Juan,
Thanks for the quick reply. I already have a similar example http://blogs.oracle.com/shay/2009/07/exploring_the_hierarchy_viewer.html and I made my code work.
However, I realize I must pre-define view objects (and their levels) to achieve this goal. What if I need to use managed bean to dynamically generate the hierarchy? In other words, the level of hierarchy is unknown at run time, the managed bean must be called recursively to generate the next level of nodes.
In the current source code,
<dvt:hierarchyViewer inlineStyle="width:100%;height:600px;" id="hv1"
value="#{bindings.EventsView1. *treeModel* }"
selectionListener="#{bindings.EventsView1. *treeModel* . *makeCurrent* }"
layout="hier_horz_left">
The hierarchyViewer seems to be built around treeModel but the closest I have found is Frank Nimphius's Re: Building a Tree Table using Recursive table
Without recursive calling, i don't think I can get similar hierarchy in http://jdevadf.oracle.com/dvt-faces-demo/faces/dvtTagGuide/ariaXml.jspx?_adf.ctrl-state=rka5d3wx6_9. I have been investigating this for last few days. Correct me if I am wrong :-) Thanks again!
sam
Edited by: user719281 on Sep 1, 2009 5:17 PM
Edited by: user719281 on Sep 1, 2009 5:18 PM
Similar Messages
-
Sample Java code and detail to call RFC from Java clas developed in Eclipse
Hi All,
I am new to Java. I have downloaded Eclipse IDE and planning to use for developing Java application to send data to SAP by calling RFC JCO Interface.
I need a sample java code/tutorial step by step to create Java class for simple example to call RFC from Java.
I have downloaded SAPJCO3 from service market place.
Kindly help me to send steps involved to configure for JCO with my Eclipse with JCO.
Thanks in advance.
SharmaHi Sharma,
Please have a look at [Example: Using Generated Proxies to Call Function Modules |http://help.sap.com/saphelp_nw04/helpdata/en/b6/55e3952a902447847066a0df27b0d6/content.htm]
JCo Exceptions : http://help.sap.com/saphelp_nw70ehp1/helpdata/en/f6/daea401675752ae10000000a155106/content.htm
Hope it will helps
Regards
Arun -
Sample java code which reads xml attributes using DOM Parser
Hi Friends,
I am looking for a sample java code which uses the DOM Parser to read the attributes values.
My xml looks like below
<?xml version='1.0' encoding='UTF-8'?>
<root>
<header unid="100" status="true">
<validation stage="1" processed="10"/>
</header>
</root>
Experts please help...
Thanks in Advance
JJYou have probably found lots of resources on the www for this by now, if not: [http://www.w3schools.com/dom/default.asp|http://www.w3schools.com/dom/default.asp]
-
Hi,
iam working in SAP .
I need sample java code on how to convert Decimal to number
For Ex: I/p-----123.11
O/p----------------12311 ( with out decimal) want to remove the dicimal point what ever the input value and deliver it to the output
Please give me code
Regards
Sumani don't know what do you want to do really. If you are doing it simply then you can take the input in a String and then remove the decimal.
String str = "123.11";
str = str.substring(0, str.indexOf("."));
System.out.println(str); -
Sample java code to obtain data from ALUI directory
Hi
I need to go to the ALUI LDAP ( directory ) services to get user profile information.
The documentation did not help me to figure out the way to obtain data from it.
so , it would be a great help if some one could share the sample java code api to obtain data from ALUI directory.i'm guessing you are asking to get the groups for a particular user. someone in the other thread posted the actual SQL, that may be easier. ( you are on 10gR3 right, because ALUI directory didn't exist before 6.5)
I dont have a sample done yet, but the internet is filled with samples of java and ldap...
http://www.coderanch.com/t/133108/Security/LDAP-sample-program -
Sample Java Code to send an HTML mail with embeded image
Hello,
Please can I get a sample Java code on sending an HTML mail with embeded image.
The HTML message and relevant input parameters withhbe supplied from a PL/SQL that will call the class , the class will embed the image and send the mail to the recepient.tev wrote:
Please can I get a sample Java codeNo. This is a forum, not a code mill.
Recommended reading: How to ask questions the smart way
db -
Sample JAVA code using Resource Adapter for RFC Connections
Hi Java Knowledgeable Ones.
I have successfully deployed the SAP Netweaver J2ee Engine "Resource Adapter for RFC Connections to ABAP Systems" to my Web Application Server. Now I need to develop a JAVA application that would utilize this deployed resource adapter. The resource adapter specifies the SAPClient, UserName, and password. I am thinking that the JAVA code to invoke this connection would therefore not need to provide this information as it should be available in the resource adapter.
Do you have sample code that you could send to me showing how to do this?
Thanks,
KevinHi Kevin,
this is actually no good style! You should not open the connection with the adaptor knowing the password. Usually it should work via a connection that uses only basic rights and the user has already authenticated and is using his security ticket.
For security handling see:
http://help.sap.com/saphelp_nw04/helpdata/en/61/f8bc3d52f39d33e10000000a11405a/frameset.htm
Regards,
Benny -
How to compile connection pool sample java code
I recently bought David Knox's "Effective Oracle Database 10g Security by Design", and have been working through his examples with client identifiers and how to leverage database security with anonymous connection pools.
The database side of things I totally understand and have set up, but I now want to compile/run the java code examples, but don't know what is required to compile this.
I'm running Oracle 10.2.0.4 (64-bit) Enterprise Edition on a Linux (RHEL 5) PC. Java version is 1.6.0_20. Relevant .bash_profile environment variables are as follows:
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin
When I try to compile, I get:
oracle:DB10204$ java FastConnect.java
Exception in thread "main" java.lang.NoClassDefFoundError: FastConnect/java
Caused by: java.lang.ClassNotFoundException: FastConnect.java
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: FastConnect.java. Program will exit.
The java source code of one of the examples is below. Is someone able to point me in the right direction as to how I get this to compile? Do I just have a syntax and/or environment configuration modification to do, or is there more to it than that to get this example working? Any help much appreciated.
oracle:DB10204$ cat FastConnect.java
package OSBD;
import java.sql.*;
import oracle.jdbc.pool.OracleDataSource;
public class FastConnect
public static void main(String[] args)
long connectTime=0, connectionStart=0, connectionStop=0;
long connectTime2=0, connectionStart2=0, connectionStop2=0;
ConnMgr cm = new ConnMgr();
// time first connection. This connection initializes pool.
connectionStart = System.currentTimeMillis();
Connection conn = cm.getConnection("SCOTT");
connectionStop = System.currentTimeMillis();
String query = "select ename, job, sal from person_view";
try {
// show security by querying from View
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery(query);
while (rset.next()) {
System.out.println("Name: " + rset.getString(1));
System.out.println("Job: " + rset.getString(2));
System.out.println("Salary: " + rset.getString(3));
stmt.close();
rset.close();
// close the connection which resets the database session
cm.closeConnection(conn);
// time subsequent connection as different user
connectionStart2 = System.currentTimeMillis();
conn = cm.getConnection("KING");
connectionStop2 = System.currentTimeMillis();
// ensure database can distinguish this new user
stmt = conn.createStatement();
rset = stmt.executeQuery(query);
while (rset.next()) {
System.out.println("Name: " + rset.getString(1));
System.out.println("Job: " + rset.getString(2));
System.out.println("Salary: " + rset.getString(3));
stmt.close();
rset.close();
cm.closeConnection(conn);
} catch (Exception e) { System.out.println(e.toString()); }
// print timing results
connectTime = (connectionStop - connectionStart);
System.out.println("Connection time for Pool: " + connectTime + " ms.");
connectTime2 = (connectionStop2 - connectionStart2);
System.out.println("Subsequent connection time: " +
connectTime2 + " ms.");
}Code download is at: http://www.mhprofessional.com/getpage.php?c=oraclepress_downloads.php&cat=4222
I'm looking at Chapter 6.stuartu wrote:
When I try to compile, I get:
oracle:DB10204$ java FastConnect.java
Exception in thread "main" java.lang.NoClassDefFoundError: FastConnect/java
Caused by: java.lang.ClassNotFoundException: FastConnect.java
I will try to explain what is happening here.
You are launching java telling it to run a class named 'java' in a package named 'FastConnect'
and java says it cannot find that class.
What you intended to do:
$ # make the directory structure match the package structure
$ mkdir OSBD
$ # move the source file in the directory structure so it matches the package structure
$ mv FastConnect.java OSBD/
$ # compile OSBD/FastConnect.java to OSBD/FastConnect.class
$ javac OSBD/FastConnect.java
$ # launch java using the OSBD/FastConnect class
$ java -cp . OSBD.FastConnectNote that the package 'OSBD' does not follow the recommended naming conventions
you might consider changing that to 'osbd'. -
Sample java code for web service calling
Hello,
I need to call the web services for adding/updating records on Oracle On Demand Entities.
In particular i need a sample code in java language that explain how to append the sessionid
to the SOAP request when calling the web service.
thanks in advance.Hi,
Each time you perform any SOD Operation after Login, ensure have your JSessionId attached to your actual Web Service URL like in example below
wsLocation ="https://secure-XXXXX.crmondemand.com/Services/Integration";
jsessionId="8d928e8330d53c6f954b16194731bad78f5f111c2043.e34PaxyNchuLe34Rax4SchaKchz0n6jAmljGr5XDqQLvpAe";
String url=wsLocation + ";jsessionid=" + jSessionId;
Use this url for all your future SOD Operation till you logout.
Regards
Deepak H Andeli -
i have installed new oracle 10g express edtion.
so tell me the code of jdbc.
my computer in LAN . so i want to install oracle 10g XE into remote computer. so tell me the process of remote connectivity with JDBC code;
from
VIVEK KUMAR KANAUJIA
Kanpur(UP)(INDIA)
E-MAIL: [email protected]Hi,
Each time you perform any SOD Operation after Login, ensure have your JSessionId attached to your actual Web Service URL like in example below
wsLocation ="https://secure-XXXXX.crmondemand.com/Services/Integration";
jsessionId="8d928e8330d53c6f954b16194731bad78f5f111c2043.e34PaxyNchuLe34Rax4SchaKchz0n6jAmljGr5XDqQLvpAe";
String url=wsLocation + ";jsessionid=" + jSessionId;
Use this url for all your future SOD Operation till you logout.
Regards
Deepak H Andeli -
Looking for sample code to create my own pub/sub!
I am a new bee in JMS. So I would really appreciate if
some one could give me some hint to start up with my school project. I am looking for a sample Java code that will:
For the Publisher:
1. Connect to a broker [create it, if it does not exist]
2. Create a publisher/destination.
3. Create a pub-sub queue
4. Publish a message
5. Ack or Nak depending on if the subscriber got or did not get the message.
For the Subscriber:
1. Connect to a broker [create it, if it does not exist]
2. Subscribe to the broker
3. Subscribe to the Queue
4. Show an received messages on the console.
Here are the command line params for both the Publisher and subscriber:
runPub 127.0.0.1:7676 myTestBroker myQueue "this is my message"
runSub 127.0.0.1:7676 myTestBroker myQueue
Please tell me if there are similar java code that will do all this and work with ANY JMS compatible client. i.e. I should not have to use the Admin tool of any JMS Server (MQSeries, iPlanet, SonicMQ etc etc). The code should follow the JMS spec and do this programmatically.
Thank you very very much in advance for doing this great favor.
With regards,
Amir.Thanks a lot for that hint. I think that's a great tutorial for a beginner. I could compile those sample codes from chapter 4 with out any problem, but could not run it. I also installed j2sdkee1.3.1 and updated my classpath according to the spec. But when I tried to run the "j2ee -verbose" command it was giving me the following error message:
ERROR: Set J2EE_HOME before running this script.
Any advise for me that I should follow next. Thanks again. -
Java code for logging from servlet on AS
Hi guys,
I have developed a servlet on SAP AS and I need to log information from processing. Can you please suggest me the best way to do that? I am not an Java expert but when I see the code I'd understand it. Can you please provide some Java logging example code which would work on AS 7.3?
Thanks a lot,
PeterHi Peter,
Please have a look of the below logging links/docs
Sample Java Code with Logging - Using Central Development Services - SAP Library
Tracing and Logging - SAPNetWeaver Application Server Java Security Guide - SAP Library
Integrating Third-Party Logging Frameworks into SAP NetWeaver CE
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20ecb0f4-ccb0-2a10-46aa-ceee8895f34b?QuickLink=index&overridelayout=true&25009594565056
Or
You can simply use System.err.println() or System.out.println()
Thanks,
Hamendra -
Logging Not Working in Java Code
Hi everyone,
I'm looking into the Java code for the Portal app, and I'm trying to do some debugging as to what's going on. I see a lot of the Adobe classes use the log4j Logger to output general logging information as well as errors, but there never seems to be any output in the log files. The files I'm checking for activity are:
Adobe LiveCycle ES2\jboss\server\lc_turnkey\log\server.log
Adobe LiveCycle ES2\jboss\bin\correspondencemanagement.log
When I build and deploy the application onto the LC server, just before my application starts I get the following line in the server.log:
2011-04-29 14:30:49,055 INFO [STDOUT] **** No servlet context set in ServletLogTarget - logging disabled.
followed by a message saying that my application has started. The line above happens everytime I re-deploy the application (without actually running the app), right before it starts, so I'm assuming that it is directly related to my application.
The only 'com.adobe' related logging lines that happen in the correspondencemanagement.log file are written when I physically run the app, and I get the following line:
2011-04-29 14:31:34,298 69729 INFO [com.adobe.dct.service.impl.DataDictionaryRegistryServiceImpl] Fetching Complete Data Dictionary object graph.
Looking into the code for the com.adobe.dct.service.impl.DataDictionaryRegistryServiceImpl class, I see it uses a completely different logging system (ie not log4j).
*sigh*
I've changed the services-config.xml file and tried setting the logging target to both flex.messaging.log.ServletLogTarget and flex.messaging.log.ConsoleTarget, but neither seem to make a difference.
I must be missing some kind of configuration to get the logging to work correctly, but Google has been little help as well.
Hopefully someone has crossed this issue before, and has a solution? Any help / pointers / advice etc welcome and appreciated!!!
Thanks,
KristianThanks for the reply Saket.
It turns out that the logging was working correctly all along. The messages I could not find were all related to bootstrap code. I was assuming that the bootstrapper would run each time the application was deployed, or at the very least each time the server was started. It turns out that you manually need to run the bootstrapper. So I was looking for log lines that would never appear by themselves. Once I manually ran the bootstrap process, the log lines ran as expected.
Cheers,
K. -
OIM should send spmlv2 requests via java code to service provider
Hi,
We have the situation in which OIM acts as Requesting authority,Spml provider acts as service provider.
Oim should send spml requests from custom java code.Spml2Client is used.We are not using genericc technology connector.
Require sample java code for Search operation.
I had done for modify request.
The request and response is as follows
PSO ID returned after searching: org.openspml.v2.msg.spml.PSOIdentifier@5c32a864
<deleteRequest xmlns='urn:oasis:names:tc:SPML:2:0' recursive='false'/>
<deleteResponse xmlns='urn:oasis:names:tc:SPML:2:0' status='success'/>
<modifyRequest xmlns='urn:oasis:names:tc:SPML:2:0' returnData='identifier'>
<psoID ID='cn=TPS User8,ou=TPS,dc=fosterstechodc,dc=com'/>
<modification modificationMode='replace'>
<data>
<dsml:modification xmlns:dsml='urn:oasis:names:tc:DSML:2:0:core' name='otherHomePhone' operation='replace'>
<dsml:value>999999</dsml:value>
</dsml:modification>
</data>
</modification>
<modification modificationMode='delete'>
<data>
<dsml:modification xmlns:dsml='urn:oasis:names:tc:DSML:2:0:core' name='description' operation='delete'>
</dsml:modification>
</data>
</modification>
<modification modificationMode='add'>
<data>
<dsml:modification xmlns:dsml='urn:oasis:names:tc:DSML:2:0:core' name='firstname' operation='add'>
<dsml:value>Barbara</dsml:value>
</dsml:modification>
</data>
</modification>
</modifyRequest>
SpmlClient: sending to http://10.101.151.209/ARServerSPML/SPMLProvider.asmx
<modifyRequest xmlns='urn:oasis:names:tc:SPML:2:0' returnData='identifier'>
<psoID ID='cn=TPS User8,ou=TPS,dc=fosterstechodc,dc=com'/>
<modification modificationMode='replace'>
<data>
<dsml:modification xmlns:dsml='urn:oasis:names:tc:DSML:2:0:core' name='otherHomePhone' operation='replace'>
<dsml:value>999999</dsml:value>
</dsml:modification>
</data>
</modification>
<modification modificationMode='delete'>
<data>
<dsml:modification xmlns:dsml='urn:oasis:names:tc:DSML:2:0:core' name='description' operation='delete'>
</dsml:modification>
</data>
</modification>
<modification modificationMode='add'>
<data>
<dsml:modification xmlns:dsml='urn:oasis:names:tc:DSML:2:0:core' name='firstname' operation='add'>
<dsml:value>Barbara</dsml:value>
</dsml:modification>
</data>
</modification>
</modifyRequest>
SpmlClient: received
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><modifyResponse status="failure" xmlns="urn:oasis:names:tc:SPML:2:0"><error>malformedRequest</error><errorMessage>At least one <modification> element must be specified.</errorMessage></modifyResponse></soap:Body></soap:Envelope>
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><modifyResponse status="failure" xmlns="urn:oasis:names:tc:SPML:2:0"><error>malformedRequest</error><errorMessage>At least one <modification> element must be specified.</errorMessage></modifyResponse></soap:Body></soap:Envelope>
org.openspml.v2.util.Spml2ExceptionWithResponse: At least one <modification
The response says the modifaction tag is not present.
The code for this request is
Modification[] modifications =
{ newModWithDSMLMod("otherHomePhone", "999999", ModificationMode.REPLACE),
newModWithDSMLMod("description", null, ModificationMode.DELETE),
newModWithDSMLMod("cn", "Barbara", ModificationMode.REPLACE)};
modifyResp = customSPMLClient.modifyUser(client,searchPSOId,modifications);
method:
public ModifyResponse modifyUser(Spml2Client client,PSOIdentifier psoId,Modification[] modifications) throws Exception {
client.setTrace(true);
ReflectiveXMLMarshaller marshaller = new ReflectiveXMLMarshaller();
ModifyRequest modReq = new ModifyRequest(null, // String requestId,
null, // ExecutionMode executionMode,
psoId, // PSOIdentifier psoID
modifications, // Modification[] modifications
ReturnData.IDENTIFIER // ReturnData returnData
System.out.println(modReq.toXML(marshaller));
ModifyResponse modResp = (ModifyResponse) client.send(modReq);
System.out.println(modResp.toXML(marshaller));
return modResp;
private static Modification newModWithDSMLMod(String modName, String modValue, ModificationMode modMode)
throws DSMLProfileException
/*DSMLModification dsmlMod = null;
dsmlMod = new DSMLModification(modName, modValue, modMode);
Extensible data = new Extensible();
data.addOpenContentElement(dsmlMod);
Selection component = null;
return new Modification(component, data, null, modMode);
Please help me out.
I need sample java code for search operation tooo.
regards,
Sindhu.Mthe sample JAVA codes are provided for sending SPML requests, HTTPClient and one more (i dont remember rite now) within the OIM installation folders itself. It's in the 'SampleHttpClient' folder. Check it once. WSDL, sample XML's and the JAVA codes all are there. You just need to set the classpath and run it.
- oidm. -
Rendering HTML JSF Component via java code
Hey,
I was wondering,
I want to build sort of HTML generator (for a very specific process),
I thought about taking the advantage of JSF components instead of writing an HTML generator,
Is it possible to render Html JSF Components via simple java class?
For instance, assuming I built an 'HtmlDataTable' object with columns, inputs, etc...
I'd like to render the dataTable as HTML and get the HTML tags via a simple java class,
Thanks.the sample JAVA codes are provided for sending SPML requests, HTTPClient and one more (i dont remember rite now) within the OIM installation folders itself. It's in the 'SampleHttpClient' folder. Check it once. WSDL, sample XML's and the JAVA codes all are there. You just need to set the classpath and run it.
- oidm.
Maybe you are looking for
-
USING TWO AIRPORT EXTREMES (802.11N) INTERNET IS VERY SLOW
I live in a 5000sq ranch in arizona and have our internet set up in one end of the house. We have an airport extreme 802.11n and it wasnt putting out a good signal to the other end of the house so we got another airport extreme and airport express to
-
Sort albums by descending year - itunes unable to play album
I prefer my albums to be displayed in itunes with the latest albums first. So I use grid view albums and set 'sort by' to 'descending'. When i select an album to play it will play the first track but the track numbers are ALSO in descending order an
-
Hello, One of our client has E-Commerce 5.0 and TREX 7.1 integrated and web shop is working fine. They are looking forward to integrate online price list. Current scenario - They have a Z table (50,000 records) which has all the pricing relevant reco
-
Loaded Infoobject Text and it returned all "#"
Hi BW guys, I encountered a strange text issue. In BW QA envoriment all the Text Datasources without a language key loaded all text as "#" in PSA. Meanwhile, the datasource with language key works well. In ECC QA side I could extract correct text wi
-
I want to start my page number to start with only at the Main section only. When I selected the default page no , my main ape starts with page 2(I have one page header and one page trailer). How can make the Min section to start with page 1 Thanks fo