Display an XML file Content as a treeView in a SharePoint 2013 custom form edited with SharePoint Designer 2013

Hello everyone,
Within a list form, user has to select a value amongst a huge number of availables options.
Instead of using something like a dropdown list, which would be very boring to parse, I would like to display possibles values in a treeview.
To do that, I tried to use an <Sharepoint:SPTreeView bind to a SharePoint:SPXmlDataSource who read data from an XML File.
<SharePoint:SPXmlDataSource runat="server" DataFile="../../SiteAssets/App_Data/myfile.xml" AutoSave="True" XPath="" ID="myDataXml"></SharePoint:SPXmlDataSource>
<SharePoint:SPTreeView runat="server" ID="MyTreeView" DataSourceID="myDataXml" />
But when I try to display the form in my web browser, an error occurs.
Therefore, my question is : Is it possible to display the content of an Xml file as a treeView in a SharePoint 2013 custom form edited with SharePoint Designer 2013 ?
If the answer is yes, how ? Which are the required properties for "SharePoint:SPXmlDataSource" tag and "SharePoint:SPTreeView"  tag ?
What are the requirements to use thoses tags ?
Regards,
Florian.
Ps : I dont have access to the server side of the SharePoint site I am working on.

Assuming that https://fullsitename is a new URL address did you make sure to update your browser to include it in the Trusted Sites zone?  The message you are quoting is exactly the one you get if you don't have it in Trusted Sites.
Paul Stork SharePoint Server MVP
Principal Architect: Blue Chip Consulting Group
Blog: http://dontpapanic.com/blog
Twitter: Follow @pstork
Please remember to mark your question as "answered" if this solves your problem.

