diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index e3b0b03182..7966b16c99 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -150,6 +150,7 @@ offline_title=Download of ''{0}'' for offline editing. done=Done yes=Yes no=No +error=Error no_not_now=No not now kilobyte=KB megabyte=MB @@ -521,6 +522,7 @@ cancel_button=Cancel clear_button=Clear you_may_want=You may want to summary_step_description=Shows a summary of the information entered. +error_wizard_completed_already=This wizard has been already been completed, please re-launch it to continue. # Category Management messages title_categories_list=Categories @@ -977,6 +979,7 @@ click_add_to_list=Click to add to list set_and_add_button=Set Values and Add selected_conditions=Selected Rule Conditions selected_actions=Selected Rule Actions +action_cannot_be_execute_repeatedly=Action cannot be executed repeatedly condition_has_aspect=Item has aspect ''{0}'' condition_has_aspect_not=Item does not have aspect ''{0}'' condition_is_subtype=Item is a subtype of ''{0}'' @@ -1541,6 +1544,7 @@ selected_dashlets=Selected Components dashboard_column=Column column_max_components=this column can display {0} components single_column_max_components=This layout can display {0} components +selected_item=Selected Item # My Alfresco Layouts messages layout_single_label=Single Column @@ -2020,9 +2024,9 @@ composite_condition_page_description=Create a condition by combining several oth composite_condition_page_title=Create Composite Condition composite_condition_page_selected=Selected conditions to be combined By composite_condition_page_or=OR -text_property_condition_property=Property name (e.g. cm:description) -integer_property_condition_property=Property name (e.g. my:count) -date_property_condition_property=Property name (e.g. cm:created) +text_property_condition_property=Property name (e.g. description or cm:description) +integer_property_condition_property=Property name (e.g. count or my:count) +date_property_condition_property=Property name (e.g. created or cm:created) property_condition_operation=Value of the property property_condition_value=Value of the property property_condition_operation=Operation diff --git a/config/alfresco/templates/RSS_2.0_recent_docs.ftl b/config/alfresco/templates/RSS_2.0_recent_docs.ftl index 62957c681d..5e991f60c2 100644 --- a/config/alfresco/templates/RSS_2.0_recent_docs.ftl +++ b/config/alfresco/templates/RSS_2.0_recent_docs.ftl @@ -3,8 +3,7 @@ Alfresco Copyright (c) 2005 Alfresco Software, Inc. All rights reserved. - <#assign hostname="http://localhost:8080/alfresco"> - <#assign spaceref="${hostname}/navigate/browse/${space.nodeRef.storeRef.protocol}/${space.nodeRef.storeRef.identifier}/${space.nodeRef.id}"> + <#assign spaceref="${url.serverPath}${url.context}/navigate/browse/${space.nodeRef.storeRef.protocol}/${space.nodeRef.storeRef.identifier}/${space.nodeRef.id}"> <#assign datetimeformat="EEE, dd MMM yyyy HH:mm:ss zzz"> ${spaceref} Recent Changes to '${space.name}' @@ -18,25 +17,24 @@ 32 32 ${spaceref} - ${hostname}${space.icon32} + ${url.serverPath}${url.context}${space.icon32} <#assign weekms=1000*60*60*24*7> <#list space.childrenByXPath[".//*[subtypeOf('cm:content')]"] as child> <#if (dateCompare(child.properties["cm:modified"], date, weekms) == 1) || (dateCompare(child.properties["cm:created"], date, weekms) == 1)> ${child.properties.name} - ${hostname}${child.url} + ${url.serverPath}${url.context}${child.url} - ${""?xml}${child.properties.name}${""?xml} + ${""?xml}${child.properties.name}${""?xml} <#if child.properties["cm:description"]?exists && child.properties["cm:description"] != ""> ${child.properties["cm:description"]} ${child.properties["cm:modified"]?string(datetimeformat)} - ${hostname}${child.url} + ${url.serverPath}${url.context}${child.url} - - + \ No newline at end of file diff --git a/config/alfresco/templates/checkedout_docs.ftl b/config/alfresco/templates/checkedout_docs.ftl index bd620ce7e5..73b4f6a281 100644 --- a/config/alfresco/templates/checkedout_docs.ftl +++ b/config/alfresco/templates/checkedout_docs.ftl @@ -13,8 +13,8 @@ <#list userhome.childrenByLuceneSearch[query] as child> <#if child.isDocument> <#if rowcount % 2 = 0><#else> - - ${child.properties.name} + + ${child.properties.name} ${(child.size / 1000)?string("0.##")} KB ${child.properties.modified?datetime} ${child.displayPath} @@ -22,4 +22,4 @@ <#assign rowcount=rowcount+1> - + \ No newline at end of file diff --git a/config/alfresco/templates/client/node_summary_panel.ftl b/config/alfresco/templates/client/node_summary_panel.ftl index 05f6704196..087510ae00 100644 --- a/config/alfresco/templates/client/node_summary_panel.ftl +++ b/config/alfresco/templates/client/node_summary_panel.ftl @@ -51,23 +51,24 @@ <#if node.properties.title?exists> - + <#if node.properties.description?exists> - + - - - - + + + + <#if node.properties.owner?exists> - + <#if node.properties.author?exists> - + <#if node.isDocument> - +
 Title:${node.properties.title?html}
 ${msg("title")}:${node.properties.title?html}
 Description:${node.properties.description?html}
 ${msg("description")}:${node.properties.description?html}
 Created:${node.properties.created?datetime}
 Creator:${node.properties.creator}
 Modified:${node.properties.modified?datetime}
 Modifier:${node.properties.modifier}
+  ${msg("created")}:${node.properties.created?datetime}
 ${msg("creator")}:${node.properties.creator}
 ${msg("modified")}:${node.properties.modified?datetime}
 ${msg("modifier")}:${node.properties.modifier}
 Owner:${node.properties.owner}
 ${msg("owner")}:${node.properties.owner}
 Author:${node.properties.author?html}
 ${msg("author")}:${node.properties.author?html}
 Size:${(node.size / 1000)?string("0.##")} KB
 ${msg("size")}:${(node.size / 1000)?string("0.##")} KB
