Load a list of images in an Array on the server dynamically

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    Load a list of images in an Array on the server dynamically

    Hi,
    we have the following problem:

    in our application v1.0 we have static html pages (+ some javascript).
    With a CMS (a Content Management System) some "mortal" people can add
    or expand the available images for the start site. The site loads
    randomly an image or a Flash animation (if the flash plugin is
    present) through a javascript and each time the start site loades and
    displays only 1 different picture. At the moment the name of these
    files are hardcoded (with relative paths) in a javascript and filled
    in an array.

    We have Java and some Javascript experience.

    The wish: the "mortal" can add pics/flash animation with the CMS in a
    specific folder.

    The problem: we must be able to display the new pics/flash without
    hard coding, this means, somehow the javascript must fill an array
    wich contains the name of all images/flash, dynamically. The script
    has to read the directory where these files are located and fill them
    in the array.

    The BIG problem: users do no have to download the jre if they don't
    want it (this is a business requirement).

    How can we fill the array dynamically with javascript? Ithink we
    should solve this problem on the server-side.

    If we have to do it with an applet and the read back the files in the
    script, then we also must solve it on the server.

    One requirement more: must work on Netscape 6.0 + 7.1 and IE 5.5 + 6.0
    No CGI, VBScript, PHP or ASP, because we have not the necessary
    know-how for it.

    Any suggestion/help will be VERY VERY appreciated..
    Haa a good day everybody

    John
  • Andrew S.

    #2
    Re: Load a list of images in an Array on the server dynamically

    zaku@freesurf.c h (John) wrote in message news:<9d8da62.0 404081650.3f5e3 6c6@posting.goo gle.com>...[color=blue]
    > Hi,
    > we have the following problem:
    >
    > in our application v1.0 we have static html pages (+ some javascript).
    > With a CMS (a Content Management System) some "mortal" people can add
    > or expand the available images for the start site. The site loads
    > randomly an image or a Flash animation (if the flash plugin is
    > present) through a javascript and each time the start site loades and
    > displays only 1 different picture. At the moment the name of these
    > files are hardcoded (with relative paths) in a javascript and filled
    > in an array.
    >
    > We have Java and some Javascript experience.
    >
    > The wish: the "mortal" can add pics/flash animation with the CMS in a
    > specific folder.
    >
    > The problem: we must be able to display the new pics/flash without
    > hard coding, this means, somehow the javascript must fill an array
    > wich contains the name of all images/flash, dynamically. The script
    > has to read the directory where these files are located and fill them
    > in the array.
    >
    > The BIG problem: users do no have to download the jre if they don't
    > want it (this is a business requirement).
    >
    > How can we fill the array dynamically with javascript? Ithink we
    > should solve this problem on the server-side.
    >
    > If we have to do it with an applet and the read back the files in the
    > script, then we also must solve it on the server.
    >
    > One requirement more: must work on Netscape 6.0 + 7.1 and IE 5.5 + 6.0
    > No CGI, VBScript, PHP or ASP, because we have not the necessary
    > know-how for it.
    >
    > Any suggestion/help will be VERY VERY appreciated..
    > Haa a good day everybody
    >
    > John[/color]

    It's a server-side issue to manage the List (or array).

    All your available image/Flash files must be easily identified (such
    as located in their own folder as you suggest). Get a List of the
    applicable files and store it in the Application context so it's
    immediately available to any http request that needs it (instead of
    having to rebuild the List all the time).

    When a mortal uploads a new image/Flash rebuild the List. Create a
    Servlet which accepts the uploaded image/Flash file, stores it, and
    rebuilds the List.

    Since you can't use static html files to build the client-side
    javascript, you'll need to look into using JSP or some other template
    technology in order to create the dynamic javascript.

    Andrew

    Comment

    Working...