Announcement

Collapse
No announcement yet.

Online Technology Editor

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Online Technology Editor

    After what has easily been the most grueling programming project in my life, I have finally finished Version 1.0 of my ASP XML Technology editor. I don't think its too shabby considering I barely knew any HTML at the beginning of the semester and I had to research all the XML stuff myself.

    Check it out.

    I will also put a link to it on my Clash website, which can be recched simply by clicking the "www" link in any of my posts.

    Current Functionality:
    1) View, modify and rename any XML file on the server.
    2) View all parts of the XML file in an XSL formatted table. This includes globals, technologies and helpers, applications and required techs, and activities and recipients.
    3) Modify any of the above values in the XML file.

    Current Limitations
    1) If you want to view anything other than Simple_Tech_Test.xml, you have to know the name of the file and type it in. (There isn't much else up there anyway)
    2) It can't yet add and delete any records/nodes; you are limited to modifying the ones already in the table.
    3) There is no input validation at all.

    Soon I hope to deal with those limitations. I should also think about making the pages look better.

    Feedback would be appreciated. I turned it in as my Honors project when it was only half done, and my teacher said it surpassed expectations. But that was only the second level programming class. What do you guys think? Can we use this?
    Last edited by Richard Bruns; December 11, 2001, 22:58.

  • #2
    Hi Richard:

    It looks pretty cool. I didn't play with anything since I am too tired .

    What is ASP?

    Cya,

    Mark
    Project Lead for The Clash of Civilizations
    A Unique civ-like game that will feature low micromanagement, great AI, and a Detailed Government model including internal power struggles. Demo 8 available Now! (go to D8 thread at top of forum).
    Check it out at the Clash Web Site and Forum right here at Apolyton!

    Comment


    • #3
      The XSL is nice! Can't think of anything to add.
      Mark, ASP is Active Server Pages. It's a way to process data on the server based on some request rather than e.g. sending an applet code to run on the client.
      I'll post comments about the content in another thread.

      About modification/creation:
      Richard, if you could add a button or something for "new activity" and so on in the Modify form, it would be nice.
      I am puzzled as to why your example file displays fine in Netscape but a modified file doesn't.
      It would be cool to put in a few carriage returns in the generated xml should some fool (like me) try to read it (I had to insert returns by hand before viewing it with my favorite editor). Admittedly, this is hardly important.
      Clash of Civilization team member
      (a civ-like game whose goal is low micromanagement and good AI)
      web site http://clash.apolyton.net/frame/index.shtml and forum here on apolyton)

      Comment


      • #4
        Originally posted by LDiCesare
        Richard, if you could add a button or something for "new activity" and so on in the Modify form, it would be nice.
        As I said, adding new stuff is on my "to-do" list. I was thinking of giving the user the option of generating the input form with a lot of blank input boxes under the filled-in ones. That way the parser would just read them all at once and save me a lot of trouble. I'd make the parser ignore the tech if the name box was blank, so that also gives the delete functionality we need.

        I am puzzled as to why your example file displays fine in Netscape but a modified file doesn't.

        Are you talking about displaying in the editor or viewing the straight XML file?

        If the editor, that may be due to the fact that I broke all the rules of proper table generation. I have one sub procedure that dynamically draws each table with input elements from the XML file, so the number of columns is not constant throughout the table. Internet Explorer autimatically corrects for this, but Netscape may not. If it is a problem, I may have to write a different procedure for every part of the tech file, and manually insert extra formatting instructions to make a proper table.

        If the problem is displaying the XML file, it may be due to the fact that the XML file generated by the code is one long unformatted string, while the example file is formatted nicely (I wrote it by hand.) I have to figure out how to make the editor format the file.

        It would be cool to put in a few carriage returns in the generated xml should some fool (like me) try to read it (I had to insert returns by hand before viewing it with my favorite editor).

        I would gladly do this if I knew how. Do you know the VB code for this off the top of your head?

        When messing with a different tech file, I noticed that the editor only displays the first word of a technology; it cuts off anything after a space. I'll have to fix that as well.

        Also I will need to optimize the code to try to get it to run faster. But that can wait until after the thing does what it is supposed to.

        Comment


        • #5
          Do you know the VB code for this off the top of your head?
          Not really but it depends on what function you call. You can add (Chr(13) + Chr(10)) to the string you write, which is line-feed + carriage-return (Windows being *@!# to use 2 characters instead of one). If tat doesn't work, which method do you call to write your file? I think Write (but not Print) puts one at the end automatically, but calling it more than once would probably be bad in terms of performance.
          Clash of Civilization team member
          (a civ-like game whose goal is low micromanagement and good AI)
          web site http://clash.apolyton.net/frame/index.shtml and forum here on apolyton)

          Comment


          • #6
            Originally posted by LDiCesare
            I think Write (but not Print) puts one at the end automatically, but calling it more than once would probably be bad in terms of performance.
            I tried writing out the XML file like that, but it requires using the Filesystem object and that was hideously slow. It took (I timed this) two seconds for every line that I wrote to the file. So now I am loading all the data into a DOM parser and saving it by:

            objDom.Save (Server.MapPath(datafile))

            This runs a lot faster, but I can't figure out how to format it nicely. The stuff is loaded into the DOM with a plethora of procedures like this:

            Sub SetTechValue(detailname, number)

            Set Detail = objDom.createElement(detailname)
            Entry.appendChild Detail
            Detail.Text = Request.Form("technology" & detailname & number)

            End Sub

            I can't figure out where or how I put code in to make the output look nice. I guess I'll have to keep trawling the web.

            Comment


            • #7
              Update

              Users now have the ability to add any number of new entries of any kind. From the start screen, you enter how many new entries you want, and what default values you want the new entries to have. This makes it easy to enter large amounts of data at once with only a few mouse clicks.

              You can also delete any entry by simply erasing its name before you click "submit."

              I have also fixed the bug that caused it to only display the first word of a name with spaces. Now the thing is actually a useful tool. It can do anything required to build up and edit the file, assuming the users know what they are doing. There is still no input validation, nor is there likely to be for a while.

              Next, I need to modify it to deal with the changes in the XML file. I also need to come up with a better file management system and see if I can get output that is formatted to be human-readable.

              Comment


              • #8
                A truly impressive effort!

                Of course we naturally are now thinking in terms of online editors for military material, maps, scenarios and the like.

                How about it?

                Cheers

                Comment


                • #9
                  I could probably adapt this to other XML files, like the military one, without too much trouble. But don't be fooled into thinking that this is anything other than a fancy XML file generator. It was designed to replace Notepad as an XML editing tool.

                  I wouldn't have a clue about how to do maps or any graphical stuff. This is all server-side, no scripting, which means that interactivity is close to nil.

                  All the entries have to be input at once, since the thing basically builds the XML file from nothing based on what is in the textbox elements. If you save to the same filename, it simply overwrites what is there. I haven't figured out how to load a file and only edit or change part of it.

                  Also, this thing is incapable of changing the structure of the XML file or any of the tag names. It relies on knowing exactly what the names of the tags are and how they are structured. Each and every one of those textboxes has to have a unique and loopable name.

                  I've only had one semester of VB and one for VB script, and XML wasn't in those classes at all. This thing is pushing my abilities to the limit.

                  Which, of course, makes it a lot of fun to work on.

                  Comment

                  Working...
                  X