Run the Ant script using Java in webcenter Portal

Hi all

I have requirement where I have to run an ant script using java or by any means to the webcenter portal.

Ant script must be run on a triggering action.

Please help me in this direction.

Thank you and best regards,

Shakir

Hey all,.

Here is the solution, I had finally

BuildFile file = new File ("myBuild.xml");

Project p = new Project();

p.setUserProperty ("ant.file", buildFile.getAbsolutePath ());

ConsoleLogger DefaultLogger = new DefaultLogger();

consoleLogger.setErrorPrintStream (System.err);

consoleLogger.setOutputPrintStream (System.out);

consoleLogger.setMessageOutputLevel (Project.MSG_INFO);

p.addBuildListener (consoleLogger);

p.init ();

ProjectHelper helper = ProjectHelper.getProjectHelper ();

p.addReference ("ant.projectHelper", assistance);

Helper.Parse (p, buildFile);

p.executeTarget (p.getDefaultTarget ());

Kind regards

Shakir

Tags: Fusion Middleware

Similar Questions

  • to run the sqlplus script using forms6i

    Hi forum members!

    SQLPLUS > connection name of user and password.
    SQLPLUS > spool d:\mydata.dat;
    SQLPLUS > select * from table1;
    SQLPLUS > spool off;

    When I check the d:\, I found the file mydata.dat. which is the necessary result for me.

    now, how can I get the result required by using forms6i.


    any suggestions will be appreciated.


    Kind regards.



    Ghulam Mustafa
    in Pakistan.

    create a script named myscript.sql, and put in the c:\temp folder

    spool c:\temp\Output.dat
    
    select * from tab; ---Your query
    
    spool off;
    
    exit;
    

    the button forms write this code

    host ('plus80w scott/tiger@mydb @c:\temp\MyScript.sql', no_screen);

    Please mark it correct / useful if it is

    Bangoura
    [My Oracle Blog | http://baigsorcl.blogspot.com/]

  • Digest the lag when running during the generation of the ant script

    I'm tying all libraries referenced by my Flex as RSL project. When I do this through Flex Builder seems to work.  When I try to do it via an Ant build script to the mxmlc task the build succeeds (everything compiles) but when running, I get error #1001 Flex: mismatch with RSL Digest for datavisualization.swc.  Not sure why I make this especially since I specify datavisualization.swf in the rsl url not a swz file. Both methods give the same set of swf, SWC, and swz files in the deployment folder.  I can't understand what is different between the two build processes after comparing the .actionScriptProperties with the ant script.  Can anyone help to shed light on this or help me understand how push wrong with that? Thank you.

    My task as mxmlx:

    < mxmlc
    file = "${Flex.main.file}" "
    output = "${Flex.output.swf}" "
    ActionScript-file-encoding = 'UTF-8 '.
    Keep-generated-actionscript = "false".
    link-TIME-shared-library static = "false".
    local = "en_US."
    MaxMemory = "256 m" >

    < path-element source-path = "${PROJECT_FRAMEWORKS}" / >

    < dir external-library-path = "${PROJECT_FRAMEWORKS} / libs/player" includes = "playerglobal.swc" / >

    "< path-element="${PROJECT_FRAMEWORKS}/libs/framework.swc DURATION-shared-library-path ">

    < url rsl - url = ' framework_$ {FLEX_BUILD} .swf ".
    < url rsl - url = ' framework_$ {FLEX_BUILD} .swz "/ >
    < / DURATION-shared-library-path >

    "< path-element="${PROJECT_FRAMEWORKS}/libs/rpc.swc DURATION-shared-library-path ">
    < url rsl - url = "rpc_$ {FLEX_BUILD} .swf" / >
    < url rsl - url = "rpc_$ {FLEX_BUILD} .swz" / >
    < / DURATION-shared-library-path >

    < runtime-shared-library-path
    Path-Element="${PROJECT_FRAMEWORKS}/libs/Automation.swc" >
    < url rsl - url = "automation.swf" / >
    < / DURATION-shared-library-path >

    < runtime-shared-library-path
    Path-Element="${PROJECT_FRAMEWORKS}/libs/automation_agent.swc" >
    < url rsl - url = "automation_agent.swf" / >
    < / DURATION-shared-library-path >

    < runtime-shared-library-path
    Path-Element="${PROJECT_FRAMEWORKS}/libs/automation_dmv.swc" >
    < url rsl - url = "automation_dmv.swf" / >
    < / DURATION-shared-library-path >

    < runtime-shared-library-path
    Path-Element="${PROJECT_FRAMEWORKS}/libs/automation_flashflexkit.swc" >
    < url rsl - url = "automation_flashflexkit.swf" / >
    < / DURATION-shared-library-path >

    < runtime-shared-library-path
    Path-Element="${PROJECT_FRAMEWORKS}/libs/DataVisualization.swc" >
    < url rsl - url = "datavisualization.swf" / >
    < / DURATION-shared-library-path >

    < runtime-shared-library-path
    Path-Element="${PROJECT_FRAMEWORKS}/libs/Flex.swc" >
    < url rsl - url = "flex.swf" / >
    < / DURATION-shared-library-path >

    < runtime-shared-library-path
    Path-Element="${PROJECT_FRAMEWORKS}/libs/qtp.swc" >
    < url rsl - url = "qtp.swf" / >
    < / DURATION-shared-library-path >

    < runtime-shared-library-path
    Path-Element="${PROJECT_FRAMEWORKS}/libs/Utilities.swc" >
    < url rsl - url = "utilities.swf" / >
    < / DURATION-shared-library-path >

    < compile .library-path dir = "${PROJECT_FRAMEWORKS}" / locale ' append = "true" > "
    < name = "{local}" / >
    < / compile .library-path >

    ...

    < default width = "500" height = "600" / >
    < / mxmlc >

    I didn't write the patch, but I just took a quick glance. I think that the "url" element has been renamed to "rsl - url" and new elements have been added as "failover-url". You can try to match this new syntax, but I don't think that this patch will be agreed due to rename it.

    -Darrell

  • Keyboard shortcut to run the last Script?

    Anyone know of a keyboard shortcut to run the last script that was executed? I'm editing an animation and wrote a script that writes code based on it, and I need a quick way to run it without the open file dialog box.

    Thank you!

    Method 1:

    You can assign shortcut keys to the first 20 scripts listed under the file > Scripts menu via the file «Adobe after effects 10.5 shortcuts» Just search for "ExecuteScript' in the shortcuts file find the section.

    Method 2:

    You can use ft_ToolBar which allows to launch scripts with the click of a button. You can also create a new button and just paste your script code directly in the window provided without having to create a jsx/jsxbin file.

  • Is it possible to run the command script with user account administrator rights?

    Is it possible to run the command script with administrator user account rights means please tell me how to...

    I need to run it in windows 7 professional service pack 1.

    There are a few myths that won't go away, for example

    • You can perform administrative tasks when you are working from a command prompt.
    • A script (batch file, VBScript, PowerShell) gives you administrative rights.

    There is no substance to a myth. Your account has administrator privileges, or it does not. There is no backdoor.

  • If I run the calc script to aggregate a BSO cube, it blocks and release each block in a few seconds?

    Hello

    If I run the calc script to aggregate a BSO cube, it blocks and release each block in a few seconds? Or is it keep held locked blocks even after aggregation for this block is over?

    For example if I correct sparse dimensions Forecast, FY15, dec.  and my accounts dimension is only dense, after calc has my senior level members in the accounts, it it will issue after updating (i.e. in fractions of seconds) or is agg keep it held in a lock?

    I ask because I want to run scripts tot., but there is the update of our cube users.  I never had a problem to start agg, while users are updating.  But maybe I am lucky.  If a user updates a closed block, they will receive an error message that I think.  They may try to update again after a few seconds, I hope.

    Thank you.

    Locking behavior for BSO Essbase is described in the database administrator's Guide: http://docs.oracle.com/cd/E57185_01/epm.1112/essbase_db/dstinteg.html

    It is certainly theoretically possible that a user can obtain a lock because of a calc, although I can't say I saw him be a problem in real-world applications (perhaps because access uncommitted is the default).

  • Run the PLSQL Script from Batch file

    I am trying to run a PL/SQL script in a batch file in sp1 Windows 7 Prof

    N ° 1) I wrote a simple PL/SQL script:

    --

    -The scope of variables

    --

    DECLARE

    v_sal number (7.2): = 50000;

    v_comm number (7.2): = v_sal *. 20;

    v_message varchar2 (100): = 'eligible for the commission;

    BEGIN

    declare

    v_sal number (7.2): = 50000;

    v_comm number (7.2): = 0;

    v_total_comp number (7.2): = v_sal + v_comm;

    Start

    v_message: = "not committed not" | v_message;

    dbms_output.put_line (' message of sub-block is ' | v_message);

    dbms_output.put_line (' subblock v_comm is ' | v_comm);

    end;

    v_message: = 'seller '. v_message;

    -dbms_output.put_line ('Main block v_total_comp' | v_total_comp); -Error: not visible in the main block

    dbms_output.put_line ('Main block v_comm' | v_comm);

    dbms_output.put_line (' main block message is ' | v_message);

    END;

    /

    Step 2) then I wrote a simple batch TstBatch.bat file

    sqlplus scott/tiger@orcl < PLSqlVarInputTst1.sql > > TstBatch.log

    Step 3) in the BACK of cmd, I tried to run TstBatch.bat

    C: > TstBatch.bat

    The log file tells me that I have connected to Oracle Database 11 g Enterprise Edition Release...

    Then a lot of SQL > SQL > SQL >... 26 times

    Procedue of PL/SQL completed successfully.

    Disconnected from Oracle database

    I also tried running the PLSQL script in SQLPlus:

    SQL: > @PLSqlVarInputTst1.sql

    Tell me the procedure completed successfully.

    QUESTION: So, where is the output of the PL/SQL script?

    Hello

    You must activate the output: Add the following line at the beginning of your PL/SQL script:

    SET SERVEROUT ON

    ...

  • Change the shared user using Java API Service

    Hi Experts,

    I have successfully run the example of classes Java from here: http://docs.oracle.com/cd/E17236_01/epm.1112/epm_security_api/frameset.htm?ch01s03.html
    And I need to change the code of UserFunctions.Java.

    UserFunctions.Java, I can create, edit, and delete a user.
    But in this sample program, when I want to edit a user, I should create a new user first.

    My requirement is I want to change the existing user passing the parameter when you run the program.
    So, when I want to launch the program, it should be like this:
    Java UserFunctions 'method' 'username', 'password', 'email', 'first name', 'last name '.

    FYI, I can create a user in passing the parameter as I mentioned above.
    But to edit a user, I still can't do it.

    Please find my codes below:

    public CSSNativeUserIF createUser (String username, String desc, String firstname, String lastname, String email, String pass) throws CSSException
    {
    The user CSSNativeUserIF = null;
    HashMap context = new HashMap();
    user = cssDMAPI.getNativeUserInstance (context, main);
    user.setLoginName (username);
    user.setDescription (desc);
    user.setFirstName (firstname);
    user.setLastName (lastname);
    user.setEmailAddress (email);
    user.setPassword (pass);
    cssDMAPI.addNativeUser (main user, context);

    return the user;
    }

    ' public void modifyUser (String username, String desc, String firstname, String lastname, String email, String pass) throws CSSException
    {
    The user CSSNativeUserIF = null;
    HashMap context = new HashMap();

    System.out.println ("Edit description user...");
    user = cssDMAPI.getNativeUserInstance (context, main);
    user.setLoginName (username);
    user.setDescription (desc);
    user.setFirstName (firstname);
    user.setLastName (lastname);
    user.setEmailAddress (email);
    user.setPassword (pass);
    cssDMAPI.updateNativeUser (main user, context);

    }

    -------

    in the Sub main():

    If (method.equals ("create"))
    {
    / * Create a native user * /.
    cu.printMsg (System.out, "- creating a user-" "");
    user = cu.createUser (username, desc, firstname, lastname, email, pass);
    cu.dumpUsers (System.out, "the user is created successfully," new CSSNativeUserIF [] {user});
    }
    ElseIf (method.equals ("update"))
    {
    / * Change native user * /.
    cu.printMsg (System.out, "- update a user-");
    cu.modifyUser (user name, desc, firstname, lastname, email, pass);
    cu.dumpUsers (System.out, "the user is updated", new CSSNativeUserIF [] {user});
    }

    Could you please help me with this?

    Thank you and best regards,

    Christophe

    Try this

    CSSUserIF [] usrs to = cssAPI.getUsers (context, principal, sLoginName);

    If (usrs.length > 0) {}
    CSSNativeUserIF natUser1 = (CSSNativeUserIF) usrs to [0];
    natUser1.setLoginName (sLoginName);
    natUser1.setFirstName (sFirstName);
    natUser1.setLastName (sLastName);
    natUser1.setEmailAddress (sEmail);
    natUser1.setDescription (sDescription);
    natUser1.setPassword (sPassword);

    cssDMAPI.updateNativeUser (context, principal, natUser1);
    }

  • What is the Action Script (using AS2) code when you loop once a scene and then re-read and intervention

    What is the Action Script (using AS2) code when you loop once a scene and then re-read and slaughter on a certain slice?

    Basically, you need keep a count and use it as your stop control.  In the first image, it takes something to assign the value, but you do not want to assign an initial value, so you could use...

    var County;

    if(Count == undefined) {}
    Count = 0;
    } else {}
    Count ++;
    }

    Then in the frame where you want to stop after that a loop is completed you can have...

    if(Count == 1) {}

    Stop();

    }

  • Elements 4.0: run the postflight script fails

    I ALMOST built Elements 4.0 as root on Mac OS 10.5.6 successfully (CPU PPC G5).  Towards the end of construction, I see 'missing file' then 'cannot run the postflight script.

    Any ideas?  Thank you.

    http://forums.Adobe.com/community/photoshop_elements

  • Problem to find the Position of the cursor by using Java Script for an input TextField

    Hello

    I have a problem to find the position of the cursor in a field inputText component.

    The following code of java script to achieve. The same functionality works fine if I run in a simple html page. But when it is used the same javascript inside the jsff does not the position of the cursor.
    var adfComponent = AdfPage.PAGE.findComponentByAbsoluteId("r1:1:it3");
    var adfComponentClientId = adfComponent.getClientId();
    var div = document.getElementById(adfComponentClientId + '::content');
    div.focus();
    var docSelectionRange = document.selection.createRange();
    
    docSelectionRange.moveStart ('character', -div.value.length);
    
    var iCaretPos = docSelectionRange.text.length;
    
    alert("iCaretPos --> "+iCaretPos);  ---> This statement always returning '0'. Instead, i want the cursor position inside the text box.
    Please let me know what I'm missing.

    For your reference, sending the sample page html that works fine with the same kind of code.
    <html>
     
     <body style="font-family: tahoma; font-size: 8pt;">
     
      <script language="JavaScript">
     
       /*
       **  Returns the caret (cursor) position of the specified text field.
       **  Return value range is 0-oField.length.
       */
       function doGetCaretPosition (oField) {
     
         var iCaretPos = 0;
              alert(oField);
         if (document.selection) { 
     
           // Set focus on the element
           oField.focus ();
     
           // To get cursor position, get empty selection range
           var oSel = document.selection.createRange ();
     
           // Move selection start to 0 position
           oSel.moveStart ('character', -oField.value.length);
     
           // The caret position is selection length
           iCaretPos = oSel.text.length;
         }
     
         // Firefox support
         else if (oField.selectionStart || oField.selectionStart == '0')
           iCaretPos = oField.selectionStart;
     
         // Return results
         return (iCaretPos);
       } 
      
     
     
      </script>
     
      <form name="blah">
     
       Text Field: <input type="text" name="nameEdit" value="">
       <input type="button" value="Get Caret" onClick="document.getElementById('where').value=doGetCaretPosition (document.forms[0].elements[0]);">
    <input id="where">
      
     
      </form>
     
     </body>
     
    </html>
    Thank you and best regards,
    Kiran kristelle

    Published by: Kiran kristelle on February 6, 2012 12:00

    ... had the chance to look at the source code of the sample. ADF Faces renders text as HTMLTextArea fields when the value of the rows property. The JavaScript code used in the example of client works differently for FF and IE if the input is a text box. This could be a problem in IE or just used JavaScript code. The rows back to a single line (remove) property makes the text as HTML input feldworking with the JavaScript for IE and FF.

    Frank

  • 12 c: SOA deployment using the ANT script

    We seek to deploy a composite SOA 12 c using the Ant.. As a first step, we use "Ant-sca - package.xml ' to create the package and then deploy using the file" Ant-sca - deploy.xml. One of the properties required by the script is "compositeDir". When we set this value to the composite directory, we get an error composite.xml is missing. And if you change its value in the "soa" with composite directory folder, it works.

    Confirmation, as what value need to affect the property "compositeDir".

    Thank you

    compositeDir is the absolute path of the directory that contains composite.xml, then you must set the property compositeDir as baseDirectory/SOA.

    For a question related to the location of the jar file, there is a known issue already documented here: Known Issues for Oracle SOA products

    Check the details under the heading: "Oracle JDeveloper and ant control Deploy SAR files in different directories;

  • Run the .bat file using fileObj.execute () showing the result by completely removing the lines of code in extend script?

    Hi guys

    I created a dynamic .bat file created inside java and copy it to a location and managed through fileObj.execute ();

    Example of

    -------------------

    var line1 = 'some code ";

    var line2 = 'some code ";

    myCode var = line 1 + line 2;


    var myFileC = new file

    myFileC.open ('w');

    myFileC.write (myCode);

    myFileC.copy ("some location\file.bat");

    myFileC.close ();

    Run the .bat file

    batFile var = new file ("of the location\file.bat");

    batFile.execute ();

    Now .bat file is successfully executed but the content of this file created bat shows up to extend in script by removing all my code above...

    I have to cancel to do back whenever I run and sometimes accidentally I saved it lose all the code.

    can someone help with this problem?

    Simply change it to this:

    var myFileC = new File ("some location\file.bat");

    myFileC.open ('w');

    myFileC.write (myCode);

    myFileC.close ();

  • Run the UCM Service using custom

    Hello

    I was looking for information how to run the service from the Complutense University of MADRID by composing personalized and found some articles about the same:

    http://jonathanhult.com/blog/2012/06/execute-a-service-from-a-Java-filter/

    http://jonathanhult.com/blog/2012/10/who-created-that-site-Studio-section/

    http://www.redstonecontentsolutions.com/5/post/2012/05/executing-a-service-from-aservicehandler.html#sthash.X31M6ZCS.tvlE83Km.DPBS

    I'm new to webcenter content and could not understand above blog stuff correctly. Queries:

    1. we make use of the service of the University Complutense of MADRID to filter, Service or ServiceHandler. Is there a difference in the code required to perform a service?

    2. What is the correct code to run the UCM service?

    No, but your custom component can have html resources (including) and html templates that can contain some iDocScript. And there, you can use this way.

    For the complete list, a service can also directly call subservices just the way it is defined - a personalized service is defined in the .hda file and it can contain a line containing such a call.

    As you are new to the WebCenter content, I recommend you use the component wizard. You must also be familiar with the creation of custom components before you dive into programming (and the functionality of the system as it is, because very often, people develop functionality that is already there).

  • How to close all windows after running the SaveAsPDF script?

    I ran into the problem where I adjusted the SaveAsPDF script to backup my PDF files with a preset specific PDF I use. But after executing the script, all newly created PDF files are open in illustrator and I have to close it manually one by one, choose if I want to 'Save' or 'do not save' (even if they are already registered). I would like for them to close right after that the PDF is created.

    I've added in the script:

    if (myFile.open("w")) {
      myFile.close(SaveOptions.DONOTSAVECHANGES);
      }
    

    Who's going to run the script and close the files, but for only 3 of the 10, I opened. The 7 remaining won't be saved or converted to PDF. Is there something wrong in my script or anything else that I can try to solve this problem?

    Here is my complete script:

    /** Saves every document open in Illustrator
      as a PDF file in a user specified folder.
    */
    
    
    // Main Code [Execution of script begins here]
    
    
    try {
      // uncomment to suppress Illustrator warning dialogs
      //app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
    
    
      if (app.documents.length > 0 ) {
    
    
      // Get the folder to save the files into
      var destFolder = null;
      destFolder = Folder.selectDialog( 'Select folder for PDF files.', '~' );
    
    
      if (destFolder != null) {
      var options, i, sourceDoc, targetFile;
    
      // Get the PDF options to be used
      options = this.getOptions();
      // You can tune these by changing the code in the getOptions() function.
    
      for ( i = 0; i < app.documents.length; i++ ) {
      sourceDoc = app.documents[i]; // returns the document object
    
      // Get the file to save the document as pdf into
      targetFile = this.getTargetFile(sourceDoc.name, '.pdf', destFolder);
    
      // Save as pdf
      sourceDoc.saveAs( targetFile, options );
    sourceDoc.close();
      }
    
    
      alert( 'Documents saved as MarkPreset PDF' );
      }
      }
      else{
      throw new Error('There are no document open!');
      }
    }
    catch(e) {
      alert( e.message, "Script Alert", true);
    }
    
    
    /** Returns the options to be used for the generated files.
      @return PDFSaveOptions object
    */
    function getOptions()
    {var NamePreset = 'MarkPreset'; 
      // Create the required options object
      var options = new PDFSaveOptions();
      options.pDFPreset=NamePreset; 
    
    
      // See PDFSaveOptions in the JavaScript Reference for available options
    
      // Set the options you want below:
    
    
      // For example, uncomment to set the compatibility of the generated pdf to Acrobat 7 (PDF 1.6)
      // options.compatibility = PDFCompatibility.ACROBAT7;
    
      // For example, uncomment to view the pdfs in Acrobat after conversion
      // options.viewAfterSaving = true;
    
      return options;
    }
    
    
    /** Returns the file to save or export the document into.
      @param docName the name of the document
      @param ext the extension the file extension to be applied
      @param destFolder the output folder
      @return File object
    */
    function getTargetFile(docName, ext, destFolder) {
      var newName = "";
    
    
      // if name has no dot (and hence no extension),
      // just append the extension
      if (docName.indexOf('.') < 0) {
      newName = docName + ext;
      } else {
      var dot = docName.lastIndexOf('.');
      newName += docName.substring(0, dot);
      newName += ext;
      }
    
      // Create the file object to save to
      var myFile = new File( destFolder + '/' + newName );
    
      // Preflight access rights
      if (myFile.open("w")) {
      myFile.close(SaveOptions.DONOTSAVECHANGES);
      }
      else {
      throw new Error('Access is denied');
      }
      return myFile;
    }
    

    Try this change

    for (i = 0; i< app.documents.length;="" i++="" ) ="">

    for (i = app.documents.length; i > 0; i--)

Maybe you are looking for