Announcement Announcement Module
Collapse
No announcement yet.
Database tree data and tree browsing Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Database tree data and tree browsing

    Hi all,


    I know that the subject indicates maybe a post on the wrong forum, but the questions are not on data access properly speaking.

    I have to re-design a module that displays multimedia catalogs for 3G mobile phones.

    The catalogs are stored as trees in a database. The tree is changing with the connexion type and with time (for ex. porn categories are displayed only after certain hours of the day). At each page we must know the mother and daughters of the category, and sometimes the little-daughters.

    For now, each time a connexion is made on the site, the tree is built with DAO's, and kept in HTTP session. A node of the tree (for example a video) is accessed via a request parameters like this :
    http://myservice/navigate.jgi?catid=12345&videoid=54321
    And after that, a recursive method was browsing the whole tree until it found the node.

    I was wondering :
    1) is there a better way to organise url's (like /cat1/cat12/cat121?videoid=54321), to go straight to the node
    2) how could I implement in an elegant manner a servlet that would allow the browsing of the tree (subclassing DispatcherServlet ?)
    3) how could I limit the amount of data hold into the session

    Thanks for your answsers.

    Bruno Thomas

    PS : sorry for my poor english

  • #2
    For point 1, do a google on "REST web".

    Comment


    • #3
      Originally posted by yatesco
      For point 1, do a google on "REST web".
      Thank you, your advice is of a great help.

      Usually I don't reply to such noisy answers, but maybe my initial post need some explanations.

      In fact, in our situation, the hierarchy represents models and not views. The navigating views are a very small set of 3 or 4 views with a proprietary markup language. So the tree is a model tree of topics and items.

      The question I was maybe clumsily ask is whether it is better to organise urls to classic hierachy like the yatesco "REST of web" (and in fact it not always the case) and make a specific servlet to treat this model tree, or to organise it with real views and passing the model (stored in database) with parameter.

      Thx again,

      Bruno Thomas

      Comment


      • #4
        Not sure what was noisy about my reply

        Anyways, I am not sure I get what your problem is?

        Why not have a single controller /render.htm and pass in the id that you want?

        Is the data structured such that you can jump to any one place in the "model" and navigate to its parent and its children? If so, whats the problem?

        Comment


        • #5
          Originally posted by yatesco
          Why not have a single controller /render.htm and pass in the id that you want?

          Is the data structured such that you can jump to any one place in the "model" and navigate to its parent and its children? If so, whats the problem?
          The problem is about virtual url trees. I was wondering if someone has allready done this : in fact it is the treatment of parameters as paths, it allows :
          1) to use the whole navigation path information without searching among persistent data or business objects
          2) to cleanly expose the urls to the final user

          The problem is also about the stored data tree, because I need some information of daughters and little daughters to provide some user navigation information, and I want to avoid the loading of the whole tree in session (as it is done now, but the amout of data contained in trees are bigger and bigger, yep content providers are working too).

          I think I'm gonna cache the tree as the user navigates.

          In fact I was wondering how were managed the urls of the springframework.org site like :
          http://www.springframework.org/node/143
          http://www.springframework.org/taxonomy/term/7

          Regards,

          Bruno Thomas

          Comment


          • #6
            I'm not sure I understand your questions, so ignore me if I'm being "noisy" as well.

            Are you looking for mod_rewrite?

            Comment


            • #7
              Originally posted by manifoldronin
              I'm not sure I understand your questions, so ignore me if I'm being "noisy" as well.
              nope my questions must be very unclear...

              Originally posted by manifoldronin
              Are you looking for mod_rewrite?
              Not exactly. Actually, as you can see, I just descovered this forum, and I was wondering if another people have had the same requierements than me, i.e. :
              - models stored in database
              - parallel browsing of a models tree (for the controler(s) servlet(s)) and a urls tree (at a user point of view)
              - keep history of browsing (with back & forward buttons and so on)
              - session management with helpers to cache data and reduce database access

              That's all !!

              By the way thank you for your noise anyway :wink:

              Bruno Thomas

              Comment

              Working...
              X