Presentation is loading. Please wait.

Presentation is loading. Please wait.

Share Site Customizations Live

Similar presentations


Presentation on theme: "Share Site Customizations Live"— Presentation transcript:

1 Share Site Customizations Live
Bla bla Share Site Customizations Live David Erik (UI Team)

2 What we’re going to do… Possibilities Unique Organizing Extension points 3 demos = 3 extension modules …customizations applied LIVE! Create your own < 1 hour!

3 Acme Research & Development department Publishes R&D articles
Partner “portal” Casting: Author: Alan Editor: Erik Partner: Patrick

4 Pre Demo: “Nothing up our sleeves”
Alfresco Community 4.2.b (vanilla)

5 Step 1 Define R&D projects Make it available

6 Don’t worry, be happy!

7 Define R&D projects Site Presets Config template
Used in create site dialog Customize using “preset-id” in evaluators

8 /alfresco/site-data/presets/ acme-rd-presets.xml
Also: Custom properties Rename pages w <pageMetadata> *-presets.xml (v 4.1) <preset id="acme-rd-preset”> <page id="site/${siteid}/dashboard"> <title-id>page.acme-rd-dashboard.title</title-id> <properties> <sitePages>[ { "pageId":"acme-rd-introduction" }, { "pageId":"documentlibrary" } ]</sitePages> </properties> </page> <components/> </preset> Also: Dashboard columns Dashlets

9 /alfresco/site-data/pages/ acme-rd-introduction.xml
Tip! (v4.0b) 2-columns 2-columns-resizable 2-columns-narrow-left 3-columns <page> <template-instance>1-column</template-instance> <components> … <component> <region-id>column</region-id> <sub-components> <sub-component id="wiki"> <url>/components/wiki/page</url> </sub-component> </sub-components> </component> </components>

10 Make preset available Global module: <customizations>

