cancel
Showing results for 
Search instead for 
Did you mean: 

Embed custom application into share site

silverhoof
Champ in-the-making
Champ in-the-making
When planning a business solution we found that the alfresco ecm and alfresco share application can address most of our problems regarding to document exchange and document oriented process control.
But some business logic is not content oriented and is better be handled by a customized web application which have its own web pages, controller logics and own database to store business entities.
How can I embed an spring web mvc web application into an alfresco share site (some thing like add calendar to a site) and let user access that application through a menu bar icon. Does the application have to use spring surf or can I just use relatively mainstream spring web technology like extjs + spring webmvc?
3 REPLIES 3

ddraper
World-Class Innovator
World-Class Innovator
Spring Surf is an extension to Spring MVC so technically Share is already fairly well set-up to use other Spring MVC technologies. It should be fairly straightforward to add new mappings to alternative view renderers so that you can render pages via an alternative Spring MVC technology but embedding content in an existing Share page (which will have been rendered by Surf) may be more challenging. The most simple solution would probably be to create a Surf Component that includes an iframe that references your new page. The alternative would be to extend Spring Surf to add processors for the technologies that you want to use so that they can be rendered as a Component.

silverhoof
Champ in-the-making
Champ in-the-making
Spring Surf is an extension to Spring MVC so technically Share is already fairly well set-up to use other Spring MVC technologies. It should be fairly straightforward to add new mappings to alternative view renderers so that you can render pages via an alternative Spring MVC technology but embedding content in an existing Share page (which will have been rendered by Surf) may be more challenging. The most simple solution would probably be to create a Surf Component that includes an iframe that references your new page. The alternative would be to extend Spring Surf to add processors for the technologies that you want to use so that they can be rendered as a Component.

So, how to create another custom site component (like the existing calendar, discussion, wiki etc..)to let user add to the site using the site configuration user interface.

ddraper
World-Class Innovator
World-Class Innovator
You'd need to create a new Surf Page configuration and add that to the list of pages in the configuration. If you look in the /share/WEB-INF/classes/alfresco/share-config.xml you'll find the following code:
<config evaluator="string-compare" condition="SitePages">
      <pages>
         <page id="calendar">calendar</page>
         <page id="wiki-page">wiki-page?title=Main_Page</page>
         <page id="documentlibrary">documentlibrary</page>
         <page id="discussions-topiclist">discussions-topiclist</page>
         <page id="blog-postlist">blog-postlist</page>
         <page id="links">links</page>
         <page id="data-lists">data-lists</page>
      </pages>
   </config>

This is the list of pages available for a site. If you add a new page to this list then the page will be available when you customize a site (you'll be able to drag and drop it into the site). If you want your new page to be added by default then you'll need to override the default "site-dashboard" preset. This file can be found in /share/WEB-INF/classes/alfresco/site-data/presets/presets.xml.

The "site-dashboard" preset contains the "site/${siteid}/dashboard" page which contains a property called "sitePages" which lists the pages that are included in a site by default.

<page id="site/${siteid}/dashboard">
            <title>Collaboration Site Dashboard</title>
            <title-id>page.siteDashboard.title</title-id>
            <description>Collaboration site's dashboard page</description>
            <description-id>page.siteDashboard.description</description-id>
            <template-instance>dashboard-2-columns-wide-right</template-instance>
            <authentication>user</authentication>
            <properties>
               <sitePages>[{"pageId":"documentlibrary"}]</sitePages>
            </properties>
         </page>

Regards,
Dave