@@ -77,7 +78,7 @@ <#assign c=cropContent(node.properties.content, 512)> <#if c?length != 0> - Preview: + ${msg("snapshot_preview")}: diff --git a/config/alfresco/templates/company_logos.ftl b/config/alfresco/templates/company_logos.ftl index 51befa00b1..f88440c4a7 100644 --- a/config/alfresco/templates/company_logos.ftl +++ b/config/alfresco/templates/company_logos.ftl @@ -17,4 +17,4 @@ - + \ No newline at end of file diff --git a/config/alfresco/templates/doc_info.ftl b/config/alfresco/templates/doc_info.ftl index 72e4a2716a..e896d8f305 100644 --- a/config/alfresco/templates/doc_info.ftl +++ b/config/alfresco/templates/doc_info.ftl @@ -5,7 +5,7 @@ Ref: ${document.nodeRef}
Type: ${document.type}
DBID: ${document.properties["sys:node-dbid"]}
- Content URL: /alfresco${document.url}
+ Content URL: ${url.context}${document.url}
Locked: <#if document.isLocked>Yes<#else>No
<#if hasAspect(document, "cm:countable") == 1 && document.properties['cm:counter']?exists> Counter: ${document.properties['cm:counter']}
@@ -54,4 +54,4 @@ <#else> No document found! - + \ No newline at end of file diff --git a/config/alfresco/templates/doc_versionhistory.ftl b/config/alfresco/templates/doc_versionhistory.ftl index ea321daa80..c8bcf506d5 100644 --- a/config/alfresco/templates/doc_versionhistory.ftl +++ b/config/alfresco/templates/doc_versionhistory.ftl @@ -5,8 +5,8 @@ VersionNameDescriptionCreated DateCreator <#list document.versionHistory as record> - ${record.versionLabel} - ${record.name} + ${record.versionLabel} + ${record.name} <#if record.description?exists>${record.description} ${record.createdDate?datetime} ${record.creator} @@ -15,4 +15,4 @@ <#else> No document found! - + \ No newline at end of file diff --git a/config/alfresco/templates/email/invite_user_email.ftl b/config/alfresco/templates/email/invite_user_email.ftl index 1f8db20624..82a26ae8e6 100644 --- a/config/alfresco/templates/email/invite_user_email.ftl +++ b/config/alfresco/templates/email/invite_user_email.ftl @@ -6,8 +6,8 @@ You can view the space through the Alfresco client: <#assign ref=space.nodeRef> <#assign workspace=ref[0..ref?index_of("://")-1]> <#assign storenode=ref[ref?index_of("://")+3..]> -http://yourserver:8080/alfresco/navigate/browse/${workspace}/${storenode} +http://${url.context}/alfresco/navigate/browse/${workspace}/${storenode} Regards -Alfresco +Alfresco \ No newline at end of file diff --git a/config/alfresco/templates/email/notify_user_email.ftl b/config/alfresco/templates/email/notify_user_email.ftl index 8a4d5e8473..94091d0753 100644 --- a/config/alfresco/templates/email/notify_user_email.ftl +++ b/config/alfresco/templates/email/notify_user_email.ftl @@ -1,14 +1,14 @@ A new document '${document.name}', is available in the '${space.name}' space, it was added by ${person.properties.firstName}<#if person.properties.lastName?exists> ${person.properties.lastName}. You can view it through this link: -http://yourserver:8080/alfresco${document.url} +http://${url.context}/alfresco${document.url} Or through the Alfresco client: <#assign ref=space.nodeRef> <#assign workspace=ref[0..ref?index_of("://")-1]> <#assign storenode=ref[ref?index_of("://")+3..]> -http://yourserver:8080/alfresco/navigate/browse/${workspace}/${storenode} +http://${url.context}/alfresco/navigate/browse/${workspace}/${storenode} Regards -Alfresco +Alfresco \ No newline at end of file diff --git a/config/alfresco/templates/general_example.ftl b/config/alfresco/templates/general_example.ftl index c39d9b855f..566c62ffd5 100644 --- a/config/alfresco/templates/general_example.ftl +++ b/config/alfresco/templates/general_example.ftl @@ -19,7 +19,7 @@ <#list userhome.children as child> <#if child.isContainer> - + ${child.properties.name} (${child.children?size}) Path: ${child.displayPath} @@ -31,11 +31,11 @@ <#list userhome.children as child> <#if child.isDocument> - + <#if child.mimetype = "text/plain"> <#elseif child.mimetype = "image/jpeg"> - + @@ -46,4 +46,4 @@ ${userhome.children[0].assocs["cm:contains"][0].name} -

=====Example Template End=====

+

=====Example Template End=====

\ No newline at end of file diff --git a/config/alfresco/templates/image_thumbnails.ftl b/config/alfresco/templates/image_thumbnails.ftl index 9d18535ff3..b51d3fbb2f 100644 --- a/config/alfresco/templates/image_thumbnails.ftl +++ b/config/alfresco/templates/image_thumbnails.ftl @@ -4,9 +4,9 @@ <#list space.children as child> <#if child.isDocument && (child.mimetype = "image/png" || child.mimetype = "image/jpeg" || child.mimetype = "image/gif")> <#if colcount % 3 = 0> - + <#if colcount % 3 = 2> <#assign colcount=colcount+1> -
${child.properties.name}
${child.properties.name}
${child.content}
${child.properties.name}
${child.properties.name}
+ \ No newline at end of file diff --git a/config/alfresco/templates/localizable.ftl b/config/alfresco/templates/localizable.ftl index 2b800f9ec0..5b634a08e2 100644 --- a/config/alfresco/templates/localizable.ftl +++ b/config/alfresco/templates/localizable.ftl @@ -11,4 +11,4 @@ <#else> No document found! - + \ No newline at end of file diff --git a/config/alfresco/templates/my_docs.ftl b/config/alfresco/templates/my_docs.ftl index 229d3fa850..63c131d753 100644 --- a/config/alfresco/templates/my_docs.ftl +++ b/config/alfresco/templates/my_docs.ftl @@ -12,8 +12,8 @@ <#list userhome.children as child> <#if child.isDocument> <#if rowcount % 2 = 0><#else> - - ${child.properties.name} + + ${child.properties.name} ${(child.size / 1000)?string("0.##")} KB ${child.properties.modified?datetime}  <#if child.isLocked>${child.properties.lockOwner} @@ -21,4 +21,4 @@ <#assign rowcount=rowcount+1> - + \ No newline at end of file diff --git a/config/alfresco/templates/my_docs_inline.ftl b/config/alfresco/templates/my_docs_inline.ftl index 20e56a336c..3623c64e73 100644 --- a/config/alfresco/templates/my_docs_inline.ftl +++ b/config/alfresco/templates/my_docs_inline.ftl @@ -8,8 +8,8 @@ <#if child.mimetype = "text/plain"> ${child.content} <#elseif child.mimetype = "image/jpeg"> - + - + \ No newline at end of file diff --git a/config/alfresco/templates/my_images.ftl b/config/alfresco/templates/my_images.ftl index 36ec65b7bd..4eb032c3d0 100644 --- a/config/alfresco/templates/my_images.ftl +++ b/config/alfresco/templates/my_images.ftl @@ -4,9 +4,9 @@ <#list userhome.children as child> <#if child.isDocument && (child.mimetype = "image/png" || child.mimetype = "image/jpeg" || child.mimetype = "image/gif")> <#if colcount % 3 = 0> -
${child.properties.name}
+
${child.properties.name}
<#if colcount % 3 = 2> <#assign colcount=colcount+1> - + \ No newline at end of file diff --git a/config/alfresco/templates/my_pressreleases.ftl b/config/alfresco/templates/my_pressreleases.ftl index f4c4af2157..7500d302fe 100644 --- a/config/alfresco/templates/my_pressreleases.ftl +++ b/config/alfresco/templates/my_pressreleases.ftl @@ -6,7 +6,7 @@ <#list child.children as doc> <#if doc.isDocument> - ${doc.properties.title} + ${doc.properties.title} ${doc.properties.description} @@ -25,4 +25,4 @@ - + \ No newline at end of file diff --git a/config/alfresco/templates/my_spaces.ftl b/config/alfresco/templates/my_spaces.ftl index f83005cab4..b674e8db93 100644 --- a/config/alfresco/templates/my_spaces.ftl +++ b/config/alfresco/templates/my_spaces.ftl @@ -4,12 +4,12 @@ <#list userhome.children as child> <#if child.isContainer> - + <#assign ref=child.nodeRef> <#assign workspace=ref[0..ref?index_of("://")-1]> <#assign storenode=ref[ref?index_of("://")+3..]> - ${child.properties.name} (${child.children?size}) + ${child.properties.name} (${child.children?size}) - + \ No newline at end of file diff --git a/config/alfresco/templates/my_summary.ftl b/config/alfresco/templates/my_summary.ftl index c2803041f9..7d375cc100 100644 --- a/config/alfresco/templates/my_summary.ftl +++ b/config/alfresco/templates/my_summary.ftl @@ -5,4 +5,4 @@ Home Space location: ${userhome.displayPath}/${userhome.name} Items in Home Space: ${userhome.children?size} Items in Company Space: ${companyhome.children?size} - + \ No newline at end of file diff --git a/config/alfresco/templates/namepath_xpath.ftl b/config/alfresco/templates/namepath_xpath.ftl index 0aace9cd38..6fb44b2340 100644 --- a/config/alfresco/templates/namepath_xpath.ftl +++ b/config/alfresco/templates/namepath_xpath.ftl @@ -4,7 +4,7 @@ <#list companyhome.childByNamePath["Data Dictionary/Content Templates"].children as child> <#if child.isDocument> - +
${child.properties.name}
${child.properties.name}
@@ -13,7 +13,7 @@ <#list companyhome.childrenByXPath["*[@cm:name='Data Dictionary']/*[@cm:name='Space Templates']/*[@cm:name='Software Engineering Project']/*"] as child> <#if child.isContainer> - + -
${child.properties.name}
${child.properties.name}
+ \ No newline at end of file diff --git a/config/alfresco/templates/recent_docs.ftl b/config/alfresco/templates/recent_docs.ftl index 698bd2af20..bb4c0732cb 100644 --- a/config/alfresco/templates/recent_docs.ftl +++ b/config/alfresco/templates/recent_docs.ftl @@ -10,11 +10,11 @@ <#list space.childrenByXPath[".//*[subtypeOf('cm:content')]"] as child> <#if (dateCompare(child.properties["cm:modified"], date, 1000*60*60*24*7) == 1) || (dateCompare(child.properties["cm:created"], date, 1000*60*60*24*7) == 1)> - - ${child.properties.name} + + ${child.properties.name} ${child.properties["cm:created"]?datetime} ${child.properties["cm:modified"]?datetime} - + \ No newline at end of file diff --git a/config/alfresco/templates/system_users.ftl b/config/alfresco/templates/system_users.ftl index da73637c95..c8c05f5ee9 100644 --- a/config/alfresco/templates/system_users.ftl +++ b/config/alfresco/templates/system_users.ftl @@ -14,4 +14,4 @@ ${child.properties["cm:homeFolder"].properties["cm:created"]?date} - + \ No newline at end of file diff --git a/config/alfresco/templates/translatable.ftl b/config/alfresco/templates/translatable.ftl index 6d6e692a28..e8cdc4c81a 100644 --- a/config/alfresco/templates/translatable.ftl +++ b/config/alfresco/templates/translatable.ftl @@ -15,4 +15,4 @@ <#else> No document found! - + \ No newline at end of file diff --git a/config/alfresco/templates/userhome_docs.ftl b/config/alfresco/templates/userhome_docs.ftl index 180fb92aa7..371958f4f7 100644 --- a/config/alfresco/templates/userhome_docs.ftl +++ b/config/alfresco/templates/userhome_docs.ftl @@ -8,8 +8,8 @@ <#if child.mimetype = "text/plain"> ${child.content} <#elseif child.mimetype = "image/jpeg"> - + - + \ No newline at end of file diff --git a/config/alfresco/templates/workflow_details.ftl b/config/alfresco/templates/workflow_details.ftl index bcafc4c0b0..97316c6445 100644 --- a/config/alfresco/templates/workflow_details.ftl +++ b/config/alfresco/templates/workflow_details.ftl @@ -5,23 +5,23 @@ <#assign ref=document.nodeRef> <#assign workspace=ref[0..ref?index_of("://")-1]> <#assign storenode=ref[ref?index_of("://")+3..]> -   Approve Step: ${document.properties["app:approveStep"]}
+   Approve Step: ${document.properties["app:approveStep"]}
<#if document.properties["app:approveFolder"]?exists> -   Approve Folder: ${document.properties["app:approveFolder"].name}
+   Approve Folder: ${document.properties["app:approveFolder"].name}
<#if document.properties["app:rejectStep"]?exists> <#assign ref=document.nodeRef> <#assign workspace=ref[0..ref?index_of("://")-1]> <#assign storenode=ref[ref?index_of("://")+3..]> -   Reject Step: ${document.properties["app:rejectStep"]}
+   Reject Step: ${document.properties["app:rejectStep"]}
<#if document.properties["app:rejectFolder"]?exists> -   Reject Folder: ${document.properties["app:rejectFolder"].name}
+   Reject Folder: ${document.properties["app:rejectFolder"].name}
<#else> This document has no workflow.
<#else> No document found! - + \ No newline at end of file diff --git a/config/alfresco/templates/xpath_search.ftl b/config/alfresco/templates/xpath_search.ftl index b81f9440d5..f875993732 100644 --- a/config/alfresco/templates/xpath_search.ftl +++ b/config/alfresco/templates/xpath_search.ftl @@ -4,7 +4,7 @@ <#list companyhome.childByNamePath["Data Dictionary/Presentation Templates"].children as child> <#if child.isDocument> - +
${child.properties.name}
${child.properties.name}
@@ -13,7 +13,7 @@ <#list companyhome.childrenByXPath["*[@cm:name='Data Dictionary']/*[@cm:name='Space Templates']/*[@cm:name='Software Engineering Project']/*"] as child> <#if child.isContainer> - +
${child.properties.name}
${child.properties.name}
@@ -21,6 +21,6 @@

Lucene Search - documents containing the text 'Alfresco'

