Share site customizations live
This presentation is the property of its rightful owner.
Sponsored Links
1 / 38

Share Site Customizations Live PowerPoint PPT Presentation


  • 88 Views
  • Uploaded on
  • Presentation posted in: General

Share Site Customizations Live. David Draper @_ DaveDraper Erik Winlöf @ erikwinlof (UI Team). What we’re going to do…. Possibilities Unique Organizing Extension points 3 demos = 3 extension modules

Download Presentation

Share Site Customizations Live

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Share site customizations live

Share Site Customizations Live

  • David Draper @_DaveDraper

  • Erik [email protected]

  • (UI Team)


What we re going to do

What we’re going to do…

  • Possibilities

  • Unique

  • Organizing

  • Extension points

  • 3 demos = 3 extension modules

  • …customizations applied LIVE!

  • Create your own < 1 hour!


Share site customizations live

Acme

  • Research & Development department

  • PublishesR&D articles

  • Partner “portal”

  • Casting:

    • Author: Alan

    • Editor: Erik

    • Partner: Patrick


  • Pre demo nothing up our sleeves

    Pre Demo: “Nothing up our sleeves”

    • Alfresco Community 4.2.b (vanilla)


    Step 1

    Step 1

    • Define R&D projects

    • Make it available


    Don t worry be happy

    Don’t worry, be happy!


    Define r d projects

    Define R&D projects

    • Site Presets

    • Config template

    • Used in create site dialog

    • Customize using “preset-id” in evaluators


    Alfresco site data presets acme rd presets xml

    /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>

    http://blogs.alfresco.com/wp/ddraper/2011/11/01/spring-surf-presets/


    Alfresco site data pages acme rd introduction xml

    /alfresco/site-data/pages/acme-rd-introduction.xml

    • Tip! (v4.0b)

    • 2-columns

    • 2-columns-resizable

    • 2-columns-narrow-left

    • 2-columns-narrow-left

    • 3-columns

    • http://blogs.alfresco.com/wp/ewinlof/2011/10/12/create-pages-in-alfresco-share-using-new-out-of-the-box-templates/

    • <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>

    http://wiki.alfresco.com/wiki/Share_Custom_Pages


    Make preset available

    Make preset available

    • Global module: <customizations>


    What is an extension module v4 0 alfresco site data extensions extension xml

    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)

    • http://docs.alfresco.com/4.0/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Ftasks%2FCreate-a-Model.html

    • Add/remove/replace

    • components in a

    • <@region>

    <evaluator>

    <components>

    • Merge share-config

    <configurations>

    <customizations>

    • Enhance templates’

    • & webscripts’:

    • markup / resources /

    • model

    http://blogs.alfresco.com/wp/ddraper/2011/08/26/extensibility-module-deployment/


    Alfresco site data extensions acme rd extension xml

    /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>


    Alfresco site webscripts org alfresco modules create site get js

    /alfresco/site-webscripts/org/alfresco/modulescreate-site.get.js

    • Note!

    • Separate runtime

    • Common model

    • http://blogs.alfresco.com/wp/ddraper/2012/05/22/customizing-share-javascript-widget-instantiation-part-1/

    • varsitePresets = [{

    • id: "site-dashboard",

    • name: msg.get("title.collaborationSite")

    • }];

    • model.sitePresets = sitePresets;

    • model.sitePresets.push(

    • {

    • id: "acme-rd-preset",

    • name: msg.get("preset.acme-rd.title")

    • });

    /alfresco/site-webscripts/acme/rd/customizations/modulescreate-site.get.js


    Demo 1 create r d project

    Demo 1: “Create R&D project”


    How quick is dave

    How quick is Dave?

    …he’s smart…

    https://github.com/share-extras/site-extension

    %>ant create-project

    -Dcompany=Acme-Dusecase=RD …


    Share

    Share

    • Namespaced project structure:

    • build targets

    • Spring context file

    • i18n

    • Site preset

    • Sample page & webscript

    • Extension modules

    • Doclib customizations


    Repository

    Repository

    Note!

    Not required…

    • Namespaced project structure:

    • build targets

    • Spring context file

    • Content model

    • Sample repo action


    Repository1

    Repository

    Alternative solution:

    Folder rule kicks off a simple workflow

    http://docs.alfresco.com/4.0/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Ftasks%2Flibrary-folder-rules-define.html

    • rd:article aspect

    • rd:statusproperty [ “Draft” | ”Published” ]

    • Repo action marks as “Published”

    http://wiki.alfresco.com/wiki/Data_Dictionary_Guide

    https://devcon.alfresco.com/berlin/sessions/developing-doclib-actions-alfresco-4


    Step 2

    Step 2

    • Publishing articles

    • Show article info in the document library

    • “Slim down” Share for Editors


    Publishing articles

    Publishing articles

    • Doclibaction

    • SiteManager(editor)

    • R&D Project only

      • Site Preset module: <configurations>


    Alfresco site data extensions acme rd extension xml1

    /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


    Alfresco site data extensions acme rd extension xml2

    /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>

    http://blogs.alfresco.com/wp/mikeh/2011/09/26/share-document-library-extensions-in-v4-0/


    Show custom data only in r d doclibs

    Show Custom data only in R&D doclibs

    • Indicators

    • Metadata templates


    Alfresco site data extensions acme rd extension xml3

    /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>

    http://blogs.alfresco.com/wp/mikeh/2011/09/26/share-document-library-extensions-in-v4-0/


    Alfresco site data extensions acme rd extension xml4

    /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_statusacme.rd.metadata.status}

    • </line>

    • </template>

    • </metadata-templates>

    • </config>

    http://blogs.alfresco.com/wp/mikeh/2011/09/26/share-document-library-extensions-in-v4-0/


    Hide documents for editors

    Hide “Documents” for Editors

    • Site Presetmodule: <components>

    • http://localhost:8081/share/page/surfBugStatus

    http://blogs.alfresco.com/wp/ddraper/2011/08/31/surfbug/


    Alfresco site data extensions acme rd extension xml5

    /alfresco/site-data/extensions/acme-rd-extension.xml

    • Also: Add & Replace

    • http://blogs.alfresco.com/wp/ewinlof/2011/11/09/add-remove-or-replace-components-on-shares-document-details-page/

    • Component evaluators: (v4.0)

    • config.component.evaluator

    • equals.component.evaluator

    • portlet.component.evaluator

    • site.component.evaluator

    • preset.component.evaluator

    • http://docs.alfresco.com/4.0/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Ftasks%2FCreate-a-Model.html

    • <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>


    Demo 2 r d site customizations

    Demo 2: “R&D site customizations”


    Step 3

    Step 3

    • Partner “portal”

    • List R&D Projects

    • Only “Published” articles

    • “inline previewer”


    Partner portal

    Partner “portal”

    • Dashboard page

      • Partner Title

      • List of R&D projects (api/sites?spf=acme-rd-preset)

    • Document Library page

      • Partner Title

      • Document List (customized)


    Alfresco site data extensions acme rd extension xml6

    /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>


    Alfresco templates org alfresco dashboard ftl

    /alfresco/templates/org/alfresco/dashboard.ftl

    • <@markup id="alf-hd”><div id="alf-hd">

    • <@region id="header" scope="global" />

    • <@region id="title" scope="page" />

    • <@region id="navigation" scope="page" />

    • </div><[email protected]>

    • <@markup target="alf-hd" action="after" id="acme-after-alf-hd">

    • <@region id="partner-title” scope="global" />

    • <@region id="partner-sites" scope="global" />

    • <[email protected]>

    /alfresco/templates/acme/rd/customizations-partner

    /dashboard.ftl

    • <#-- Remove markup sections we don't want -->

    • <@markup target="alf-hd"action="remove" id="acme-remove-alf-hd" />

    http://docs.alfresco.com/4.0/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Ftasks%2Ftu-share-FM-temp-customize.html


    Only published docs

    Only “Published” docs

    • Custom repository webscript

      • /slingshot/doclib2/acme-rd

      • rd:status == “Published”

    • Share “surf-doclist” webscript

      • <data-url-resolver>

        • “resolver.doclib.doclistDataUrl”


    Alfresco site data extensions acme rd extension xml7

    /alfresco/web-extensions/acme-rd-share-context.xml

    /alfresco/site-data/extensions/acme-rd-extension.xml

    • <bean id="acme.rd.doclib.resolver.doclistDataUrl”

    • class="org.alfresco.web.resolver.doclib.

    • DefaultDoclistDataUrlResolver">

    • <property name="basePath" value="/slingshot/doclib2/acme-rd"/>

    • </bean>

    • <config evaluator="string-compare” condition="DocumentLibrary"

    • replace="true">

    • <doclist><data-url-resolver>

    • acme.rd.doclib.resolver.doclistDataUrl

    • </data-url-resolver></doclist>

    • </config>


    Inline previewer

    “inline previewer”

    • Document List “viewRenderer”

    • Notes from Ray’s session

    • https://devcon.alfresco.com/berlin/sessions/share-document-library-views-dam-interface

    http://rgauss.com/2012/08/08/adding-document-library-views-to-alfresco-share/


    Demo 3 partner portal

    Demo 3: “Partner ‘portal’”


    What we have done

    What we have done

    • Site extension project

    • Site Preset

    • Global module

    • Site preset module

    • Group module


    Start worrying

    Start worrying!

    • Engineering sessions

    • Slides & code

      • https://devcon.alfresco.com/berlin/sessions/share-customizations-live

    • Blogs

      • http://blogs.alfresco.com/wp/ewinlof/

      • http://blogs.alfresco.com/wp/ddraper/

    • Site Extension project

      • https://github.com/share-extras/site-extension


  • Login