版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)
文檔簡介
AlfrescofromanagileframeworkperspectiveJeffPottsjpotts@AgendaPatternsofAlfrescoCustomizationATaleofTwoFrameworks:Surfvs.DjangoHeavyShareCustomization:Areal-worldexampleConclusions&AdvicePATTERNSOFALFRESCOCUSTOMIZATIONCustomAlfrescoPatternsNon-AlfrescoframeworkontopofAlfrescoSurfontopofAlfrescoLightShareCustomizationsHeavyShareCustomizationsPatternswearen’tgoingtotalkabout:ExplorerclientcustomizationsPortalintegrationEmbeddedAlfrescoSource:thomashawkNon-AlfrescoFrameworkSource:Optaros+SurfonAlfrescoSource:OptarosLightShareCustomizationsHeavyShareCustomizationsATALEOFTWOFRAMEWORKSSurforSomethingElse?Shareisapopular,extensibleclientwithagreatUIWhenShareistoomuchortoofarfromyourbusinessrequirements…WhichframeworkontopofAlfresco?Anexperiment…Source:irargerichAwordonagileframeworksAgileframeworksandscriptinglanguagesareverypopularExamples:Rails,Grails,Django,Wicket,Symfony,Cake,etc.Productive,fastdevcyclesBuilt-inBootstrapping,ORM,MVC,tests/fixtures,administrativeUI’sHundredsavailableacrosseverylanguageimaginableCanbetrendy,likefrozenyogurtSource:mswineCommonrequirementsLetcontentauthorscreate"chunks"anduploadfilesChunksandfilesgettaggedandcategorizedNotallobjectshavefiles--theUIcan'tfreakoutwhenitcomesacross"content-less"objectsFront-endwebsiteneedstobeabletoqueryforchunks,files,andcontent-lessobjectsThefront-endwebsitecannotlooklikeShareOurusersaren'tteamsTheydon'tcareabout““documentlibraries”Asimpleexample:ToDoBasicrequirementsEnduserscreate/managetodolistitemsTodolistitemsaretaggedEnduserscanuploaddocumentsrelatedtoToDo’sExtendedrequirementsCertaincategoriesofToDoListshaveassociatedcontentchunksthatneedtobedisplayed.Example:Todolistthatiscategorizedas"Writing"shoulddisplaywithcontentchunksthatgiveadviceonwriting.GroupingsofToDolistsFriends/Co-workersProjects,etc.RSSfeedsApproachesToDo’s,Users,andFilesareobjects.I’llmapURLstovariousviewsonthoseobjects.I’llprobablyusearelationaldatabasetopersisteverythingexceptthefiles,whichI’llletmyframeworkhandle.Filesaredocuments.That’seasy.ToDo’sare““content-less”objects.IneedtofigureoutafolderforallofthisstufftoliveinandhowIwanttorelateToDo’stofiles.I’llmapURLstovariousviewswhichwillrequestdatafromtherepositoryviaREST.Five-minutelookatDjangoCreatinganewDjangoappDefiningacontentmodelCreatingatemplateModelViewControllerUsingtheadminsitetoeditobjectinstancesSource:WilliamGottliebFunDjangoFacts:Startedasaninternalprojectin2003attheJournal-Worldnewspaper(Lawrence,KS)Namedafterjazzguitarist,DjangoReinhardtTheOnionrecentlymigratedtoDjangofromDrupalModelfromdjango.dbimportmodelsfromdjango.contrib.auth.modelsimportUserfromdatetimeimportdate,datetimeclassToDoItem(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.ForeignKey(User,related_name='todo_creator')assignee=models.ForeignKey(User,null=True,blank=True,related_name='todo_assignee')#attachments=Document#ArrayofCMISdocuments
def__unicode__(self):returnself.titleclassTag(models.Model):name=models.CharField(max_length=64,unique=True)toDoItems=models.ManyToManyField(ToDoItem)
def__unicode__(self):returnmodels.pyURLsmaptoViewsurlpatterns=patterns('',(r'^admin/',include(admin.site.urls)),(r'^$',main_page),(r'^user/(\w+)/$',user_page),(r'^login/$','django.contrib.auth.views.login'),(r'^logout/$',logout_page),(r'^register/$',register_page),(r'^register/success/$',direct_to_template,{'template':'registration/register_success.html'}),(r'^create/$',todo_create_page),(r'^save/(\d+)/$',todo_save_page),(r'^site_media/(?P<path>.*)$','django.views.static.serve',{'document_root':site_media}),(r'^tag/([^\s]+)/$',tag_page),(r'^tag/$',tag_cloud_page),)settings.pydefuser_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,'show_edit':username==request.user.username,})
returnrender_to_response('user_page.html',variables)views.py<html><head><title>DjangoToDo's|{%blocktitle%}{%endblock%}</title><linkrel="stylesheet"href="/site_media/style.css"type="text/css"/></head><body><divid="nav"><ahref="/">home</a>{%ifuser.is_authenticated%}welcome,<ahref="/user/{{user.username}}/">{{user.username}}</a>!|<ahref="/create/">newtodo</a>|<ahref="/logout">logout</a>{%else%}<ahref="/login/">login</a><ahref="/register/">register</a>{%endif%}</div><h1>{%blockhead%}{%endblock%}</h1>{%blockcontent%}{%endblock%}</body></html>base.html{%extends"base.html"%}{%blocktitle%}{{username}}{%endblock%}{%blockhead%}ToDo'sfor{{username}}{%endblock%}{%blockcontent%}{%include"todo_list.html"%}{%endblock%}user_page.html{%iftodos%}<ulclass="todos">{%fortodointodos%}<li><ahref="/todo/{{todo.id}}"class="title">{{todo.title}}</a>{%ifshow_edit%}…todo_list.htmlTemplateInheritanceAlfrescoapproachContentConsumerUICustomSurfpages/templates/componentsforthe"front-end"userinterfaceAdministrativeUILightly-customizedAlfrescoShareDataPersistenceCustomcontentmodelforproperties,associations(ToDodatalisthappenstoalreadyexist)DocumentlibraryforfilesandcontentchunksDataListobjectsforToDoitemsRuleonafoldertoaddtaggableandclassifiableaspectstonewobjectsAlfrescoapproachBusinessLogicSharewebscriptstogenerateUIandhandleformpostsRepowebscriptstohandleJSONPOSTsthatcreatenewdata(fileupload,newtodo)RepowebscriptstohandleGETsthatretrieveexistingdata(chunksforagivencategory,todolistinfo)JavaScriptforallweb-tierandrepo-tierwebscriptcontrollers(fastdev,cutsdownonrestarts)Demo:AtaleoftwoframeworksSharesiteDatalistcontentmodelSurfpages&webscripts(XML,FreeMarker,JavaScript)Repositorywebscripts(minimal)SurfconfigAlfrescouserfactoryShareconfig(minimal)RDBback-endSchemamanagedbyDjangoPythonclassesModelControllers(“Views”)FormsURLmappingAdminUIWorkRemainingAddfileuploadtobothDjangoandAlfrescoToDo’sDjangohasaFiletypeDjangosupportscustomFileManagers(Hello,CMIS!)Refactordjango-alfrescotouseCMIS;e.g.,CmisDocumenttypeAdd““categorizablechunk””tobothSearchFriendslistSource:jphilipgComparisonBothhavedecenttoolingpydevforDjangoEclipse/STS,Roo,Maven,AntforAlfrescoModel,forms,querymucheasierinDjango“Learningwherestuffgoes”MuchfasterinDjangoSurfdocumentationis“stillevolving”Source:TheBusyBrainToDoDemoAppAlfrescoDjangoNumberoffiles7523Alfresco#ofFilesbyTypeDjango#ofFilesbyTypeComparison(cont’’d)GotchasLackofquery-ableassociationsinDMrepowaspainfulAddusertoSharesiteonuserregistrationpostCreatearuleonthedatalistfoldertosetownerKeeptrackofassigneeadd/removeAttempttosimplifyactuallymadeSurfsiteharderFormswithoutJavaScriptNopickersNotfullyleveragingAlfresco’sformserviceSource:automaniaToDoDemoAlfrescoDjangoLinesofCode1,578674AlfrescoLOCbyTypeDjangoLOCbyTypeHEAVYSHARECUSTOMIZATIONAreal-worldexampleSaaSplatformwantsacommunitysitewithresourcestheircustomersneedtoleveragetheplatformbetterContentchunks&filesDiscussionthreads,blogsEverythingtaggedagainstmultipletaxonomiesConsumerUIContentManagement/AdminUIArchitectureLightlycustomizedShareAdminUIConsumerUIHeavilycustomizedShareContentModelBehaviorsRulesWebScriptsThemeYUIFormServiceWebScriptsContentManagersCommunityUsersDataModelGlobalShareSiteClientShareSitesProjectShareSitesUsers&GroupsClientIDoncm:us
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024年商鋪房屋買賣合同范本
- 新型連鎖商品供貸合同書
- 產(chǎn)品責(zé)任保險合同條款全新解讀
- 擋土墻工程設(shè)計施工總包合同
- 房屋建造安全協(xié)議
- 試用期勞動合同維權(quán)寶典
- 快遞承包合同的格式與內(nèi)容
- 建筑安裝工程安全合同書范本
- 長沙市古建筑維修工程施工合同
- 合作助力報刊業(yè)發(fā)展協(xié)議
- 個人向紀(jì)檢委寫悔過書集合3篇
- 代購居間合同范本
- 音樂家舒伯特課件
- 幼兒園幼兒膳食營養(yǎng)分析報告
- 高中新課程建設(shè)方案
- 醫(yī)學(xué)案例分析模板
- 大隱靜脈射頻消融手術(shù)
- 第一單元 長度單位復(fù)習(xí)(課件)二年級上冊數(shù)學(xué) 人教版(共22張)
- 肩痹(肩袖損傷)中醫(yī)臨床路徑及入院標(biāo)準(zhǔn)2020版
- 醫(yī)療廢物的正確處置
- 加利福尼亞批判性思維技能測試后測試卷班附有答案
評論
0/150
提交評論