Share Components (Proposed)

cancel
Showing results for 
Search instead for 
Did you mean: 

Share Components (Proposed)

resplin
Intermediate
0 0 1,506

Obsolete Pages{{Obsolete}}

The official documentation is at: http://docs.alfresco.com



This article refers to a proposed feature in Alfresco Share

Share Components provide a system for finding, installing and publishing SURF-based components for Alfresco Share.

A component is a collection of web scripts, Surf components and static assets, in addition to any supporting repository-tier web scripts, which can be installed into an Alfresco Share instance. Components may be packaged using the ZIP file format (or ACPs/Jars?), allowing for easy distribution and installation into the Alfresco repository which is used as a container.

Initially support should be provided within the Share Administration Console for searching one or more configured component stores and installing components on a system-wide basis. Ideally, certain components such as themes, language packs and dashlets would be installable by normal users for their own individual use. This would require deeper changes to Surf to allow different sets of web scripts or Surf components to be 'visible' for different users.


High Level Components


Web Tier Support


  • Configuration for loading web scripts and SURF components from a remote Alfresco repository via HTTP
  • Admin console component for managing installed components and installing new components

Repository Support


  • Data Dictionary structures for holding installed component metadata and files, plus data on configured component stores
  • Bootstrap configuration to create the required Data Dictionary structures from an ACP file
  • Web script Store API for querying, fetching, adding, updating and removing individual component items - similar to the existing AVM store API
  • Web script Component API for querying, fetching, adding, updating and removing installed complete components
  • Web script Component Store List API for managing the list of configured stores

Share Online Component Store (SOCS)


  • Implements a Component Store RESTful API providing access to components, search capabilities and feedback (ratings/comments), May extend Component API?

Detailed Design


Data Dictionary structures


Consumer structure


cm:share_components
|
|- cm:components
   |- components.json
   |- stores.json
|- cm:site_data
   |- chrome
   |- component-types
   |- components
   |- configurations
   |- content-associations
   |- page-associations
   |- page-types
   |- pages
   |- template-instances
|- cm:site_resources
|- cm:site_webscripts
   |- org
     |- alfresco
       |- ...
|- cm:templates
|- cm:webscripts

Store structure


cm:share_component_store
|
|- packages
   |- org.alfresco.component.dashlet.site-tags
     |- org.alfresco.component.dashlet.site-tags.acp
     |- org.alfresco.component.dashlet.site-tags.jar
|- sources
   |- org.alfresco.component.dashlet.site-tags
     |- site-webscripts
     |- webscripts

Component Store API


Store metdata


GET /componentstore/details (JSON)

List components


GET /componentstore/index - All components
GET /componentstore/index/t/site-dashlet - Filter by component type
GET /componentstore/index/org/alfresco - Filter by org.alfresco namespace
GET /componentstore/index/t/admin-console/org/alfresco - Filter by component type and namespace
GET /componentstore/index/t/admin-console/org/alfresco?q=test - Filter by component type, namespace and search term q

Get/Update/Add/Delete a component


GET /componentstore/item/org/alfresco/components/dashlets/site-tags-dashlet - Return JSON metadata
POST /componentstore/item/org/alfresco/components/dashlets/site-tags-dashlet - Create new item
PUT /componentstore/item/org/alfresco/components/dashlets/site-tags-dashlet - Update item
DELETE /componentstore/item/org/alfresco/components/dashlets/site-tags-dashlet - Delete item

Get/Set component files


GET /componentstore/package/org/alfresco/components/dashlets/site-tags-dashlet
GET /componentstore/package/org/alfresco/components/dashlets/site-tags-dashlet?f=[acp|zip|jar]
PUT /componentstore/package/org/alfresco/components/dashlets/site-tags-dashlet

Submit component ratings/comments


POST /componentstore/reviews/org/alfresco/components/dashlets/site-tags-dashlet (JSON format, fields 'rating' and 'comment')

Component Consumer API


Component stores configured for the current repository


GET /components/stores - Get a JSON list of the stores configured against this repository
POST /components/stores/socs - Add a new store called socs
PUT /components/stores/socs - Update the socs store
DELETE /components/stores/socs - Delete the socs store

Store listings (held locally in the repo)


GET /components/storeitems - List all store items that we know about
GET /components/storeitems?q=searchterm - List all store items matching a search term
POST /components/storeitems/update - Re-fetch the list of store items from the stores' APIs

Install component


POST /components/install/566 - Install component with local ID 566
POST /components/update/566 - Update component with local ID 566 to latest version available from the stores
DELETE /components/delete/566 - Uninstall component with local ID 566
DELETE /components/delete/org/alfresco/components/dashlets/site-tags/dashlet - Uninstall component with ID org.alfresco.components.dashlets.site-tags-dashlet

Source Code


See http://code.google.com/p/socs/
Engineering Notes