Similar Messages

  • How to display an xml file contents in jsp as tree view

    hi,
    Iam trying to read an xml file and display the structure in jsp as tree view, can any one help me

    Use a [XML or DOM parser|http://java-source.net/open-source/xml-parsers] to read a XML file into a tree structure of Java objects.
    Use the [Collections API|http://java.sun.com/docs/books/tutorial/collections/index.html] to get hold of the relevant elements in a tree structure.
    Use JSTL´s [c:forEach|http://java.sun.com/javaee/5/docs/tutorial/doc/bnakh.html] tag to iterate over a Collection in JSP.
    Use HTML´s [<ul>/<li>|http://www.w3.org/TR/REC-html40/struct/lists.html#h-10.2] or [<dl>/<dt>/<dd>|http://www.w3.org/TR/REC-html40/struct/lists.html#h-10.3] tags to represent a tree in HTML.

  • Displaying doc/txt file contents from portlet

    Hi, Can someone pls give a hint on how to do this:
    One "book" type content created, with a doc file uploaded. The "publisher " for
    this content is set to "sams".
    create a content selector which retrieves only this (content) book correctly.
    create two portlets. one portlet with above content selector inserted, displays
    the publisher name with a hyperlink.
    I want the other portlet to display the contents of the file uploaded, for this
    publisher. I could establish portlet comm. and could display other properties
    of the book such as "author/titile" on the second portlet, but want to know how
    to display the uploaded file contents.
    thanks much,
    -developer

    As far as retriving the contents of an uploaded file...
    If your XML document has been loaded into Content Management as a binary
    property, you have two options:
    a) to directly inline the content into the JSP, do something like this:
    <cm:getProperty id="node" name="binaryPropertyName" failOnError="true"
    isMultiple="false"/>
    (This assumes node holds a reference to the Content Management Node
    object (perhaps retrieved via a <cm:getNode> tag)
    b) to retrieve the value into a script variable for more processing, do
    something like this:
    <%
    Property bodyProp= (Property)node.getProperty("binaryPropertyName");
    InputStream in= node.getPropertyBytes( bodyProp.getId() );
    // dont forget to close the InputStream
    String result=null;
    InputStreamReader reader= new InputStreamReader(in);
    StringBuffer streamContents= new StringBuffer();
    char[] data= new char[8192];
    int charsRead;
    while ((charsRead = reader.read(data)) > 0 )
    streamContents.append(data, 0, charsRead);
    result= streamContents.toString();
    %>
    -Steve
    "portal developer" <[email protected]> wrote in message
    news:40ae343d$[email protected]..
    >
    Hi, Can someone pls give a hint on how to do this:
    One "book" type content created, with a doc file uploaded. The "publisher" for
    this content is set to "sams".
    create a content selector which retrieves only this (content) bookcorrectly.
    >
    create two portlets. one portlet with above content selector inserted,displays
    the publisher name with a hyperlink.
    I want the other portlet to display the contents of the file uploaded,for this
    publisher. I could establish portlet comm. and could display otherproperties
    of the book such as "author/titile" on the second portlet, but want toknow how
    to display the uploaded file contents.
    thanks much,
    -developer

  • How can I transfer a XML file content to a MS SQL database by stored procedure using LabWindows/CVI SQL Toolkit?

    Hi,
    I have a problem to transfer a XML file content to a MS SQL database by a given/fixed stored procedure. I'm able to transfer the content of the file by using following method ...
    hstmt = DBPrepareSQL (hdbc, EXEC usp_InsertReport '<Report> ..... </Report>');
    resCode = DBExecutePreparedSQL (hstmt);
    resCode = DBClosePreparedSQL (hstmt);
    ... but in this case I'm not able to fetch the return value of the stored procedure! 
    I have tried to follow the example of the stored procedure in the help documentation (DBPrepareSQL) but I miss a datatype for xml?!?
    Any idea how to solve my problem?
    KR Cake  
    Solved!
    Go to Solution.

    After some additional trials I found a solution by calling the stored procedure in this way
    DBSetAttributeDefault (hdbc, ATTR_DB_COMMAND_TYPE, DB_COMMAND_STORED_PROC);
    DBPrepareSQL (hdbc, "usp_InsertReport");
    DBCreateParamInt (hstmt, "", DB_PARAM_RETURN_VALUE, -1);
    DBCreateParamChar (hstmt, "XMLCONTENT", DB_PARAM_INPUT, sz_Buffer, (int) strlen(sz_Buffer) + 1 );
    DBExecutePreparedSQL (hstmt);
    DBClosePreparedSQL (hstmt);
    DBGetParamInt (hstmt, 1, &s32_TestId);
    where sz_Buffer is my xml file content and s32_TestID the return value of the stored procdure (usp_InsertReport(@XMLCONTENT XML))
    Now I face the problem, that DBCreateParamChar limits the buffer size to 8000 Bytes.
    Any idea to by-pass this shortage??

  • How to display an XMl file in a webydynpro Application.

    Hi All,
    I am working with a webdynpro application where i have an xml file. when ever i run the webdynpro application it has to display that xml file in the browser instead of view. It would be appreciable if anyone give me some idea on how to start this application
              Thanks in advance
    Regards
    ravi

    HI Ravi,
    Insert a portalIFRame or IFrame with width 100%.
    Create a context variable (Say xmlFile) of type String and bind to Source property of PoratlIFrame .
    Put the xmlfile inside Project\src\mimes\Components\Package\
    Let the xml file name be Config1.xml.
    Write the following code inside wdDoinit()
    wdContext.currentContextElement().setPortalFrame(WDURLGenerator.getWebResourceURL(wdComponentAPI.getComponent().getDeployableObjectPart(),"Config1.xml"));
    Regards
    Fahad Hamsa

  • Streaming XML file content to a HTTPS servlet..

    Hi,
    I want to stream the contents of a XML file , which I have generated through XDK for PL/SQL, to a HTTPS address for a servlet.
    This HTTPS connections uses certifcates for user authentication. I have the certifcate on my local machine. Is there anyway of doing this through PL/SQL? Are there any packages available in Oracle 8.1.6 for this purpose? Can somebody tell me if there is a better way of doing this?
    Any help will be greatly appreciated.
    Thanks.

    After some additional trials I found a solution by calling the stored procedure in this way
    DBSetAttributeDefault (hdbc, ATTR_DB_COMMAND_TYPE, DB_COMMAND_STORED_PROC);
    DBPrepareSQL (hdbc, "usp_InsertReport");
    DBCreateParamInt (hstmt, "", DB_PARAM_RETURN_VALUE, -1);
    DBCreateParamChar (hstmt, "XMLCONTENT", DB_PARAM_INPUT, sz_Buffer, (int) strlen(sz_Buffer) + 1 );
    DBExecutePreparedSQL (hstmt);
    DBClosePreparedSQL (hstmt);
    DBGetParamInt (hstmt, 1, &s32_TestId);
    where sz_Buffer is my xml file content and s32_TestID the return value of the stored procdure (usp_InsertReport(@XMLCONTENT XML))
    Now I face the problem, that DBCreateParamChar limits the buffer size to 8000 Bytes.
    Any idea to by-pass this shortage??

  • How to insert External XML file content into XMLTYPE through Pro*c

    Could any one sugest me how to insert a external XML file content into Db
    into XMLTYPE datatype through Pro*c program.
    Thanks for any help...... who has done this
    Ghanta Tagore

    Hi
    After some good fight of 3 days, I have done it through Pro*c
    This is the way to handle this
    Buffer-->Temporary Clob-->XMLTYPE(using CreateXml)
    Pasting my piece o code to do this
    ===============
    OCIClobLocator *license_txt;
    varchar h_ttt[1024] = {'\0'};
    ub4 amt;
    int i;
    EXEC SQL ALLOCATE :license_txt;
    EXEC SQL LOB CREATE TEMPORARY :license_txt ;
    GetName(name); /*Gets Name to insert into name column in License Table*/
    for(i=0; i<4;i++)
    GetXMLL((char *)h_ttt.arr); /*Gets a string value of XML into this example*/
    /*<Tagore>Is From TCS Delhi</Tagore>*/
    /*This can be changed to get buffer from FILE */
    h_ttt.len = strlen((char *)h_ttt.arr);
    amt = sizeof(char) * h_ttt.len ;
    EXEC SQL LOB WRITE APPEND :amt FROM :h_ttt INTO :license_txt;
    EXEC SQL
    INSERT INTO license_table VALUES (:sss, :name, sys.xmltype.createXML(:license_txt))
    ================
    Thanks For ur Help
    Tagore Ghanta

  • Again: display large XML fil;e?

    Dear all,
    Any ideas to display large XML file into a JTree? This has been asked before, but still does not have any solution yet.
    I am looking for your kind help. Please help show me some codes, if you know.
    Many thanks!

    Any (close) examples for it? i've not got any - sorry
    btw, how large is large? does this mean you can't afford to store the whole XML in memory at the same time, or simply that the gui is unresponsive/resource hungry?
    asjf

  • Problems with parsing and display a XML-File

    Hi,
    I'm working on an applet to read a XML-file, display the content in a JTree, in order to modify and save it again. I found this tutorial: http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/dom/index.html
    I took this example http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/dom/work/DomEcho02.java and modified it, to run it as an applet.
    I changed the method main into:
    public class EditorTest extends JApplet {
    public void init(){
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
         try {
              DocumentBuilder builder = factory.newDocumentBuilder();
              File file = new File("/path/inhalt.xml");
              document = builder.parse(file);
         } catch (SAXException sxe) {
              // Error generated during parsing)
              Exception     x = sxe;
              if (sxe.getException() != null)
                   x = sxe.getException();
              x.printStackTrace();
         catch (ParserConfigurationException pce) {
              // Parser with specified options can't be built
              pce.printStackTrace();
         } catch (IOException ioe) {
              // I/O error
              ioe.printStackTrace();
         makeWindow(); //equals makeFrame(); in the tutorial
    } //initThe method makeWindow() looks like this:
    private Container container;
    private void makeWindow(){
         container = getContentPane();
         JDesktopPane desktop = new JDesktopPane();
         final EditorTest echoPanel = new EditorTest();
         JMenuBar menuBar = MakeMenuBar();  //returns a JMenuBar with a few items in it
         container.add(menuBar, BorderLayout.NORTH);
    }The constructor:
    public DomEcho02() {
         // Set up the tree
         JTree tree = new JTree(new DomToTreeModelAdapter());
         // Build left-side view
         JScrollPane treeView = new JScrollPane(tree);
         treeView.setPreferredSize( new Dimension( leftWidth, windowHeight ));
         // Build right-side view
         final JEditorPane htmlPane = new JEditorPane("text/html","");
         htmlPane.setEditable(true);
         JScrollPane htmlView = new JScrollPane(htmlPane);
         htmlView.setPreferredSize(new Dimension( rightWidth, windowHeight ));
         // Build split-pane view
         JSplitPane splitPane = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT, treeView, htmlView );
         splitPane.setContinuousLayout( true );
         splitPane.setDividerLocation( leftWidth );
         splitPane.setPreferredSize( new Dimension( windowWidth + 10, windowHeight+10 ));
         // Add GUI components
         this.setLayout(new BorderLayout());
         this.add("Center", splitPane );
    } // ConstructorI didn't change the class AdapterNode and DomToTreeModelAdapter. When I change the line "JTree tree = new JTree(new DomToTreeModelAdapter());" into "JTree tree = new JTree();", the applet starts and display a standard-JTree, as it ist generated by the constructor. If I want to display my own Tree the applet fails. When I start it with the appletviewer I get this message:
    java.lang.NullPointerException
    at DomEcho02$AdapterNode.childCount(DomEcho02.java:151)
    at DomEcho02$DomToTreeModelAdapter.isLeaf(DomEcho02.java:167)
    at javax.swing.JTree.setModel(JTree.java:704)
    at javax.swing.JTree.<init>(JTree.java:511)
    at DomEcho02.<init>(DomEcho02.java:51)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    at java.lang.Class.newInstance0(Class.java:350)
    at java.lang.Class.newInstance(Class.java:303)
    at sun.applet.AppletPanel.createApplet(AppletPanel.java:721)
    at sun.applet.AppletPanel.runLoader(AppletPanel.java:650)
    at sun.applet.AppletPanel.run(AppletPanel.java:324)
    at java.lang.Thread.run(Thread.java:595)
    Is there anyone out there, who knows how to fix it?
    Thanks in advance.

    I found out, how it was going wrong.
    When the applet started, it didn't start with the method init(), as it should do, it started with the constructor. Because there was no document the method childCount() throws a exception. After this, the method init() startet reading the file and started the constructor again, but the results were not shown.
    After knowing this I decided to write the Applet again and now it's working fine.

  • Help with displaying my xml file in my jtext area

    Hi i am trying to read the data from my xml file and display it once the user clicks on the list all button.
    below is the source code for my program can someone please tell me some code to this.
    package tractorgui;
    import java.awt.BorderLayout;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.beans.XMLEncoder;
    import java.io.BufferedReader;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.FileReader;
    import java.beans.XMLDecoder;
    import javax.swing.*;
    import javax.swing.border.LineBorder;
    //import tractor.TextInputPrompt;
    import tractor.Tractor;
    * This code was edited or generated using CloudGarden's Jigloo
    * SWT/Swing GUI Builder, which is free for non-commercial
    * use. If Jigloo isbeing used commercially (ie, by a corporation,
    * company or business for any purpose whatever) then you
    * should purchase a license for each developer using Jigloo.
    * Please visit www.cloudgarden.com for details.
    * Use of Jigloo implies acceptance of these licensing terms.
    * A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
    * THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
    * LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
    public class NewSwingApp extends javax.swing.JFrame {
    //          //Set Look & Feel
    //          try {
    //               javax.swing.UIManager.setLookAndFeel("com.jgoodies.looks.plastic.Plastic3DLookAndFeel");
    //          } catch(Exception e) {
    //               e.printStackTrace();
              private static final long serialVersionUID = 1L;
         private JButton searchmanufacturer;
         private JButton jButton3;
         private JLabel companyname;
         private JPanel labelpannel;
         private JButton listall;
         private JPanel MenuButtons;
         private JButton archivetractor;
         private JTextArea outputscreen;
         private JButton exhibittractor;
         private JButton deletetractor;
         private JButton addtractor;
         private JButton listallexbited;
         private Tractor [ ] tractors;
         private JScrollPane jScrollPane2;
         private JScrollPane jScrollPane1;
    private int numberOfTractors;
         * Auto-generated main method to display this JFrame
         public static void main(String[] args) {
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        NewSwingApp inst = new NewSwingApp();
                        inst.setLocationRelativeTo(null);
                        inst.setVisible(true);
         public NewSwingApp() {
              super();
              initGUI();
         private void initGUI() {
              try {
                   BorderLayout thisLayout = new BorderLayout();
                   getContentPane().setLayout(thisLayout);
                   this.setPreferredSize(new java.awt.Dimension(750, 700));
                        labelpannel = new JPanel();
                        BorderLayout labelpannelLayout = new BorderLayout();
                        getContentPane().add(labelpannel, BorderLayout.NORTH);
                        labelpannel.setLayout(labelpannelLayout);
                        jButton3 = new JButton();
                        getContentPane().add(getExitsystem(), BorderLayout.SOUTH);
                        jButton3.setText("Exit System");
                        jButton3.setPreferredSize(new java.awt.Dimension(609, 57));
                        jButton3.setBackground(new java.awt.Color(0,255,255));
                        jButton3.setForeground(new java.awt.Color(0,0,0));
                        jButton3.setFont(new java.awt.Font("Arial",1,24));
                        jButton3.addActionListener(new ActionListener() {
                             public void actionPerformed(ActionEvent evt) {
                                            System.exit(0);
                        MenuButtons = new JPanel();
                        getContentPane().add(MenuButtons, BorderLayout.WEST);
                        GridLayout MenuButtonsLayout = new GridLayout(7, 1);
                        MenuButtonsLayout.setColumns(1);
                        MenuButtonsLayout.setRows(7);
                        MenuButtonsLayout.setHgap(5);
                        MenuButtonsLayout.setVgap(5);
                        MenuButtons.setLayout(MenuButtonsLayout);
                        MenuButtons.setPreferredSize(new java.awt.Dimension(223, 267));
                             listall = new JButton();
                             MenuButtons.add(getListall());
                             listall.setText("List All");
                             listall.setBackground(new java.awt.Color(0,255,255));
                             listall.setForeground(new java.awt.Color(0,0,0));
                             listall.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
                             listall.setFont(new java.awt.Font("Arial",2,14));
                             listall.addActionListener(new ActionListener() {
                                  /* (non-Javadoc)
                                  * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
                                  public void actionPerformed(ActionEvent evt) {
                                       String XMLFile = "tractor.xml-courseworkasignment/src";
                                       //** Prints the contents of my XML file
                                       try {
                                       String s;
                                       BufferedReader in = new BufferedReader( new FileReader(XMLFile)
                                       outputscreen.setText("File successfully opened");
                                       try {
                                       while ( (s=in.readLine()) !=null)
                                       outputscreen.append(s);
                                       catch(Exception e) {
                                            outputscreen.append("Error reading line: " + e.getMessage());
                                       outputscreen.append("End of Document");
                                       catch(FileNotFoundException e) {
                                            outputscreen.append("Error in opening file: " + e.getMessage());
                             listallexbited = new JButton();
                             MenuButtons.add(getListallexbited());
                             listallexbited.setText("List All Tractors On Exhibition ");
                             listallexbited.setPreferredSize(new java.awt.Dimension(157, 57));
                             listallexbited.setBackground(new java.awt.Color(0,255,255));
                             listallexbited.setForeground(new java.awt.Color(64,0,0));
                             listallexbited.addActionListener(new ActionListener() {
                                  public void actionPerformed(ActionEvent evt) {
                                       outputscreen.repaint();
                                       String XMLFile = "C:tractor.xml";
                                  // Print contents of XML file
                                  try {
                                  String s;
                                  BufferedReader in = new BufferedReader( new FileReader(XMLFile)
                                  outputscreen.setText("File successfully opened");
                                  try {
                                  while ( (s=in.readLine()) !=null)
                                  outputscreen.append(s);
                                  catch(Exception e) {
                                       outputscreen.append("Error reading line: " + e.getMessage());
                                  outputscreen.append("End of Document");
                                  catch(FileNotFoundException e) {
                                       outputscreen.append("Error in opening file: " + e.getMessage());
                             addtractor = new JButton();
                             MenuButtons.add(getAddtractor());
                             addtractor.setText("Add Tractor ");
                             addtractor.setBackground(new java.awt.Color(0,255,255));
                             addtractor.setForeground(new java.awt.Color(64,0,0));
                             addtractor.addActionListener(new ActionListener() {
                                  public void actionPerformed(ActionEvent evt) {
                                       String manufacturer =JOptionPane.showInputDialog(getComponent(0), "Enter Manufacturer of Tractor");
                                       String shp = (JOptionPane.showInputDialog(getComponent(0), "Enter Horse Power of Tractor"));
                                       int hp =Integer.parseInt(shp);
                                       int sisRare =Integer.parseInt(JOptionPane.showInputDialog(getComponent(0), "Enter If the Tractor is rare (1=Yes/2=No)"));
                                       boolean isRare;
                                       if (sisRare== 1) {
                                       isRare =true;     
                                       }else
                                            isRare =false;
                                       String yom= JOptionPane.showInputDialog(getComponent(0), "Enter Year of Manufacture");
                                       int yearOfManufacture =Integer.parseInt(yom);
                                       String yis =JOptionPane.showInputDialog(getComponent(0), "Enter Number of years the Tractor has been in service");
                                       int yearsInService =Integer.parseInt(yis);
                                       String svalue = JOptionPane.showInputDialog(getComponent(0), "Enter Tractor's Value (?Pounds)");
                                       double value = Double.parseDouble(svalue);
                                       String lastWorkPlace =JOptionPane.showInputDialog(getComponent(0), "Enter Last Workplace");
                                            if(NewSwingApp.addTractor(new Tractor(manufacturer, hp, isRare, yearOfManufacture, yearsInService, value, lastWorkPlace, false)))
                                       JOptionPane.showMessageDialog((getComponent(0)), "Tractor Added");
                                       else
                                            JOptionPane.showMessageDialog(getComponent(0), "Could not Add Tractor");
                             deletetractor = new JButton();
                             MenuButtons.add(getDeletetractor());
                             deletetractor.setText("Delete Tractor ");
                             deletetractor.setBackground(new java.awt.Color(0,255,255));
                             deletetractor.setForeground(new java.awt.Color(64,0,0));
                             deletetractor.addActionListener(new ActionListener() {
                                  public void actionPerformed(ActionEvent evt) {
                                       System.out.println("deletetractor.actionPerformed, event="+evt);
                                       JOptionPane.showInputDialog(getComponent(0), "Enter Tractor ID");
                             exhibittractor = new JButton();
                             MenuButtons.add(getExhibittractor());
                             exhibittractor.setText("Exhibit Tractor");
                             exhibittractor.setBackground(new java.awt.Color(0,255,255));
                             exhibittractor.setForeground(new java.awt.Color(0,0,0));
                             exhibittractor.addActionListener(new ActionListener() {
                                  public void actionPerformed(ActionEvent evt) {
                                       System.out.println("exhibittractor.actionPerformed, event="+evt);
                                       JOptionPane.showInputDialog(getComponent(0), "Enter Tractor I.D");
                             archivetractor = new JButton();
                             MenuButtons.add(getArchivetractor());
                             archivetractor.setText("Archive Tractor");
                             archivetractor.setBackground(new java.awt.Color(0,255,255));
                             archivetractor.setForeground(new java.awt.Color(0,0,0));
                             archivetractor.addActionListener(new ActionListener() {
                                  public void actionPerformed(ActionEvent evt) {
                                       System.out.println("archivetractor.actionPerformed, event="+evt);
                                       JOptionPane.showInputDialog(getComponent(0), "Enter Tractor I.D");
                             searchmanufacturer = new JButton();
                             MenuButtons.add(searchmanufacturer);
                             searchmanufacturer.setText("Search Manufacturer");
                             searchmanufacturer.setPreferredSize(new java.awt.Dimension(159, 21));
                             searchmanufacturer.setBackground(new java.awt.Color(0,255,255));
                             searchmanufacturer.setForeground(new java.awt.Color(64,0,0));
                             searchmanufacturer.addActionListener(new ActionListener() {
                                  public void actionPerformed(ActionEvent evt) {
                                       System.out.println("searchmanufacturer.actionPerformed, event="+evt);
                                       JOptionPane.showInputDialog(getComponent(0), "Enter Manufacturer Name");
                        outputscreen = new JTextArea();
                        getContentPane().add(outputscreen, BorderLayout.CENTER);
                        outputscreen
                                  .setText("");
                        outputscreen.setBorder(BorderFactory.createTitledBorder(""));
                        outputscreen.setWrapStyleWord(true);
                        outputscreen.setEditable(false);
                        outputscreen.setEnabled(true);
                        outputscreen.setBackground(new java.awt.Color(255, 255, 255));
                        outputscreen.setForeground(new java.awt.Color(64, 0, 0));
                        companyname = new JLabel();
                        getContentPane().add(companyname, BorderLayout.NORTH);
                        companyname.setText(" Wolvesville Tractor Museum");
                        companyname.setPreferredSize(new java.awt.Dimension(609, 85));
                        companyname.setBackground(new java.awt.Color(255,255,0));
                        companyname.setFont(new java.awt.Font("Arial",1,28));
                        companyname.setForeground(new java.awt.Color(0,0,0));
                        companyname.setBorder(BorderFactory.createTitledBorder(""));
                        companyname.setOpaque(true);
                   this.setSize(750, 750);
              } catch (Exception e) {
                   e.printStackTrace();
         protected static boolean addTractor(Tractor tractor) {
                   if (tractor.getManufacturer()==null) return false; else
                   if (tractor.getHp()<50||tractor.getHp()>1100) return false; else
                   if (tractor.getIsRare()==false) return false; else
                   if (tractor.getYearsInService()<1||tractor.getYearsInService()>200) return false; else
                   if (tractor.getYearOfManufacture()<1800||tractor.getYearOfManufacture()>2008) return false; else
                   if (tractor.getValue()<100||tractor.getValue()>1500) return false; else
                   if (tractor.getLastWorkPlace()==null) return false; else
              return true;
         public JPanel getMenuButtons() {
              return MenuButtons;
         public JButton getListall() {
              return listall;
         public JLabel getCompanyname() {
              return companyname;
         public JButton getExitsystem() {
              return jButton3;
         public JButton getSearchmanufacturer() {
              return searchmanufacturer;
         public JButton getListallexbited() {
              return listallexbited;
         public JButton getAddtractor() {
              return addtractor;
         public JButton getDeletetractor() {
              return deletetractor;
         public JButton getExhibittractor() {
              return exhibittractor;
         public JButton getArchivetractor() {
              return archivetractor;
         public JTextArea getOutputscreenx() {
              return outputscreen;
    public void savetractors () {
         try {
              XMLEncoder encoder = new XMLEncoder(new FileOutputStream("tractor.xml"));
              encoder.writeObject(tractors);
              encoder.close();
         } catch (FileNotFoundException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
    public void loadtractors () {
    try {
              XMLDecoder decoder = new XMLDecoder(new FileInputStream("tractor.xml"));
              tractors = (Tractor[]) decoder.readObject();
              decoder.close();
              for (int i=0; i<tractors.length;i++) {
                   if (tractors!=null)numberOfTractors =i;
              numberOfTractors++;
         } catch (FileNotFoundException e) {
              // TODO Auto-generated catch block
              tractors=new Tractor[25];
              numberOfTractors=0;

    here's an example:
    http://jdj.sys-con.com/read/37550.htm
    you need to have a class Tractor with all those properties and then use readObject.Somehow you need to tell the Encoder/Decoder what Tractor means..
    hope this helps!!

  • How to display an XML file as it is in browser that XI sent to my J2EE appl

    Hi all!
    I have a scenario like File->XI->J2EE appl.
    The file is getting picked up from my machine by XI.
    Now XI should send that XML file to my J2EE appl.
    My servlet receives that XML and displays as it is in browser. But am getting some error like:
    XML page cannot be displayed.
    XML document must have a top level element. Error processing resource 'http://localhost:7001/Invoke/DisplayRes'.
    I deployed my .ear file on BEA Weblogic application server9.0
    I found no error when i tested in SXI_MONI and RWB->Message monitor as well.
    This is my servlet code:
    public class DisplayRes extends HttpServlet {
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    doPost(request,response);
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    BufferedReader brin =new BufferedReader(new InputStreamReader(request.getInputStream()));
    String inputLine;
    StringBuffer sBuf = new StringBuffer();
    PrintWriter out = response.getWriter();
    response.setContentType("text/xml");
    while ((inputLine = brin.readLine()) != null)
    sBuf.append(inputLine);
    //out.setContentType("text/xml");
    //out.println(sBuf.toString());
    out.write(sBuf.toString());
    brin.close();
    out.flush();
    what went  wrong? Help me
    Thanks

    Hi
    Can anyone tell me how XI sends messages to applications like J2EE. In REceiver comm channel, I think we specify about the target system like J2EE appl.
    Aadapter Type: HTTP
                   Receiver
    Transport Protocol:  HTTP1.0
    Message Protocol:    XI payload in HTTP body
    Adapter Engine:      Integration Server
    Addressing Type:     URL address
    Target host:         localhost
    Service Number:      7001(Port number of Weblogic appl server--where my J2EE appl is deployed).
    Path     :  /Invoke/DisplayRes/
    Authentication Type:Use Logon Data for SAP System
    Content Type: text/xml
    Username:   xiappluser
    password:   xx
    XML code:   UTF-8
    I suppose XI sends msgs to http://localhost:7001/Invoke/DisplayRes/........
    in this example if am correct?
    Then I have given all tyhe necessary setting but my servlet is not able to display XML msg in browser?
    This is my servlet code:
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
         PrintWriter out = response.getWriter();
         BufferedReader brin =new BufferedReader(new InputStreamReader(request.getInputStream()));
         String inputLine;
         StringBuffer sBuf = new StringBuffer();
            response.setContentType("text/xml");
         while ((inputLine = brin.readLine()) != null)
             sBuf.append(inputLine);
             out.println("hi");            
                out.println(sBuf.toString());
             brin.close();
             out.flush();
    What went wrong?
    Help me, all helpful answers are highly rewarded.
    Thanks

  • EC SALES LIST - Belgique: XML file: Content not accepted in prolog

    Hy tou you all,
    We've implemented all Ec sales list note oss for Belgium but at the upload in the delcaration vat system the xml file is not accepted : "Content not accepte in prolog"; Did this message encured to you ?
    Thanks,
    TF

    HI,
    I hope you are asking about below legal changes
    http://www.minfin.fgov.be/portail2/fr/e-services/intervat/calendrier.html
    and SAP DS colleagues are working on same and they are planning to release the note
    within soon.
    For same information will check the service market place.
    Thank you.
    Regards
    Madhu M

  • How to display an xml file as a tree in html

    Hi, JAVA/XML/XSLT/HTML gurus,
    I have an xml file and want to display it as a tree in html using XSLT.
    Is there any example for this?
    King regards,
    AG

    ... except for the "using XSLT" part. But that doesn't make sense anyway because XSLT doesn't display anything, it just transforms data.

  • Searching for BLOB xml file content

    Hi Gurus,
    I am having a table with a blob type column which is holding xml files. Is there a way to select records of the table based on specific words contained in the xml?
    Many Thanks,
    Napster

    rp0428 wrote:
    But if OP really wants to search the 'content' of the xml elements I don't see that working for them.
    Sure, he can.  All you have to do is add auto_section_group to the index parameters, then you can search within any of the specific tags, as demonstrated below.
    SCOTT@orcl12c> CREATE TABLE a_table
      2    (id          NUMBER,
      3      blob_type_column  BLOB)
      4  /
    Table created.
    SCOTT@orcl12c> INSERT INTO a_table VALUES (1,
      2  UTL_RAW.CAST_TO_RAW (
      3  '<a><b>something different</b><c>whatever you are looking for</c></a>'))
      4  /
    1 row created.
    SCOTT@orcl12c> INSERT INTO a_table VALUES (2,
      2  UTL_RAW.CAST_TO_RAW (
      3  '<a><b>something else</b><c>something different</c></a>'))
      4  /
    1 row created.
    SCOTT@orcl12c> CREATE INDEX test_index ON a_table (blob_type_column)
      2  INDEXTYPE IS CTXSYS.CONTEXT
      3  PARAMETERS ('SECTION GROUP CTXSYS.AUTO_SECTION_GROUP')
      4  /
    Index created.
    SCOTT@orcl12c> SELECT id, UTL_RAW.CAST_TO_VARCHAR2 (blob_type_column)
      2  FROM   a_table
      3  WHERE  CONTAINS
      4            (blob_type_column,
      5             '(whatever AND looking) WITHIN c') > 0
      6  /
            ID
    UTL_RAW.CAST_TO_VARCHAR2(BLOB_TYPE_COLUMN)
             1
    <a><b>something different</b><c>whatever you are looking for</c></a>
    1 row selected.
    SCOTT@orcl12c> SELECT id, UTL_RAW.CAST_TO_VARCHAR2 (blob_type_column)
      2  FROM   a_table
      3  WHERE  CONTAINS
      4            (blob_type_column,
      5             '(something different) WITHIN b') > 0
      6  /
            ID
    UTL_RAW.CAST_TO_VARCHAR2(BLOB_TYPE_COLUMN)
             1
    <a><b>something different</b><c>whatever you are looking for</c></a>
    1 row selected.
    SCOTT@orcl12c> SELECT id, UTL_RAW.CAST_TO_VARCHAR2 (blob_type_column)
      2  FROM   a_table
      3  WHERE  CONTAINS
      4            (blob_type_column,
      5             '(something different) WITHIN c') > 0
      6  /
            ID
    UTL_RAW.CAST_TO_VARCHAR2(BLOB_TYPE_COLUMN)
             2
    <a><b>something else</b><c>something different</c></a>
    1 row selected.

  • How to Display all xml files at time in the browser

    Hi,
    In my solution , it have one folder contain all xml files onliy like Billersettings.111.2.xml , Billersettings.113.2.xml...etc.
    Each xml file have only one record like biillerid,name,amount,date..etc. Now , when i run the page ,it should be show all files contained in form of gridview....
    i wrote some code , but shows error like.. Root element is missing. My code is here..
    protected
    void Page_Load(object
    sender, EventArgs e){
    if(!IsPostBack){
    String sFilepath =
    "Billersettings" +
    "*" +
    ".xml";
    string[] paths =
    Directory.GetFiles(@"D:\Fiserv\PWSunittest\PWSunittest\BillerSettings\",
    sFilepath);
    foreach (string
    xmlFile in paths)
    dataSet.ReadXml(xmlFile);
    GridView1.DataSource = dataSet;
    GridView1.DataBind();
    }  Please help  me
    Enugu Srinivasulu .NET Developer

    Hi,
    This forum is to discuss problems of C# development. Your question is not related to the topic of this forum.
    I suggestion you post the question in the ASP.NET forums at
    http://forums.asp.net/. It is appropriate and more experts will assist you.
    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.

Maybe you are looking for

  • 10.0.2 any books for dummies?

    Apple instruction assumes too much for me. Any books  for dummies?

  • All items needs to be entered again in Custom MIRO (for imports)

    We are doing imports. Now when we have to pay customs duty, we do MIRO. For custom duty payment, i have to copy all the items (like material number and quantity) in MIRO screen which is very hectic. So is there any way / setting where all the items a

  • Saving a file on Android?

    Hi Everyone, I'm having trouble saving a file on Android devices. I'm using the Air for Android packager and a Droid 2 if that matters. I have a base XML file that I want to open, manipulate and save. The base file is one of the 'included files' that

  • Firefox crashes when using Adobe Flash

    I am using the newest version of Firefox (5.0.1) and the newest version of Adobe Flash (10.3.183.5) without any other add-ons. For some reason Firefox keeps crashing when playing Flash. Anything from Youtube, Flash webpages, online games, etc. It's n

  • No behaviors work

    Just trying to get any behaviors to work. Even created a new page, set some text, and added "open browser window" as a behavior, and nothing happens, no rollover hand nothing. Im kind of new to Dreamweaver so not sure if im missing something obvious?