APIs  for Retrieving properties from portalapp.xml

Hi all,
Can anyone tell me Is there any Java/Portal APIs for retrieving properties from portalapp.xml as well as from manifest.mf.
Help wud be highly appreciated.
Regards,
Karthick

Hi Karthick,
If you want to access the manifest file, you could do something like this:
import java.io.File;
import java.io.FileInputStream;
import java.util.jar.Manifest;
import com.sapportals.portal.prt.runtime.IPortalRuntimeResources;
import com.sapportals.portal.prt.runtime.PortalRuntime;
File privateResoucePath = PortalRuntime.getRuntimeResources().getLocation(IPortalRuntimeResources.LT_PRIVATE_RESOURCES);
File parPath = new File ( privateResoucePath, "HelloWorldProject" );  // name - par file name without the ".par" extension);       
if ( parPath.exists()!=false ) {
    try {
        File manifestPath = new File ( parPath, "META-INF" );
        FileInputStream fis = null;
        fis = new FileInputStream(new File(manifestPath, "MANIFEST.MF"));
        Manifest mf = new Manifest(fis);
        java.util.jar.Attributes attr =  mf.getMainAttributes();
        if (attr!=null) {
            return attr.getValue("Specification-Title");
        else {return null;}
    } catch (Exception e) {
        e.printStackTrace();
        return "ERROR"+e.toString();
META-INF is top level folder.
Hope this helps.
Daniel

Similar Messages

  • How to access properties from portallapp.xml in jsp file

    <b>portalapp.xml</b>
    <property name="SupportUrl" value="http://sapdp1ci.zrh.swissre.com:53000/irj/portal?navigationtarget=navurl://8f7e974723098424468c8ae903228c0e">
              <property name="personalization" value="dialog"/>
              <property name="plainDescription" value="Support Desk Link URL"/>
              <property name="category" value="Navigation"/>
            </property>
    <b>jsp code</b>
    private String getSupportUrl(IPortalComponentRequest request)
         IPortalComponentContext myContext = request.getComponentContext();
         IPortalComponentProfile profile = myContext.getProfile();
         String supportDeskLocation = profile.getProperty("SupportUrl");
         //String supportDeskLocation = (String)request.getNode().getValue(SUPPORT_URL);
         return supportDeskLocation;
    but supportDeskLocation is coming as null.
    Please help me in solving the issue.
    Points will be awarded
    thanks
    bala

    Hi Michal,
    How are you?
    I´m trying to access a property from portalapp.xml and I have in the right place according to your post and here is my code to retrieve it:
    String value = (String)request.getNode().getValue("MyLogoffUrl");
    Did you activated something or did something else so your property could be reached by the JSP?
    It is just returning null in my case.
    Thanx in Advanced!
    Kind Regards,
    Gerardo j

  • Exception while loading properties from an xml file

    Hi all,
    I've got a problem while loading properties from an XML file:
    java.lang.ClassCastException: org.apache.xerces.dom.DeferredCommentImpl cannot be cast to org.w3c.dom.Element
    ERROR - Cannot load properties from the specified file <./conf/login.prop> java.lang.ClassCastException: org.apache.xerces.dom.DeferredCommentImpl cannot be cast to org.w3c.dom.Element
         at java.util.XMLUtils.importProperties(XMLUtils.java:97)
         at java.util.XMLUtils.load(XMLUtils.java:69)
         at java.util.Properties.loadFromXML(Properties.java:852)
         at g2.utility.HRPMProperties.<init>(HRPMProperties.java:78)
         at g2.utility.HRPMProperties.getInstance(HRPMProperties.java:94)
         at g2.gui.workers.ApplicationSwingWorker.<init>(ApplicationSwingWorker.java:36)
         at g2.main.Main.main(Main.java:37)but this code worked before, and I've got the xerces and xercesImpl packages in the classpath, anyone can give me an hint on how to fix the problem?

    Here there's the code that instantiates the HRPMProperties object loading the property file:
    public class HRPMProperties extends Properties {
         * A reference to myself.
        protected static HRPMProperties mySelf = null;
         * The property file to which load the configuration.
        protected static String propertyFile = "./conf/login.prop";
          * A set of static strings used as keys in the properties file.
         public final static String DATABASE_URL = "database_url";
         public final static String DATABASE_USERNAME = "database_username";
         public final static String DATABASE_PASSWORD = "database_password";
         public final static String REAL_USERNAME = "real_username";
         public final static String REAL_PASSWORD = "real_password";
         public final static String PHANTOM_LOGIN = "login_thru_phantom_user";
         public final static String AUTOCONNECT = "autoconnect";
         public final static String TRANSLATION_FILE = "translation_file";
         * Builds up an empty properties map.
        protected HRPMProperties(){
         super();
         this.reload();
         * Builds up the property map from the specified input file. <B> The file must be in XML format</B>.
         * In case of exception and/or problems reading from the specified file, an empty property map is returned.
         * @param fileName the path and the name of the file with the XML representation of the properties.
        protected HRPMProperties(String fileName){
         super();
         try{
             this.loadFromXML(new FileInputStream(fileName));        
         }catch(Exception e){
             Logger.error("Cannot load properties from the specified file <"+fileName+"> " + e);
             e.printStackTrace();
         * Provides an instance of the property class loaded from the default configuration file.
         * @return the property instance
        public static final HRPMProperties getInstance(){
         if( HRPMProperties.mySelf != null )
             return HRPMProperties.mySelf;
         else{
             HRPMProperties.mySelf = new HRPMProperties(HRPMProperties.propertyFile);
             return HRPMProperties.mySelf;
    }The constructor is the one triggering the exception, so there's a problem loading the XML property file.

  • How to modify select query for retrieve assets from assets tab and assets in merchandising in 10.1.2?

    Hi All,
          I need to modify the SQL for retrieving assets from assets tab and assets in merchandising in 10.1.2. I found the class for SQLQuery builder, but I want to change the SQL.
          Could you anyone please how to solve this.
    Thanks & Regards,
    Bala

    Hi All,
          I need to modify the SQL for retrieving assets from assets tab and assets in merchandising in 10.1.2. I found the class for SQLQuery builder, but I want to change the SQL.
          Could you anyone please how to solve this.
    Thanks & Regards,
    Bala

  • How to retrieve the data/property value from portalapp.xml

    Hi I would like to retrive the some common data from the portalapp.xml file
    <application>
      <application-config>
        <property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
          </application-config>
      <components>
        <component name="DynZMMGR">
          <component-config>
            <property name="ClassName" value="DynZMMGR"/>
            <property name="SecurityZone" value="DynZMMGR/high_safety"/>
            <property name="ComponentType" value="jspnative"/>
            <property name="JSP" value="pagelet/DynJspZMMGR.jsp"/>
          </component-config>
          <component-profile/>
        </component>
        <component name="dynpagedel">
          <component-config>
            <property name="ClassName" value="dynpagedel"/>
          </component-config>
          <component-profile/>
        </component>
        <component name="VARIANTLIST">
          <component-config>
            <property name="ClassName" value="com.sap.ep.r3rpts.VARIANTLIST"/>
            <property name="SecurityZone" value="com.sap.ep.r3rpts.VARIANTLIST/high_safety"/>
          </component-config>
          <component-profile/>
        </component>
        <component name="DynZMM33">
          <component-config>
            <property name="ClassName" value="DynZMM33"/>
            <property name="SecurityZone" value="DynZMM33/high_safety"/>
            <property name="ComponentType" value="jspnative"/>
            <property name="JSP" value="pagelet/DynJspZMM33.jsp"/>
          </component-config>
          <component-profile/>
        </component>
      </components>
      <services/>
    </application>
    The above is my portalapp.xml file .
    I want to retrieve the common data across the component.
    These  datas are common across the components .
    I kmow by putting the data inside the
    component name="DynZMM33">
          <component-config>
            <property name="ClassName" value="DynZMM33"/>
            <property name="SecurityZone" value="DynZMM33/high_safety"/>
            <property name="ComponentType" value="jspnative"/>
            <property name="JSP" value="pagelet/DynJspZMM33.jsp"/>
          </component-config>
    <component-profile>
       <property name="UserID" value="userid"/>
       <property name="password" value="password"/>
    </component-profile>
    </component>
    this becoms component specific ... which I can retriev the by using
    String ClientVal = request.getComponentContext().getProfile().getProperty("Client");
    in doContent()  method ..
    But this way i have to specify these properties in all the component.. which is repetetive in nature.
    I would rather put it in common location and want to retrieve the info from the portalapp.xml...
    How to achieve this
    I am using "AbstractPortalComponent"  .
    thanks
    pkiran

    Hi Prashanth,
    see Reading another iView's profile personalized values and Validate PCD URI
    Anyhow, maybe you should implement a service which returns the values (from the service profile). This would be more clean for accessing global values.
    Hope it helps
    Detlev

  • URGENT : Add & Retrieve properties from Embedded LDAP in Weblogic 9.2

    I am using Embedded LDAP WebLogic 9.2 and i followed the steps mentioned in the URL below.I have nt changed anything except Server URL which points to localhost:7001.
    http://e-docs.bea.com/wlp/docs92/users/appendixa.html#wp1055363
    Questions:
    1)How to add additional attributes to embedded LDAP? (eg email, phone etc).
    2)How to read those properties from embedded LDAP using WebLogic Portal API? Any code samples?
    Any help is appreaciated.

    this problem is due to hard-coded user/pwd in installation scripts. Here are steps
    1) open file AIA_HOME/Infrastructure/install/wlscripts/FPWLCommonConfig.xml
    2) reach to target CreateStartupClasses
    3) there are three java tasks for com.oracle.oems.weblogic.AQJMSPasswordUtility
    4) in the task for oraesb, password is hardcoded as 'oraesb' in clear text.
    5) this should be password of 'ORAESB' database user.
    6) change this password value; and restart the installation.
    Regards,
    Vaibhav

  • API for retrieving processor data

    does anyone here know which java API is used to retrieve data from the processor.....Kinda like system monitoring tool which is able to retrieve the state of processor and display it through graph.......

    Besides System and Runtime, I don't think there's much. This would at least give you some memory information. There may be a third party package (maybe check SourceForge), but I don't know of one).
    You could potentially make calls to the OS using the exec command in Runtime. You could use the properties in System to figure out the platform and go from there. Take a look at this post for more info on using exec.
    http://forum.java.sun.com/thread.jsp?forum=57&thread=125678
    Good luck

  • How to retrieve value from AIAInstallProperties.xml in AIA Flow.

    After PIP Developement, Installer team will build the OUI installer for the PIP.They will build the screens for our PIP based on the requirements we give them.We give them a list of properties that we need the installer to prompt for and then the installer will store the values entered by the user in AIAInstallProperties.xml file.When the code is written, these properties are used instead of hardcoding any machine names, usernames, passwords, etc. When the services are deployed the properties are replaced with the values in AIAInstallProperties.xml.
    How to retreive those values from AIAInstallProperties.xml file to your participating applications or any adapters in your code?
    When the services are deployed how the properties are getting replaced with the values in AIAInstallProperties.xml.?
    Can anyone explain the above two flow.
    Thanks in advance.

    Hi
    Prem Edwin's posting about AIAInstallProperties.xml is correct.
    Two points, the 11gR1 is a foundation pack only release, that is why the OUI is only built to collect FP related information. In the future, when PIPs arrive, new wizard steps will involve to collect PIP specific information during installation/deployment time.
    For your example of of getting a file location during installation, it would be effectively for your self-built PIPs. That is why the 11gR1 FP OUI would not support that.
    Also, there are only finite number of tokens can be detokenized from AIAInstallProperties.xml to composite.xml, if you were introducing a random new 'file path', I don't believe it would be replaced automatically by default in R1 time.
    Thanks!

  • API to retrieve data from SAP content server

    Is there an API available to retrieve data from SAP content server?

    Hi
    you could check out function groups starting with OPT.
    F.eks. OPTB, OPTC, OPTD
    Also check function group ARCHIVOBJECT.
    best regards
    Thomas Madsen Nielsen

  • Problem while executing app for retrieving data from EXCEL Sheet

    hi
    i have this exception while running my application of retrieving data from a Excel sheet through java application , i had also set theclasspath for jxl. jar file but where its going wrong i dont know heres my code
    import java.util.Date;
    import java.io.*;
    import jxl.*;
    import javax.swing.*;
    import java.awt.*;
    import jxl.read.biff.BiffException;
    public class testExcel2
    public static void main(String args[]) throws jxl.read.biff.BiffException
    try
    File f=new File("move.xls");
    jxl.Workbook workbook=null;
    jxl.Sheet sheet=null;
    workbook=jxl.Workbook.getWorkbook(f);
    sheet=workbook.getSheet(0);
    Cell a1 = sheet.getCell(0,0);
    String stringa1 = a1.getContents();
    System.out.println("stringshaddddddddjk "+stringa1);
    workbook.close();
    }catch(IOException ex){
    System.out.println("Error" + ex);
    catch (BiffException ex2){
    System.out.println("Error" + ex2);
    catch(IndexOutOfBoundsException ex1){
    System.out.println("Error" + ex1);
    compilation is sucees but while running its giving an EXCeption
    MicrosoftXP[Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.
    G:\mysfw\pgms>java testexcel2
    Exception in thread "main" java.lang.NoClassDefFoundError: testexcel2 (wrong nam
    e: testExcel2)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)

    Java is case sensitive. testexcel2 is different from testExcel2.
    G:\mysfw\pgms>java testexcel2
    Exception in thread "main" java.lang.NoClassDefFoundError: testexcel2 (wrong name: testExcel2)

  • Retrieve data from recursive XML structure

    Hi,
    I had a XML which is something like below
    <?xml version="1.0" encoding="iso-8859-1" ?>
    <Relationship>
    <Name>John</Name>
    <Age>99</Age>
    <Gender>Male</Gender>
    <Children ID='1'>
         <Name>Peter</Name>
         <Age>55</Age>
         <Gender>Male</Gender>
         <Children ID='1'>
              <Name>Winnie</Name>
              <Age>40</Age>
              <Gender>Female</Gender>
              <Children ID='1'>
                   <Name>Sam</Name>
                   <Age>20</Age>
                   <Gender>Male</Gender>
              </Children>
         </Children>          
    </Children>     
    <Children ID='2'>
         <Name>Mike</Name>
         <Age>50</Age>
         <Gender>Male</Gender>
         <Children ID='1'>
              <Name>Jessica</Name>
              <Age>40</Age>
              <Gender>Female</Gender>
              <Children ID='1'>
                   <Name>Harison</Name>
                   <Age>20</Age>
                   <Gender>Male</Gender>
              </Children>
         </Children>          
    </Children>     
    </Relationship>
    As you see, the node <Name><Age><Gender><Children> is repeated within every <Children> node
    My question are:
    1. Is is possible to retrieve all the <Name> value if we don't know how deep is the <Children> node?
    2. Is is possible to retrieve the father and son/daugther relationship, i.e. John --> Peter, John-->Mike, Peter-->Winne, Mike-->Jessica
    Thanks
    Vincent

    Hi Vincent,
    For 1, use a descendant axis, like this :
    SQL> var xmldoc varchar2(4000)
    SQL>
    SQL> begin
      2   :xmldoc := '<?xml version="1.0" encoding="iso-8859-1" ?>
      3  <Relationship>
      4  <Name>John</Name>
      5  <Age>99</Age>
      6  <Gender>Male</Gender>
      7  <Children ID="1">
      8   <Name>Peter</Name>
      9   <Age>55</Age>
    10   <Gender>Male</Gender>
    11   <Children ID="1">
    12    <Name>Winnie</Name>
    13    <Age>40</Age>
    14    <Gender>Female</Gender>
    15    <Children ID="1">
    16     <Name>Sam</Name>
    17     <Age>20</Age>
    18     <Gender>Male</Gender>
    19    </Children>
    20   </Children>
    21  </Children>
    22  <Children ID="2">
    23   <Name>Mike</Name>
    24   <Age>50</Age>
    25   <Gender>Male</Gender>
    26   <Children ID="1">
    27    <Name>Jessica</Name>
    28    <Age>40</Age>
    29    <Gender>Female</Gender>
    30    <Children ID="1">
    31     <Name>Harison</Name>
    32     <Age>20</Age>
    33     <Gender>Male</Gender>
    34    </Children>
    35   </Children>
    36  </Children>
    37  </Relationship>';
    38  end;
    39  /
    PL/SQL procedure successfully completed
    SQL>
    SQL> select x.*
      2  from xmltable(
      3        '/Relationship/descendant::Children/Name'
      4        passing xmltype(:xmldoc)
      5        columns name varchar2(30) path '.'
      6       ) x
      7  ;
    NAME
    Peter
    Winnie
    Sam
    Mike
    Jessica
    Harison
    6 rows selected
    If you want to include "John" in the result set, just replace the XQuery expression with '/Relationship/descendant::Name'.
    For 2, here's one way :
    SQL> select x.*
      2  from xmltable(
      3        'for $i in /Relationship/descendant::Name
      4           , $j in $i/following-sibling::Children/Name
      5         return element r {
      6           element parent {$i/text()}
      7         , element child {$j/text()}
      8         }'
      9        passing xmltype(:xmldoc)
    10        columns parent_name varchar2(30) path 'parent'
    11              , child_name  varchar2(30) path 'child'
    12       ) x
    13  ;
    PARENT_NAME                    CHILD_NAME
    John                           Peter
    John                           Mike
    Peter                          Winnie
    Winnie                         Sam
    Mike                           Jessica
    Jessica                        Harison
    6 rows selected
    Or the recursive approach :
    SQL> select x.*
      2  from xmltable(
      3        'declare function local:getChildren($p as element()) as element()*
      4         {
      5          for $i in $p/Children
      6          return (
      7            element r {
      8              element parent_name {$p/Name/text()}
      9            , element child_name {$i/Name/text()}
    10            }
    11          , local:getChildren($i)
    12          )
    13         }; (::)
    14         local:getChildren(/Relationship)'
    15        passing xmltype(:xmldoc)
    16        columns parent_name varchar2(30) path 'parent_name'
    17              , child_name  varchar2(30) path 'child_name'
    18       ) x
    19  ;
    PARENT_NAME                    CHILD_NAME
    John                           Peter
    Peter                          Winnie
    Winnie                         Sam
    John                           Mike
    Mike                           Jessica
    Jessica                        Harison
    6 rows selected
    Edited by: odie_63 on 24 août 2011 12:12

  • Urgent: Help required for fetching CHILDNODE from an XML schema.

    Hi All,
    Good Morning to all, i have problem in extracting the child node name. I have created a xml schema say "emrxmlsample3.xsd" based on this schema i have created a xmltype table and inserted a value to the table. I have a problem in fetching the "CHILDNODE" name. Kindly help me in solving this problem. Here by i am posting all the workings i have done...
    I am using the following client:
    SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jan 31 11:44:59 2011
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    ////////////////////////////////// XML Schema ///////////////////////
    begin
    dbms_xmlschema.registerSchema(
    'http://www.oradev.com/emrxmlsample3.xsd',
    '<schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.oradev.com/emrxmlsample3.xsd"
    xmlns:samp="http://www.oradev.com/emrxmlsample3.xsd"
    version="1.0">
         <element name="HISTORY">
              <complexType>
                   <sequence>
                        <element name="HPI">
                             <complexType>
                                  <sequence>
                                       <element name = "PAIN">
                                            <complexType>
                                                 <sequence>
                                                      <element name = "SET">
                                                           <complexType>
                                                                <sequence>
                                                                     <element name = "LOCATION">
                                                                          <complexType>
                                                                               <sequence>
                                                                                    <element name = "HEAD" type = "string"/>
                                                                                    <element name = "NECK" type = "string"/>
                                                                                    <element name = "BACK" type = "string"/>                                                       
                                                                                    <element name = "CHEST" type = "string"/>                                                       
                                                                                    <element name = "ABDOMEN" type = "string"/>     
                                                                                    <element name = "JOINTS" type = "string"/>     
                                                                                    <element name = "OTHERS" type = "string"/>
                                                                               </sequence>
                                                                          </complexType>
                                                                     </element>
                                                                     <element name = "SEVERITY">
                                                                          <complexType>
                                                                               <sequence>
                                                                                    <element name = "MILD" type = "string"/>
                                                                                    <element name = "MODERATE" type = "string"/>
                                                                                    <element name = "SEVERE" type = "string"/>                                                       
                                                                                    <element name = "VERYSEVERE" type = "string"/>                                                       
                                                                               </sequence>
                                                                          </complexType>
                                                                     </element>     
                                                                     <element name = "CHARACTER">
                                                                          <complexType>
                                                                               <sequence>
                                                                                    <element name = "DIFFUSE" type = "string"/>
                                                                                    <element name = "PRICKING" type = "string"/>
                                                                                    <element name = "CUTTING" type = "string"/>                                                       
                                                                                    <element name = "PIERCING" type = "string"/>                                                       
                                                                               </sequence>
                                                                          </complexType>
                                                                     </element>                                                                      
                                                                </sequence>
                                                           </complexType>      
                                                      </element>
                                                 </sequence>     
                                            </complexType>
                                       </element>
                                  </sequence>
                             </complexType>
                        </element>
                   </sequence>
              </complexType>
         </element>
         </schema>',
    TRUE, TRUE, FALSE, FALSE);
    end;
    ////////////////////////// Table which has multiple Column //////////////////////////
    CREATE TABLE chipsemr3 (
    id number, CHIPSEMR XmlType)
    XMLTYPE CHIPSEMR STORE AS OBJECT RELATIONAL
    XMLSCHEMA "http://www.oradev.com/emrxmlsample3.xsd"
    ELEMENT "HISTORY";
    ///////////////////////////////// Insert Query in chipsxmltable //////////////////////////
    INSERT INTO chipsemr3 VALUES(1,
    xmltype.createxml('<?xml version="1.0"?>
    <samp:HISTORY xmlns:samp="http://www.oradev.com/emrxmlsample3.xsd" >
              <HPI>
                   <PAIN>
                        <SET>
                             <LOCATION>
                                  <HEAD> YES </HEAD>
                                  <NECK> NO </NECK>
                                  <BACK> N </BACK>
                                  <CHEST> N </CHEST>
                                  <ABDOMEN> N </ABDOMEN>
                                  <JOINTS> N </JOINTS>
                                  <OTHERS> N </OTHERS>
                             </LOCATION>
                             <SEVERITY>
                                  <MILD> N </MILD>
                                  <MODERATE> N </MODERATE>
                                  <SEVERE> N </SEVERE>
                                  <VERYSEVERE> N </VERYSEVERE>
                             </SEVERITY>
                             <CHARACTER>
                                  <DIFFUSE> N </DIFFUSE>
                                  <PRICKING> N </PRICKING>
                                  <CUTTING> N </CUTTING>
                                  <PIERCING> N </PIERCING>
                             </CHARACTER>
                        </SET>
                   </PAIN>
              </HPI>
    </samp:HISTORY>'));
    To show the Root Node Name:
    1. Query
    select x.CHIPSEMR.getrootelement() CHIPSNODES from chipsemr3 x, table(xmlsequence(x.CHIPSEMR.extract('//node()'))) x
    Apologies if the description is not clear. Kindly let me know if further details are needed. Many thanks for your help.
    Very best regards,
    Godwin Jebakumar C.V.

    Hi,
    I'm not sure what you want actually.
    You can get all elements names with :
    SELECT value(x).getRootElement() chipsnodes
    FROM chipsemr3 t,
         TABLE(
           XMLSequence(
             Extract(t.chipsemr, '//*')
         ) x
    ;or, starting with 10.2 :
    SELECT x.*
    FROM chipsemr3 t,
         XMLTable(
          'for $i in //* return local-name($i)'
          passing t.chipsemr
          columns chipsnode varchar2(30) path '.'
         ) x
    ;

  • How to retrieve data from this XML

    Hi
    I am getting below XML file and I need to get data from the file into table in a database ( SQL SERVER ). Please kindly help to shred and load the data into a table 
    <claimInvoice xmlns="http://www.XYZ.com">
      <INum>INum1</INum>
      <dueAmount xmlns="">1</dueAmount>
      <Billadd xmlns="">Billadd1</Billadd>
      <remittance xmlns="">
        <RemCom>RemCom1</RemCom>
      </remittance>
      <summary xmlns="">
        <title>title1</title>   
        <accountAging>
              <totalDue>1</totalDue>
        </accountAging>
    </summary>
    </claimInvoice>
    How Can i get  data for the following :
    INum,
    dueDate,
    Billadd,
    RemCom,
    title,
    totalDue
    Thanks
    Kodi

    see illustration below
    declare @x xml='<claimInvoice xmlns="http://www.XYZ.com">
    <INum>INum1</INum>
    <dueAmount xmlns="">1</dueAmount>
    <Billadd xmlns="">Billadd1</Billadd>
    <remittance xmlns="">
    <RemCom>RemCom1</RemCom>
    </remittance>
    <summary xmlns="">
    <title>title1</title>
    <accountAging>
    <totalDue>1</totalDue>
    </accountAging>
    </summary>
    </claimInvoice>'
    ;WITH XMLNAMESPACES ('http://www.XYZ.com' AS def)
    SELECT t.u.value('def:INum[1]','varchar(50)') AS INum,
    t.u.value('dueAmount[1]','int') AS dueAmount,
    t.u.value('Billadd[1]','varchar(10)') AS Billadd,
    t.u.value('(remittance/RemCom)[1]','varchar(50)') AS RemCom,
    t.u.value('(summary/title)[1]','varchar(50)') AS title,
    t.u.value('(summary/accountAging/totalDue)[1]','int') AS totalDue
    FROM @x.nodes('/def:claimInvoice')t(u)
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Retrieve element from an XML variable

    I have a BPEL process that takes in a XML message and from that message I want to parse out one element.
    Using BPEL v10.1.3.3.0
    Here is the xsd's, (use a wrapper for adding the name space)
    <?xml version="1.0" encoding="UTF-8"?>
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="TempNamespace"
    xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
    nxsd:version="DTD">
    <include schemaLocation="VendorMasterBridge_2_1.xsd"/>
    </schema>
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="VendorMasterBridge">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="VendorMaster" minOccurs="1" maxOccurs="unbounded">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="VendorNumber" minOccurs="1" type="xs:string"/>
    <xs:element name="VendorName" minOccurs="0" type="xs:string"/>
    <xs:element name="BatchCtrlNbr" minOccurs="0" type="xs:string"/>
    <xs:element name="Error" minOccurs="0" type="xs:string"/>
    <xs:element name="VendorMasterFields" minOccurs="0">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="DateCreated" minOccurs="0" type="xs:dateTime"/>
    <xs:element name="Address1" minOccurs="0" type="xs:string"/>
    <xs:element name="Address2" minOccurs="0" type="xs:string"/>
    <xs:element name="PassReqdAutoCreate" minOccurs="0" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    <xs:attribute name="id" use="optional" type="xs:string"/>
    <xs:attribute name="version" use="optional" type="xs:string" default="2.1"/>
    <xs:attribute name="timestamp" use="optional" type="xs:dateTime"/>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    I use the Assign activity to try and get the Address1 field
    <assign name="Assign_1">
    <copy>
    <from variable="Vendxml" part="VendorMasterBridge"
    query="/ns3:VendorMasterBridge/VendorMaster/VendorMasterFields/Address1"/>
    <to variable="addr"/>
    </copy>
    </assign>
    When I deploy and run the BPEL process I get this error
    <selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"><part name="summary"><summary>empty variable/expression result.
    xpath variable/expression expression "/ns3:VendorMasterBridge/VendorMaster/VendorMasterFields/Address1" is empty at line 87, when attempting reading/copying it.
    Please make sure the variable/expression result "/ns3:VendorMasterBridge/VendorMaster/VendorMasterFields/Address1" is not empty.
    </summary>
    </part></selectionFailure>
    Here is the XML used for input
    <invWriteVendor_Enqueue_InputVariable>
    <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="VendorMasterBridge">
    <VendorMasterBridge xmlns:ns0="TempNamespace" id="RMS">
    <VendorMaster xmlns="">
    <VendorNumber>1077952523</VendorNumber>
    <VendorName>UNIFLEX</VendorName>
    <VendorMasterFields>
    <Address1>383 W COMBO AVE</Address1>
    <Address2>PO BOX 9004</Address2>
    <City>HICKSVILLE</City>
    <StateCode>NY</StateCode>
    <Zip>11801-9004</Zip>
    <Country>USA</Country>
    <TelephoneNumber>05169322400</TelephoneNumber>
    <StatusCode>00</StatusCode>
    </VendorMasterFields>
    </VendorMaster>
    </VendorMasterBridge>
    </part></invWriteVendor_Enqueue_InputVariable>
    Can someone help me know what I am doing wrong?
    If I do an assign of the input xml to another xml of the same message type all the fields transfer. I only run into this issue if I am trying to access a specific element.
    Thanks for any help on this,

    Thanks for the reply, but could you be a little more specific? Problem with the namespace where, in the incoming message? Is it defined wrong in the BPEL process? A mis-match somewhere?
    I kind of figured it was a namespace issue but I can not seem to track it down.

  • Simplest way to modify properties from web.xml

    I'm testing a very small Web application which uses init-params in web.xml for configuration. For manual testing purposes, I need to be able to change the values of these as easily as possible, preferably from the WebLogic admin console. (I can do it from the console on Websphere App Server, and on Tomcat by editing a file which is immediately re-read.) We don't currently use deployment descriptors in any way and this is only a test of basic code functionality, not of deployment mechanisms, so the change can be as quick-and-dirty as you like. I'm using WebLogic v10 on Linux.
    Thanks,
    Pete

    Another option for you may be to deploy the application in exploded format and use weblogic.Deployer or WLST to redeploy the application :
    http://edocs.bea.com/wls/docs100/deployment/autodeploy.html
    This would be slightly more similar to your Tomcat deployment, but requires a few more steps.

Maybe you are looking for