This blog records some ideas, notes, and information of my works and studies in information technology.

Wednesday, May 6, 2009

[TSM] Problems to be solved...

  1. File uploading
    Use org.apache.struts.upload.FormFile to store the uploading file
  2. File downloading
    Extend org.apache.struts.actions.DownloadAction and create your own downloading action.
    a. Save the data from DB to a temporary file.
    b. Link a special id with the generated file.
    c. Return the id.
    Then the actions using this downloading action could generate a hyper link with the id. End users click on the link and system would call downloading action and pass the id. DownloadAction will return FileStreamInfo object.

    POINT: Override the function:
    protected StreamInfo getStreamInfo(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)

  3. Applet File saving (in the database or on the disk?)
    I decided to save applet files in the database. Ray told me that there are one advantages in saving files in the DB:
    You only need to backup DB and all data could be backuped in one step! (Consistence)
    The way to save your files into a DB is using org.apache.commons.codec.binary.Base64, which is in the commons-codec package.
    You should Use Base64 to encode binary data to plain text and save it into the DB.
    If you want to retrieve the data, you can use Base64 to decode the data from DB!

    Why should we use TEXT type to save binary data?

    Ray told me that: If you use Blob to save binary data, the saving way could be different in different DB provider!
    And you also have chances that you can't retrive data by normal "select" ways.
    Flexibility is lost!
  4. Do I have to change the common library in TSMWeb?
    Add new common library in TSMWeb. But keep the old one.
  5. Controlling exception
    Create TSMException, use try-catch to direct system message to error page
  6. Logging system
    Use java.util.logging.* to create a new logging system.
    It's not necessary because Jboss has it's own logging system. (The log file is in jboss-5.0.0.GA\server\default\log\.)
    http://www.jboss.org/community/docs/DOC-11280
    http://java.dzone.com/articles/configuring-logging-jboss
    How to set up Jboss logging system~
  7. TSMWeb call TSMEJB session bean
    Set up development environment
    Use the methods in the Orelly EJB 3 book. The main problem is that if you want to call an EJB remote call, you have to include necessary libraries listed in jboss-5.0.0.GA\client\jbossall-client.jar. Now I decided to put TSMWeb and TSMEJB both on the Jboss Envirnment because the jboss-javaee.jar conflicts with Servlet.class in Tomcat server.
  8. How to show Constant String from Constant Integer in JSP?
    Implement SimpleTagSupport libaray!!!!
  9. UserLoginFilter is waiting for being finished!!
    Finished
  10. Modify the primary key of CardSet and KeyProfile tables
    I decided to use UUID as primary keys of CardSet and KeyProfile tables

No comments:

Post a Comment