版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Alfresco from an agile framework perspectiveJeff Potts Copyright 2010, Metaversant Group, Inc. | 2Agenda Patterns of Alfresco Customization A Tale of Two Frameworks: Surf vs. Django Heavy Share Customization: A real-world example Conclusions & Advice3PATTERNS OF ALFRESCO CUSTOMIZATION Copyright
2、2010, Metaversant Group, Inc. | 4Custom Alfresco Patterns Non-Alfresco framework on top of Alfresco Surf on top of Alfresco Light Share Customizations Heavy Share CustomizationsPatterns we arent going to talk about: Explorer client customizations Portal integration Embedded AlfrescoSource: thomas ha
3、wk Copyright 2010, Metaversant Group, Inc. | 5Non-Alfresco FrameworkSource: Optaros+ Copyright 2010, Metaversant Group, Inc. | 6Surf on AlfrescoSource: Optaros Copyright 2010, Metaversant Group, Inc. | 7Light Share Customizations Copyright 2010, Metaversant Group, Inc. | 8Heavy Share Customizations9
4、A TALE OF TWO FRAMEWORKS Copyright 2010, Metaversant Group, Inc. | 10Surf or Something Else? Share is a popular, extensible client with a great UI When Share is too much or too far from your business requirements Which framework on top of Alfresco? An experimentSource: irargerich Copyright 2010, Met
5、aversant Group, Inc. | 11A word on agile frameworks Agile frameworks and scripting languages are very popular Examples: Rails, Grails, Django, Wicket, Symfony, Cake, etc. Productive, fast dev cycles Built-in Bootstrapping, ORM, MVC, tests/fixtures, administrative UIs Hundreds available across everyl
6、anguage imaginable Can be trendy, like frozen yogurtSource: mswine Copyright 2010, Metaversant Group, Inc. | 12Common requirements Let content authors create chunks and upload files Chunks and files get tagged and categorized Not all objects have UI cant freak out when it comes across content-less o
7、bjects Front-end web site needs to be able to query for chunks, files, and content-less objects The front-end web site cannot look like Share Our users arent teams They dont care about “document libraries” Copyright 2010, Metaversant Group, Inc. | 13A simple example: To DoBasic requirements End user
8、s create/manage to do list items To do list items are tagged End users can upload documents related to To DosExtended requirements Certain categories of To Do Lists have associated content chunks that need to be displayed. Example: To do list that is categorized as Writing should display with conten
9、t chunks that give advice on writing. Groupings of To Do lists Friends/Co-workers Projects, etc. RSS feeds Copyright 2010, Metaversant Group, Inc. | 14Approaches To Dos, Users, and Files are objects. Ill map URLs to various views on those objects. Ill probably use a relational database to persist ev
10、erything except the files, which Ill let my framework handle. Files are documents. Thats easy. To Dos are “content-less” objects. I need to figure out a folder for all of this stuff to live in and how I want to relate To Dos to files. Ill map URLs to various views which will request data from the re
11、pository via REST. Copyright 2010, Metaversant Group, Inc. | 15Five-minute look at Django Creating a new Django app Defining a content model Creating a template Model View Controller Using the admin site to edit object instancesSource: William GottliebFun Django Facts: Started as an internal project
12、 in 2003 at the Journal-World newspaper (Lawrence, KS) Named after jazz guitarist, Django Reinhardt The Onion recently migrated to Django from Drupal Copyright 2010, Metaversant Group, Inc. | 16Modelfrom django.db import modelsfrom django.contrib.auth.models import Userfrom datetime import date, dat
13、etimeclass ToDoItem(models.Model): title = models.CharField(max_length=200) dueDate = models.DateField(default=date.today() priority = models.IntegerField(default=3) status = models.TextField() notes = models.TextField() createdDate = models.DateTimeField(default=datetime.today() creator = models.Fo
14、reignKey(User, related_name=todo_creator) assignee = models.ForeignKey(User, null=True, blank=True, related_name=todo_assignee) #attachments = Document # Array of CMIS documents def _unicode_(self): return self.titleclass Tag(models.Model): name = models.CharField(max_length=64, unique=True) toDoIte
15、ms = models.ManyToManyField(ToDoItem) def _unicode_(self): return models.py Copyright 2010, Metaversant Group, Inc. | 17URLs map to Viewsurlpatterns = patterns(, (radmin/, include(admin.site.urls), (r$, main_page), (ruser/(w+)/$, user_page), (rlogin/$, django.contrib.auth.views.login), (rlo
16、gout/$, logout_page), (rregister/$, register_page), (rregister/success/$, direct_to_template, template: registration/register_success.html), (rcreate/$, todo_create_page), (rsave/(d+)/$, todo_save_page), (rsite_media/(?P.*)$, django.views.static.serve, document_root: site_media), (rtag/(s+)/$, tag_p
17、age), (rtag/$, tag_cloud_page),)settings.pydef user_page(request, username): user = get_object_or_404(User, username=username) todos = user.todo_assignee.order_by(-id) variables = RequestContext(request, username: username, todos: todos, show_tags: True, show_assignee: False, show_creator: True, sho
18、w_edit: username = request.user.username, ) return render_to_response( user_page.html, variables )views.py Copyright 2010, Metaversant Group, Inc. | 18 Django To Dos | % block title % endblock % home % if user.is_authenticated % welcome, user.username ! | new to do | logout % else % login register %
19、 endif % % block head % endblock % % block content % endblock % base.html% extends base.html % block title % username % endblock % block head %To Dos for username % endblock % block content % % include todo_list.html % endblock %user_page.html% if todos % % for todo in todos % todo.title % if show_e
20、dit % todo_list.htmlTemplate Inheritance Copyright 2010, Metaversant Group, Inc. | 19Alfresco approach Content Consumer UI Custom Surf pages/templates/components for the front-end user interface Administrative UI Lightly-customized Alfresco Share Data Persistence Custom content model for properties,
21、 associations (To Do data list happens to already exist) Document library for files and content chunks Data List objects for To Do items Rule on a folder to add taggable and classifiable aspects to new objects Copyright 2010, Metaversant Group, Inc. | 20Alfresco approach Business Logic Share web scr
22、ipts to generate UI and handle form posts Repo web scripts to handle JSON POSTs that create new data (, new to do) Repo web scripts to handle GETs that retrieve existing data (chunks for a given category, to do list info) JavaScript for all web-tier and repo-tier web script controllers (fast dev, cu
23、ts down on restarts) Copyright 2010, Metaversant Group, Inc. | 21Demo: A tale of two frameworks Share site Data list content model Surf pages & web scripts (XML, FreeMarker, JavaScript) Repository web scripts (minimal) Surf config Alfresco user factory Share config (minimal) RDB back-end Schema
24、managed by Django Python classes Model Controllers (“Views”) Forms URL mapping Admin UI Copyright 2010, Metaversant Group, Inc. | 22Work Remaining Add to both Django and Alfresco To Dos Django has a Django supports custom (Hello, CMIS!) Refactor django-alfresco to use CMIS; e.g., CmisDocument type A
25、dd “categorizable chunk” to both Search Friends listSource: jphilipg Copyright 2010, Metaversant Group, Inc. | 23Comparison Both have decent tooling pydev for Django Eclipse/STS, Roo, Maven, Ant for Alfresco Model, forms, query much easier in Django “Learning where stuff goes” Much faster in Django
26、Surf documentation is “still evolving”Source: TheBusyBrainTo Do Demo AppAlfrescoDjangoNumber of files7523Alfresco # of Files by TypeDjango # of Files by Type Copyright 2010, Metaversant Group, Inc. | 24Comparison (contd) Gotchas Lack of query-able associations in DM repo was painful Add user to Shar
27、e site on user registration post Create a rule on the data list folder to set owner Keep track of assignee add/remove Attempt to simplify actually made Surf site harder Forms without JavaScript No pickers Not fully leveraging Alfrescos form serviceSource: automaniaTo Do DemoAlfrescoDjangoLines of Co
28、de1,578674Alfresco LOC by TypeDjango LOC by Type25HEAVY SHARE CUSTOMIZATION Copyright 2010, Metaversant Group, Inc. | 26A real-world exampleSaaS platform wants a community site with resources their customers need to leverage the platform betterContent chunks & filesDiscussion threads, blogsEvery
29、thing tagged against multiple taxonomiesConsumer UIContent Management / Admin UI Copyright 2010, Metaversant Group, Inc. | 27ArchitectureLightly customized ShareAdmin UIConsumer UIHeavily customized ShareContent ModelBehaviorsRulesWeb ScriptsThemeYUIForm ServiceWeb ScriptsContent ManagersCommunity U
30、sers Copyright 2010, Metaversant Group, Inc. | 28Data ModelGlobal Share SiteClient Share SitesProject Share SitesUsers & GroupsClient ID on cm:userOne group per clientClient Data ListSnippets & ResourcesCategoriesCategories for products, topics, processesProject Data ListClient LogosProcess
31、State Data ListUser-uploaded ContentShare Site HierarchyAdmin DataTeam Data List Copyright 2010, Metaversant Group, Inc. | 29Content Consumer UI Copyright 2010, Metaversant Group, Inc. | 30Content Chunks Copyright 2010, Metaversant Group, Inc. | 31 Copyright 2010, Metaversant Group, Inc. | 32 Copyright 2010, Metaversant Group, Inc. | 33Administrat
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- GB/T 21871-2025橡胶配合剂缩略语
- 2026年新疆建设职业技术学院单招职业适应性测试题库及完整答案详解1套
- 2026年六盘水幼儿师范高等专科学校单招职业倾向性测试题库及参考答案详解
- 2026年福建理工大学单招职业技能考试题库及答案详解1套
- 2026年四川西南航空职业学院单招职业适应性考试题库带答案详解
- 2026年安徽冶金科技职业学院单招职业适应性考试题库附答案详解
- 2026年甘肃农业职业技术学院单招职业倾向性考试题库及参考答案详解
- 2026年辽宁经济职业技术学院单招职业技能测试题库含答案详解
- 2026年芜湖职业技术学院单招职业技能考试题库及参考答案详解一套
- 2026年抚州职业技术学院单招职业倾向性测试题库含答案详解
- 节能环保安全知识培训课件
- 钢结构工程施工质量检查标准
- 2025-2030中国集成电路设计行业人才缺口分析与培养体系建设及技术创新评估
- 工艺流程规范
- 城市地下综合管网建设项目技术方案
- 运城十三县考试题及答案
- 【书法练习】中考语文古诗文硬笔字帖(田英章字体)
- DB65-T 4900-2025 新能源发电升压站验收技术规范
- 贵州省市政工程计价定额2025定额说明(重要)
- 车辆日常保养与维护课件
- 农村集体经济发展讲座
评论
0/150
提交评论