How to get UCM content from Java class?

Hello,
I need to get UCM content from backend I mean from the Java class. Is there any way to do that? If anybody please give any resources it will be very helpful.
Thanks and regards.

Hi
You mean to say that with JAVA API you want to search and retrieve the contents ? If yes , then you should use RIDC API for the same and that way you can use to do all the operations on UCM from the JAVA Api .
Search this forum and you will get sample codes for the checkin , search , checkout operations .
Documentation is available at : http://docs.oracle.com/cd/E14571_01/doc.1111/e16819/toc.htm
Thanks
Srinath

Similar Messages

  • How to get stylesheet object from JAVA RESOURCE stored in DB

    Hi,
    I stored a xslt file in the database and have a JAVA RESOURCE file now. How can i get a stylesheet object from this resource file?
    I took the following class to get an impression how to get the contents of the resource but -although the name of the resource was spelled correctly- i got a file not found exception.
    Whats wrong?
    public class PrintRessource {
    public static void print (String p_ressource){
    try {
    Class c = PrintRessource.class;
    System.out.println(c.toString());
    InputStream file = c.getResourceAsStream(p_ressource);
    if (file == null)
    throw new FileNotFoundException("XSLT file not in DB");
    byte[] buffer = new byte[4096];
    int bytes_read;
    while ((bytes_read = file.read(buffer)) != -1)
    System.out.println(new String(buffer, 0 , buffer.length));
    catch (Exception exp) {
    System.out.println(exp);
    Thanks

    The code works as is. I just forgot to add the slash in front of the Resource file name.

  • How to get php content with java ??

    i have made a php file what will display a number,
    here's a example
    <?php
    if ($action == "answer"){
    echo "18274926";
    ?>
    no i want to get the number with java
    so here's my java code
    import java.io.*;
    import java.net.*;
    import java.util.Date;
    class URLConnecties
        public static void main(String args[]) throws Exception
            int teken;
            URL url = new URL("http://www.gamer.mineurwar.nl/net/javachallenge.php?command=DaTe");
            URLConnection urlconnection = url.openConnection();
            System.out.println("Type inhoud: " +
                urlconnection.getContentType());
            System.out.println("Datum document: " +
                new Date(urlconnection.getDate()));
            System.out.println("Laatst gewijzigd: " +
                new Date(urlconnection.getLastModified()));
            System.out.println("Document vervalt: " +
                urlconnection.getExpiration());
            int lengteinhoud = urlconnection.getContentLength();
            System.out.println("Lengte inhoud: " + lengteinhoud);
            if (lengteinhoud > 0) {
                InputStream in = urlconnection.getInputStream();
                while ((teken = in.read()) != -1) {
                    System.out.print((char) teken);
                in.close();
    }if you change the url ro a .html file it displays the code correctly(source),
    but when trying to get the content of a php file (the number)
    it says that there is no content from the php file
    yhe source of the original php file what's in the code can be found at
    www.gamer.mineurwar.nl/net/javachallenge.txt

    The 'content' is generated dynamically by a PHP script so the "content lenght" can't be known in advance by the server. For this reason connection.getContentLenght() returns -1; it doesn't mean that there is no content, only that it can't be known how much there will be.
    To solve the issue, remove the if statement from around the while-loop:// if (lengteinhoud > 0) { DELETE THIS LINE
    InputStream in = urlconnection.getInputStream();
    while ((teken = in.read()) != -1) {
        System.out.print((char) teken);
    // } and this too

  • How to get return value from Java runtime.getRuntime.exec?

    I'm running shell commands from an Oracle db (11gr2) on aix.
    But, I would like to get a return value from a shell comand... like you get with "echo $?"
    I use a code like
    CREATE OR REPLACE JAVA SOURCE NAMED common."Host" AS
    import java.io.*;
    public class Host {
      public static int executeCommand(String command) {
        int retval=0;
        try {
            String[] finalCommand;
            finalCommand = new String[3];
            finalCommand[0] = "/bin/sh";
            finalCommand[1] = "-c";
            finalCommand[2] = command;
          final Process pr = Runtime.getRuntime().exec(finalCommand);
          pr.waitFor();
       catch (Exception ex) {
          System.out.println(ex.getLocalizedMessage());
          retval=-1;
        return retval;
    /but I do not get a return value... because I don't know how to get return value..
    Edited by: user9158455 on 22-Sep-2010 07:33

    Hi,
    Have your tried pr.exitValue() ?
    I think you also need a finally block that destroys the subprocess
    Regards
    Peter

  • af:chooseDate - how to get selected month in java class

    <af:chooseDate id="choose_date_ID"
    binding="#{EventsBackingBean.choose_date_ID}">
    </af:chooseDate>
    in adf ,how to get the selected month value in the component.
    and if we change the the month from the drop down,then again new value should be reflected in java class.

    Hi Hoque,
    As per the documentation of af:choose at http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e12419/tagdoc/af_chooseDate.html
    "In order to indicate that a particular inputDate should be updated in response to chooseDate selection changes, the the inputDate's "chooseId" attribute must be set to the id of the associated chooseDate component.ts mentioned that the the af:choose "
    So, i believe that if you can create a binding to the af:inputDate component in your backing bean, you can extract the newly selected date in a ValueChangedListener using the getValue() function on the bound component.
    private RichInputDate chooseDateInput;
        public void setChooseDateInput(RichInputDate chooseDateInput) {
            this.chooseDateInput = chooseDateInput;
        public RichInputDate getChooseDateInput() {
            return chooseDateInput;
        public void chooseDateInput(ValueChangeEvent valueChangeEvent) {
          Date selectedDate = (Date)chooseDateInput.getValue();
        }Regards,
    Ryan

  • How to get private fields from super class?

    Hi.
    I must get protected and private fields from a class. I know that sounds werid but I have a very good reason for doing so, ask if you want.
    I have tried the getDeclaredField(String) method, but it apparently doesn't return the fields declared by the super classes.
    What's the smartest solution to this?
    Thank you all.
    edit: note that the superclass hierarchy's length is 3 and that there are several classes at the bottom level.
    Edited by: bestam on Sep 24, 2009 2:05 PM

    bestam wrote:
    I do not claim I have invented a new programming language Sir, you must be mistaken. This is not turing complete.
    This is a language for describing Cards or a game's rules if you want.
    AspectJ isn't Turing complete but AspectJ is still a compiler.
    This is how I have been working :
    - I have implemented the core library in Java (what is a Player, what is an Effect, what is a Card, what is a BuildingCard, what is a Player's Turn and so on)
    - It also includes packages dedicated to service, able to retrieve and send data to the clients via sockets.
    - Then I have "hardcoded" a dozen of specific cards in Java, for testing and validating the core library. I have been doing so by extending the BuildinCard's class for example.
    - But my ultimate goal is not to code thoses 1.000+ cards of the game in Java. I chosed to design a little language so that I would end up writing cards faster. While I'm traversing the syntactical tree representing the card, I feed the card's fields one by one. Some of them are quite primitive, some other are more complex and have a recursive nature for instance.
    Providing detail for how you implemented it doesn't change anything about what I already said.
    Thus, this is not really a compiler as it doesn't transform a text in language A into a text in language B.
    You really need to understand more about what "compilers" and certainly compiler theory do before you decide what they can and cannot do.
    And your statement still does not change what I said.
    Is this wrose than the bean design pattern from JSP ? I'm not sure.
    Bean design? A "bean" has almost zero requirements.
    Aside of that, it's a bit harsh to be told "read the fucking manual" while I have written my first compiler some years ago.Not sure who that was directed. I suggested some reading material on compiler theory.
    If you think that your idea is ideal then knock yourself out. Since I doubt I will end up seeing it in anything that I must maintain it doesn't matter to me. But you did in fact ask what the best solution was.

  • 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 array values from one class to another

    Supposing i have:
    - a class for the main()
    - another for the superclass
    And i want to create a subclass that does some function on an array object of the the superclass, how can i do so from this new subclass while keeping the original element values?
    Note: The values in the array are randomly generated integers, and it is this which is causing my mind in failing to comprehend a solution.
    Any ideas?

    If the array is declared as protected or public in the superclass you can directly access it using its identifier. If not, maybe the superclass can expose the array via some getter method.
    If this functionality can be generified (or is generic enough) to apply to all subclasses of the superclass the method should be moved to the superclass to avoid having to reproduce it in all the subclasses.

  • How to get the parameter from Java Script into the Parameter crystal Report

    Hi All,
    Crystal Report is integrated with Oracle 10g. I created the base SQL query for col1, col2, col3 and col4. Java Script pass parameter value (185) to Col1.
    My question is how to create crystal report to make Col1 as parameter and how to get the parameter value 185(Col1) from Java Script. Is there any additional code I need to include in the crystal report?
    FYI.
    Java script sends the right parameter value.There is no issue in java script.
    This is an automatic scheduled process when batch runs, Java script should pass the parameter value and the crystal report should get the value and produce the output report.

    Not sure if this is an application question or if you are trying to hook into Crystal Reports parameter UI? If the later then no option other than report design. If an application then I can move this to the Java Forums.
    If you are asking how to alter the parameters I suggest you remove the Java reference and post a new question so it's not confusing the issue.
    Please clarify?

  • How to get HttpServletResponse in a Java class?

    I have the following code:
    HttpServletResponse response = (HttpServletResponse)FacesContext.getCurrentInstance().getExternalContext().getResponse();
    This is usually used when there is a page with a method in the backing bean.
    What I have is a Java class, with no page. I want to alter the code above with something else in the right hand side.
    JDev version: 11.1.1.5.0

    My use case is :
    I want to run a job in Weblogic Server which will run a jasper report every 30 seconds.
    The job is called in a Generic java class which implements TimerListener.
    I am following the code in http://biemond.blogspot.de/2009/09/job-scheduling-in-weblogic.html .
    I have added a code in the Batch1 class to export the pdf file at every 30 seconds.
    For that, I need to get the HttpServletResponse object to be used in this class.
    Hope it's clear.

  • How to create .exe files from Java class files?

    I'm new to Java and I just wonder if it is possible to make executable files out of Java class files. I've checked the Java online help and several search engines, but I still couldn't find anything about that. Is it possible to do so? If not, why not?
    Thanx a lot for any help.

    I don't remember if there is a program that converts the class file,
    but I do know that there are a few that either convert the class file,
    or the .java file. You might try searching for ".java to .exe" in the
    search engine and seeing what that pulls up.

  • How to get oc4j version from Java program

    i have the following in my Java Program
    Runtime r = Runtime.getRuntime();
    Process p = r.exec("java -jar oc4j.jar –version");
    and then i try to read the InputStream from the Process p.
    but this line is not executing, it returns the following error.
    Unknown switch: ?version, type java -jar oc4j.jar -? for help
    if i change it to ----------
    Runtime r = Runtime.getRuntime();
    Process p = r.exec("java -jar $ORACLE_HOME/j2ee/home/oc4j.jar –version");
    then i get another error :
    Exception in thread "main" java.util.zip.ZipException: No such file or directory
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:112)
    at java.util.jar.JarFile.<init>(JarFile.java:127)
    at java.util.jar.JarFile.<init>(JarFile.java:65)
    but if i cd to /oracle/j2ee/home and then run the command java -jar oc4j.jar –version, then it gives me the right output with the right version, but for some reason the samething from inside the java program is giving me errors,
    please help. i just need to read the oc4j version running on the server and display it in JSP.

    Process p = r.exec("java -jar oc4j.jar –version");The character before "version" should be a hyphen; yours is not.
    Process p = r.exec("java -jar $ORACLE_HOME/j2ee/home/oc4j.jar –version");
    then i get another error : Exception in thread "main"
    java.util.zip.ZipException: No such file or directory
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:112)
    at java.util.jar.JarFile.<init>(JarFile.java:127)
    at java.util.jar.JarFile.<init>(JarFile.java:65)One more problem here: $ORACLE_HOME will be not be interpreted in the runtime.exec even if it is defined as an environment variable. So you get an error that tells you oc4j.jar is not found.
    Hope this helps you.

  • How to get iWeb content from MobileMe

    Hi,
    I'm usually making web projects with Adobe programs, but my own (more or less blog) I did it with iWeb ... to try this tool.
    Now I switched from iMac to MBP (yes, great present) and after a month I remembered this "iWeb project". Now when I start iWeb the only option is to choose a template, but I would like to connect to MobileMe account where I published my blog and work further on this ... is it possible somehow, or should I copy iWeb files from iMac to MBP?
    Regards,
    Matej

    What you will need is the domain.sites2 file that resides in your User/Library/Application Support/iWeb folder on the iMac. Copy it to the same folder on the MBP, replacing the one that's there now, and you will be good to go.
    If you want to work on the site from both computers this MacWorld article may be of some help: Managing an iWeb site from multiple Macs.
    If you don't have the domain file on the iMac or a backup copy of it you'll have to rebuild the site from scratch. If the site is a true blog you may lose the comments associated with it. Chapter 2.3 of the iWeb FAQ.org site has tips on using some of the published files in the reconstruction of the site.
    OT

  • How to get IP address from java applet

    is there anyway to find the IP address of a person who is on java applet on some chatting website (not me, but the other users)...... well, this question may sound stupid, but am actually new to this, so please help.
    :)

    >
    is there anyway to find the IP address of a person who is on java applet on some chatting website (not me, but the other users)...... >Sure. Ask whoever it is you are chatting to.. "wots ur ip?". Do not be surprised when they 'tell you where to go'.

  • How to set classpath from java class ??

    I have tried to use System.setProperty("java.class.path", "my class path string ") to set classpath dynamically. But it is not working. How to set it dynamically from java class ?? Thanks , gary

    Look into the java.net.URLClassLoader. You can't set the classpath after the fact but you can specify URL's that will checked when you try to load a class with that loader.

Maybe you are looking for