11 <configurations> <customizations>
What is an extension module? (v4.0) /alfresco/site-data/extensions/*-extension.xml Module evaluators: site.module.evaluator (v4.0) portal.module.evaluator (v4.0) group.module.evaluator (v4.2b) <evaluator> Add/remove/replace components in a <components> Merge share-config <configurations> <customizations> Enhance templates’ & webscripts’: markup / resources / model

12 /alfresco/site-data/extensions/ acme-rd-extension.xml
<extension> <modules> <module> <id>Acme Rd (1) Global changes</id> <auto-deploy>true</auto-deploy> <!-- No evaluator, always applied! --> <customizations> <customization> <targetPackageRoot>org.alfresco</targetPackageRoot> <sourcePackageRoot>acme.rd.customizations</sourcePackageRoot> </customization> </customizations> </module>

13 /alfresco/site-webscripts/org/alfresco/modules create-site.get.js
Note! Separate runtime Common model var sitePresets = [{ id: "site-dashboard", name: msg.get("title.collaborationSite") }]; model.sitePresets = sitePresets; /alfresco/site-webscripts/acme/rd/customizations/modules create-site.get.js model.sitePresets.push( { id: "acme-rd-preset", name: msg.get("preset.acme-rd.title") });

14 Demo 1: “Create R&D project”

15 How quick is Dave? …he’s smart…
https://github.com/share-extras/site-extension %>ant create-project -Dcompany=Acme -Dusecase=RD …

16 Share Namespaced project structure: build targets Spring context file
Site preset Sample page & webscript Extension modules Doclib customizations

17 Repository Note! Not required… Namespaced project structure:
build targets Spring context file Content model Sample repo action

18 Alternative solution: Folder rule kicks off a simple workflow
Repository Alternative solution: Folder rule kicks off a simple workflow rd:article aspect rd:status property [ “Draft” | ”Published” ] Repo action marks as “Published” https://devcon.alfresco.com/berlin/sessions/developing-doclib-actions-alfresco-4

19 Step 2 Publishing articles Show article info in the document library
“Slim down” Share for Editors

20 Publishing articles Doclib action SiteManager (editor)
R&D Project only Site Preset module: <configurations>

21 /alfresco/site-data/extensions/ acme-rd-extension.xml
<module> <id>Acme Rd (2) Site changes</id> <evaluator type="site.module.evaluator"> <params> <sites>.*</sites> <sitePresets>acme-rd-preset</sitePresets> <applyForNonSites>false</applyForNonSites> <groups>.*</groups> </params> </evaluator> <configurations>  Actions, indicators etc

22 /alfresco/site-data/extensions/ acme-rd-extension.xml
Also: (v4.2b) isSiteConsumer isSiteContributor isSiteCollaborator “pagelink” / “link” https://devcon.alfresco.com/berlin/sessions/developing-doclib-actions-alfresco-4 <config evaluator="string-compare" condition="DocLibActions"> <actions> <action id="acme-rd-document-setStatusPublished" type="javascript"> <evaluator>acme.rd.evaluator.doclib.hasArticleAspect</evaluator> <evaluator negate="true">acme.rd.evaluator.doclib.isStatusPublished</evaluator> <evaluator>evaluator.doclib.action.isSiteManager</evaluator> <permissions> <permission allow="true">Write</permission> </permissions> <param name="function">onActionSimpleRepoAction</param> <param name="action">acme.rd.setPublishedStatus</param> </action>

23 Show Custom data only in R&D doclibs
Indicators Metadata templates

24 /alfresco/site-data/extensions/ acme-rd-extension.xml
Tip! <override>some-indicator-id</override> “action” attribute <config evaluator="string-compare" condition="DocumentLibrary"> <indicators> <indicator id="acme-rd-status" index="10" icon=”…/rd/components/documentlibrary/indicators/status-16.png” label="acme.rd.indicator.status"> <evaluator>acme.rd.evaluator.doclib.hasArticleAspect</evaluator> <labelParam index="0">{jsNode.properties.rd_status}</labelParam> </indicator> </indicators> </config>

25 /alfresco/site-data/extensions/ acme-rd-extension.xml
Renders objects with: (v4.2b) userName displayName iso8601 title name …or register a custom renderer (v.4.0) <config evaluator="string-compare" condition="DocumentLibrary"> <metadata-templates> <template id="acme-rd-status"> <evaluator>acme.rd.evaluator.doclib.hasArticleAspect</evaluator> <line index="10" id="date">{date}{size}</line> <line index="20" id="rd:status"> {rd_status acme.rd.metadata.status} </line> </template> </metadata-templates> </config>

26 Hide “Documents” for Editors
Site Preset module: <components>

27 /alfresco/site-data/extensions/ acme-rd-extension.xml
Also: Add & Replace Component evaluators: (v4.0) config.component.evaluator equals.component.evaluator portlet.component.evaluator site.component.evaluator preset.component.evaluator <component> <scope>template</scope> <region-id>filter</region-id> <source-id>documentlibrary</source-id> <sub-components> <sub-component id="default"> <evaluations> <evaluation id="hideSiteManagersFilter"> <render>false</render> <evaluators> <evaluator type="group.component.evaluator"> <params><groups>SiteManager</groups></params> </evaluator>

28 Demo 2: “R&D site customizations”

29 Step 3 Partner “portal” List R&D Projects Only “Published” articles
“inline previewer”

30 Partner “portal” Dashboard page Document Library page Partner Title
List of R&D projects (api/sites?spf=acme-rd-preset) Document Library page Document List (customized)

31 /alfresco/site-data/extensions/ acme-rd-extension.xml
<module> <id>Acme Rd (3) Partner changes</id> <evaluator type="group.module.evaluator"> <params> <groups>GROUP_Partner</groups> <groupRelation>AND</groups> </params> </evaluator> <customizations> <customization> <targetPackageRoot>org.alfresco</targetPackageRoot> <sourcePackageRoot>acme.rd.customizations-partner</sourcePackageRoot> </customization>

32 /alfresco/templates/org/alfresco /dashboard.ftl
id="alf-hd”><div id="alf-hd"> id="header" scope="global" /> id="title" scope="page" /> id="navigation" scope="page" /> /alfresco/templates/acme/rd/customizations-partner /dashboard.ftl target="alf-hd" action="after" id="acme-after-alf-hd"> id="partner-title” scope="global" /> id="partner-sites" scope="global" /> <#-- Remove markup sections we don't want --> target="alf-hd" action="remove" id="acme-remove-alf-hd" />

33 Only “Published” docs Custom repository webscript
/slingshot/doclib2/acme-rd rd:status == “Published” Share “surf-doclist” webscript <data-url-resolver> “resolver.doclib.doclistDataUrl”

34 /alfresco/site-data/extensions/ acme-rd-extension.xml
/alfresco/web-extensions/ acme-rd-share-context.xml <bean id="acme.rd.doclib.resolver.doclistDataUrl” class="org.alfresco.web.resolver.doclib. DefaultDoclistDataUrlResolver"> <property name="basePath" value="/slingshot/doclib2/acme-rd"/> </bean> /alfresco/site-data/extensions/ acme-rd-extension.xml <config evaluator="string-compare” condition="DocumentLibrary" replace="true"> <doclist><data-url-resolver> acme.rd.doclib.resolver.doclistDataUrl </data-url-resolver></doclist> </config>

35 “inline previewer” Document List “viewRenderer”
Notes from Ray’s session https://devcon.alfresco.com/berlin/sessions/share-document-library-views-dam-interface

36 Demo 3: “Partner ‘portal’”

37 What we have done Site extension project Site Preset Global module
Site preset module Group module

38 Start worrying! Engineering sessions Slides & code Blogs
https://devcon.alfresco.com/berlin/sessions/share- customizations-live Blogs Site Extension project https://github.com/share-extras/site-extension


Download ppt "Share Site Customizations Live"

Similar presentations


Ads by Google