My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
SitePollDashlet  
Describes the Site Poll Dashlet add-on for Alfresco Share
Addon-Dashlet
Updated Nov 29, 2011 by will.abson

Introduction

This project defines a custom dashlet allowing polls to be defined within a site, which site users can then vote on, using the dashlet.

Installation

The dashlet is packaged as a single JAR file for easy installation into Alfresco Share.

To install the dashlet, simply drop the site-poll-dashlet.jar file into the tomcat/shared/lib folder within your Alfresco installation, and restart the application server. You might need to create this folder if it does not already exist.

Building from Source

Check out the project if you have not already done so

svn checkout http://share-extras.googlecode.com/svn/trunk/Site%20Poll%20Dashlet

Change into the new directory

cd "Site Poll Dashlet"

An Ant build script is provided to build a JAR file containing the custom files, which can then be installed into the tomcat/shared/lib folder of your Alfresco installation.

To build the JAR file, run the following command from the base project directory.

ant clean dist-jar

The command should build a JAR file named site-poll-dashlet.jar in the dist directory within your project, which you can then copy into the tomcat/shared/lib folder of your Alfresco installation.

Alternatively, you can use the build script to hot deploy the JAR file directly into a local Tomcat instance for testing. You will need to use the hotcopy-tomcat-jar task and set the tomcat.home property in Ant.

ant -Dtomcat.home=C:/Alfresco/tomcat clean dist-jar hotcopy-tomcat-jar

After you have deployed the JAR file you will need to restart Tomcat to ensure it picks up the changes.

Usage

  1. Log in to Alfresco Share and navigate to a site where you are a Site Manager
  2. Navigate to the Data Lists page
  3. If you have not done so before, create a new data list of type Poll
  4. Create your poll in the list by clicking the New Item button. Make sure you tick the Enabled checkbox and complete all other required fields.
  5. Navigate back to the site dashboard and click the Customize Dashboard button to edit the contents of the dashboard. Drag the dashlet into one of the columns from the list of dashlets to add it.
  6. Back on the dashboard, click Configure on the Site Poll dashlet and select the poll to display.
  7. Click OK to save the configuration and then refresh the page in your browser to make this take effect.
  8. The poll should now be displayed in the dashlet. After you have voted on it you will be able to see the current results.

Known Issues

  • By default, only members with the Site Contributor role or greater are able to vote in polls that you create. You can however allow Site Consumers to vote by changing the permission on the poll object, using the Repository Browser component in Share or via Alfresco Explorer.
Comment by GavinSte...@gmail.com, Nov 9, 2010

Is this dashlet able to configure/add a poll? I'm unable to find any way to create a new poll and cannot select one using this dashlet as it states there are no polls configured. Gavin

Comment by erwin.bo...@gmail.com, Dec 27, 2010

I have the same problem. Could someone explain what I'm doing wrong?

Comment by project member will.abson, Jan 4, 2011

Defining polls was previously a manual task in Alfresco Explorer, but you should find that in the latest version of the code (see Building from Source, above) you can now define them using in a Data List.

I've tested the changes against Community 3.4.b, so I'd be interested to know if this works for you (but note that only Site Contributors or greater are currently able to vote, unless you change the permissions on the poll object).

Comment by erwin.bo...@gmail.com, Jan 7, 2011

Works like a charm in 34b! One thing to add to "Usage": you need to refresh the page after step 6.

Comment by project member will.abson, Jan 13, 2011

Thanks Erwin, I've updated the instructions as you suggest. Ideally the dashlet would auto-refresh itself, but that involves moving the rendering logic into the client-side layer, so perhaps one for another time.

Comment by Bertrand...@gmail.com, Mar 4, 2011

Really great dashlet but I've got some troubles cause I use Alfresco in French. (there are troubles with dates and numbers).

poll.get.json.ftl Date parsing throw NaN error with : "EEE, dd MMM yyyy HH:mm:ss z", it works with : "MM/dd/yyyy HH:mm:ss a".

results.get.json.ftl, add ?c otherwise JSON is malformed "votes": ${jsonUtils.encodeJSONString(response.votes?c)}, "share": ${jsonUtils.encodeJSONString(response.share?c)}

site-poll.get.js line 29: if (pollEnabled && response.startDate) => if (pollEnabled && response.endDate)

Sincerly

Comment by bwesa...@gmail.com, Mar 31, 2011

I followed the instructions, including the refreshing the browser after step 6. Although I get the poll question, I don't have the options for answering the poll question. I get:

You cannot vote in this poll because either the poll is disabled, or it is not currently active

I have made sure the poll is active and enabled but no success. Am using Alfresco 3.4d.

Brian

Comment by bwesa...@gmail.com, Apr 1, 2011

After further research I have discovered that entering the "Effective from" date when setting up a poll breaks the poll, i.e. results in users not being able to take the poll.

The poll dashlet is functional, but it is impossible to schedule polls.

Brian

Comment by project member will.abson, Apr 1, 2011

Hi Brian, could you file a bug report for this in the issues section? Please be sure to include the version of the poll dashlet you are using as well as the version of Alfresco.

Comment by project member will.abson, May 24, 2011

The problems with the Effective from and Effective to dates should now be fixed in version 0.4 of the dashlet. In addition to this the activity feed is also updated when a user submits a vote (thanks to Jeff Potts for the suggestion)

Comment by peter.a....@gmail.com, Jun 11, 2011

Great extension. Love the integration with the Datalists feature. These lists are the next best thing after content rules.

I did manage to get an error (the rest works like a charm) -Add the jar to the tomcat/shared/lib -restart alfresco -drag sitepoll dashlet to dashboard -click configure (I should configure a poll datalist first but i didn't in this case) -Dialog box opens: Select poll -There isn't a poll because I didnt configure one; if you click cancel you return to dashboard. -When you click OK it throws a nasty error:

05110003 Failed to execute script 'classpath:alfresco/site-webscripts/org/alfresco/modules/dashlet/config-dashlet.post.json.js': 05110002 TypeError?: Cannot call method "length" of null (file:/C:/Alfresco/tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/modules/dashlet/config-dashlet.post.json.js#5)

Using 3.4.0 Enterprise

Comment by peter.a....@gmail.com, Jun 12, 2011

To track error above please watch issue page:

http://code.google.com/p/share-extras/issues/detail?id=29

Comment by art.r.ta...@gmail.com, Jul 11, 2011

Works great. Terrific Dashlet! Are the individual responses stored? If so, where?

Comment by project member will.abson, Jul 11, 2011

Thanks Art, glad it works well for you. The individual responses are stored as child objects of the data list, and are defined in the custom model file bundled with the add-on. Also, the child items are named using the voter's username, which ensures that a person can only ever vote once.

Comment by juan.man...@gmail.com, Mar 8, 2012

I've been looking at the source code of this dashlet as I'm currently developing a dashlet with similar functionality, i.e. a form in a dashlet that post data that it's stored in a custom datalist. I have almost done it, but I'm having problem making the form in the dashlet doing the POST without reloading.

As I see in the source code, somehow JavaScript? is intercepting the submit action, and performing an Ajax POST instead, but I can't replicate this functionality. Could someone throw some help explaining how is Site Poll doing this?

Thanks.


Sign in to add a comment
Powered by Google Project Hosting