wiki:S2S_WEB_RESOURCE_MANIPULATION_R4
Last modified 15 years ago Last modified on 10/30/09 15:01:35

Error: Macro BackLinksMenu(None) failed
compressed data is corrupt

Error: Macro TicketQuery(summary=S2S_WEB_RESOURCE_MANIPULATION_R4, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|) failed
current transaction is aborted, commands ignored until end of transaction block

Analysis

(Give as much as possible of the needed information for designing and implementing the task in the following sections.)

Overview

Here is an example tree of the data for a sophie2 server

  • There are three users: admin, peter, and sophie2_user
  • Groups
    • Two predefined: everyone and admin
    • One custom peters_friends


These data can be accessed by the sophie 2 server web ui as follow:

  • A user's profile is accessible at url <server-address>users/<user-name> if current user can access it. By default only a own profile is accessible.
    • A user can access it's own profile by clicking Edit Profile link (which is available after login)
  • The resources are accessible at url <server-address>/resources
    • Resources can be viewed by clicking the browse menu item.
    • If current user is logged in the browse menu item navigates to <server-address>/resources/<user-name>
    • The resource contains a folder for every registered user who has some content.
  • The groups are not implemented for now and are not part of these analysis.

Task requirements

The following things should be added.

Optional
  * group item in the main menu used for
        * creating a group
        * adding a member to a group
        * (optional) giving read or write permissions for a member of a group
        * a definite user can see only his resources if nobody gives him permission for others
        * a group name is created by the name chose by the user plus the user's unique name. In this way no groups with equal names can exist.
  • add delete button for a definite resource
  • add upload button, giving the ability to upload a new resource
  • opening a resource now gives a common information for the resource, but some more things should be added:
    • last change information
    • all child resources which can also be opened
  • all the downloaded resources are in the corresponding format(if jpg, in jpg; if pdf in pdf; if sjrb, in sjrb).
  • frames and pages are not available to be downloaded.
  • Texts and comments are exported in rtf format.

Task result

Source code

Implementation idea

Optional
 * Add group as a new item in the main menu.
  • Add "upload" button in the "browse" page.
  • Add "delete" button next to the "download" one appearing for each resource.

RESOURCES_EXPORT_IMPORT_R0

How to demo

  1. Open "browse" and see there your resources.
  2. Upload a book resource as the book has a text frame in it.
  3. Open the book resource and the text resource should be there.
  4. Open the text resource.
  5. Download the resource and notice the downloaded resource is in rtf format.

    Optional
     1. Open "group"
     2. Create a new group
     3. Add an existing user to your group
     4. (optional) Give him a permission for reading for an existing resource
    

Design

The solutions is based on following components

Refactoring

  • HandleContext - is used by all the BaseHandlerSupport subclasses instead of Request and Response so a developer will can easily mock it.
  • WebUIContext - has common access to WebUI module extension points including (connectors and resourceHelper) also some logic about getting the right facade and opening accesses.

New Features

  • ServerResourceHalper - Now there is the server data initialization logic and also holds the server resource app locator.
  • Navigator - Takes care of navigation. It is produced by the HandleContext.
  • Views - some new views are implemented for directory and book resources (resource_directory.jspx and resource_book.jspx). Also the default resource view (resource.jspx) was fixed.
  • resource changes - there are now a tag resourceChanges which prints the history of given resource.
  • actions - there are tags for different resource actions. For now they are download view and delete.
  • Renderers
    • When a request is received to execute some action about some resource a ResourceRenderer is handling the logic.
    • The ResourceRendererProvider creates a renderer for specified resource and action
    • Renderer implementations
      • ViewResourceRenderer - is created by given resource and view page. There is convention about resource view page names. There is one default called resource.jspx and if there is specific

view page for different kind of resource they should be named resource_<kind>.jspx where <kind> is the kind of the resource. for example resource_directory.jspx, resource_book.jspx - directory and book are resource kinds.

  • DownloadResourceRenderer - Creates a zip for the resource and returns it to the client.
  • DeleteResourceRenderer - Deletes a resource and redirects to parent.
  • Upload - a resource can be uploaded in resource directory. The request for uploading are handled by UploadResourceHandler. It find the parent directory by inspecting the referrer request header.
    • Upload make uses of Jetty's MultipartFilter.

Implementation

Is in /branches/private/tsachev/server-web

Testing

(Place the testing results here.)

Comments

(Write comments for this or later revisions here.)

Attachments