Java API Calls for command line operations

I would like to use the command line operations programmatically from Java, or PL/SQL.
I would like to parse a XML file. From DOS Command line I can issue a ifsput test.xml and I can have the file parsed and stored in the database.
Can I do the same thing programmatically using java or plsql from database.
Thanks
Ramna

The following code allows you to parse an XML file. In this case it parses a string containing a SimpleUserDefinition.
package ifs.demo.common.users;
import oracle.ifs.beans.*;
import oracle.ifs.beans.parsers.Parser;
import oracle.ifs.beans.parsers.SimpleXmlParser;
import oracle.ifs.common.*;
import java.io.File;
import java.io.StringReader;
import java.io.FileNotFoundException;
import ifs.demo.vcard.type.Vcard;
import ifs.demo.vcard.parser.VcardParser;
import java.util.Locale;
import java.util.Hashtable;
public class UserCreator extends Object {
private static LibrarySession getConnection(String user,String password,String serviceName, String schemaPassword)
throws IfsException
LibraryService service = new LibraryService();
CleartextCredential me = new CleartextCredential(user,password);
ConnectOptions connect = new ConnectOptions();
connect.setLocale(Locale.getDefault());
connect.setServiceName(serviceName);
connect.setServicePassword(schemaPassword);
return service.connect(me,connect);
private static void createUser(LibrarySession ifs)
throws IfsException
String simpleUserString = "<?xml version = '1.0' standalone = 'yes'?>\n"
+ "<SimpleUser>\n"
+ " <UserName>TestUser2</UserName>\n"
+ " <Password>ifs</Password>\n"
+ " <HomeFolderRoot>/home</HomeFolderRoot>\n"
+ "</SimpleUser>\n";
StringReader userDefinition = new StringReader(simpleUserString);
SimpleXmlParser xmlParser = new SimpleXmlParser(ifs);
xmlParser.parse(userDefinition,null,null);
public static void main(String[] args)
try {
LibrarySession ifs = getConnection("system","manager","IfsDefault","manager");
ifs.setAdministrationMode(true);
createUser(ifs);
} catch (IfsException e) {
IfsException.setVerboseMessage(true);
e.printStackTrace();
Note that you ask about doing this from the database. If you mean that you want to run this code from inside the database the answer is not supported in 1.1. What you would need to do is use Oracle Advanced QUeuing to send a message, containing the XML to a process running outside the database and have that process connect to iFS and perform the parsing.
null

Similar Messages

  • Calling linux command line in Java

    Hi guys,
    I met a problem about calling linux comand in java program.
    In linux, I type :
    similarity.pl -type WordNet::Similarity::vector -file /home/csunix/fzsu/exam.txt
    it returns:
    Loading WordNet... done.
    Loading Module... done.
    good#a#1 nice#a#1
    good#a#1 nice#a#1 0.885813537770033
    dog#n#1 cat#n#1
    dog#n#1 cat#n#1 0.712603873475428
    good#a#6 nice#a#1
    good#a#6 nice#a#1 0.822428178005622
    From above, we can see that it works well, similarity.pl is a perl program for computing similarity between two concept, and -type and -file are the parameters.
    Now I want to use java to call these command, and here is my code:
    public static void main(String[] args) {
    try{
    String command="similarity.pl -type WordNet::Similarity::vector -file /home/csunix/fzsu/exam.txt";
    Process p=Runtime.getRuntime().exec(command);
    BufferedReader br=new BufferedReader(new InputStreamReader(p.getInputStream()));
    String line=null;
    while ((line=br.readLine())!=null){
    System.out.println(line);
    }catch (IOException ex){
    ex.printStackTrace();
    But noting is print out. I also add the full path for similarity.pl, like /home/csunix/fzsu/similarity.pl in the variable "command", but still the same.
    I also change variable "command" to a string array in this way:
    String command[]={"/home/csunix/nlplib/WordNet/2.1-F7/perl/bin/similarity.pl",
                        "-type","WordNet::Similarity::vector","-file","/home/csunix/fzsu/exam.txt"};
    Again, I get nothing from it.
    Can anyone point out how to solve this problem?
    Thanks,
    Joe

    Crosspost.
    Don't do this if you want help!
    This question is answered on "New to Java".

  • Command line operations in java

    hi there,
    is it possible to create a java program that can perform a specified command line operation?
    regards

    hi there,
    is it possible to create a java program that can
    perform a specified command line operation?
    regardsYes, thats what the String[] args in public static void main(String[] args) is for.

  • Any API's or command line utilities for accessing Beehive Groups

    Hi, I have an internally developed application that has it's own list of users. I am wondering if I can leverage Beehive groups by programmatically accessing groups in order to enumerate their members. Does any one know of anyway API's or command line utilities to access this information ?

    We got API and command line utilities in ST Beehive and Beehive Online but its access is restricted to Product Development IT group.
    Thanks,
    Jereen

  • How to change a setting in the Java Control Panel with command line

    Hi,
    I am trying to figure out how to change a setting in the Java Control Panel with command line or with a script. I want to enable "Use SSL 2.0 compatible ClientHello format"
    I can't seem to find any documentation on how to change settings in the Java Control Panel via the command line
    Edited by: 897133 on Nov 14, 2011 7:15 AM

    OK figured it out. This is for the next person seeking the same solution.
    When you click on the Java Control Panel (found in the Control panel) in any version of Windows, it first looks for a System Wide Java Configuration (found here: C:\Windows\Sun\Java\Deployment). At this point you must be wondering why you don't have this folder (C:\Windows\Sun\Java\Deployment) or why its empty. Well, for an enterprise environment, you have to create it and place something in it - it doesn't exist by default. So you'll need a script (I used Autoit) to create the directory structure and place the the two files into it. The two files are "deployment.properties" and "deployment.config".
    Example: When you click on the Java Control Panel it first checks to see if this directory exists (C:\Windows\Sun\Java\Deployment) and then checks if there is a "deployment.config". If there is one it opens it and reads it. If it doesn't exist, Java creates user settings found here C:\Users\USERNAME\AppData\LocalLow\Sun\Java\Deployment on Windows 7.
    __deployment.config__
    It should look like this inside:
    *#deployment.config*
    *#Mon Nov 14 13:06:38 AST 2011*
    *# The First line below specifies if this config is mandatory which is simple enough*
    *# The second line just tells Java where to the properties of your Java Configuration*
    *# NOTE: These java settings will be applied to each user file and will overwrite existing ones*
    deployment.system.config.mandatory=True
    deployment.system.config=file\:C\:/WINDOWS/Sun/Java/Deployment/deployment.properties
    If you look in C:\Users\USERNAME\AppData\LocalLow\Sun\Java\Deployment on Windows 7 for example you will find "deployment.properties". You can use this as your default example and add your settings to it.
    How?
    Easy. If you want to add *"Use SSL 2.0 compatible ClientHello format"*
    Add this line:
    deployment.security.SSLv2Hello=true
    Maybe you want to disable Java update (which is a big problem for enterprises)
    Add these lines:
    deployment.javaws.autodownload=NEVER
    deployment.javaws.autodownload.locked=
    Below is a basic AutoIt script you could use (It compiles the files into the executable. When you compile the script the two Java files must be in the directory you specify in the FileInstall line, which can be anything you choose. It will also create your directory structure):
    #NoTrayIcon
    #RequireAdmin
    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_UseX64=n
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    Func _JavaConfig()
         $ConfigFile_1 = @TempDir & "\deployment.properties"
         $ConfigFile_2 = @TempDir & "\deployment.config"
         FileInstall ("D:\My Documents\Autoit\Java config\deployment.properties", $ConfigFile_1)
    FileInstall ("D:\My Documents\Autoit\Java config\deployment.config", $ConfigFile_2)
         FileCopy($ConfigFile_1, @WindowsDir & "\Sun\Java\Deployment\", 9)
         FileCopy($ConfigFile_2, @WindowsDir & "\Sun\Java\Deployment\", 9)
         Sleep(10000)
         FileDelete(@TempDir & "\deployment.properties")
         FileDelete(@TempDir & "\deployment.config")
    EndFunc
    _JavaConfig()
    Now if you have SCUP and have setup Self Cert for your organization, you just need to create a SCUP update for JRE.
    Edited by: 897133 on Nov 16, 2011 4:53 AM

  • Where can I get a java API specification for jdk 6 update 7?

    Where can I get a java API specification for jdk 6 update 7?
    About jdk-6u7-windows-i586-p.exe

    Flying_eagle wrote:
    I don't know what is it called. I think maybe it's a specification about api that lists java api and explains how to use them.
    Such as a html file just like a dictionary.Well, the API documentation I posted a link of in reply #1 is not an explanation of how to use the Java classes. It is more a reference. When you need a thorough explanation, I recommend doing some tutorials, or buying a book.

  • Since updating to OS X Mavericks I get a continuous update request for command line developer tools.  How do I stop this?

    Since installing OS X Mavericks, automatic updates keep producing download demand for Command Line Developer tools 6.0 and 6.1.  I don't need these but cannot seem to stop the updates available, even if they are downloaded and installed.  Can anyone tell me how to stop this?

    Try re-indexing Spotlight.
    Spotlight – Re-index

  • Financial Reporting - Exporting Batch for Command Line Scheduling Issue

    Financial Reporting 11.1.2.2
    When I export, a successfully run scheduled batch, for command line scheduling the xml file that is exported only has the following information in it. I think that it is missing alot of information.
    Any ideas what I am doing wrong, if anything?
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <JOB_OBJECT OBJECT_ID="0">
    <DATA_SOURCE_USER_CREDENTIALS DS_PASSWD="" DS_USER_NAME=""/>
    <HR_USER_CREDENTIALS HR_PASSWD="" HR_USER_NAME=""/>
    <OUTPUT_OPTIONS>
    <HTML VALUE="No"/>
    <MHTM VALUE="No"/>
    <PDF EXPORT_PDF_FOLDER_LABEL="" VALUE="Yes"/>
    <SAVE_AS_SNAPSHOT VALUE="No"/>
    <PRINT VALUE="No"/>
    </OUTPUT_OPTIONS>
    </JOB_OBJECT>

    Hi again,
    I am not sure if you can extract the formatting to Excel... I had also issues.
    Can you please try to retrieve the report into Excel via Smartview? Check page 136 of  http://docs.oracle.com/cd/E40248_01/epm.1112/smart_view_user.pdf
    Regards,
    Thanos

  • Api call for "browse pages" popup window?

    Hi,
    Is there a supported API call for rendering the "browse pages" popup window? The one that appears when you use the "go to page" link.
    We used to call wwsbr_explorer.display but this call has changed in 10.1.4 to wwsbr_explorer_ui.display...
    Thanks, Tony

    closed !
    Please use the other thread.

  • Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile

    Where can I find "Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile"?
    Thanks a lot for your time.

    Hi, this is referring to the JavaDocs for Java methods/classes supported by ADF Mobile. You can typically right (or ctrl) click on any ADF Mobile specific Java method and select "JavaDoc". You can open up a sample app that contains any Java class - for example the HR sample app, and find any method with name "adfmf*". You should be able to see the Java doc for the ADF Mobile related methods/classes.
    Thanks,
    Joe Huang

  • Java API docs for MapViewer

    I'm looking for the Java API docs for the oracle.lbs.mapclient.MapViewer bean.
    The mapviewer .pdf file has an API section, but only inludes descriptions of some of the arguments passed to the various methods. I'm using the 9.04 release - where should I look for these docs and/or source code?
    Thanks,
    Eric Everman
    USGS

    OK - I found them. They are part of the 9.04 kit as part of the web application.
    ***NOTE: It would be if oracle had all of its javadoc in one location, rather then rely on installations to provide docs.***
    If others are looking for them, they are available as part of the installed web application at:
    host:port:context/mapclient
    Or, if you want file access to them, unzip the mapviewer.ear file that comes with the kit. From that unzip the web.war file. The viewerbean API docs are then located in the mapclient subdirectory.

  • I need Java API documentation for Adapter Modules

    Hi
    Please provide me Java API documentation for Adatper Modules
    Regards
    Sowmya

    Use this
    https://help.sap.com/javadocs/pi/SP3/xpi/index.html
    http://help.sap.com/saphelp_nw04/helpdata/en/87/3ef4403ae3db12e10000000a155106/frameset.htm
    which is part of
    http://help.sap.com/saphelp_nw04/helpdata/en/8b/895e407aa4c44ce10000000a1550b0/frameset.htm
    Regards,
    Prateek

  • Requesting API calls for Windows 10's virtual desktops

    Please add API calls for working with Windows 10's virtual desktops, for example, a way to determine which virtual desktop a particular window is on and which virtual desktop is active.
    The problem can be seen using the Snipping Tool. Open the tool and select a
    New / Window Snip. As you move the mouse around, the snipping tool
    highlights areas where there is no window, but there is a window in another virtual desktop.
    First desktop, Snipping Tool highlights and empty area ...
    Second desktop...
    It's because Snipping Tool has no way to know which virtual desktop a particular window is on.
    Thanks!

    Thanks, been there, did that, but there's no way to know if Microsoft listened or provided a solution :-(
    Hi GoVideo,
    Currently, Windows 10 is still in the Technical Preview stage, Microsoft will collect all feedbacks and evaluate them guardedly.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • JAVA API Calls

    Hi All,
    you may elaborate on What is Java API Calls and send me stuff onthat, suggest me online trainings on tht. Thanks in Advance.

    A good place to start is :- http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/html_esb_api/topapilist.htm
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • API call for launching Sun Java System Application Server

    Hi,
    I want to use an API call to start the Sun Application server, so that the server runs in the same JVM as my java aplication.
    Please advise me how to do this.
    Thank you
    Komal

    Here is sample code to start application server if you are using SJSAS Platform Edition 8.1 2005Q2 Update 2
    http://docs.sun.com/app/docs/doc/819-2642/6n4tspp9t?a=view#beaps

Maybe you are looking for