wiki:BASE_RESOURCE_COMMONS_R0
Last modified 16 years ago Last modified on 12/05/08 11:57:22

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

Error: Macro TicketQuery(summary=BASE_RESOURCE_COMMONS_R0, 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

Overview

Resource is an object that can be persisted. Resources can be used in frame content. Resource can be used in the timeline. Resources can be nested in other resources (i.g. book can have nested another book (embedded book)).

Base resource model should have the following information

  • UUID
  • Target
    • Data
    • URL
  • MetaInfo
  • Comment

Resource Scope could be

  • Book
  • Local
  • Server

Types of resources (the target of the resource)

  • Text
    • Plain
    • RTF
    • HTML
  • Image
  • Audio
  • Movie
  • Book
  • Template
  • etc.

MetaInfo of the resource is:

  • The author of the resource
  • The date the resource was created
  • Version of the resource
  • The date the resource was last modified
  • Who was the last that modified the resource
  • The dimensions of the image (if the target of the resource is an image)
  • etc.

Operations over a resource:

  • The resource can be created.
  • The resource can be modified (in a separate window).
  • The resource can be deleted.
  • The resource can be persisted.
  • The resource can be imported(exported) to a server.
  • The resource can be previewed (in a separate window).

Resource Manager manages:

  • Resource Versioning
  • Resource Security
  • Resource save/load

In the first revision of the task you should improve resource concept.

Task requirements

  • Resources should be in a separate module.
  • The model of the resource should be well and clearly defined.
  • It should be easily to add new resource type (the library should provide extensibility).
  • Check what we have for resources and modify where it is necessary. After this revision we are supposed to have the basic hierarchy of the resources.
  • Book should be made resource.
  • The MetaInfo problem
    • It should be easy to deal with the meta information of the resource. Think about an annotation @Meta("description").
    • It should be easy to add new meta information of a resource (extensibility).

Task result

  • The result of this task should be source code.

Implementation idea

  • Create module org.sophie2.base.resources
  • @Meta("description") annotation for the meta info of the resource.

How to demo

  • Show the new module in eclipse.
  • Show the modified classes.
  • Run the application and demonstrate the usage of resources.
  • Ask if there are any questions.

Design

  • There is already created module for the resources org.sophie2.base.model.resources that will be used.

  • The UML class diagram for the initial structure of the package:

source:/trunk/sophie2-platform/modules/org.sophie2.base.model.resources/doc/base_resources.jpg

  • The BaseResource is the base class for all the resources, every resource will extend it. The resource's target is the data of the resource or path to it.
  • Every resource will have one of the scopes defined in the ResourceScope enumeration.
  • The HierarchicalResource is base class for all the resources that have nested resources.
  • The @ResourceMeta annotation will be used to annotate the properties of the resources that are meta information. If a property of an resource is annotated with @ResourceMeta it will be treated as meta information. The resource manager will be able to retrieve the meta information of an resource to save it in specific way.
  • After the implementation of the base resource hierarchy, all the resources used in Sophie will extend BaseResource or HierarchicalResource.
  • There will be for example ImageResource for the images in the book, FileResource for resources that are stored in files and etc.
  • In this revision is not possible to make the current book part of this resource hierarchy. The refactoring will take some time.

Implementation

The implementation is made according to the design.

Testing

Comments

Log

Analysis:
Design:
Implementation:
Testing:
Comments: