diff --git a/maven-alfresco-archetypes/maven-alfresco-share-archetype/src/main/resources/archetype-resources/pom.xml b/maven-alfresco-archetypes/maven-alfresco-share-archetype/src/main/resources/archetype-resources/pom.xml index 5bc8557b..595ae0d8 100644 --- a/maven-alfresco-archetypes/maven-alfresco-share-archetype/src/main/resources/archetype-resources/pom.xml +++ b/maven-alfresco-archetypes/maven-alfresco-share-archetype/src/main/resources/archetype-resources/pom.xml @@ -1,122 +1,136 @@ - - - 4.0.0 - ${groupId} - ${artifactId} - ${version} - Alfresco Share client - war - SHARE customization meant to be the main Alfresco UI, which enables collaboration and easy ReST based remotable customization. - - - - alfresco-public - http://maven.alfresco.com/nexus/content/groups/public/ - - - - - - local - 3.2r - info - 8081 - - - - + + + 4.0.0 + ${groupId} + ${artifactId} + ${version} + Alfresco Share client + war + SHARE customization meant to be the main Alfresco UI, which enables collaboration and easy ReST based remotable customization. + + + + alfresco-public + http://maven.alfresco.com/nexus/content/groups/public + + + alfresco-public-snapshots + http://maven.alfresco.com/nexus/content/groups/public-snapshots + + + + + + local + 3.2r + info + 8081 + + + + - - org.alfresco - share - war - ${alfresco.version} - community - - - - - - - - src/main/properties/${env}/application.properties - - + --> + + org.alfresco + share + war + ${alfresco.version} + community + + + + + + + + src/main/properties/${env}/application.properties + + - - - src/main/resources - true - + --> + + + src/main/resources + true + - - src/main/properties - - application.properties - + --> + + src/main/properties/${env} + + application.properties + - alfresco/web-extension - true - - - - - org.apache.maven.plugins - maven-war-plugin - - false - - src/main/properties/${env}/application.properties - - - - - - - - - - - - run - - - - org.mortbay.jetty - maven-jetty-plugin - - - - ${share.servlet.port} - - - - - - run-jetty - pre-integration-test - - run-exploded - - - - - - - - - - - + --> + alfresco/web-extension + true + + + + + org.apache.maven.plugins + maven-war-plugin + + false + + src/main/properties/${env}/application.properties + + + + + + + + + + + + run + + + + org.mortbay.jetty + maven-jetty-plugin + + + + ${share.servlet.port} + + + + + + run-jetty + pre-integration-test + + run-exploded + + + + + + + + + + + diff --git a/maven-alfresco-archetypes/maven-alfresco-share-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/web-extension/custom-slingshot-application-context.xml b/maven-alfresco-archetypes/maven-alfresco-share-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/web-extension/custom-slingshot-application-context.xml index 731acfcd..a5960c6e 100644 --- a/maven-alfresco-archetypes/maven-alfresco-share-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/web-extension/custom-slingshot-application-context.xml +++ b/maven-alfresco-archetypes/maven-alfresco-share-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/web-extension/custom-slingshot-application-context.xml @@ -6,6 +6,7 @@ + classpath:alfresco/web-extension/application.properties diff --git a/maven-alfresco-archetypes/maven-alfresco-share-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/web-extension/webscript-framework-config-custom.xml b/maven-alfresco-archetypes/maven-alfresco-share-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/web-extension/webscript-framework-config-custom.xml index fa31f9de..a13ca4a5 100644 --- a/maven-alfresco-archetypes/maven-alfresco-share-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/web-extension/webscript-framework-config-custom.xml +++ b/maven-alfresco-archetypes/maven-alfresco-share-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/web-extension/webscript-framework-config-custom.xml @@ -1,93 +1,83 @@ - - - - - - ${share.server.scheme} - ${share.server.name} - ${share.server.port} - - - - - - + + + + ${share.server.scheme} + ${share.server.name} + ${share.server.port} + + - - - - alfresco-noauth - Alfresco - unauthenticated access - Access to Alfresco Repository WebScripts that do not require authentication - alfresco - ${alfresco.server.scheme}://${alfresco.server.name}:${alfresco.server.port}/${alfresco.webapp.name}/s - none - + - - alfresco - Alfresco - user access - Access to Alfresco Repository WebScripts that require user authentication - alfresco - ${alfresco.server.scheme}://${alfresco.server.name}:${alfresco.server.port}/${alfresco.webapp.name}/s - user - + + + + alfresco-noauth + Alfresco - unauthenticated access + Access to Alfresco Repository WebScripts that do not require authentication + alfresco + + ${alfresco.server.scheme}://${alfresco.server.name}:${alfresco.server.port}/${alfresco.webapp.name}/s + + none + - - - - - - - - - - + + + + - - alfresco - Alfresco - user access - Access to Alfresco Repository WebScripts that require user authentication - alfrescoCookie - http://localhost/alfresco/wcs - user - true - - - - - --> - \ No newline at end of file diff --git a/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/pom.xml b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/pom.xml new file mode 100644 index 00000000..f22f49b1 --- /dev/null +++ b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + org.alfresco.maven + maven-alfresco-share-module-archetype + 1.0.0-SNAPSHOT + maven-archetype + Maven Archetype to build Alfresco Share JAR modules (dashlets,pages,etc.) + + com.sourcesense.alfresco + maven-alfresco-archetypes + 1.9.2-SNAPSHOT + ../pom.xml + + + + + org.apache.maven.archetype + archetype-packaging + 2.0-alpha-4 + + + + + maven-archetype-plugin + 2.0-alpha-4 + true + + + + diff --git a/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml new file mode 100644 index 00000000..75fad9ad --- /dev/null +++ b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -0,0 +1,20 @@ + + + + src/main/resources + + **/*.xml + **/*.properties + + + + src/main/resources + + **/*.js + **/*.ftl + **/*.css + **/*.png + + + + \ No newline at end of file diff --git a/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/META-INF/maven/archetype.xml b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/META-INF/maven/archetype.xml new file mode 100644 index 00000000..ac579b40 --- /dev/null +++ b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/META-INF/maven/archetype.xml @@ -0,0 +1,15 @@ + + maven-share-module + + src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.config.xml + src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.desc.xml + src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.head.ftl + src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.html.ftl + src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.js + src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.properties + src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get_cy.properties + src/main/resources/META-INF/components/dashlets/images/refresh.png + src/main/resources/META-INF/components/dashlets/site-tags.css + src/main/resources/META-INF/components/dashlets/site-tags.js + + \ No newline at end of file diff --git a/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/pom.xml b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/pom.xml new file mode 100644 index 00000000..2a376fdc --- /dev/null +++ b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/pom.xml @@ -0,0 +1,35 @@ + + + 4.0.0 + ${groupId} + ${artifactId} + jar + ${version} + ${artifactId} project + http://share.alfresco.com + + + + alfresco-public + http://maven.alfresco.com/nexus/content/groups/public + + + alfresco-public-snapshots + http://maven.alfresco.com/nexus/content/groups/public-snapshots + + true + daily + + + + + + junit + junit + 3.8.1 + test + + + + diff --git a/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/components/dashlets/images/refresh.png b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/components/dashlets/images/refresh.png new file mode 100644 index 00000000..71f0d4c1 Binary files /dev/null and b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/components/dashlets/images/refresh.png differ diff --git a/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/components/dashlets/site-tags-min.js b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/components/dashlets/site-tags-min.js new file mode 100644 index 00000000..44bc1e7c --- /dev/null +++ b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/components/dashlets/site-tags-min.js @@ -0,0 +1 @@ +(function(){var e=YAHOO.util.Dom,r=YAHOO.util.Event;var k=Alfresco.util.encodeHTML,i=Alfresco.util.combinePaths;var l="org.alfresco.share.dashlet",c=l+".siteTagsFilter";Alfresco.dashlet.SiteTags=function p(s){return Alfresco.dashlet.SiteTags.superclass.constructor.call(this,"Alfresco.dashlet.SiteTags",s)};YAHOO.extend(Alfresco.dashlet.SiteTags,Alfresco.component.Base,{options:{maxItems:50,activeFilter:"all"},tagsContainer:null,containerId:null,onReady:function m(){var w=this;this.tagsContainer=e.get(this.id+"-tags");r.addListener(this.id+"-refresh","click",this.onRefresh,this,true);this.services.preferences=new Alfresco.service.Preferences();this.widgets.all=new YAHOO.widget.Button(this.id+"-all",{type:"checkbox",value:"all",checked:true});this.widgets.all.on("checkedChange",this.onAllCheckedChanged,this.widgets.all,this);this.widgets.filter=new YAHOO.widget.Button(this.id+"-filter",{type:"split",menu:this.id+"-filter-menu",lazyloadmenu:false});this.widgets.filter.on("click",this.onFilterClicked,this,true);var x=this.widgets.filter.getMenu();x.subscribe("click",function(z,y){var A=y[1];if(A){w.widgets.filter.set("label",A.cfg.getProperty("text"));w.onFilterChanged.call(w,y[1])}});if(this.options.activeFilter=="all"){this.widgets.filter.value="documentLibrary";this.setActiveFilter("all")}else{this.widgets.filter.value=this.options.activeFilter;var t=x.getItems(),v,s,u;for(s=0,u=t.length;s'+this.msg("message.no-tags")+""}else{var F,s=function t(G){return G.count/(C/y)},A=function z(G){return(0.5+s(G)).toFixed(2)},B=function u(H,G){if(H.nameG.name){return 1}return 0};E.sort(B);for(v=0,D=E.length;v'+k(F.name)+" "}}this.tagsContainer.innerHTML=w;Alfresco.util.Anim.fadeIn(this.tagsContainer)},onTagsFailed:function o(){this.tagsContainer.innerHTML=this.msg("refresh-failed");Alfresco.util.Anim.fadeIn(this.tagsContainer)},getUriTemplate:function j(s){var t=Alfresco.constants.URL_CONTEXT+"page/site/"+this.options.siteId;switch(this.options.activeFilter){case"wiki":t+="/wiki";break;case"blog":t+="/blog-postlist";break;case"documentLibrary":t+="/documentlibrary#filter=tag|"+encodeURIComponent(s.name);break;case"calendar":t+="/calendar";break;case"links":t+="/links";break;case"discussions":t+="/discussions-topiclist";break;default:t+="/search?tag="+encodeURIComponent(s.name)+"&a=false"}return t},updateFilterUI:function b(){switch(this.options.activeFilter){case"all":e.removeClass(this.widgets.filter.get("element"),"yui-checkbox-button-checked");break;default:this.widgets.all.set("checked",false,true);e.addClass(this.widgets.filter.get("element"),"yui-checkbox-button-checked");break}},setActiveFilter:function f(s,t){this.options.activeFilter=s;this.containerId=s!=="all"?s:"";this.updateFilterUI();this.refreshTags();if(t!==true){this.services.preferences.set(c,s)}},onAllCheckedChanged:function h(s,t){this.setActiveFilter("all");t.set("checked",true,true)},onFilterClicked:function a(s){this.setActiveFilter(this.widgets.filter.value)},onFilterChanged:function q(t){var s=t.value;this.widgets.filter.value=s;this.setActiveFilter(s)}})})(); \ No newline at end of file diff --git a/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/components/dashlets/site-tags.css b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/components/dashlets/site-tags.css new file mode 100644 index 00000000..25c4baf3 --- /dev/null +++ b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/components/dashlets/site-tags.css @@ -0,0 +1,27 @@ +.site-tags .tag +{ + display: inline-block; + padding: 0.2em; +} + +.site-tags .refresh +{ + background-image: url(images/refresh.png); + background-repeat: no-repeat; + float: right; + height: 16px; + left: -8px; + position: relative; + top: -22px; + width: 16px; +} + +.site-tags .refresh a, +.site-tags .refresh a:active, +.site-tags .refresh a:hover +{ + display: block; + height: 16px; + text-decoration: none; + width: 16px; +} diff --git a/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/components/dashlets/site-tags.js b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/components/dashlets/site-tags.js new file mode 100644 index 00000000..cb71a7e7 --- /dev/null +++ b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/components/dashlets/site-tags.js @@ -0,0 +1,422 @@ +/** + * Copyright (C) 2005-2009 Alfresco Software Limited. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + * As a special exception to the terms and conditions of version 2.0 of + * the GPL, you may redistribute this Program in connection with Free/Libre + * and Open Source Software ("FLOSS") applications as described in Alfresco's + * FLOSS exception. You should have recieved a copy of the text describing + * the FLOSS exception, and it is also available here: + * http://www.alfresco.com/legal/licensing + */ + +/** + * Dashboard Site Tags component. + * + * @namespace Alfresco + * @class Alfresco.dashlet.SiteTags + */ +(function() +{ + /** + * YUI Library aliases + */ + var Dom = YAHOO.util.Dom, + Event = YAHOO.util.Event; + + /** + * Alfresco Slingshot aliases + */ + var $html = Alfresco.util.encodeHTML, + $combine = Alfresco.util.combinePaths; + + /** + * Preferences + */ + var PREFERENCES_DASHLET = "org.alfresco.share.dashlet", + PREF_SITE_TAGS_FILTER = PREFERENCES_DASHLET + ".siteTagsFilter"; + + + /** + * Dashboard SiteTags constructor. + * + * @param {String} htmlId The HTML id of the parent element + * @return {Alfresco.dashlet.SiteTags} The new component instance + * @constructor + */ + Alfresco.dashlet.SiteTags = function SiteTags_constructor(htmlId) + { + return Alfresco.dashlet.SiteTags.superclass.constructor.call(this, "Alfresco.dashlet.SiteTags", htmlId); + }; + + /** + * Extend from Alfresco.component.Base and add class implementation + */ + YAHOO.extend(Alfresco.dashlet.SiteTags, Alfresco.component.Base, + { + /** + * Object container for initialization options + * + * @property options + * @type object + */ + options: + { + /** + * Max items + * + * @property maxItems + * @type integer + * @default 50 + */ + maxItems: 50, + + /** + * Currently active filter. + * + * @property activeFilter + * @type string + * @default "all" + */ + activeFilter: "all" + }, + + /** + * Tags DOM container. + * + * @property tagsContainer + * @type object + */ + tagsContainer: null, + + /** + * ContainerId for tag scope query + * + * @property containerId + * @type string + * @default "" + */ + containerId: null, + + /** + * Fired by YUI when parent element is available for scripting + * @method onReady + */ + onReady: function SiteTags_onReady() + { + var me = this; + + // The tags container + this.tagsContainer = Dom.get(this.id + "-tags"); + + // Hook the refresh icon click + Event.addListener(this.id + "-refresh", "click", this.onRefresh, this, true); + + // Preferences service + this.services.preferences = new Alfresco.service.Preferences(); + + // "All" filter + this.widgets.all = new YAHOO.widget.Button(this.id + "-all", + { + type: "checkbox", + value: "all", + checked: true + }); + this.widgets.all.on("checkedChange", this.onAllCheckedChanged, this.widgets.all, this); + + // Dropdown filter + this.widgets.filter = new YAHOO.widget.Button(this.id + "-filter", + { + type: "split", + menu: this.id + "-filter-menu", + lazyloadmenu: false + }); + this.widgets.filter.on("click", this.onFilterClicked, this, true); + // Clear the lazyLoad flag and fire init event to get menu rendered into the DOM + var menu = this.widgets.filter.getMenu(); + menu.subscribe("click", function (p_sType, p_aArgs) + { + var menuItem = p_aArgs[1]; + if (menuItem) + { + me.widgets.filter.set("label", menuItem.cfg.getProperty("text")); + me.onFilterChanged.call(me, p_aArgs[1]); + } + }); + + if (this.options.activeFilter == "all") + { + this.widgets.filter.value = "documentLibrary"; + this.setActiveFilter("all"); + } + else + { + this.widgets.filter.value = this.options.activeFilter; + + // Loop through and find the menuItem corresponding to the default filter + var menuItems = menu.getItems(), + menuItem, + i, ii; + + for (i = 0, ii = menuItems.length; i < ii; i++) + { + menuItem = menuItems[i]; + if (menuItem.value == this.options.activeFilter) + { + menu.clickEvent.fire( + { + type: "click" + }, menuItem); + break; + } + } + } + }, + + /** + * Event handler for refresh click + * @method onRefresh + * @param e {object} Event + */ + onRefresh: function SiteTags_onRefresh(e) + { + if (e) + { + // Stop browser's default click behaviour for the link + Event.preventDefault(e); + } + this.refreshTags(); + }, + + /** + * Refresh tags + * @method refreshTags + */ + refreshTags: function SiteTags_refreshTags() + { + // Hide the existing content + Dom.setStyle(this.tagsContainer, "display", "none"); + + // Make an AJAX request to the Tag Service REST API + Alfresco.util.Ajax.jsonGet( + { + url: Alfresco.constants.PROXY_URI + "api/tagscopes/site/" + $combine(this.options.siteId, this.containerId, "tags"), + successCallback: + { + fn: this.onTagsSuccess, + scope: this + }, + failureCallback: + { + fn: this.onTagsFailed, + scope: this + }, + scope: this, + noReloadOnAuthFailure: true + }); + }, + + /** + * Tags retrieved successfully + * @method onTagsSuccess + * @param p_response {object} Response object from request + */ + onTagsSuccess: function SiteTags_onTagsSuccess(p_response) + { + // Retrieve the tags list from the JSON response and trim accordingly + var tags = p_response.json.tags.slice(0, this.options.maxItems), + numTags = tags.length, + totalTags = 0, + html = "", + i, ii; + + // Work out total number of tags for scaling + for (i = 0, ii = tags.length; i < ii; i++) + { + totalTags += tags[i].count; + } + + // Tags to show? + if (tags.length === 0) + { + html = '' + this.msg("message.no-tags") + ''; + } + else + { + // Define inline scaling functions + var tag, + fnTagWeighting = function tagWeighting(thisTag) + { + return thisTag.count / (totalTags / numTags); + }, + fnTagFontSize = function tagFontSize(thisTag) + { + return (0.5 + fnTagWeighting(thisTag)).toFixed(2); + }, + fnSortByTagAlphabetical = function sortByTagAlphabetical(tag1, tag2) + { + if (tag1.name < tag2.name) + return -1; + + if (tag1.name > tag2.name) + return 1; + + return 0; + }; + + // Sort tags alphabetically - standard for tag clouds + tags.sort(fnSortByTagAlphabetical); + + // Generate HTML mark-up for each tag + for (i = 0, ii = tags.length; i < ii; i++) + { + tag = tags[i]; + html += '' + $html(tag.name) + ' '; + } + } + this.tagsContainer.innerHTML = html; + + // Fade the new content in + Alfresco.util.Anim.fadeIn(this.tagsContainer); + }, + + /** + * Tags request failed + * @method onTagsFailed + */ + onTagsFailed: function SiteTags_onTagsFailed() + { + this.tagsContainer.innerHTML = this.msg("refresh-failed"); + Alfresco.util.Anim.fadeIn(this.tagsContainer); + }, + + /** + * Generate Uri template based on current active filter + * @method getUriTemplate + * @param tag {object} Tag object literal + */ + getUriTemplate: function SiteTags_getUriTemplate(tag) + { + var uri = Alfresco.constants.URL_CONTEXT + 'page/site/' + this.options.siteId; + switch (this.options.activeFilter) + { + case "wiki": + uri += '/wiki'; + break; + + case "blog": + uri += '/blog-postlist'; + break; + + case "documentLibrary": + uri += '/documentlibrary#filter=tag|' + encodeURIComponent(tag.name); + break; + + case "calendar": + uri += '/calendar'; + break; + + case "links": + uri += '/links'; + break; + + case "discussions": + uri += '/discussions-topiclist'; + break; + + default: + uri += '/search?tag=' + encodeURIComponent(tag.name) + '&a=false'; + } + return uri; + }, + + /** + * Sets the active filter highlight in the UI + * @method updateFilterUI + */ + updateFilterUI: function SiteTags_updateFilterUI() + { + switch (this.options.activeFilter) + { + case "all": + Dom.removeClass(this.widgets.filter.get("element"), "yui-checkbox-button-checked"); + break; + + default: + this.widgets.all.set("checked", false, true); + Dom.addClass(this.widgets.filter.get("element"), "yui-checkbox-button-checked"); + break; + } + }, + + /** + * Saves active filter to user preferences + * @method saveActiveFilter + * @param filter {string} New filter to set + * @param noPersist {boolean} [Optional] If set, preferences are not updated + */ + setActiveFilter: function SiteTags_saveActiveFilter(filter, noPersist) + { + this.options.activeFilter = filter; + this.containerId = filter !== "all" ? filter : ""; + this.updateFilterUI(); + this.refreshTags(); + if (noPersist !== true) + { + this.services.preferences.set(PREF_SITE_TAGS_FILTER, filter); + } + }, + + /** + * YUI WIDGET EVENT HANDLERS + * Handlers for standard events fired from YUI widgets, e.g. "click" + */ + + /** + * All tasks + * @method onAllCheckedChanged + * @param p_oEvent {object} Button event + * @param p_obj {object} Button + */ + onAllCheckedChanged: function Sitetags_onAllCheckedChanged(p_oEvent, p_obj) + { + this.setActiveFilter("all"); + p_obj.set("checked", true, true); + }, + + /** + * Filter button clicked event handler + * @method onFilterClicked + * @param p_oEvent {object} Dom event + */ + onFilterClicked: function SiteTags_onFilterClicked(p_oEvent) + { + this.setActiveFilter(this.widgets.filter.value); + }, + + /** + * Filter drop-down changed event handler + * @method onFilterChanged + * @param p_oMenuItem {object} Selected menu item + */ + onFilterChanged: function SiteTags_onFilterChanged(p_oMenuItem) + { + var filter = p_oMenuItem.value; + this.widgets.filter.value = filter; + this.setActiveFilter(filter); + } + }); +})(); diff --git a/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.config.xml b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.config.xml new file mode 100644 index 00000000..923d230a --- /dev/null +++ b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.config.xml @@ -0,0 +1,3 @@ + + 50 + \ No newline at end of file diff --git a/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.desc.xml b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.desc.xml new file mode 100644 index 00000000..2f4381a3 --- /dev/null +++ b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.desc.xml @@ -0,0 +1,6 @@ + + Tag Cloud + Displays a cloud of all the tags defined in this site + site-dashlet + /components/dashlets/site-tags + \ No newline at end of file diff --git a/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.head.ftl b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.head.ftl new file mode 100644 index 00000000..42124fc9 --- /dev/null +++ b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.head.ftl @@ -0,0 +1,4 @@ +<#include "../component.head.inc"> + +<@link rel="stylesheet" type="text/css" href="${page.url.context}/res/components/dashlets/site-tags.css" /> +<@script type="text/javascript" src="${page.url.context}/res/components/dashlets/site-tags.js">@script> \ No newline at end of file diff --git a/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.html.ftl b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.html.ftl new file mode 100644 index 00000000..d11ea3af --- /dev/null +++ b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.html.ftl @@ -0,0 +1,31 @@ + + + ${msg("header")} + + + + + + ${msg("filter.wiki")} + ${msg("filter.blog")} + ${msg("filter.documentLibrary")} + ${msg("filter.calendar")} + ${msg("filter.links")} + ${msg("filter.discussions")} + + + style="height: ${args.height}px;"#if>> + + + + \ No newline at end of file diff --git a/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.js b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.js new file mode 100644 index 00000000..35404b05 --- /dev/null +++ b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.js @@ -0,0 +1,32 @@ +const PREFERENCES_ROOT = "org.alfresco.share.dashlet"; + +function main() +{ + var s = new XML(config.script); + model.maxItems = parseInt(s.maxitems, 10); + + var result, preferences = {}; + + // Request the current user's preferences + var result = remote.call("/api/people/" + stringUtils.urlEncode(user.name) + "/preferences?pf=" + PREFERENCES_ROOT); + if (result.status == 200 && result != "{}") + { + var prefs = eval('(' + result + ')'); + try + { + // Populate the preferences object literal for easy look-up later + preferences = eval('(prefs.' + PREFERENCES_ROOT + ')'); + if (typeof preferences != "object") + { + preferences = {}; + } + } + catch (e) + { + } + } + + model.preferences = preferences; +} + +main(); \ No newline at end of file diff --git a/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.properties b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.properties new file mode 100644 index 00000000..437f82d2 --- /dev/null +++ b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get.properties @@ -0,0 +1,11 @@ +header=Site Tags +message.no-tags=No tags found +message.error=Error: Could not retrieve tags list. + +filter.all=All +filter.wiki=Wiki +filter.blog=Blog +filter.documentLibrary=Document Library +filter.calendar=Calendar +filter.links=Links +filter.discussions=Discussions \ No newline at end of file diff --git a/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get_cy.properties b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get_cy.properties new file mode 100644 index 00000000..2e2ea1da --- /dev/null +++ b/maven-alfresco-archetypes/maven-alfresco-share-module-archetype/src/main/resources/archetype-resources/src/main/resources/alfresco/site-webscripts/org/alfresco/components/dashlets/site-tags.get_cy.properties @@ -0,0 +1,2 @@ +header.siteTags=Tagiau Safle +header.noTags=Dim tagiau wedi canfod \ No newline at end of file diff --git a/maven-alfresco-archetypes/pom.xml b/maven-alfresco-archetypes/pom.xml index e99c1637..c1dd3097 100644 --- a/maven-alfresco-archetypes/pom.xml +++ b/maven-alfresco-archetypes/pom.xml @@ -22,6 +22,7 @@ maven-alfresco-amp-archetype maven-alfresco-extension-archetype maven-alfresco-share-archetype + maven-alfresco-share-module-archetype/ diff --git a/pom.xml b/pom.xml index c18d8132..cedfb534 100644 --- a/pom.xml +++ b/pom.xml @@ -229,6 +229,7 @@ community contexts. http://maven.alfresco.com/nexus/content/repositories/releases + alfresco snapshots repository alfresco-snapshots http://maven.alfresco.com/nexus/content/repositories/snapshots