Analysis
Overview
The goal of this task is to allow the users to manage, edit and view resource on Sophie 2 Server site.
- This will happen on 2 steps.
- First of all there should be a list of available resources inside resource section, or search results section.
- The list should include resource name, resource type(image,text,book etc.), indication of rights, owner.
- Second after selecting a resource, detailed view section will appear. This section should include preview of the current resource, specific meta data, action menu that allow managing functionality(delete, open in applet, download, show hmtl/pdf preview etc. this will be specified in the next revision).
- In this section user is allowed to edit some of the listed meta data.
- There should be a deep link to every resource. The url should be human readable - to do so we'll make it look something like this
- http://[DOMAINNAME]/resources/[RESOURCE_PATH]/[RESOURCE]
- The resource path it self contains the names of the parents of the current resource(like folders structure)(In next revisions there could be folder structure included in the url. That depends on server administration and will provide uniqueness of the url)
- First of all there should be a list of available resources inside resource section, or search results section.
Task requirements
- Produce the deep link functionality for detailed resource view.
- For this revision the detailed section should contain only resource meta data.
- Optional we could add the functionality for editing the meta data (this is with low possibility)
- Optional add download button with proper functionality
Task result
- The result should be source code.
Implementation idea
- Create few sample resources and users.
- Don't take additional overhead for displaying the data in this section (in order of setting look and feel). The entire layout and vision for this page will be applied latter.
Related
S2S_WEB_COMMONS_R1
S2S_WEB_COMMONS_R2
GROUP_APP_SERVER_RESOURCE_ACCESS_R0
How to demo
- paste different urls in order to demonstrate the deep link
Design
Request handler
- We will implement RequestHandler for all requests which request path starts with /resources/.
- Find resource by location using ResourceManager from a Facade.
The facade will be provided as extesnion point to WebUI module.
- Here is important to use server side redirect to view, so the bookmark functionality will be well supported.
- In future there should be always server side redirects to jsp pages and when it is done everywhere direct *.jspx requests must be forbidden.
View
- View will be rendered by resources.jspx - simple jsp page that will show all available meta data for loaded resource as simple table.
In the image above are shown some example meta info properties. They will be different for different types of resources.
Tests
Base test for the task are:
ResourcesHandlerTest
Implementation
- A base class for testing handler was created using jmock library to mock the request and response.
- A custom tag for site template was created.
- In the folder with jsp resurces a WEB-INF/tags folder was added so our custom tag can be compiled (This was needed in order to workaround JSP specification) also
the package org.apache.jsp.tag.web. was made public for the bundle this is were Jasper compiler generates these tag handler classes.
- A jspx page for viewing the resource was created that uses the template tag.
- Resource handler now supports requests /resources/* and if the they have queryString ?download return binary content. The WSResourceManager now uses this approach instead
of resource_manager?method=getResource&location=resource_location.
- getResourceList in ResourcesWebService was changed so the locations it returns will be like http://serverName:serverPort/resources/resourceRelativeLocation
- MemoryDatabaseManager was changed to store all the temp resources in locations prefixed with tmp/
Changeset: [3799], [3819], [3885], [3886]
Merged to the trunk in [3976].
Testing
Test class is ResourcesHandlerTest and is fixed in [4077]
Comments
- Editing resource it self could happen if the user download it or via applet. Also another way to edit resource is to reach it from the application without using the site.
- Implementing this task requires GROUP_APP_SERVER_RESOURCE_ACCESS_R0 to be integrated in the trunk
Attachments
-
resource.png
(24.3 KB) -
added by tsachev 16 years ago.
Desing of resources handler
- Resource-view.png (6.1 KB) - added by tsachev 16 years ago.