Previously we have showed how to create a module for alfresco and share. this will come handy for you here as you need to know how to deploy custom content types for alfresco and custom settings for share. You can find this blog posts :
In this post we are going to explain how to set up share so it would allow you to work with custom types, aspects and properties that you have defined in your custom model.
Previously we have created one aspect type with come custom properties, both aspect and model is listed below .
ab:invoice aspect represents an invoice in our system
ab:invoiceFolder is a custom type meant to hold a list of files with aspect ab:invoice and total values of invoices will be written in ab:total property.
After model has been deployed share UI must be set so it would allow user to manage aspect ab:invoice, to create rules that depend on this aspect. To change the folder type to our custom type cm:invoiceFolder .
In share module project and in share-config-custom.xml we need to add next xml in order to accomplish this .
This xml allows share to show our custom type and aspect. Lets see list of images that demonstrate this.
Changing type of folder to Invoice Folder
Setting aspect criteria when creating new rule
Performing adding aspect when rule is triggered
Aspects and types have properties of their own, it is important to allow this properties to be seen in share UI to ther user. There are two places where properties values can be seen and in the properties form and document details.
We will demonstrate this in ab:invoice aspect that we have previously added to one of the files. To add this three properties we will use next xml that is to be added to share-config-custom.xml.
Lets spend a moment to see the code, ab:invoice is an aspect therefore we have
we can see two things in form tag, field-visibility and appearance. first one defines list of properties that will be shown or hidden and other how are they rendered. Lets go through them in more details.
Appearance defines look and feel of visible fields, it can contain two types of tags, set and field.
This concludes this short tutorial on how to set share to allow you to manage aspects and types in rules and forms.Recent Thoughts Twitter Google+ Subscribe Categories
Alfresco is an open source Enterprise Content Management (ECM) system for Windows and Linux-like operating systems.
The year-on-year growth of business connections, contacts, and communications is expanding enterprise boundaries more than ever before. Alfresco enables organizations to collaborate more effectively, improve business process efficiency, and ensure information governance.
The basic purpose of Alfresco is to help users to capture and manage information in a better way. It helps you capture, organize, and share binary files.
This book will cover the basic building blocks of an Alfresco system, how the components fit together, and the information required to build a system architecture.
This book will also focus on security aspects of Alfresco. such as authentication, troubleshooting, managing permissions, and so on.
It will also focus on managing content and storage, indexing and searches, setting up clustering for high availability, and so forth.What You Will Learn
Vandana Pal is a software engineer and author. She currently works as senior consultant at CIGNEX Datamatics.
She has extensive experience working with Enterprise Digital Asset Management and Content Management Systems. She has worked with various deployments of Alfresco in various domains, such as media, finance, and healthcare, for different organizations across the world. She has hands-on experience working with architecture design, performance tuning, security implementation, integration, and the orchestration of complex workflows in Alfresco.
She has more than 7 years of experience in software engineering. Her journey in this field began when she started working with different open source technologies and found them interesting. She holds a bachelors of engineering degree in information technology from Gujarat University, India.
Vandana has also coauthored Alfresco 4 Enterprise Content Management Implementation.Table of Contents
We understand your time is important. Uniquely amongst the major publishers, we seek to develop and publish the broadest range of learning and information products on each technology. Every Packt product delivers a specific learning pathway, broadly defined by the Series type. This structured approach enables you to select the pathway which best suits your knowledge level, learning style and task objectives.Learning
As a new user, these step-by-step tutorial guides will give you all the practical skills necessary to become competent and efficient.Beginner's Guide
Friendly, informal tutorials that provide a practical introduction using examples, activities, and challenges.Essentials
Fast paced, concentrated introductions showing the quickest way to put the tool to work in the real world.Cookbook
A collection of practical self-contained recipes that all users of the technology will find useful for building more powerful and reliable systems.Blueprints
Guides you through the most common types of project you'll encounter, giving you end-to-end guidance on how to build your specific solution quickly and reliably.Mastering
Take your skills to the next level with advanced tutorials that will give you confidence to master the tool's most powerful features.Starting
Accessible to readers adopting the topic, these titles get you into the tool or technology so that you can become an effective user.
I would like to customize the share UI header, for example remove some of buttons such as People and Shared files. I found that this can be done by modifying the share-header.lib.js file located in the tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/share/imports folder. On modifying this file, I can see the changes. But as has been advised in these links: https://forums.alfresco.com/forum/developer-discussions/alfresco-share-development/correctbest-way-customize-shares-ui-07182011 http://ecmarchitect.com/archives/2010/09/07/1212
The right way would be to create the same folder structure under the tomcat/webapps/share/WEB-INF/classes/alfresco/web-extension directory and put the modified file there. I created the folder hierarchy and copied the share-header.lib.js file in this folder with the changes but now the changes are not seen on the website. Am I missing something. Can anyone advise on the right method to do this ?
asked Oct 27 '14 at 16:32
The general guideline that tomcat/webapps/share/WEB-INF/classes/alfresco/web-extension overrides tomcat/webapps/share/WEB-INF/classes/alfresco is correct but there is one big caveat: it only works for webscripts.
In your case there are two files involved in the generation of the header:
The former belongs indeed to a webscript (you'll find a share-header.get.desc.xml in the same directory). This file can be overridden by placing a file in a similar directory structure under WEB-INF/classes/alfresco/web-extension as you've correctly found in your research.
The latter however is not part of a webscript. Rather it is imported through an import directive. Importing is a completely different mechanism and the WEB-INF/classes/alfresco/web-extension trick doesn't work here.
The first lines of share-header.get.js clarify this:
The imported resource is loaded from the classpath literally, without any web-extension overlay. To import your customised version of share-header.lib.js, the first line should have been:
So in summary my recommendation is to customise both header/share-header.get.js (just the first line) and imports/share-header.lib.js (as you've already done).
Remember that when you create a new customisation file it is safer to restart Alfresco. On the other hand when you edit an existing customisation file it is sufficient to visit /share/service/index on your local installation and click on Refresh Web Scripts and Clean Dependency Caches .
Actually, your approach isn't the best one. As in Alfresco documentation you should configure your share-config-custom.xml in tomcat/shared/classes/web-extension folder. You should find a sample file there. Look for the original one share-config.xml in share webapp folder: and search for the <header> tag. It will look something similar to this:
Copy the entire section in your share-config-custom.xml file. make your changes and restart Alfresco. You should be good to go.
Changes in Alfresco/Share version 5.0
I have recently downloaded Alfresco 5.0 and am working my way through the book, taking into account the changes in 5.0 as far as I can.
I am attempting some simple customizations of the Collaborations site.
Following the example on p378/9, I have placed the following bean in:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
page.siteDashboard.title=Erewhon Social Care: Dashboard
But nothing happens when I stop tomcat and relaunch Share - I still see "My Sites", not "My Cases".
Is this something to do with the changes in version 5.0? or am I doing something else wrong.
Hope you can help - tearing my hair out, Dave
PS. the space in "Co mponent" was introduced by the editor, it's not in my code!
Last edited by DaveWoz; February 8th, 2015 at 12:37 PM. Reason: corrected typo
In DetailAlfresco Share is a modern, browser-based platform for social content management and collaboration. Alfresco Share sets the premise for affordablecollaboration for enterprises. Based on the sturdy Surf framework, Share leverages dynamic site generation capabilities of Alfresco for better participation amongst enterprise personnel. Do you want to know more about Share?Alfresco Share will guide you through creating and managing sites. The book focuses on business needs rather than technical syntax. The book builds a case study around a sample example, so that you will have an easier, practical understanding of Alfresco Share. There are step-by-step examples which explain how the out of the box features can be made best use of as well as the other options that are available, and how they fit into the overall picture. By the end of this book, you will know how to set up an efficient and effective collaboration system for your company and customers.The book will guide the readers to learn Alfresco through steps starting from installation to the deployment of Alfresco Share. It helps the users understand the benefits that they can reap by implementing Alfresco share solution in their enterprise environment.You will learn about how alfresco share application is built on top of alfresco repository using Spring Surf Framework. You will be taught how to manage users and groups and the concepts of the underlying framework behind the Alfresco security model.The book will also teach you to create and manage a site for collaboration within the team. You will also learn to configure dashboards for easy use. The content also includes explaining how members can contribute content and share their expertise with other team members by creating entries on the site wiki, blog, forums, discussion etc. You will become familiar with managing documents through Document library and implementing workflows to automate the business process. You will be able to try out various configurations within share such as searching custom properties, enabling custom aspects. configuring new advance workflows, and managing actions on document library. You will learn about how to set up the development environment and different approaches for deployment followed in share.Our book, Alfresco Share aims to help users get a better perspective of enterprise collaboration. It will help you set up an infrastructure for supporting multiple sites using Alfresco Share, enable a shortened development cycle, and make the best use of collaborative features.ApproachWritten in an easy-to-read and encouraged-to-try style, this book will take you from the basics of using Share to deploying Alfresco Share through a case-study. The necessary screenshots and thorough explanations are provided.Who this book is forIf you are a business user or content manager looking to implement a collaboration strategy for your enterprise, then this book is for you. This book is not a developer guide. It focuses on business needs rather than technical syntax. However, it helps in understanding the capabilities of Alfresco Share through Case Study. Although no knowledge of Alfresco is presumed, exposure to XML, templating language, YUI and the concepts of web scripts and Document Management will help you to get the most from this book.
Making Alfresco Share Dashlets Configurable Blue Fish Development Group
This article isn’t an exhaustive dashlet development how-to. For an introduction to the platform and technologies used to build dashlets, a great place to start is the Alfresco Surf Platform Developers Guide .
Dashlets are a lot of fun. They expose a tremendous amount of functionality, and they give users and project teams the power to assemble and organize that functionality as they see fit. They can be as simple as the two file Hello World dashlet from Dr. Q’s Workshop. On the other hand, they can also be incredibly complex, with well over 20 files making up a single dashlet.
I know that when I first waded into the deep end of the dashlet pond, I started drowning quite quickly. Back when I was a naive ‘noob’, it took me a while to find my way around and comfortably accomplish some of the tasks I had assumed would be very easy. One of the areas I struggled with was figuring out how to make my dashlets configurable, so that end users could change the way they look or behave. I wanted to make dashlets similar to Alfresco’s Web View dashlet that lets users provide a URL, and then displays the page referenced by that URL within the dashlet.
The goal of this article is to help you understand how to make your dashlets configurable so that you can focus on the development of new features, and not the plumbing of configuration values.Dashlets Are Easy, Sometimes
Dashlets can be very simple. For example, a simple Hello World dashlet can be implemented with just two files:
Drop these two files into the
directory and you’ve got a new dashlet ready to go.
If some dashlets can be so simple, why are others often so hard? Well, in this article I’m going to show you how taking this simple, static Hello World dashlet, and adding configuration capabilities expands these two source files into a total of 16 files. I know, I know; that sounds like a lot. But once you learn your way around you’ll be adding configuration capabilities to all you dashlets.A Configurable Example
For the purposes of this article, I’ll be using an example dashlet that accepts and displays three configuration values. Not earth shattering functionality, but then very few people would have guessed Twitter was going to change the world when it was first rolled out. Here is a look at the end product in action:
This dashlet allows users to dynamically configure its three displays values. As you can see below, it accepts a title, headline, and story:
Once the configuration dialog is saved the dashlet on the dashboard is automatically updated with the new values, and those values are persisted for all future views of that instance of the dashlet.Anatomy of a Dashlet’s Configuration Process
As you begin experimenting with dashlet development, I highly recommend that you check out the Alfresco Developers Wiki. This site has some tremendously useful Web Scripts framework documentation and examples. One particularly helpful section discusses the framework’s use of the MVC pattern, and how a Web Script’s execution flows through the framework. In that section the following diagram is used to help explain the flow:
Our example dashlet will actually complete this loop three different times as we interact with it. Let’s quickly review each of the three loops.Main Dashlet Display
The initial loop is completed every time our dashlet is drawn onto a dashboard. In this loop, the steps highlighted in the diagram execute as follow:
The second loop is completed when users click on the dashlet’s Configure link. In this loop, the steps highlighted in the diagram execute as follow:
The final loop is completed when a user submits the configuration dialog by clicking the OK button. In this loop, the steps highlighted in the diagram execute as follow:
First, let’s look at where the 16 files that make up this dashlet live within the context of the Share application. Here is a view of the files that make up our example dashlet deployed into Alfresco Enterprise 3.2r:
If this looks a little foreign to you, then let me direct you over to a great article about Alfresco source code organization written by my colleague Josh Toub.
These 16 files require 9 easy steps to enable our configuration functionality. Let’s dive right in.Define Defaults
The first thing we need to do is define some default values for our configuration parameters. These default values will be used when the dashlet is first instantiated onto the dashboard. Default values are defined in the aafb.get.config.xml file as follows:Set Configuration Parameter Values
Now that we’ve got some configuration values defined, we need to display them within our dashlet. We define the dashlet’s layout with a FreeMarker template in the
aafb.get.html.ftl file as follows:
This template uses properties values from the aafb.get.properties file and has access to the scripts included in the aafb.get.head.ftl file.Create Instance of Custom Object for Managing Configuration
At the top of our aafb.get.html.ftl you probably noticed a script block. The first seven lines within that block create a new instance of a custom object. This custom object is used to manage the values of our configuration parameters and control the behavior of the configuration dialog used to set those values.
When the script block executes on the loading of our dashlet, the constructor and setOptions methods of our custom object are called. Those methods are defined in the aafb.js file. The code snippet below provides the entire contents of the aafb.js so that you can see how these two methods fit into the overall file. We’ll discuss the individual sections of the file a little bit later.Layout Configuration Dialog
Next, let’s look at the implementation of the dialog used to set configuration values. Much like the dashlet itself, the configuration dialog is rendered with a FreeMarker template. In our example, the config-aafb.get.html.ftl file is used as follows:
Just like our aafb.get.html.ftl, the config-aafb.get.html.ftl uses properties from its own property file, config-aafb.get.properties.Define Configuration Dialog Validation Behavior
With our dialog in place, let’s discuss how to define the validation behavior for fields on that dialog.
In the doSetupFormsValidation method we set up validation rules that make both the title and headline fields mandatory, and prevent users from submitting the dialog if the rules aren’t satisfied. In this method, we also set the form values to the current values of the configuration parameters so users can see what they’re about to change. This is all done in aafb.js as follows:
Alfresco supplies many other form validation rules as part of its forms service. You can find more documentation on the Alfresco forms service on the Alfresco Wiki.Submit Configuration Dialog
The final thing we need to do is define what our dashlet should do when new values are successfully submitted and processed through the configuration dialog. In the onSuccess function we setup a callback mechanism that accepts the JSON response and sets some values. First, we set the values of our custom object. Then we update the contents of the dashlet’s markup so that users will automatically see the new values. This is all done in aafb.js as follows:A Few Words of Advice
Now that you’ve seen how a simple dashlet that supports configuration is assembled, let’s take a moment to talk about a few of the areas that could trip you up.Don’t Lose Your Head
Don’t forget to include the *.get.head.ftl (aafb.get.head.ftl in our example) file in your dashlet. There isn’t much going on in this file, but without it, you won’t have access to your *.js file(s) or any custom styles you might define in a
Alfresco.Aafb is not a constructor
In your *.get.head.ftl file you’ll see a line like this:
There you have it, a straightforward (as straightforward as I can put it anyway) example of a custom dashlet that supports configuration. The number of files required to support configuration can seem intimidating at first, but I hope this article has shown you that once you understand how the files work together, it’s really not all that complex.
So, now that you know how enable configuration in your own custom dashlets, what will you build? To help you get started, I’ve included a collection of documentation, links, and source files in the Resources section. Please share your questions, thoughts and ideas in the comments below. Thanks, and happy configuring!Resources
The following links and documents were referenced in writing this article, and are a great source for more information on all of the topics above:You might also like
Probably you even didn't have enough time to have a look on pop-up window because in case of successfull upload it immediately hides. Which is quite sad because it could show a bit more to the user than just a status of upload. I will show how to improve this component and get a bit more from it. This article is split in two parts. This one covers the UI changes. The second one will show how to extend functionality of upload webscript. I'll post a link to it here when it would be written.
I was quite surised when discovered that out-the-box alfresco RM doesn't audit document view action. After suffering for a while I've finally managed to turn it on!
For better understanding of Alfresco sometimes it's needed to see Alfresco tables. Here I'm showing how to connect to Alfresco Postgre database on a server and to h2 database during development.
Alfresco 5.0.a is the first version with faceted search support. By default it supports 7 facets. Here I'll show how to add custom facets on custom metadata.
This reference describes the publicly available and supported APIs (Application Programming Interfaces) that enable developers to write applications that access Alfresco.
Important: It is important to note that any APIs not covered by this document are unsupported and subject to significant change.
Alfresco provides a wide range of APIs. This topic introduces the APIs available, and their typical use.
Alfresco One API
For more detailed information see the Web Scripts documentation .Alfresco Repository Freemarker Template API
For more detailed information see the Web Scripts documentation .Alfresco Repository REST API
When you need to create new services in Alfresco, or develop applications or customizations that cannot be implemented at the web script level, it is necessary to write those extensions in Java. Alfresco provides numerous Java-level APIs, which are documented through the JavaDoc system. Links to the JavaDoc documentation can be found on the Alfresco Developer Site. While in theory it is possible to access the complete range of Java APIs, there is a list of recommended Public Java API calls. Where possible it is strongly recommended that your application limits itself to this list, so that your application works on future versions of Alfresco.CMIS
Alfresco Repository is fully CMIS-compliant. If as a developer you wish to create a client that can access any CMIS repository, you can use the CMIS API. Note that the Alfresco One API uses the CMIS API for repository access and is documented in the Alfresco One API documentation .
Further information on CMIS can be found at the CMIS web site. The Apache Chemistry project provides various implementations of the CMIS standard. Further information can be found at the Chemistry project site .
Tags: alfresco share ebook free download