<#list companyhome.childrenByLuceneSearch["TEXT:alfresco"] as child> - + -
${child.properties.name}
${child.properties.name}
+ \ No newline at end of file diff --git a/config/alfresco/web-client-config.xml b/config/alfresco/web-client-config.xml index c1380ab10e..3aeeabac79 100644 --- a/config/alfresco/web-client-config.xml +++ b/config/alfresco/web-client-config.xml @@ -103,6 +103,14 @@ true + + + + true + + + + true diff --git a/source/java/org/alfresco/web/app/servlet/BaseTemplateContentServlet.java b/source/java/org/alfresco/web/app/servlet/BaseTemplateContentServlet.java index c7637f8dc3..e2de7546f9 100644 --- a/source/java/org/alfresco/web/app/servlet/BaseTemplateContentServlet.java +++ b/source/java/org/alfresco/web/app/servlet/BaseTemplateContentServlet.java @@ -32,6 +32,7 @@ import java.util.HashMap; import java.util.Map; import java.util.StringTokenizer; +import javax.faces.context.FacesContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -334,7 +335,7 @@ public abstract class BaseTemplateContentServlet extends BaseServlet root.put(TemplateService.KEY_IMAGE_RESOLVER, imageResolver); // method to allow client urls to be generated - root.put("url", new URLHelper(req.getContextPath())); + root.put("url", new URLHelper(req)); return root; } @@ -353,16 +354,34 @@ public abstract class BaseTemplateContentServlet extends BaseServlet */ public static class URLHelper { - String context; - - public URLHelper(String context) - { - this.context = context; - } - - public String getContext() - { - return context; - } + String contextPath; + String serverPath; + + public URLHelper(HttpServletRequest request) + { + this.contextPath = request.getContextPath(); + this.serverPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort(); + } + + public URLHelper(FacesContext context) + { + this.contextPath = context.getExternalContext().getRequestContextPath(); + final Object request = context.getExternalContext().getRequest(); + if (request instanceof HttpServletRequest) + { + final HttpServletRequest httpServletRequest = (HttpServletRequest) request; + this.serverPath = httpServletRequest.getScheme() + "://" + httpServletRequest.getServerName() + ":" + httpServletRequest.getServerPort(); + } + } + + public String getContext() + { + return this.contextPath; + } + + public String getServerPath() + { + return this.serverPath; + } } } diff --git a/source/java/org/alfresco/web/app/servlet/FacesHelper.java b/source/java/org/alfresco/web/app/servlet/FacesHelper.java index 8ea1429755..f15847afcd 100644 --- a/source/java/org/alfresco/web/app/servlet/FacesHelper.java +++ b/source/java/org/alfresco/web/app/servlet/FacesHelper.java @@ -29,6 +29,7 @@ import javax.faces.component.UIComponent; import javax.faces.component.UIViewRoot; import javax.faces.context.FacesContext; import javax.faces.context.FacesContextFactory; +import javax.faces.el.EvaluationException; import javax.faces.el.ValueBinding; import javax.faces.lifecycle.Lifecycle; import javax.faces.lifecycle.LifecycleFactory; @@ -159,8 +160,21 @@ public final class FacesHelper */ public static Object getManagedBean(FacesContext fc, String name) { - ValueBinding vb = fc.getApplication().createValueBinding("#{" + name + "}"); - return vb.getValue(fc); + Object obj = null; + + try + { + ValueBinding vb = fc.getApplication().createValueBinding("#{" + name + "}"); + obj = vb.getValue(fc); + } + catch (EvaluationException ee) + { + // catch exception to resolve ADB-158/ACT-7343 + // not much we can do here, just make sure return is null + obj = null; + } + + return obj; } /** diff --git a/source/java/org/alfresco/web/bean/NavigationBean.java b/source/java/org/alfresco/web/bean/NavigationBean.java index d5fea94a6c..a094b00959 100644 --- a/source/java/org/alfresco/web/bean/NavigationBean.java +++ b/source/java/org/alfresco/web/bean/NavigationBean.java @@ -961,7 +961,7 @@ public class NavigationBean implements Serializable { if (this.cifsServerPath == null) { - StringBuilder buf = new StringBuilder(24); + StringBuilder buf = new StringBuilder(32); String serverName = this.getCifsServer().getConfiguration().getServerName(); if (serverName != null && serverName.length() != 0) @@ -970,9 +970,10 @@ public class NavigationBean implements Serializable buf.append(serverName); // Check if there is a suffix to apply to the host name - - if ( clientConfig != null && clientConfig.getCifsURLSuffix() != null) + if (clientConfig != null && clientConfig.getCifsURLSuffix() != null) + { buf.append(clientConfig.getCifsURLSuffix()); + } buf.append("\\"); buf.append(diskShare.getName()); @@ -1000,6 +1001,22 @@ public class NavigationBean implements Serializable return SpaceDetailsDialog.buildRSSFeedURL(getCurrentNode()); } + /** + * @return true if User/Group admin is allowed by admin users + */ + public boolean isAllowUserGroupAdmin() + { + return this.clientConfig.isUserGroupAdmin(); + } + + /** + * @return true if users can configure their own settings and password in the User Console + */ + public boolean isAllowUserConfig() + { + return this.clientConfig.getAllowUserConfig(); + } + // ------------------------------------------------------------------------------ // Helpers diff --git a/source/java/org/alfresco/web/bean/TemplateMailHelperBean.java b/source/java/org/alfresco/web/bean/TemplateMailHelperBean.java index 0957d77e53..8515c4d3a1 100644 --- a/source/java/org/alfresco/web/bean/TemplateMailHelperBean.java +++ b/source/java/org/alfresco/web/bean/TemplateMailHelperBean.java @@ -147,8 +147,7 @@ public class TemplateMailHelperBean implements Serializable model.put("role", roleText); model.put("space", node); // object to allow client urls to be generated in emails - model.put("url", new BaseTemplateContentServlet.URLHelper( - fc.getExternalContext().getRequestContextPath())); + model.put("url", new BaseTemplateContentServlet.URLHelper(fc)); body = services.getTemplateService().processTemplate("freemarker", templateRef.toString(), model); } diff --git a/source/java/org/alfresco/web/bean/actions/BaseActionWizard.java b/source/java/org/alfresco/web/bean/actions/BaseActionWizard.java index 6384c349ba..5ed80b633f 100644 --- a/source/java/org/alfresco/web/bean/actions/BaseActionWizard.java +++ b/source/java/org/alfresco/web/bean/actions/BaseActionWizard.java @@ -80,7 +80,8 @@ public abstract class BaseActionWizard extends BaseWizardBean protected static final String PROP_ACTION_NAME = "actionName"; protected static final String PROP_ACTION_SUMMARY = "actionSummary"; protected static final String NO_PARAMS_MARKER = "noParamsMarker"; - + protected static final String ERROR_ACTION_CANNOT_BE_EXECUTE_REPEATEDLY = "action_cannot_be_execute_repeatedly"; + transient private ActionService actionService; transient private MimetypeService mimetypeService; transient private PersonService personService; @@ -610,6 +611,14 @@ public abstract class BaseActionWizard extends BaseWizardBean // get the handler for the action, if there isn't one we presume it // is a no-parameter action IHandler handler = this.actionHandlers.get(this.action); + + if (!handler.isAllowMultiple() && isActionPresent(this.action)) + { + Utils.addErrorMessage(Application.getMessage( + FacesContext.getCurrentInstance(), ERROR_ACTION_CANNOT_BE_EXECUTE_REPEATEDLY)); + return; + } + if (handler != null) { // setup any UI defaults the action may have and get the location of @@ -1057,6 +1066,24 @@ public abstract class BaseActionWizard extends BaseWizardBean return true; } + protected boolean isActionPresent(String actionName) + { + for(Map prop : allActionsProperties) + { + Serializable name = prop.get(PROP_ACTION_NAME); + if (name != null) + { + if (name.equals(actionName)) + { + return true; + } + } + } + + return false; + } + + // ------------------------------------------------------------------------------ // Inner classes diff --git a/source/java/org/alfresco/web/bean/actions/IHandler.java b/source/java/org/alfresco/web/bean/actions/IHandler.java index 022235fe9c..b1b392a229 100644 --- a/source/java/org/alfresco/web/bean/actions/IHandler.java +++ b/source/java/org/alfresco/web/bean/actions/IHandler.java @@ -91,4 +91,11 @@ public interface IHandler extends Serializable */ public String generateSummary(FacesContext context, IWizardBean wizard, Map props); + + /** + * Returns value of possibility of repeated performance of action + * + * @return true is allow multiple + */ + public boolean isAllowMultiple(); } diff --git a/source/java/org/alfresco/web/bean/actions/handlers/BaseActionHandler.java b/source/java/org/alfresco/web/bean/actions/handlers/BaseActionHandler.java index 0fd94048bd..8d2487e908 100644 --- a/source/java/org/alfresco/web/bean/actions/handlers/BaseActionHandler.java +++ b/source/java/org/alfresco/web/bean/actions/handlers/BaseActionHandler.java @@ -55,4 +55,12 @@ public abstract class BaseActionHandler implements IHandler { return ACTION_PAGES_LOCATION + actionName + ".jsp"; } + + /* + * @see org.alfresco.web.bean.actions.IHandler#isAllowMultiple() + */ + public boolean isAllowMultiple() + { + return true; + } } diff --git a/source/java/org/alfresco/web/bean/actions/handlers/CheckInHandler.java b/source/java/org/alfresco/web/bean/actions/handlers/CheckInHandler.java index 893391925f..d6e9d6261b 100644 --- a/source/java/org/alfresco/web/bean/actions/handlers/CheckInHandler.java +++ b/source/java/org/alfresco/web/bean/actions/handlers/CheckInHandler.java @@ -95,4 +95,12 @@ public class CheckInHandler extends BaseActionHandler return MessageFormat.format(Application.getMessage(context, "action_check_in"), new Object[] {change, comment}); } + + /* + * @see org.alfresco.web.bean.actions.IHandler#isAllowMultiple() + */ + public boolean isAllowMultiple() + { + return false; + } } diff --git a/source/java/org/alfresco/web/bean/actions/handlers/CheckOutHandler.java b/source/java/org/alfresco/web/bean/actions/handlers/CheckOutHandler.java index 6ae9d4fe8a..16c5918c39 100644 --- a/source/java/org/alfresco/web/bean/actions/handlers/CheckOutHandler.java +++ b/source/java/org/alfresco/web/bean/actions/handlers/CheckOutHandler.java @@ -86,4 +86,12 @@ public class CheckOutHandler extends BaseActionHandler return MessageFormat.format(Application.getMessage(context, "action_check_out"), new Object[] {spaceName}); } + + /* + * @see org.alfresco.web.bean.actions.IHandler#isAllowMultiple() + */ + public boolean isAllowMultiple() + { + return false; + } } diff --git a/source/java/org/alfresco/web/bean/actions/handlers/MoveHandler.java b/source/java/org/alfresco/web/bean/actions/handlers/MoveHandler.java index a0d122afc9..3034cc6441 100644 --- a/source/java/org/alfresco/web/bean/actions/handlers/MoveHandler.java +++ b/source/java/org/alfresco/web/bean/actions/handlers/MoveHandler.java @@ -85,4 +85,12 @@ public class MoveHandler extends BaseActionHandler return MessageFormat.format(Application.getMessage(context, "action_move"), new Object[] {spaceName}); } + + /* + * @see org.alfresco.web.bean.actions.IHandler#isAllowMultiple() + */ + public boolean isAllowMultiple() + { + return false; + } } diff --git a/source/java/org/alfresco/web/bean/ajax/NodeInfoBean.java b/source/java/org/alfresco/web/bean/ajax/NodeInfoBean.java index 1a027236f0..ca609814e0 100644 --- a/source/java/org/alfresco/web/bean/ajax/NodeInfoBean.java +++ b/source/java/org/alfresco/web/bean/ajax/NodeInfoBean.java @@ -33,7 +33,9 @@ import java.util.Map; import javax.faces.context.FacesContext; import javax.faces.context.ResponseWriter; +import org.alfresco.i18n.I18NUtil; import org.alfresco.repo.content.transform.TransformerInfoException; +import org.alfresco.repo.template.I18NMessageMethod; import org.alfresco.repo.template.TemplateNode; import org.alfresco.repo.web.scripts.FileTypeImageUtils; import org.alfresco.service.cmr.repository.ContentIOException; @@ -145,10 +147,11 @@ public class NodeInfoBean implements Serializable FacesContext context = FacesContext.getCurrentInstance(); Map model = new HashMap(8, 1.0f); + I18NUtil.registerResourceBundle("alfresco.messages.webclient"); // create api methods model.put("date", new Date()); - model.put("url", new BaseTemplateContentServlet.URLHelper( - context.getExternalContext().getRequestContextPath())); + model.put("msg", new I18NMessageMethod()); + model.put("url", new BaseTemplateContentServlet.URLHelper(context)); if (nodeRef != null) { model.put("node", new TemplateNode( diff --git a/source/java/org/alfresco/web/bean/ajax/TaskInfoBean.java b/source/java/org/alfresco/web/bean/ajax/TaskInfoBean.java index e68b24b946..4c832237dd 100644 --- a/source/java/org/alfresco/web/bean/ajax/TaskInfoBean.java +++ b/source/java/org/alfresco/web/bean/ajax/TaskInfoBean.java @@ -143,8 +143,7 @@ public class TaskInfoBean implements Serializable // create template api methods and objects model.put("date", new Date()); - model.put("url", new BaseTemplateContentServlet.URLHelper( - context.getExternalContext().getRequestContextPath())); + model.put("url", new BaseTemplateContentServlet.URLHelper(context)); model.put("task", new Workflow.WorkflowTaskItem( Repository.getServiceRegistry(context), this.imageResolver, diff --git a/source/java/org/alfresco/web/bean/categories/CategoriesDialog.java b/source/java/org/alfresco/web/bean/categories/CategoriesDialog.java index e0bffe34a2..e9b734049a 100644 --- a/source/java/org/alfresco/web/bean/categories/CategoriesDialog.java +++ b/source/java/org/alfresco/web/bean/categories/CategoriesDialog.java @@ -421,6 +421,15 @@ public class CategoriesDialog extends BaseDialogBean implements IContextListener contextUpdated(); } + /** + * Reset the current category navigation point - e.g. ready for redisplay of the root UI + */ + public void resetCategoryNavigation(ActionEvent event) + { + setCurrentCategory(null); + this.location = null; + } + /** * Action called when a category folder is clicked. * Navigate into the category. @@ -517,7 +526,6 @@ public class CategoriesDialog extends BaseDialogBean implements IContextListener { this.categoriesRichList.setValue(null); } - } /** diff --git a/source/java/org/alfresco/web/bean/dashboard/DashboardWizard.java b/source/java/org/alfresco/web/bean/dashboard/DashboardWizard.java index b82d09e1ab..d53d660e21 100644 --- a/source/java/org/alfresco/web/bean/dashboard/DashboardWizard.java +++ b/source/java/org/alfresco/web/bean/dashboard/DashboardWizard.java @@ -127,7 +127,7 @@ public class DashboardWizard extends BaseWizardBean label = Application.getMessage(FacesContext.getCurrentInstance(), def.LabelId); } return buildSummary( - new String[]{"Layout"}, + new String[]{Application.getMessage(FacesContext.getCurrentInstance(),"step_layout")}, new String[]{label}); } diff --git a/source/java/org/alfresco/web/bean/dialog/BaseDialogBean.java b/source/java/org/alfresco/web/bean/dialog/BaseDialogBean.java index c61d2db421..754f1016fb 100644 --- a/source/java/org/alfresco/web/bean/dialog/BaseDialogBean.java +++ b/source/java/org/alfresco/web/bean/dialog/BaseDialogBean.java @@ -147,10 +147,19 @@ public abstract class BaseDialogBean implements IDialogBean, Serializable ReportedException.throwIfNecessary(e); } } + else + { + Utils.addErrorMessage(Application.getMessage(context, "error_wizard_completed_already")); + } return outcome; } + public boolean isFinished() + { + return isFinished; + } + public List getAdditionalButtons() { // none by default, subclasses can override if necessary diff --git a/source/java/org/alfresco/web/bean/dialog/IDialogBean.java b/source/java/org/alfresco/web/bean/dialog/IDialogBean.java index 22b755b570..2f55ca487c 100644 --- a/source/java/org/alfresco/web/bean/dialog/IDialogBean.java +++ b/source/java/org/alfresco/web/bean/dialog/IDialogBean.java @@ -139,4 +139,11 @@ public interface IDialogBean extends Serializable * @return Id of an action group */ public String getMoreActionsConfigId(); + + /** + * Determines whether the has finished + * + * @return true if the wizard has finished + */ + public boolean isFinished(); } diff --git a/source/java/org/alfresco/web/bean/rules/handlers/BaseConditionHandler.java b/source/java/org/alfresco/web/bean/rules/handlers/BaseConditionHandler.java index 4c9cef5a2c..60f57cebec 100644 --- a/source/java/org/alfresco/web/bean/rules/handlers/BaseConditionHandler.java +++ b/source/java/org/alfresco/web/bean/rules/handlers/BaseConditionHandler.java @@ -27,7 +27,11 @@ package org.alfresco.web.bean.rules.handlers; import java.io.Serializable; import java.util.Map; +import javax.faces.context.FacesContext; + +import org.alfresco.service.namespace.NamespaceService; import org.alfresco.web.bean.actions.IHandler; +import org.alfresco.web.bean.repository.Repository; /** * Base class for all condition handler implementations. @@ -55,4 +59,24 @@ public abstract class BaseConditionHandler implements IHandler { return CONDITION_PAGES_LOCATION + conditionName + ".jsp"; } + + /** + * Returns the NamespaceService for further retrieve a prefix strings. + * + * @see org.alfresco.web.bean.rules.handlers.property.TextPropertyValueConditionHandler#prepareForEdit(Map, Map) + * + * @return The NamespaseService for further usage + */ + protected NamespaceService getNamespaceService() + { + return Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getNamespaceService(); + } + + /* + * @see org.alfresco.web.bean.actions.IHandler#isAllowMultiple() + */ + public boolean isAllowMultiple() + { + return true; + } } diff --git a/source/java/org/alfresco/web/bean/rules/handlers/property/TextPropertyValueConditionHandler.java b/source/java/org/alfresco/web/bean/rules/handlers/property/TextPropertyValueConditionHandler.java index b8aeb81b5c..a2784b84fa 100644 --- a/source/java/org/alfresco/web/bean/rules/handlers/property/TextPropertyValueConditionHandler.java +++ b/source/java/org/alfresco/web/bean/rules/handlers/property/TextPropertyValueConditionHandler.java @@ -32,10 +32,9 @@ import javax.faces.context.FacesContext; import org.alfresco.repo.action.evaluator.ComparePropertyValueEvaluator; import org.alfresco.repo.action.evaluator.compare.ComparePropertyValueOperation; -import org.alfresco.service.ServiceRegistry; +import org.alfresco.service.namespace.NamespaceService; import org.alfresco.service.namespace.QName; import org.alfresco.web.app.Application; -import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.bean.rules.handlers.PropertyValueHandler; import org.alfresco.web.bean.wizard.IWizardBean; import org.apache.commons.logging.Log; @@ -53,6 +52,7 @@ public class TextPropertyValueConditionHandler extends PropertyValueHandler public static final String UI_PARAM_OPERATION = "operation"; public static final String UI_PARAM_QNAME = "qname"; + private static final String DEFAULT_NAMESPACE = NamespaceService.CONTENT_MODEL_PREFIX; public String getJSPPath() { @@ -72,15 +72,17 @@ public class TextPropertyValueConditionHandler extends PropertyValueHandler super.prepareForSave(conditionParams, repoProps); String propertyString = (String) conditionParams.get(UI_PARAM_QNAME); - FacesContext fc = FacesContext.getCurrentInstance(); - ServiceRegistry serviceRegistry = Repository.getServiceRegistry(fc); QName qname = null; - if ((propertyString.indexOf(':')) == -1) // TODO: there might be a better way to resolve namespaces - qname = QName.createQName(propertyString); - else - qname = QName.createQName(propertyString, serviceRegistry.getNamespaceService()); + // TODO: there might be a better way to resolve namespaces instead of propertyString.indexOf(':')? + // The part of ADB-131 fix. We use default namespase prefix of content model 'cm'. + // It is necessary to enable an ability to set the property as its localName (e.g. description). + // It keeps also an ability to enter a user content model text properties such as 'my:description' + propertyString = propertyString.indexOf(':') == -1 ? + DEFAULT_NAMESPACE + QName.NAMESPACE_PREFIX + propertyString : + propertyString; + qname = QName.createQName(propertyString, getNamespaceService()); if (logger.isDebugEnabled()) logger.warn("Storing Property QName " + qname); @@ -96,8 +98,10 @@ public class TextPropertyValueConditionHandler extends PropertyValueHandler logger.debug("Retrieving Text Condition Parameters for editing"); super.prepareForEdit(conditionProps, repoProps); - conditionProps.put(UI_PARAM_QNAME, ((QName) repoProps.get(ComparePropertyValueEvaluator.PARAM_PROPERTY)) - .toPrefixString()); + // The part of ADB-131 fix. The NamespaceService is used to get a valid prefix string. + // When the user attempt to edit a rule a 'Summary' string contain an invalid property name + // and then the property will be saved with default prefix 'cm'. But the property may be as 'my:description' + conditionProps.put(UI_PARAM_QNAME, ((QName) repoProps.get(ComparePropertyValueEvaluator.PARAM_PROPERTY)).toPrefixString(getNamespaceService())); conditionProps.put(UI_PARAM_OPERATION, repoProps.get(ComparePropertyValueEvaluator.PARAM_OPERATION).toString()); } diff --git a/source/java/org/alfresco/web/bean/wizard/BaseWizardBean.java b/source/java/org/alfresco/web/bean/wizard/BaseWizardBean.java index 36a0a79b05..e26997be0b 100644 --- a/source/java/org/alfresco/web/bean/wizard/BaseWizardBean.java +++ b/source/java/org/alfresco/web/bean/wizard/BaseWizardBean.java @@ -29,6 +29,7 @@ import javax.faces.context.FacesContext; import org.alfresco.web.app.AlfrescoNavigationHandler; import org.alfresco.web.app.Application; import org.alfresco.web.bean.dialog.BaseDialogBean; +import org.alfresco.web.ui.common.Utils; /** * Base class for all wizard beans providing common functionality @@ -41,11 +42,23 @@ public abstract class BaseWizardBean extends BaseDialogBean implements IWizardBe public String next() { + if (isFinished()) + { + Utils.addErrorMessage(Application.getMessage(FacesContext.getCurrentInstance(), + "error_wizard_completed_already")); + } + return null; } public String back() { + if (isFinished()) + { + Utils.addErrorMessage(Application.getMessage(FacesContext.getCurrentInstance(), + "error_wizard_completed_already")); + } + return null; } diff --git a/source/java/org/alfresco/web/bean/wizard/WizardManager.java b/source/java/org/alfresco/web/bean/wizard/WizardManager.java index 6117b3eb67..094dc4982b 100644 --- a/source/java/org/alfresco/web/bean/wizard/WizardManager.java +++ b/source/java/org/alfresco/web/bean/wizard/WizardManager.java @@ -460,8 +460,15 @@ public final class WizardManager implements Serializable */ public boolean getNextButtonDisabled() { + IWizardBean wb = this.currentWizardState.getWizard(); + + if (wb.isFinished()) + { + return true; + } + return (this.currentWizardState.getCurrentStep() == this.currentWizardState.getSteps().size() || - this.currentWizardState.getWizard().getNextButtonDisabled()); + wb.getNextButtonDisabled()); } /** @@ -481,6 +488,11 @@ public final class WizardManager implements Serializable */ public boolean getBackButtonDisabled() { + if (this.currentWizardState.getWizard().isFinished()) + { + return true; + } + return this.currentWizardState.getCurrentStep() == 1; } @@ -511,8 +523,15 @@ public final class WizardManager implements Serializable */ public boolean getFinishButtonDisabled() { + IWizardBean wb = this.currentWizardState.getWizard(); + + if (wb.isFinished()) + { + return true; + } + return (this.currentWizardState.getCurrentStep() != this.currentWizardState.getSteps().size() && - this.currentWizardState.getWizard().getFinishButtonDisabled()); + wb.getFinishButtonDisabled()); } /** diff --git a/source/java/org/alfresco/web/config/ClientConfigElement.java b/source/java/org/alfresco/web/config/ClientConfigElement.java index 636f2249c6..702fcb12db 100644 --- a/source/java/org/alfresco/web/config/ClientConfigElement.java +++ b/source/java/org/alfresco/web/config/ClientConfigElement.java @@ -83,6 +83,8 @@ public class ClientConfigElement extends ConfigElementAdapter private String cifsURLSuffix; private boolean languageSelect = true; private boolean zeroByteFileUploads = true; + private boolean userGroupAdmin = true; + private boolean allowUserConfig = true; /** @@ -269,6 +271,16 @@ public class ClientConfigElement extends ConfigElementAdapter combinedElement.setZeroByteFileUploads(newElement.isZeroByteFileUploads()); } + if (newElement.getAllowUserConfig() != combinedElement.getAllowUserConfig()) + { + combinedElement.setAllowUserConfig(newElement.getAllowUserConfig()); + } + + if (newElement.isUserGroupAdmin() != combinedElement.isUserGroupAdmin()) + { + combinedElement.setUserGroupAdmin(newElement.isUserGroupAdmin()); + } + return combinedElement; } @@ -766,4 +778,36 @@ public class ClientConfigElement extends ConfigElementAdapter { this.zeroByteFileUploads = zeroByteFileUploads; } + + /** + * @return true if allowing User Group administration by an admin user + */ + public boolean isUserGroupAdmin() + { + return this.userGroupAdmin; + } + + /** + * @param userGroupAdmin true to allow User Group administration by an admin user + */ + /*package*/ void setUserGroupAdmin(boolean userGroupAdmin) + { + this.userGroupAdmin = userGroupAdmin; + } + + /** + * @return true to allow users to modify their personal settings in the User Console screen + */ + public boolean getAllowUserConfig() + { + return this.allowUserConfig; + } + + /** + * @param allowUserConfig true to allow users to modify their personal settings in the User Console screen + */ + /*package*/ void setAllowUserConfig(boolean allowUserConfig) + { + this.allowUserConfig = allowUserConfig; + } } diff --git a/source/java/org/alfresco/web/config/ClientElementReader.java b/source/java/org/alfresco/web/config/ClientElementReader.java index 42a6dad79e..58cadbc859 100644 --- a/source/java/org/alfresco/web/config/ClientElementReader.java +++ b/source/java/org/alfresco/web/config/ClientElementReader.java @@ -68,6 +68,8 @@ public class ClientElementReader implements ConfigElementReader public static final String ELEMENT_CIFSURLSUFFIX = "cifs-url-suffix"; public static final String ELEMENT_LANGUAGESELECT = "language-select"; public static final String ELEMENT_ZEROBYTEFILEUPLOADS = "zero-byte-file-uploads"; + public static final String ELEMENT_USERGROUPADMIN = "user-group-admin"; + public static final String ELEMENT_ALLOWUSERCONFIG = "allow-user-config"; /** @@ -291,6 +293,20 @@ public class ClientElementReader implements ConfigElementReader { configElement.setZeroByteFileUploads(Boolean.parseBoolean(zeroByteFiles.getTextTrim())); } + + // get allow user group admin mode + Element userGroupAdmin = element.element(ELEMENT_USERGROUPADMIN); + if (userGroupAdmin != null) + { + configElement.setUserGroupAdmin(Boolean.parseBoolean(userGroupAdmin.getTextTrim())); + } + + // get allow user config mode + Element userConfig = element.element(ELEMENT_ALLOWUSERCONFIG); + if (userConfig != null) + { + configElement.setAllowUserConfig(Boolean.parseBoolean(userConfig.getTextTrim())); + } } return configElement; diff --git a/source/java/org/alfresco/web/ui/common/renderer/ErrorsRenderer.java b/source/java/org/alfresco/web/ui/common/renderer/ErrorsRenderer.java index 4efc7728f9..c56cd368b5 100644 --- a/source/java/org/alfresco/web/ui/common/renderer/ErrorsRenderer.java +++ b/source/java/org/alfresco/web/ui/common/renderer/ErrorsRenderer.java @@ -46,6 +46,7 @@ import org.alfresco.web.ui.common.Utils; public class ErrorsRenderer extends BaseRenderer { private static final String DEFAULT_MESSAGE = "wizard_errors"; + private static final String ERROR_HINT = "error"; /** * @see javax.faces.render.Renderer#encodeBegin(javax.faces.context.FacesContext, javax.faces.component.UIComponent) @@ -66,6 +67,7 @@ public class ErrorsRenderer extends BaseRenderer String errorClass = (String)component.getAttributes().get("errorClass"); String infoClass = (String)component.getAttributes().get("infoClass"); String message = (String)component.getAttributes().get("message"); + String errorHint = Application.getMessage(context, ERROR_HINT); if (message == null) { @@ -97,7 +99,9 @@ public class ErrorsRenderer extends BaseRenderer { out.write("Error  "); + out.write("/images/icons/info_icon.gif' alt='"); + out.write(Utils.encode(errorHint)); + out.write("' align='absmiddle'/>  "); out.write(Utils.encode(message)); out.write("\n
    "); @@ -119,7 +123,9 @@ public class ErrorsRenderer extends BaseRenderer // the info icon on the left and the list of messages on the right out.write(" <%-- Shelf --%> - diff --git a/source/web/jsp/content/add-content-dialog.jsp b/source/web/jsp/content/add-content-dialog.jsp index bdd06da567..055f9f8f7e 100644 --- a/source/web/jsp/content/add-content-dialog.jsp +++ b/source/web/jsp/content/add-content-dialog.jsp @@ -204,7 +204,7 @@ if (fileUploaded) { finishButtonPressed = false; return validateName(document.getElementById("dialog:dialog-body:file-name"), - '', true); + decodeURI(''), true); } else { diff --git a/source/web/jsp/dashboards/wizard/columns.jsp b/source/web/jsp/dashboards/wizard/columns.jsp index f59940b932..c439929453 100644 --- a/source/web/jsp/dashboards/wizard/columns.jsp +++ b/source/web/jsp/dashboards/wizard/columns.jsp @@ -38,6 +38,11 @@ { document.getElementById("wizard:finish-button").disabled = false; } + function outputSelectedItem() + { + var all_dashlets = document.getElementById('wizard:wizard-body:all-dashlets'); + document.getElementById('wizard:wizard-body:selected-dashlets').innerHTML = all_dashlets.options[all_dashlets.selectedIndex].innerHTML; + } @@ -64,7 +69,7 @@ <%-- note this component ID is referenced in DashboardWizard --%> - + @@ -87,4 +92,7 @@ + + + diff --git a/source/web/jsp/ml/add-translation-dialog.jsp b/source/web/jsp/ml/add-translation-dialog.jsp index db477124e4..71466b2a12 100644 --- a/source/web/jsp/ml/add-translation-dialog.jsp +++ b/source/web/jsp/ml/add-translation-dialog.jsp @@ -214,7 +214,7 @@ { finishButtonPressed = false; return validateName(document.getElementById("dialog:dialog-body:file-name"), - '', true); + decodeURI(''), true); } else { diff --git a/source/web/jsp/rules/compare-text-property.jsp b/source/web/jsp/rules/compare-text-property.jsp index 2b63d18825..d6643658ac 100644 --- a/source/web/jsp/rules/compare-text-property.jsp +++ b/source/web/jsp/rules/compare-text-property.jsp @@ -151,7 +151,7 @@ - + diff --git a/source/web/jsp/rules/rules.jsp b/source/web/jsp/rules/rules.jsp index 777122d9b3..f73d47aaaf 100644 --- a/source/web/jsp/rules/rules.jsp +++ b/source/web/jsp/rules/rules.jsp @@ -102,7 +102,7 @@ - + @@ -112,7 +112,7 @@ - + diff --git a/source/web/jsp/trashcan/recover-listed.jsp b/source/web/jsp/trashcan/recover-listed.jsp index d336420b6f..8931242c32 100644 --- a/source/web/jsp/trashcan/recover-listed.jsp +++ b/source/web/jsp/trashcan/recover-listed.jsp @@ -64,7 +64,7 @@ -
    Error"); + out.write("/images/icons/info_icon.gif' alt='"); + out.write(Utils.encode(errorHint)); + out.write("'/>"); out.write(""); while (messages.hasNext()) diff --git a/source/java/org/alfresco/web/ui/common/renderer/ModeListRenderer.java b/source/java/org/alfresco/web/ui/common/renderer/ModeListRenderer.java index acc0643372..854b724358 100644 --- a/source/java/org/alfresco/web/ui/common/renderer/ModeListRenderer.java +++ b/source/java/org/alfresco/web/ui/common/renderer/ModeListRenderer.java @@ -152,7 +152,7 @@ public class ModeListRenderer extends BaseRenderer } String menuId = UIMenu.getNextMenuId(list, context); - out.write(""); @@ -375,7 +375,7 @@ public class ModeListRenderer extends BaseRenderer } // output item link - out.write(""); + out.write(""); if (!list.isDisabled() && !item.isDisabled()) { out.write("'); diff --git a/source/java/org/alfresco/web/ui/repo/component/UIOpenSearch.java b/source/java/org/alfresco/web/ui/repo/component/UIOpenSearch.java index 95918a5e74..d41c8e6ac4 100644 --- a/source/java/org/alfresco/web/ui/repo/component/UIOpenSearch.java +++ b/source/java/org/alfresco/web/ui/repo/component/UIOpenSearch.java @@ -105,7 +105,8 @@ public class UIOpenSearch extends SelfRenderingComponent out.write(" = new Alfresco.OpenSearchClient('"); out.write(clientId); out.write("');\n"); - + // ADB-133: Synchronizing lengths of search fields + final Integer searchMinimum = Application.getClientConfig(FacesContext.getCurrentInstance()).getSearchMinimum(); // register the engines on the client for (OpenSearchEngine engine : engines) { @@ -116,7 +117,9 @@ public class UIOpenSearch extends SelfRenderingComponent out.write(engine.getLabel()); out.write("', '"); out.write(engine.getUrl()); - out.write("');\n"); + out.write("', "); + out.write(searchMinimum.toString()); + out.write(");\n"); } // pass in NLS strings @@ -160,6 +163,11 @@ public class UIOpenSearch extends SelfRenderingComponent out.write(Application.getMessage(context, "last_page")); out.write("\");\n"); + out.write(clientId); + out.write(".setMsgInvalidTermLength(\""); + out.write(Application.getMessage(context, "search_minimum")); + out.write("\");\n"); + out.write("\n"); // write out the HTML diff --git a/source/web/index.jsp b/source/web/index.jsp index fb07091fe4..a6ecdfdb2a 100644 --- a/source/web/index.jsp +++ b/source/web/index.jsp @@ -120,12 +120,15 @@ if (request.getMethod().equalsIgnoreCase("GET")) if (NavigationBean.LOCATION_MYALFRESCO.equals(location)) { // Clear previous location - Fixes the issue ADB-61 - FacesContext fc = FacesContext.getCurrentInstance(); + FacesContext fc = FacesHelper.getFacesContext(request, response, application); if (fc != null) { NavigationBean navigationBean = (NavigationBean)FacesHelper.getManagedBean(fc, "NavigationBean"); - navigationBean.setLocation(null); - navigationBean.setToolbarLocation(null); + if (navigationBean != null) + { + navigationBean.setLocation(null); + navigationBean.setToolbarLocation(null); + } } // Send redirect response.sendRedirect(request.getContextPath() + "/faces/jsp/dashboards/container.jsp"); diff --git a/source/web/jsp/admin/admin-console.jsp b/source/web/jsp/admin/admin-console.jsp index ce0d206d37..d6eae781a6 100644 --- a/source/web/jsp/admin/admin-console.jsp +++ b/source/web/jsp/admin/admin-console.jsp @@ -28,60 +28,23 @@ <%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -
    - - - -
    - - - -
    - - - - - -
    - - - - - -
    - - - -
    - - - -
    -
    \ No newline at end of file + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/web/jsp/browse/browse.jsp b/source/web/jsp/browse/browse.jsp index a279055e0c..c2d526f721 100644 --- a/source/web/jsp/browse/browse.jsp +++ b/source/web/jsp/browse/browse.jsp @@ -91,7 +91,7 @@ <%-- Main area --%>
    + <%@ include file="../parts/shelf.jsp" %>
    + diff --git a/source/web/jsp/users/user-console.jsp b/source/web/jsp/users/user-console.jsp index aac62b57c8..5f50ffa955 100644 --- a/source/web/jsp/users/user-console.jsp +++ b/source/web/jsp/users/user-console.jsp @@ -34,7 +34,7 @@ + rendered="#{!NavigationBean.isGuest && NavigationBean.allowUserConfig}" /> + rendered="#{!NavigationBean.isGuest && NavigationBean.allowUserConfig}" /> diff --git a/source/web/jsp/wcm/add-content-dialog.jsp b/source/web/jsp/wcm/add-content-dialog.jsp index f24e438919..2316abdf75 100644 --- a/source/web/jsp/wcm/add-content-dialog.jsp +++ b/source/web/jsp/wcm/add-content-dialog.jsp @@ -197,7 +197,7 @@ { finishButtonPressed = false; return validateName(document.getElementById("dialog:dialog-body:file-name"), - '', true); + decodeURI(''), true); } else { diff --git a/source/web/scripts/ajax/opensearch.js b/source/web/scripts/ajax/opensearch.js index fd11a478c8..e6abeece37 100644 --- a/source/web/scripts/ajax/opensearch.js +++ b/source/web/scripts/ajax/opensearch.js @@ -63,6 +63,10 @@ Alfresco.OpenSearchClient.prototype = msgLastPage: null, + msgInvalidTermLength: null, + + minTermLength: 0, + /** * Registers an OpenSearch engine to be called when performing queries */ @@ -73,6 +77,18 @@ Alfresco.OpenSearchClient.prototype = this.enginesById[id] = se; }, + /** + * Registers an OpenSearch engine to be called when performing queries. + * Extra parameter is the minimum search term length. + */ + registerOpenSearchEngine: function(id, label, url, minLengh) + { + var se = new Alfresco.OpenSearchEngine(id, label, url); + this.engines[this.engines.length] = se; + this.enginesById[id] = se; + this.minTermLength = minLengh; + }, + /** * Sets the 'No Results' message */ @@ -137,6 +153,14 @@ Alfresco.OpenSearchClient.prototype = this.msgLastPage = msg; }, + /** + * Sets the invalid term length message + */ + setMsgInvalidTermLength: function(msg) + { + this.msgInvalidTermLength = msg; + }, + /** * Handles the key press event, if ENTER is pressed execute the query */ @@ -205,6 +229,14 @@ Alfresco.OpenSearchClient.prototype = var term = document.getElementById(this.id + _SEARCH_TERM_FIELD_ID).value; var count = document.getElementById(this.id + _PAGE_SIZE_FIELD_ID).value; + // ADB-134 fix (Error message about not enough search criteria) + if (term.length < this.minTermLength) + { + var errorMsg = this.msgInvalidTermLength.replace("{0}", this.minTermLength); + handleCaughtError(errorMsg); + return; + } + // default the count if its invalid if (count.length == 0 || isNaN(count) || count < 1) { @@ -212,8 +244,8 @@ Alfresco.OpenSearchClient.prototype = document.getElementById(this.id + _PAGE_SIZE_FIELD_ID).value = count; } - // issue the queries if there is enough search criteria - if (this.searchInProgress == false && term != null && term.length > 1) + // issue the queries if there is enough search criteria (& ADB-133 fix: parametrized minTermLength) + if (this.searchInProgress == false && term != null && term.length >= this.minTermLength) { // remove previous results (if necessary) var resultsPanel = document.getElementById(this.id + _RESULTS_DIV_ID_SUFFIX);