Creating a dynamic jtree using datas retrieved by dom in xml parsing

help me with code to create a dynamic jtree using data retrieved as nodes by xml parsing using dom

Ok, so you want to make a tree. To determine the data that appears in a tree, you have to make a custom tree model. The API for this is at :
http://java.sun.com/j2se/1.4.2/docs/api/
A tutorial for using trees is at :
http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html
I assume you are going to be using Nodes, since you are using XML. For this I might start with something like
class NodeTreeModel implements TreeModelI would then implement the 'getChildCount()' as the number of subnodes a node has, and the value of a tree node to the nodes value.
Hope that starts you off.

Similar Messages

  • How to create a dynamic newsflash using dreamweaver and PHP

    Hi there,
       I would like to create a dynamic newsflash using dreamweaver and PHP in that the newsflash will be pulling information from a MySQL database. The newsflash should also have a link to view more information about the piece of news a user wants to know more about. Which tools do I need to use in dreamweaver and how's the procedure to go about that. Any advice is highly appreciated. Thanx in advance!

    I think you´ll need at least a MySQL table with the following columns:
    - id (primary key, int, auto_increment etc)
    - news_headline (varchar)
    - news_teaser (text)
    - news_content (text)
    What I´d personally add are columns such as:
    - news_date (date or datetime)
    - news_external_link (varchar), if a "read more..." link is supposed to navigate to an external URL rather than displaying the contens of the "news_contents" column.
    Based on such a MySQL table it should be easy to use Dreamweavers standard Server Behaviors to create the usual datalist.php, insert.php, update.php and delete.php documents, and there are numerous tutorials out there which will teach you how to do that.
    Am I right when assuming that you´ll also need to know how to automatically pull, say, the 5 most recent news records from the database ?

  • I need to know how I will create a dynamic website using php and mysql

    I need to know how will I create a dynamic website using php and mysql that people could have the abilities of registering in the website, and modify their profile where they can add their pictures and everything. apart from that, they should have the ability to search about other member. hope to here more from you.

    If you are a right-brained creative, and have no previous experience or propensity to be able to understand coding and database "stuff", and/or if your time can be better spent on other skills, I recommend you save your sanity and hire a developer... or at least the first time around. I have been attempting to grasp this for years... and have a library of marked up books to prove my efforts, all while trying to keep up with an ongoing client base that is always cramped. It's a wonder I still have my sanity... then again, I might not be the best person to determine that. Others might question it.
    That said, I still plan to master php... one of these days.

  • SQ02 - Create InfoSet using 'Data retrieval by program'

    Using SQ02, I would like to use the data returned by an ABAP program as the data source for an InfoSet.  When attempting to create an InfoSet, I noticed the 'Data retrieval by program' option.  I would like to discover how to use this option and how to pass parameters to the ABAP program I'd like to use.

    The "Data retrieval program" would be coded like any normal report except for adding a few comment tags that will be used by SQ01 query generator as placeholders to insert its own code into your code to generate the query program.
    In general this is how a data retrieval program is coded. SQ01 when it generates the query will insert its own code in place of *<Query_body> and *<Query_head> comment tags
    REPORT ztest_sq01_driver_program.
    TABLES: <name of dictionary structure of your infoset>.
    * DATA declarations
    START-OF-SELECTION.
    *<Query_head>
    * <Fetch your data here and store it in an internal table gt_report> that has all the fields that you need in your query
    END-OF-SELECTION.
      LOOP AT gt_report INTO gs_report.
        MOVE-CORRESPONDING gs_report TO <name of dictionary structure of your infoset>
    *<Query_body>
      ENDLOOP.

  • Create JTree using data from DataBase

    Hi all,
    I have GUI with JTree, and i have data in database with ParentID, ChiledID fileds,
    i want to crate tree structure from using data in database.
    can you people tell me how can i proceed, I will get a data as List of Vectors from DB.
    Thanks
    Daya

    i got the solution,
    what i did i having object class extended DefaultMutableTreeNode and i have list of objects class refrence and i know which is parent and a child so just add the child refrence to parent refrence which stored in list.
    Thanks
    daya

  • Problem - Creating a Dynamic LOV using duplicate value in select statement

    I am trying to create a Dynamic LOV by attempting to follow a pattern similar to the following:
    select shop_name d, shop_id r
    from shops
    order by 1
    However, I want to use the shop_name twice as in the following because I do not have any other unique identifier available such as a shop_id to associate with the shop name:
    select shop_name d, shop_name r
    from shops
    order by 1
    But I get an error where I am not allowed to duplicate the shop_name in the select statement. I read somewhere on this forum where it can be done but I can't find exactly how.
    Can someone tell or show me how to accomplish this?
    Thanks in anticipation for your answer.
    Thanks,
    Ric

    Ric,
    I just tried to do this on APEX 3.0, and it worked just fine with this SQL:
    select ename d, ename r from emp order by 1Perhaps you could put an example on apex.oracle.com or specify the error message that you're getting.
    So as long as you have uniquely aliased both columns, this should not present a problem.
    Thanks,
    - Scott -

  • How do I create a Dynamic java.sql.Date ArrayList or Collection?

    I Have a MySQL table with a Datetime field with many values inserted.
    I want to know which is the Best way to capture all the Inserted DB values inside a Dynamic Array.
    I get errors that state that I should use Matching data-types, and plus I don't know how to create or fill a Dynamic Date ArrayList/Collection.
    Please Help, I need this urgently...

    package pruebadedates;
    import java.sql.*;
    * @author J?s?
    public class ClaseDeDates {
        /** Creates a new instance of ClaseDeDates */
         * @param args the command line arguments
        public static void main(String[] args) {
            java.sql.Date aDate[] = null;       
            Connection con = null;
            Statement stmt = null;
            ResultSet rs = null;
            try{
                Class.forName("com.mysql.jdbc.Driver").newInstance();
                con = DriverManager.getConnection("jdbc:mysql://localhost/pruebafechas", "root", "picardias");
                    if(!con.isClosed()){
                    stmt = con.createStatement();
                    stmt.executeQuery ("SELECT dates FROM datestable");
                    rs = stmt.getResultSet();
                        while (rs.next())
                        aDate[] = rs.getDate("dates");
            catch(Exception e)
               System.out.println(e);
            //System.out.println(aDate);     
    }Hi, There is my code and the errors that I get are:
    found : java.sql.Date
    required: java.sql.Date[]
    aDate = rs.getDate("dates");
    Actually I have No idea as How to get a Result set into an ArrayList or Collection. Please tell me how to do this Dynamically. I have like 25 records in that Database table, but they will grow, so I would really appreciate to know the code to do this. I suspect my problem is in the bolded part of my code.
    Thank you very much Sir.

  • Creating a business partner using data from a remote legacy system

    Hi Experts,
    I am trying to make an interface for creating a business partner in SAP CRM from customer data created in a remote legacy system. I want to map the fields in XI.
    But to create a customer I need a RFC or a BAPI or maybe an IDoc, that includes all fields for business partner creation and can create a new business partner from the data.
    I have identified an RFC that have the structure of the BDoc BUPA_MAIN. This RFC is called: CRM_BUPA_MAIN_CRM_IN
    But I am not sure if that RFC can be used for Business Partner creation.
    Can anyone tell me if that RFC can be used, or if there are other RFC's, BAPI's or IDoc's that can be used for remote creation of business partners (they have to include all fields of the Business Partner)??
    There are a few BAPI's that include some of the fields for BP creation, but making several calls to different BAPIs from XI to CRM is not an option (I thought the BAPI: BAPI_BUPA_FS_CREATE_FROM_DATA could have been used, but it lacks some of the data fields needed for creating BPs).
    Thanks in advance,
    Torsten
    Edited by: Torsten Sander on Apr 22, 2008 2:48 PM

    Hi Experts,
    I am trying to make an interface for creating a business partner in SAP CRM from customer data created in a remote legacy system. I want to map the fields in XI.
    But to create a customer I need a RFC or a BAPI or maybe an IDoc, that includes all fields for business partner creation and can create a new business partner from the data.
    I have identified an RFC that have the structure of the BDoc BUPA_MAIN. This RFC is called: CRM_BUPA_MAIN_CRM_IN
    But I am not sure if that RFC can be used for Business Partner creation.
    Can anyone tell me if that RFC can be used, or if there are other RFC's, BAPI's or IDoc's that can be used for remote creation of business partners (they have to include all fields of the Business Partner)??
    There are a few BAPI's that include some of the fields for BP creation, but making several calls to different BAPIs from XI to CRM is not an option (I thought the BAPI: BAPI_BUPA_FS_CREATE_FROM_DATA could have been used, but it lacks some of the data fields needed for creating BPs).
    Thanks in advance,
    Torsten
    Edited by: Torsten Sander on Apr 22, 2008 2:48 PM

  • Managed bean can not be created. - dynamic menubar using ADF

    hi All,
    had to post the thread again to make sure it dint go un noticed!
    scenario:
    making dynamic menu navigation using ADFFaces, all steps followed as mentioned in SRDemo Sample. but still i get this error:
    error encountered:
    SEVERE:Managedbean menuItem_General could not be created.
    javax.faces.FacesException:Can't get value from value binding expression: '#{resources['erms.menu.gen']}'.
    more details here on last thread posted:
    ADF- managedbean creation error while making dynamic menus.
    plz help!

    We found the solution how it works... But its a little bit strange.
    Before we had the following on the sending part:
    connectionFactory = (ConnectionFactory) ctx.lookup("jmsfactory/default/FactoryName");
    destination = (Queue) ctx.lookup("jmsqueues/default/QueueName");
    We could not use EJB injection here as the place were it was used is a POJO.
    Now in our Job-Bean we do the following:
         @Resource(name="FactoryName")
         private ConnectionFactory connectionFactory;
         @Resource(name="QueueName")
         private Queue destination;
    and then we transfer the connection factory and queue to our POJO... and it works... From our understanding both should be the same???
    Frank

  • Creating a dynamic grid using actionscript

    Hello all:
    I am working on a Flash project which requires that the user
    input 2 values. These two values will be used as height and width
    to generate a dynamic grid. I am new to actionscript and am
    struggling with how to create the 2 input fields and pass the
    values to actionscript by an event such as the user pressing
    return. The code below will create the grid correctly based upon
    the hardcoded variable values hightlighted, but I need the user to
    enter the values and press return to generate the grid.
    Can anyone suggest the actionscript required to capture the 2
    values, send them to actionscript with an event such as pressing
    return and then have AS generate the grid width and height based
    upon the user input. The i (10) and j (10) values in line 4 and 5
    are the values that I need to have the user input to generate the
    grid.
    Any help will be most appreciated!
    initX = 0;
    initY = 0;
    counter = 0;
    for (var i = 1; i<=10; i++) {
    for (var j = 1; j<=10; j++) {
    counter++;
    grid_container.attachMovie("cellMC", "cell"+counter,
    counter);
    grid_container["cell"+counter]._x = initX;
    grid_container["cell"+counter]._y = initY;
    grid_container["cell"+counter].onRelease = function() {
    cellName.text = this._name;
    initX += 30;
    initY += 30;
    initX = 0;

    Thanks for the quick reponse kglad. I will give it a
    go.

  • Help: Creating a Dynamic TreeView Using JSP

    I'm involved in a research project developing a webclient for the subversion VCS. I was able to access the repository and get the content as a string using the JavaSVN Library. It is like follows
    A/
    A/1.txt
    A/B/2.txt
    A/B/3.txt
    C/
    C/4.txt
    The problem i'am having is that displaying this out put in a tree Type Structure. So any one can help me this any matter is greatly appriciated
    Regards,
    Samantha

    Javascript open source for Tree Menu
    http://www.softcomplex.com/products/tigra_tree_menu_pro/

  • Dynamic tables with data driven visibility of columns (XML).

    Hi
    I am trying to make a template in LiveCycle Designer (XDP) with a dynamic table, and with dynamic visibility of columns.
    I want the column visibility to be driven by the xml input.
    (There is no user input.)
    I want the columns to visible in the table only if one or more of the rows has a data cell with value in a spesific column. If not the entire column should dissappear from the generated pdf.
    If that is not possible, my alternative is so set a value in th XML file to hide a tables column. But how?
    I have no problems of making dynamic tables, that is solved.
    I only want to hide unused columns in a table, defined in the xml source file.
    Can anyone help?
    Borge

    Hi,
    The link is not working..
    Please provide a valid link.

  • Is there a way to use a progress bar with Xerces XML Parser?

    My program is parsing very long XML files that take several minutes to parse. I am using Xerces as the parser. I would like to use a progress bar to show the progress, but I haven't found any way to get Xerces to give progress updates. Is this possible?

    Use teh SAX parser and listen to SAX events. Example:
    import java.io.*;
    import java.util.*;
    //jaxp-api.jar:
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    //sax.jar:
    import org.xml.sax.Attributes;
    import org.xml.sax.InputSource;
    import org.xml.sax.XMLReader;
    import org.xml.sax.helpers.DefaultHandler;
    import mine.IOUtils;
    * Handler to read content from (large) XML sources and send events to registered XMLListeners. Use this class to read
    * big (multiple megabytes) XML files via SAX and listen to XML events to process XML elements.
    * For small (less than a megabyte) XML files, it's more convenient to use the DOM API
    * to read the XML into a DOM document and perform XPath commands. DOM is easier to handle but has
    * the drawback that the complete XML content is stored in one big DOM document object in memory.
    public final class XMLHandler extends DefaultHandler {
        /** (Reusable) XMLReader to parse an XML document. */
        private XMLReader xmlReader = null;
        /** Registered XMLEventListeners. */
        private List<XMLListener> listeners = new ArrayList<XMLListener>();
        /** Value of current element. */
        private StringBuilder elementValue = null;
        /** Stack of current element and all of its parent elements. */
        private Stack<String> elementStack = new Stack<String>();
         * Constructor.
         * @throws Exception
        public XMLHandler() throws Exception {
            super();
            // Create a JAXP SAXParserFactory and configure it
            final SAXParserFactory spf = SAXParserFactory.newInstance(); //Use the default (non-validating) parser
            spf.setValidating(true);
            // Create a JAXP SAXParser
            final SAXParser saxParser = spf.newSAXParser();
            // Get the encapsulated SAX XMLReader
            xmlReader = saxParser.getXMLReader();
            xmlReader.setContentHandler(this);
            xmlReader.setDTDHandler(this);
            xmlReader.setEntityResolver(this);
            xmlReader.setErrorHandler(this);
        }//XMLHandler()
          * Add XMLListener to receive XML events from the current XML document.
         *  If <i>listener</i> is null, no exception is thrown and no action is performed.
          * @param listener XMLListener to add.
         public void addXMLEventListener(final XMLListener listener) {
            if (listener != null) {
                listeners.add(listener);
        }//addXMLEventListener()
         * Parse current XML document. Registered XMLEventListeners will receive events during parsing.
         * @param fileName Name of file to read XML content from.
         * @throws Exception
        public void parse(final String fileName) throws Exception {
            if (fileName != null) {
                parse(IOUtils.openInputStream(fileName));
        }//readXML()
          * Parse current XML document. Registered XMLEventListeners will receive events during parsing.
         * @param inputStream InputStream to read XML content from.
          * @throws Exception
         public void parse(final InputStream inputStream) throws Exception {
            if (inputStream != null) {
                xmlReader.parse(new InputSource(inputStream));
        }//readXML()
         * Overwrite super.
         * Receive notification of the beginning of the document.
        @Override
        public void startDocument() {
            for (XMLListener l : listeners) {
                l.documentStarted();
        }//startDocument()
         * Overwrites super.
         * Receive notification of the start of an element.
        @Override
        public void startElement(final String uri, final String localName, final String qName, final Attributes atts) {
            elementStack.push(qName);
            for (XMLListener l : listeners) {
                l.elementStarted(qName, elementStack);
            elementValue = new StringBuilder(); //element value
            //element attributes:
            if (atts.getLength() > 0) {
                String attName = null;
                for (int i = 0; i < atts.getLength(); i++) {
                    attName = atts.getQName(i);
                    final String attValue = atts.getValue(i);
                    for (XMLListener l : listeners) {
                        l.attributeRead(qName, attName, attValue);
                }//next attribute
            }//else: no attributes
        }//startElement()
         * Overwrites super.
         * Receive notification of character data inside an element. This method can be called multiple times
         * from SAX, so we need to append all results of all calls to the final element value.
        @Override
        public void characters(final char ch[], final int start, final int length) {
            String s = new String(ch, start, length);
            elementValue.append(s);
        }//characters()
         * Overwrites super.
         * Receive notification of the end of an element.
        @Override
        public void endElement(final String uri, final String localName, final String qName) {
            for (XMLListener l : listeners) {
                l.elementEnded(qName, elementValue.toString());
            elementStack.pop();
        }//endElement()
         * Overwrite super.
         * Receive notification of the end of the document.
        @Override
        public void endDocument() {
            for (XMLListener l : listeners) {
                l.documentEnded();
        }//endDocument()
    }//XMLHandler

  • Using UTL_I18N.ESCAPE_REFERENCE still results in XML Parsing Failed'

    Trying to create an RSS feed from a list of newly delivered library materials, and it's all working except for one record with a Turkish character in it. I am trying to convert that value into AL32UTF8 (the database is UTF8) in the XMLElement call, but I still receive errors that the parsing failed at line 24, which is just before the beginning of the loop to aggregate the xmlelements.
    Any pointers to what I am doing wrong, conceptually and technically, would be gratefully received, thanks very much for any assistance and/or pointers here.
    Peter
    create or replace
    PROCEDURE "RSSLOOPWORKS2" ( fund_in IN VARCHAR2)
    is
    -- customizable parameters
    l_title varchar2(255) := ' New Titles Since ' || to_char(sysdate - 90, 'MM/DD/YYYY');
    l_link varchar2(255) := 'replace this' || fund_in || '.rss';
    l_description varchar2(255) := 'This is a feed of changes to items ' || fund_in;
    l_language varchar2(255) := 'en-us';
    -- end customizable parameters
    l_version varchar2(10) := '2.0';
    l_clob clob;
    l_idx pls_integer := 1;
    l_len pls_integer := 255;
    l_defrows pls_integer := 100;
    l_maxrows pls_integer := 100;
    l_desclen pls_integer := 250;
    -- for output to file
    begin
    -- fund := fund_in;
    for i in (
    select xmlelement( "rss",
    -- Begin XML Header Block
    xmlattributes( l_version as "version"),
    xmlelement( "channel",
    xmlforest( l_title as "title",
    l_link as "link",
    l_description as "description",
    l_language as "language"),
    -- End XML Header Block
    -- Begin List of Individual Articles or Items
    xmlagg(
    xmlelement( "item",
    CASE
    WHEN x.title IS NOT NULL THEN xmlelement("title", x.title)
    ELSE xmlelement("title", substr(UTL_I18N.ESCAPE_REFERENCE(x.description,'AL32UTF8'),1,255))
    END,
    xmlelement("link", x.link),
    xmlelement("description", UTL_I18N.ESCAPE_REFERENCE(x.description,'AL32UTF8') || ' -- Call number: ' || x.callnum),
    xmlelement("callnum", x.callnum),
    xmlelement("pubDate", to_char(x.updated_on,'Dy, DD Mon RRRR hh24:mi:ss') || ' EST'),
    xmlelement("guid", XMLATTRIBUTES('false' as "isPermaLink"),x.id||to_char(x.updated_on,'JHH24MISS'))
    -- End List of Individual Articles or Items
    ) as result
    from ( -- Actual Database Query that populates the list of Items
    select id,title,link,description,updated_on, callnum
    from drx_rss_feeds
    where (fund like fund_in||'%')
    and rownum < (l_maxrows+1)) x)
    loop
    l_clob := xmltype.extract(i.result,'/').getclobval;
    exit;
    end loop; --i
    --- OUTPUT RESULTS
    -- for i in 1..ceil(dbms_lob.getlength(l_clob)/l_len) loop
    dbms_xslprocessor.clob2file(l_clob, '/iiidb/http/live/screens/rss/', fund_in || '.rss');
    -- l_idx := l_idx + l_len;
    -- end loop; --i
    end rssloopworks2;

    Is your database characater set AL32UTF8 or UTF8. If it's not AL32UTF8 please convert and try again... Database character set UTF8 is not a complete implementation of XML's UTF-8 encoding.

  • Question regarding the creation of a custom dynamic stamp using "Will Print" from "Set Doc. Actions

    Hi all,
    Using Acrobat 9.0 Professional, I have successfully created a dynamic stamp using the forums where I have added Login / Date to my own image and it works great as designed.  However, the problem I am having is that when a document is stamped it becomes flat and doesn't update dynamically which does not work for my requirements.
    I need to create a pdf that is stamped by myself so that other users (using only Reader) can open the pdf and when printed the stamp will print with the correct date/time (in the format I describe below).
    I found a workaround (outside of a stamp) where I added a text box (called "Today") that updates everytime the document is printed by going to
    Advanced / Document Processing / Set Document Actions / Document Will Print
    and adding the following Java Code:
    var f = this.getField("Today");
    f.value = util.printd('yyyymmddhMMss', new Date());
    This provides me with the unique number that I need for printing  (ie: 20100317102030).  It works great as an inserted text field on my pdf.
    My problem is that when I use the "create custom stamp" as in other tutorials by inserting this new text field, it will not update (or display) on print, even though it was set the exact same way as the custom stamp I got working using the Adobe dynamic stamp information.
    Can you offer any advice on how I can get this to work as a custom stamp?  I would rather not have to create both a stamp and then overlay the text field manually as I have hundreds of documents (maybe more) to do this for.
    Also, as an aside, if I could get this to work, I would also like to add Login ID that updates in the same manner as my custom date format (but one problem at a time I guess! )
    Thanks for any and all help that you can provide.  I looked through these forums and elsewhere, but I don't seem to see anyone else with the same problems (with solutions posted).
    I really wish Adobe had a Custom Stamp creator as part of their program, with the dynamic option.  It would be so easy for them and save a lot of users so much time.

    Stamps are just like a inked rubber stamp, except in Acrobat you can suppress printing them and you can move them. So if you use a dated "Faxed" stamp when you fax a document, even though you can adjust the stamp before affixing the stamp, once the document is stamped the date on the document can not be changed or moved. It appears, that the use of a stamp might not be the best solution.
    "Interactive" means Acrobat JavaScript programing.
    With JavaScript not only can you insert variable data but also fixed text strings or a combination of both.
    So your script could be updated to something like:
    var f = this.getField("Today");
    f.value = "Printed : " + util.printd('yyyymmddhMMss', new Date());
    http://forums.adobe.com/message/1333261#1333261
    Getting the 'login name" will require some special JavaScript code being added to an application level JavaScript folder that runs upon initialization and is the data or function created is then accessed  by your PDF. This file will need to be installed on each user's system.
    http://www.acrobatusers.com/forums/aucbb/viewtopic.php?pid=30444

Maybe you are looking for

  • Itunes always changes or delets my playlists I make on my phone.

    I even have 'prevent from syncing' clicked on but every time I plug my iphone in it deletes all the songs I have added to my playlist. I tried to click "manaually manage music and videos" but when I click apply it warns me that it is going to erase m

  • How to find out version, support package, patchlevel of installed j2ee as

    Hello all We have PI 7.11 installed and I'd like to know what the support package and patchlevel of our installed j2ee application server is. We would like to post-install NWDI and need to know which are the right SCA-Files for us to download. Can an

  • Reporting Services Server cannot connect to the DPM database. ( dpm 2010 )

    Reporting Services Server cannot connect to the DPM database. To repair the configuration, follow steps for repairing DPM from DPM Setup Help. ID: 3001 i can not try the Recommended action from error codes catalog because i did not found Change repor

  • Dedection is not capturing in vendor payment advice

    Hi All, I need your help to slove this problem, when i run F-58 print with payment in that payment advice dedection amout is capturing in dedection coloum, when i run APP (F110) in payment advice dedection amount is not capturing in dection coloum fo

  • HT5766 problems with download

    Im trying to install a newer version of itunes onto my computer, Ive tried 10.6.3 and 11.0.3 and it keeps giving me and error code 2749 I think ad will not finish the downloa