From 893797f72fa319d5d0e63fc9fcef2b82a903c2d6 Mon Sep 17 00:00:00 2001 From: Samuel Langlois Date: Tue, 8 Oct 2013 16:24:25 +0000 Subject: [PATCH 01/29] Update version to 4.2.1, pom files to 4.2.1-SNAPSHOT and version.schema to 6100 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/V4.2-BUG-FIX/root@56399 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1ba0caaf90..29003a74a4 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-parent - 4.2.0-SNAPSHOT + 4.2.1-SNAPSHOT ../../pom.xml alfresco From c81bb3391aa6249c00ccffe49044b6e1c6e7d8a1 Mon Sep 17 00:00:00 2001 From: Kevin Roast Date: Thu, 10 Oct 2013 11:16:58 +0000 Subject: [PATCH 02/29] Fix for ALF-20277 - Impossible to login to Alfresco JSF client when alfresco is read only. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/PATCHES/V4.2.0/root@56458 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../java/org/alfresco/web/bean/LoginBean.java | 2 +- .../alfresco/web/bean/repository/User.java | 4 +- .../web/bean/users/UserPreferencesBean.java | 40 +++++++++++++++++-- 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/source/java/org/alfresco/web/bean/LoginBean.java b/source/java/org/alfresco/web/bean/LoginBean.java index fa6efb3c2b..98bf59f141 100644 --- a/source/java/org/alfresco/web/bean/LoginBean.java +++ b/source/java/org/alfresco/web/bean/LoginBean.java @@ -423,7 +423,7 @@ public class LoginBean implements Serializable // note: to enable MT runtime client config customization, need to re-init NavigationBean // in context of tenant login page this.navigator.initFromClientConfig(); - + if (NavigationBean.LOCATION_MYALFRESCO.equals(this.preferences.getStartLocation())) { return "myalfresco"; diff --git a/source/java/org/alfresco/web/bean/repository/User.java b/source/java/org/alfresco/web/bean/repository/User.java index fcdb9332be..685d2d87c2 100644 --- a/source/java/org/alfresco/web/bean/repository/User.java +++ b/source/java/org/alfresco/web/bean/repository/User.java @@ -203,7 +203,7 @@ public final class User implements SessionUser } return this.preferences; } - + /** * Get or create the node used to store user preferences. * Utilises the 'configurable' aspect on the Person linked to this user. @@ -267,7 +267,7 @@ public final class User implements SessionUser } return prefRef; } - }); + }, txService.isReadOnly()); } /** diff --git a/source/java/org/alfresco/web/bean/users/UserPreferencesBean.java b/source/java/org/alfresco/web/bean/users/UserPreferencesBean.java index 07eb7ee908..60faf7c403 100644 --- a/source/java/org/alfresco/web/bean/users/UserPreferencesBean.java +++ b/source/java/org/alfresco/web/bean/users/UserPreferencesBean.java @@ -26,9 +26,8 @@ import java.util.ResourceBundle; import javax.faces.context.FacesContext; import javax.faces.model.SelectItem; +import javax.transaction.UserTransaction; -import org.springframework.extensions.config.Config; -import org.springframework.extensions.surf.util.I18NUtil; import org.alfresco.service.cmr.ml.ContentFilterLanguagesService; import org.alfresco.service.cmr.ml.MultilingualContentService; import org.alfresco.service.cmr.repository.NodeRef; @@ -40,6 +39,8 @@ import org.alfresco.web.bean.NavigationBean; import org.alfresco.web.bean.repository.PreferencesService; import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.config.LanguagesConfigElement; +import org.springframework.extensions.config.Config; +import org.springframework.extensions.surf.util.I18NUtil; /** * Simple bean backing the user preferences settings. @@ -113,7 +114,23 @@ public class UserPreferencesBean implements Serializable { if (this.contentFilterLanguage == null) { - Locale locale = (Locale) PreferencesService.getPreferences().getValue(PREF_CONTENTFILTERLANGUAGE); + Locale locale = null; + UserTransaction tx = null; + try + { + FacesContext context = FacesContext.getCurrentInstance(); + tx = Repository.getUserTransaction(context, true); + tx.begin(); + + locale = (Locale) PreferencesService.getPreferences().getValue(PREF_CONTENTFILTERLANGUAGE); + + tx.commit(); + } + catch (Throwable err) + { + try { if (tx != null) {tx.rollback();} } catch (Exception tex) {} + } + // Null means All Languages if (locale == null) { @@ -260,7 +277,22 @@ public class UserPreferencesBean implements Serializable */ public String getStartLocation() { - String location = (String)PreferencesService.getPreferences().getValue(PREF_STARTLOCATION); + String location = null; + UserTransaction tx = null; + try + { + FacesContext context = FacesContext.getCurrentInstance(); + tx = Repository.getUserTransaction(context, true); + tx.begin(); + + location = (String)PreferencesService.getPreferences().getValue(PREF_STARTLOCATION); + + tx.commit(); + } + catch (Throwable err) + { + try { if (tx != null) {tx.rollback();} } catch (Exception tex) {} + } if (location == null) { // default to value from client config From 30be652c8eb94bde0db3c55d7d6bd378763931f1 Mon Sep 17 00:00:00 2001 From: Samuel Langlois Date: Thu, 10 Oct 2013 17:12:33 +0000 Subject: [PATCH 03/29] ALF-20275 Declare dependencies to alfresco-web-framework-commons as provided, so that they are not transitive git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/V4.2-BUG-FIX/root@56484 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- pom.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pom.xml b/pom.xml index 29003a74a4..7f0de6cad9 100644 --- a/pom.xml +++ b/pom.xml @@ -61,6 +61,7 @@ alfresco-web-framework-commons ${project.version} classes + provided ${project.groupId} @@ -169,10 +170,13 @@ standard 1.1.0 + + org.apache.chemistry.opencmis chemistry-opencmis-test-browser ${dependency.opencmis.version} + provided From 911621be2a56e66960d1c321deb0d30b603d6293 Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Fri, 11 Oct 2013 16:34:59 +0000 Subject: [PATCH 04/29] Merged V4.1-BUG-FIX (4.1.7) to V4.2-BUG-FIX (4.2.1) 55942: Merged DEV to V4.1-BUG-FIX (4.1.7) 52177: MNT-8884: URL of the "View in CIFS" link is not URL encoded - Utils.java was updated. Fix does URL encoding for CIFS link except a link that will be displayed in IE. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/V4.2-BUG-FIX/root@56549 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../org/alfresco/web/ui/common/Utils.java | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/source/java/org/alfresco/web/ui/common/Utils.java b/source/java/org/alfresco/web/ui/common/Utils.java index 4012ea9ce3..dd7f5259c0 100644 --- a/source/java/org/alfresco/web/ui/common/Utils.java +++ b/source/java/org/alfresco/web/ui/common/Utils.java @@ -67,6 +67,7 @@ import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.security.PersonService; import org.alfresco.service.namespace.NamespaceService; import org.alfresco.service.namespace.QName; +import org.alfresco.util.EqualsHelper; import org.alfresco.util.Pair; import org.alfresco.web.app.Application; import org.alfresco.web.app.servlet.DownloadContentServlet; @@ -476,13 +477,38 @@ public final class Utils extends StringUtils NodeRef rootNode = contentCtx.getRootNode(); try { - url = Repository.getNamePathEx(context, node.getNodePath(), rootNode, "\\", - "file:///" + navBean.getCIFSServerPath(diskShare)); + if (!EqualsHelper.nullSafeEquals(rootNode, node.getNodeRef())) + { + String userAgent = Utils.getUserAgent(context); + final boolean isIE = Utils.USER_AGENT_MSIE.equals(userAgent); + + if (isIE) + { + url = Repository.getNamePathEx(context, node.getNodePath(), rootNode, "\\", "file:///" + navBean.getCIFSServerPath(diskShare)); + } + else + { + // build up the CIFS url + StringBuilder path = new StringBuilder("file:///").append(navBean.getCIFSServerPath(diskShare)); + List paths = fileFolderService.getNamePath(rootNode, node.getNodeRef()); + + // build up the path skipping the first path as it is the root folder + for (int x = 0; x < paths.size(); x++) + { + path.append("\\").append(WebDAVHelper.encodeURL(paths.get(x).getName(), userAgent)); + } + url = path.toString(); + } + } } catch (AccessDeniedException e) { // cannot build path if user don't have access all the way up } + catch (FileNotFoundException nodeErr) + { + // cannot build path if file no longer exists + } catch (InvalidNodeRefException nodeErr) { // cannot build path if node no longer exists From 55eaa9d238196ad92490c9d398d4af72c1664ce4 Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Mon, 14 Oct 2013 17:07:28 +0000 Subject: [PATCH 05/29] Merged V4.2.0 (4.2) to V4.2-BUG-FIX (4.2.1) 56458: Fix for ALF-20277 - Impossible to login to Alfresco JSF client when alfresco is read only. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/V4.2-BUG-FIX/root@56634 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../java/org/alfresco/web/bean/LoginBean.java | 2 +- .../alfresco/web/bean/repository/User.java | 4 +- .../web/bean/users/UserPreferencesBean.java | 40 +++++++++++++++++-- 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/source/java/org/alfresco/web/bean/LoginBean.java b/source/java/org/alfresco/web/bean/LoginBean.java index fa6efb3c2b..98bf59f141 100644 --- a/source/java/org/alfresco/web/bean/LoginBean.java +++ b/source/java/org/alfresco/web/bean/LoginBean.java @@ -423,7 +423,7 @@ public class LoginBean implements Serializable // note: to enable MT runtime client config customization, need to re-init NavigationBean // in context of tenant login page this.navigator.initFromClientConfig(); - + if (NavigationBean.LOCATION_MYALFRESCO.equals(this.preferences.getStartLocation())) { return "myalfresco"; diff --git a/source/java/org/alfresco/web/bean/repository/User.java b/source/java/org/alfresco/web/bean/repository/User.java index fcdb9332be..685d2d87c2 100644 --- a/source/java/org/alfresco/web/bean/repository/User.java +++ b/source/java/org/alfresco/web/bean/repository/User.java @@ -203,7 +203,7 @@ public final class User implements SessionUser } return this.preferences; } - + /** * Get or create the node used to store user preferences. * Utilises the 'configurable' aspect on the Person linked to this user. @@ -267,7 +267,7 @@ public final class User implements SessionUser } return prefRef; } - }); + }, txService.isReadOnly()); } /** diff --git a/source/java/org/alfresco/web/bean/users/UserPreferencesBean.java b/source/java/org/alfresco/web/bean/users/UserPreferencesBean.java index 07eb7ee908..60faf7c403 100644 --- a/source/java/org/alfresco/web/bean/users/UserPreferencesBean.java +++ b/source/java/org/alfresco/web/bean/users/UserPreferencesBean.java @@ -26,9 +26,8 @@ import java.util.ResourceBundle; import javax.faces.context.FacesContext; import javax.faces.model.SelectItem; +import javax.transaction.UserTransaction; -import org.springframework.extensions.config.Config; -import org.springframework.extensions.surf.util.I18NUtil; import org.alfresco.service.cmr.ml.ContentFilterLanguagesService; import org.alfresco.service.cmr.ml.MultilingualContentService; import org.alfresco.service.cmr.repository.NodeRef; @@ -40,6 +39,8 @@ import org.alfresco.web.bean.NavigationBean; import org.alfresco.web.bean.repository.PreferencesService; import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.config.LanguagesConfigElement; +import org.springframework.extensions.config.Config; +import org.springframework.extensions.surf.util.I18NUtil; /** * Simple bean backing the user preferences settings. @@ -113,7 +114,23 @@ public class UserPreferencesBean implements Serializable { if (this.contentFilterLanguage == null) { - Locale locale = (Locale) PreferencesService.getPreferences().getValue(PREF_CONTENTFILTERLANGUAGE); + Locale locale = null; + UserTransaction tx = null; + try + { + FacesContext context = FacesContext.getCurrentInstance(); + tx = Repository.getUserTransaction(context, true); + tx.begin(); + + locale = (Locale) PreferencesService.getPreferences().getValue(PREF_CONTENTFILTERLANGUAGE); + + tx.commit(); + } + catch (Throwable err) + { + try { if (tx != null) {tx.rollback();} } catch (Exception tex) {} + } + // Null means All Languages if (locale == null) { @@ -260,7 +277,22 @@ public class UserPreferencesBean implements Serializable */ public String getStartLocation() { - String location = (String)PreferencesService.getPreferences().getValue(PREF_STARTLOCATION); + String location = null; + UserTransaction tx = null; + try + { + FacesContext context = FacesContext.getCurrentInstance(); + tx = Repository.getUserTransaction(context, true); + tx.begin(); + + location = (String)PreferencesService.getPreferences().getValue(PREF_STARTLOCATION); + + tx.commit(); + } + catch (Throwable err) + { + try { if (tx != null) {tx.rollback();} } catch (Exception tex) {} + } if (location == null) { // default to value from client config From 68fae4cd3474aefb716950f3db4f4e2d72ccb50b Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Tue, 22 Oct 2013 22:16:57 +0000 Subject: [PATCH 06/29] Merged V4.1-BUG-FIX (4.1.7) to V4.2-BUG-FIX (4.2.1) 56837: MNT-9767: Merged DEV to V4.1-BUG-FIX 56823: MNT-9767 : Navigation arrows of the document details view do not work when a search result is displayed Was added the check for currentSortColumn when it is null. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/V4.2-BUG-FIX/root@56920 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../web/bean/content/DocumentDetailsDialog.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/source/java/org/alfresco/web/bean/content/DocumentDetailsDialog.java b/source/java/org/alfresco/web/bean/content/DocumentDetailsDialog.java index ea88e1cf5d..acfe57cf13 100644 --- a/source/java/org/alfresco/web/bean/content/DocumentDetailsDialog.java +++ b/source/java/org/alfresco/web/bean/content/DocumentDetailsDialog.java @@ -715,8 +715,11 @@ public class DocumentDetailsDialog extends BaseDetailsBean implements Navigatio if (nodes.size() > 1) { String currentSortColumn = this.browseBean.getContentRichList().getCurrentSortColumn(); - boolean currentSortDescending = this.browseBean.getContentRichList().isCurrentSortDescending(); - Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending)); + if (currentSortColumn != null) + { + boolean currentSortDescending = this.browseBean.getContentRichList().isCurrentSortDescending(); + Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending)); + } Node next = NodeListUtils.nextItem(nodes, id); getRecentNodeRefsStack().clear(); this.browseBean.setupContentAction(next.getId(), false); @@ -738,8 +741,11 @@ public class DocumentDetailsDialog extends BaseDetailsBean implements Navigatio if (nodes.size() > 1) { String currentSortColumn = this.browseBean.getContentRichList().getCurrentSortColumn(); - boolean currentSortDescending = this.browseBean.getContentRichList().isCurrentSortDescending(); - Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending)); + if (currentSortColumn != null) + { + boolean currentSortDescending = this.browseBean.getContentRichList().isCurrentSortDescending(); + Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending)); + } Node previous = NodeListUtils.previousItem(nodes, id); getRecentNodeRefsStack().clear(); this.browseBean.setupContentAction(previous.getId(), false); From 21a71e8f341e1b220e3f17f57e0f6517e4bcd1c7 Mon Sep 17 00:00:00 2001 From: Gethin James Date: Tue, 29 Oct 2013 16:40:48 +0000 Subject: [PATCH 07/29] Fixed failing tests by loading the test resource config from the class path, BDE-195 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/V4.2-BUG-FIX/root@57339 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../web/config/WebClientConfigTest.java | 58 +++++++++++-------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/source/test-java/org/alfresco/web/config/WebClientConfigTest.java b/source/test-java/org/alfresco/web/config/WebClientConfigTest.java index 0f29db0a8a..98dfff2d58 100644 --- a/source/test-java/org/alfresco/web/config/WebClientConfigTest.java +++ b/source/test-java/org/alfresco/web/config/WebClientConfigTest.java @@ -20,16 +20,10 @@ package org.alfresco.web.config; import java.util.ArrayList; import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.StringTokenizer; +import java.util.StringTokenizer; -import org.springframework.extensions.config.Config; -import org.springframework.extensions.config.ConfigElement; -import org.springframework.extensions.config.ConfigException; -import org.springframework.extensions.config.xml.XMLConfigService; import org.alfresco.service.namespace.QName; import org.alfresco.util.BaseTest; import org.alfresco.web.config.ActionsConfigElement.ActionDefinition; @@ -41,6 +35,10 @@ import org.alfresco.web.config.WizardsConfigElement.ConditionalPageConfig; import org.alfresco.web.config.WizardsConfigElement.PageConfig; import org.alfresco.web.config.WizardsConfigElement.StepConfig; import org.alfresco.web.config.WizardsConfigElement.WizardConfig; +import org.springframework.extensions.config.Config; +import org.springframework.extensions.config.ConfigElement; +import org.springframework.extensions.config.ConfigException; +import org.springframework.extensions.config.xml.XMLConfigService; /** * JUnit tests to exercise the capabilities added to the web client config @@ -50,6 +48,10 @@ import org.alfresco.web.config.WizardsConfigElement.WizardConfig; */ public class WebClientConfigTest extends BaseTest { + private static final String TEST_CONFIG = "test-config.xml"; + private static final String TEST_CONFIG_OVERRIDE = "test-config-override.xml"; + private static final String CLASSPATH_RESOURCE = "classpath:"; + /** * @see junit.framework.TestCase#setUp() */ @@ -63,7 +65,7 @@ public class WebClientConfigTest extends BaseTest */ public void testPropertySheetConfig() { - XMLConfigService svc = initXMLConfigService("test-config.xml"); + XMLConfigService svc = initXMLConfigService(TEST_CONFIG); // get hold of the property sheet config from the global section Config global = svc.getGlobalConfig(); @@ -122,9 +124,15 @@ public class WebClientConfigTest extends BaseTest } - public void testPropertyViewing() + @Override + public String getResourcesDir() + { + return CLASSPATH_RESOURCE; + } + +public void testPropertyViewing() { - XMLConfigService svc = initXMLConfigService("test-config.xml"); + XMLConfigService svc = initXMLConfigService(TEST_CONFIG); Config propViewConfig = svc.getConfig("Property Viewing"); assertNotNull("Property Viewing section should not be null", propViewConfig); @@ -162,7 +170,7 @@ public class WebClientConfigTest extends BaseTest public void testPropertyEditing() { - XMLConfigService svc = initXMLConfigService("test-config.xml"); + XMLConfigService svc = initXMLConfigService(TEST_CONFIG); Config propEditConfig = svc.getConfig("Property Editing"); assertNotNull("Property Editing section should not be null", propEditConfig); @@ -203,7 +211,7 @@ public class WebClientConfigTest extends BaseTest public void testPropertyOverride() { - XMLConfigService svc = initXMLConfigService("test-config.xml", "test-config-override.xml"); + XMLConfigService svc = initXMLConfigService(TEST_CONFIG, TEST_CONFIG_OVERRIDE); // get the config for the size property in the space-aspect property sheet PropertySheetConfigElement propSheet = ((PropertySheetConfigElement)svc.getConfig("space-aspect"). @@ -278,7 +286,7 @@ public class WebClientConfigTest extends BaseTest */ public void testClientConfig() { - XMLConfigService svc = initXMLConfigService("test-config.xml"); + XMLConfigService svc = initXMLConfigService(TEST_CONFIG); // get the global config and from that the client config ClientConfigElement clientConfig = (ClientConfigElement)svc.getGlobalConfig(). @@ -298,7 +306,7 @@ public class WebClientConfigTest extends BaseTest public void testClientOverride() { - XMLConfigService svc = initXMLConfigService("test-config.xml", "test-config-override.xml"); + XMLConfigService svc = initXMLConfigService(TEST_CONFIG, TEST_CONFIG_OVERRIDE); // try and get the global config section Config globalSection = svc.getGlobalConfig(); @@ -330,7 +338,7 @@ public class WebClientConfigTest extends BaseTest */ public void testNavigation() { - XMLConfigService svc = initXMLConfigService("test-config.xml"); + XMLConfigService svc = initXMLConfigService(TEST_CONFIG); // *** Test the returning of a view id override Config testCfg = svc.getConfig("viewid-navigation-result"); @@ -405,7 +413,7 @@ public class WebClientConfigTest extends BaseTest public void testNavigationGenericConfig() { - XMLConfigService svc = initXMLConfigService("test-config.xml"); + XMLConfigService svc = initXMLConfigService(TEST_CONFIG); // do a lookup using the generic config elements and make sure the correct // info comes out @@ -451,7 +459,7 @@ public class WebClientConfigTest extends BaseTest public void testLanguages() { - XMLConfigService svc = initXMLConfigService("test-config.xml", "test-config-override.xml"); + XMLConfigService svc = initXMLConfigService(TEST_CONFIG, TEST_CONFIG_OVERRIDE); LanguagesConfigElement config = (LanguagesConfigElement)svc.getConfig("Languages"). getConfigElement(LanguagesConfigElement.CONFIG_ELEMENT_ID); @@ -486,7 +494,7 @@ public class WebClientConfigTest extends BaseTest public void testAdvancedSearch() { - XMLConfigService svc = initXMLConfigService("test-config.xml", "test-config-override.xml"); + XMLConfigService svc = initXMLConfigService(TEST_CONFIG, TEST_CONFIG_OVERRIDE); AdvancedSearchConfigElement config = (AdvancedSearchConfigElement)svc.getConfig("Advanced Search"). getConfigElement(AdvancedSearchConfigElement.CONFIG_ELEMENT_ID); @@ -529,7 +537,7 @@ public class WebClientConfigTest extends BaseTest public void testViews() { - XMLConfigService svc = initXMLConfigService("test-config.xml", "test-config-override.xml"); + XMLConfigService svc = initXMLConfigService(TEST_CONFIG, TEST_CONFIG_OVERRIDE); ViewsConfigElement config = (ViewsConfigElement)svc.getConfig("Views"). getConfigElement(ViewsConfigElement.CONFIG_ELEMENT_ID); @@ -661,7 +669,7 @@ public class WebClientConfigTest extends BaseTest public void testDialogOverride() { - XMLConfigService svc = initXMLConfigService("test-config-dialogs-wizards.xml", "test-config-override.xml"); + XMLConfigService svc = initXMLConfigService("test-config-dialogs-wizards.xml", TEST_CONFIG_OVERRIDE); // get the 'dialogs' element DialogsConfigElement dialogsElement = ((DialogsConfigElement)svc.getConfig("Dialogs"). @@ -803,7 +811,7 @@ public class WebClientConfigTest extends BaseTest public void testActions() { - XMLConfigService svc = initXMLConfigService("test-config.xml"); + XMLConfigService svc = initXMLConfigService(TEST_CONFIG); // get the "Actions" config Config cfg = svc.getGlobalConfig(); @@ -839,7 +847,7 @@ public class WebClientConfigTest extends BaseTest public void testActionsOverriding() { - XMLConfigService svc = initXMLConfigService("test-config.xml", "test-config-override.xml"); + XMLConfigService svc = initXMLConfigService(TEST_CONFIG, TEST_CONFIG_OVERRIDE); // get the "Actions" config Config cfg = svc.getConfig("Actions Override"); @@ -900,7 +908,7 @@ public class WebClientConfigTest extends BaseTest public void testETHREEOH2145() { - XMLConfigService svc = initXMLConfigService("test-config.xml", "test-config-e30-2145.xml"); + XMLConfigService svc = initXMLConfigService(TEST_CONFIG, "test-config-e30-2145.xml"); // get the "client" config from global config section Config cfg = svc.getGlobalConfig(); @@ -922,7 +930,7 @@ public class WebClientConfigTest extends BaseTest public void testWCM() { // setup the config service - XMLConfigService svc = initXMLConfigService("test-config.xml"); + XMLConfigService svc = initXMLConfigService(TEST_CONFIG); // get the global config object Config global = svc.getGlobalConfig(); @@ -981,7 +989,7 @@ public class WebClientConfigTest extends BaseTest public void testWCMOverride() { // setup the config service - XMLConfigService svc = initXMLConfigService("test-config.xml", "test-config-override.xml"); + XMLConfigService svc = initXMLConfigService(TEST_CONFIG, TEST_CONFIG_OVERRIDE); // get the global config object Config global = svc.getGlobalConfig(); From 6a0db7b688d7112b681e02e2ba68d95fae4e4cf9 Mon Sep 17 00:00:00 2001 From: Pavel Yurke Date: Wed, 30 Oct 2013 09:08:00 +0000 Subject: [PATCH 08/29] Merged DEV to V4.2-BUG-FIX (4.2.1) 57347 : MNT-9838 : Some images are absent on "About Alfresco" page - New logos added git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/V4.2-BUG-FIX/root@57348 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- source/web/jsp/dialog/about.jsp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/source/web/jsp/dialog/about.jsp b/source/web/jsp/dialog/about.jsp index 119f4f4052..3fdd3860e0 100644 --- a/source/web/jsp/dialog/about.jsp +++ b/source/web/jsp/dialog/about.jsp @@ -51,7 +51,10 @@ Spring Framework - Hibernate + Mybatis + + + Ibatis
@@ -79,6 +82,12 @@ Lucene + + Solr + + + Hazelcast + Code Generation Library @@ -91,7 +100,7 @@ TinyMCE - OpenOffice.org + LibreOffice JooReports From 6e4c59fee5084fa0f3d6b204c4de1de273fb0246 Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Wed, 30 Oct 2013 10:29:01 +0000 Subject: [PATCH 09/29] Reverse Merged. Commit to wrong branch. Should have been HEAD-BUG-FIX. 57334: Moved test_indexCheckService.js to test-resources, BDE-195 57335: Enterprise depends on wdr-deployment, BDE-195 57336: An explicit instruction to Junit to ignore this class, BDE-195 57337: Excluding wcm tests that aren't run in ant, BDE-195 57339: Fixed failing tests by loading the test resource config from the class path, BDE-195 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/V4.2-BUG-FIX/root@57353 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../web/config/WebClientConfigTest.java | 58 ++++++++----------- 1 file changed, 25 insertions(+), 33 deletions(-) diff --git a/source/test-java/org/alfresco/web/config/WebClientConfigTest.java b/source/test-java/org/alfresco/web/config/WebClientConfigTest.java index 98dfff2d58..0f29db0a8a 100644 --- a/source/test-java/org/alfresco/web/config/WebClientConfigTest.java +++ b/source/test-java/org/alfresco/web/config/WebClientConfigTest.java @@ -20,10 +20,16 @@ package org.alfresco.web.config; import java.util.ArrayList; import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.StringTokenizer; +import java.util.StringTokenizer; +import org.springframework.extensions.config.Config; +import org.springframework.extensions.config.ConfigElement; +import org.springframework.extensions.config.ConfigException; +import org.springframework.extensions.config.xml.XMLConfigService; import org.alfresco.service.namespace.QName; import org.alfresco.util.BaseTest; import org.alfresco.web.config.ActionsConfigElement.ActionDefinition; @@ -35,10 +41,6 @@ import org.alfresco.web.config.WizardsConfigElement.ConditionalPageConfig; import org.alfresco.web.config.WizardsConfigElement.PageConfig; import org.alfresco.web.config.WizardsConfigElement.StepConfig; import org.alfresco.web.config.WizardsConfigElement.WizardConfig; -import org.springframework.extensions.config.Config; -import org.springframework.extensions.config.ConfigElement; -import org.springframework.extensions.config.ConfigException; -import org.springframework.extensions.config.xml.XMLConfigService; /** * JUnit tests to exercise the capabilities added to the web client config @@ -48,10 +50,6 @@ import org.springframework.extensions.config.xml.XMLConfigService; */ public class WebClientConfigTest extends BaseTest { - private static final String TEST_CONFIG = "test-config.xml"; - private static final String TEST_CONFIG_OVERRIDE = "test-config-override.xml"; - private static final String CLASSPATH_RESOURCE = "classpath:"; - /** * @see junit.framework.TestCase#setUp() */ @@ -65,7 +63,7 @@ public class WebClientConfigTest extends BaseTest */ public void testPropertySheetConfig() { - XMLConfigService svc = initXMLConfigService(TEST_CONFIG); + XMLConfigService svc = initXMLConfigService("test-config.xml"); // get hold of the property sheet config from the global section Config global = svc.getGlobalConfig(); @@ -124,15 +122,9 @@ public class WebClientConfigTest extends BaseTest } - @Override - public String getResourcesDir() - { - return CLASSPATH_RESOURCE; - } - -public void testPropertyViewing() + public void testPropertyViewing() { - XMLConfigService svc = initXMLConfigService(TEST_CONFIG); + XMLConfigService svc = initXMLConfigService("test-config.xml"); Config propViewConfig = svc.getConfig("Property Viewing"); assertNotNull("Property Viewing section should not be null", propViewConfig); @@ -170,7 +162,7 @@ public void testPropertyViewing() public void testPropertyEditing() { - XMLConfigService svc = initXMLConfigService(TEST_CONFIG); + XMLConfigService svc = initXMLConfigService("test-config.xml"); Config propEditConfig = svc.getConfig("Property Editing"); assertNotNull("Property Editing section should not be null", propEditConfig); @@ -211,7 +203,7 @@ public void testPropertyViewing() public void testPropertyOverride() { - XMLConfigService svc = initXMLConfigService(TEST_CONFIG, TEST_CONFIG_OVERRIDE); + XMLConfigService svc = initXMLConfigService("test-config.xml", "test-config-override.xml"); // get the config for the size property in the space-aspect property sheet PropertySheetConfigElement propSheet = ((PropertySheetConfigElement)svc.getConfig("space-aspect"). @@ -286,7 +278,7 @@ public void testPropertyViewing() */ public void testClientConfig() { - XMLConfigService svc = initXMLConfigService(TEST_CONFIG); + XMLConfigService svc = initXMLConfigService("test-config.xml"); // get the global config and from that the client config ClientConfigElement clientConfig = (ClientConfigElement)svc.getGlobalConfig(). @@ -306,7 +298,7 @@ public void testPropertyViewing() public void testClientOverride() { - XMLConfigService svc = initXMLConfigService(TEST_CONFIG, TEST_CONFIG_OVERRIDE); + XMLConfigService svc = initXMLConfigService("test-config.xml", "test-config-override.xml"); // try and get the global config section Config globalSection = svc.getGlobalConfig(); @@ -338,7 +330,7 @@ public void testPropertyViewing() */ public void testNavigation() { - XMLConfigService svc = initXMLConfigService(TEST_CONFIG); + XMLConfigService svc = initXMLConfigService("test-config.xml"); // *** Test the returning of a view id override Config testCfg = svc.getConfig("viewid-navigation-result"); @@ -413,7 +405,7 @@ public void testPropertyViewing() public void testNavigationGenericConfig() { - XMLConfigService svc = initXMLConfigService(TEST_CONFIG); + XMLConfigService svc = initXMLConfigService("test-config.xml"); // do a lookup using the generic config elements and make sure the correct // info comes out @@ -459,7 +451,7 @@ public void testPropertyViewing() public void testLanguages() { - XMLConfigService svc = initXMLConfigService(TEST_CONFIG, TEST_CONFIG_OVERRIDE); + XMLConfigService svc = initXMLConfigService("test-config.xml", "test-config-override.xml"); LanguagesConfigElement config = (LanguagesConfigElement)svc.getConfig("Languages"). getConfigElement(LanguagesConfigElement.CONFIG_ELEMENT_ID); @@ -494,7 +486,7 @@ public void testPropertyViewing() public void testAdvancedSearch() { - XMLConfigService svc = initXMLConfigService(TEST_CONFIG, TEST_CONFIG_OVERRIDE); + XMLConfigService svc = initXMLConfigService("test-config.xml", "test-config-override.xml"); AdvancedSearchConfigElement config = (AdvancedSearchConfigElement)svc.getConfig("Advanced Search"). getConfigElement(AdvancedSearchConfigElement.CONFIG_ELEMENT_ID); @@ -537,7 +529,7 @@ public void testPropertyViewing() public void testViews() { - XMLConfigService svc = initXMLConfigService(TEST_CONFIG, TEST_CONFIG_OVERRIDE); + XMLConfigService svc = initXMLConfigService("test-config.xml", "test-config-override.xml"); ViewsConfigElement config = (ViewsConfigElement)svc.getConfig("Views"). getConfigElement(ViewsConfigElement.CONFIG_ELEMENT_ID); @@ -669,7 +661,7 @@ public void testPropertyViewing() public void testDialogOverride() { - XMLConfigService svc = initXMLConfigService("test-config-dialogs-wizards.xml", TEST_CONFIG_OVERRIDE); + XMLConfigService svc = initXMLConfigService("test-config-dialogs-wizards.xml", "test-config-override.xml"); // get the 'dialogs' element DialogsConfigElement dialogsElement = ((DialogsConfigElement)svc.getConfig("Dialogs"). @@ -811,7 +803,7 @@ public void testPropertyViewing() public void testActions() { - XMLConfigService svc = initXMLConfigService(TEST_CONFIG); + XMLConfigService svc = initXMLConfigService("test-config.xml"); // get the "Actions" config Config cfg = svc.getGlobalConfig(); @@ -847,7 +839,7 @@ public void testPropertyViewing() public void testActionsOverriding() { - XMLConfigService svc = initXMLConfigService(TEST_CONFIG, TEST_CONFIG_OVERRIDE); + XMLConfigService svc = initXMLConfigService("test-config.xml", "test-config-override.xml"); // get the "Actions" config Config cfg = svc.getConfig("Actions Override"); @@ -908,7 +900,7 @@ public void testPropertyViewing() public void testETHREEOH2145() { - XMLConfigService svc = initXMLConfigService(TEST_CONFIG, "test-config-e30-2145.xml"); + XMLConfigService svc = initXMLConfigService("test-config.xml", "test-config-e30-2145.xml"); // get the "client" config from global config section Config cfg = svc.getGlobalConfig(); @@ -930,7 +922,7 @@ public void testPropertyViewing() public void testWCM() { // setup the config service - XMLConfigService svc = initXMLConfigService(TEST_CONFIG); + XMLConfigService svc = initXMLConfigService("test-config.xml"); // get the global config object Config global = svc.getGlobalConfig(); @@ -989,7 +981,7 @@ public void testPropertyViewing() public void testWCMOverride() { // setup the config service - XMLConfigService svc = initXMLConfigService(TEST_CONFIG, TEST_CONFIG_OVERRIDE); + XMLConfigService svc = initXMLConfigService("test-config.xml", "test-config-override.xml"); // get the global config object Config global = svc.getGlobalConfig(); From ee5e06e66b316945742a34dc1bf2c743e41b31ad Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Fri, 1 Nov 2013 13:20:44 +0000 Subject: [PATCH 10/29] Merged V4.1-BUG-FIX (4.1.8) to V4.2-BUG-FIX (4.2.1) 57425: Merged V4.1.7 (4.1.7) to V4.1-BUG-FIX (4.1.8) 57422: MNT-9767: Merged DEV to PATCHES/V4.1.7 57268: MNT-9767 : Navigation arrows of the document details view do not work when a search result is displayed Was added the check for currentSortColumn when it is null in SpaceDetailsDialog. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/V4.2-BUG-FIX/root@57531 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../web/bean/spaces/SpaceDetailsDialog.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/source/java/org/alfresco/web/bean/spaces/SpaceDetailsDialog.java b/source/java/org/alfresco/web/bean/spaces/SpaceDetailsDialog.java index f3bcb41049..71122b3241 100644 --- a/source/java/org/alfresco/web/bean/spaces/SpaceDetailsDialog.java +++ b/source/java/org/alfresco/web/bean/spaces/SpaceDetailsDialog.java @@ -179,8 +179,11 @@ public class SpaceDetailsDialog extends BaseDetailsBean implements NavigationSup if (nodes.size() > 1) { String currentSortColumn = this.browseBean.getSpacesRichList().getCurrentSortColumn(); - boolean currentSortDescending = this.browseBean.getSpacesRichList().isCurrentSortDescending(); - Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending)); + if (currentSortColumn != null) + { + boolean currentSortDescending = this.browseBean.getSpacesRichList().isCurrentSortDescending(); + Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending)); + } next = NodeListUtils.nextItem(nodes, id); this.browseBean.setupSpaceAction(next.getId(), false); } @@ -208,8 +211,11 @@ public class SpaceDetailsDialog extends BaseDetailsBean implements NavigationSup if (nodes.size() > 1) { String currentSortColumn = this.browseBean.getSpacesRichList().getCurrentSortColumn(); - boolean currentSortDescending = this.browseBean.getSpacesRichList().isCurrentSortDescending(); - Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending)); + if (currentSortColumn != null) + { + boolean currentSortDescending = this.browseBean.getSpacesRichList().isCurrentSortDescending(); + Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending)); + } previous = NodeListUtils.previousItem(nodes, id); this.browseBean.setupSpaceAction(previous.getId(), false); } From 40a176205a39ebf72a9a7eb6d45798a68e5ed3d6 Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Tue, 5 Nov 2013 10:19:01 +0000 Subject: [PATCH 11/29] Merged V4.1-BUG-FIX (4.1.8) to V4.2-BUG-FIX (4.2.1) 57582: Merged DEV to V4.1-BUG-FIX (4.1.8) with corrections 56334: MNT-9712: VTI doesn't allow external authentication. - Modify org.alfresco.web.sharepoint.auth.BasicAuthenticationHandler to check Remote User - Add unit test. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/V4.2-BUG-FIX/root@57647 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../web-client-application-context.xml | 6 +++ .../auth/BasicAuthenticationHandler.java | 42 ++++++++++++++++--- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/config/alfresco/web-client-application-context.xml b/config/alfresco/web-client-application-context.xml index 25aa552d0c..4d07ef2160 100644 --- a/config/alfresco/web-client-application-context.xml +++ b/config/alfresco/web-client-application-context.xml @@ -328,6 +328,12 @@ + + + + + + diff --git a/source/java/org/alfresco/web/sharepoint/auth/BasicAuthenticationHandler.java b/source/java/org/alfresco/web/sharepoint/auth/BasicAuthenticationHandler.java index 9548e1eae1..f31947a9ae 100644 --- a/source/java/org/alfresco/web/sharepoint/auth/BasicAuthenticationHandler.java +++ b/source/java/org/alfresco/web/sharepoint/auth/BasicAuthenticationHandler.java @@ -27,10 +27,11 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.alfresco.repo.SessionUser; +import org.alfresco.repo.management.subsystems.ActivateableBean; +import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.repo.security.authentication.AuthenticationException; import org.alfresco.repo.web.auth.AuthenticationListener; import org.alfresco.repo.web.auth.BasicAuthCredentials; -import org.alfresco.repo.web.auth.TicketCredentials; import org.alfresco.repo.webdav.auth.SharepointConstants; import org.alfresco.web.bean.repository.User; import org.apache.commons.codec.binary.Base64; @@ -49,6 +50,8 @@ public class BasicAuthenticationHandler extends AbstractAuthenticationHandler im private final static String BASIC_START = "Basic"; private AuthenticationListener authenticationListener; + protected RemoteUserMapper remoteUserMapper; + protected AuthenticationComponent authenticationComponent; /** * Set the authentication listener @@ -98,8 +101,8 @@ public class BasicAuthenticationHandler extends AbstractAuthenticationHandler im { String authHdr = request.getHeader(HEADER_AUTHORIZATION); HttpSession session = request.getSession(false); - SessionUser user = session == null ? null : (SessionUser) session.getAttribute(USER_SESSION_ATTRIBUTE); - if (user == null) + SessionUser sessionUser = session == null ? null : (SessionUser) session.getAttribute(USER_SESSION_ATTRIBUTE); + if (sessionUser == null) { if (authHdr != null && authHdr.length() > 5 && authHdr.substring(0, 5).equalsIgnoreCase(BASIC_START)) { @@ -147,18 +150,33 @@ public class BasicAuthenticationHandler extends AbstractAuthenticationHandler im authenticationListener.authenticationFailed(new BasicAuthCredentials(username, password), ex); } } + else + { + if (remoteUserMapper != null && (!(remoteUserMapper instanceof ActivateableBean) || ((ActivateableBean) remoteUserMapper).isActive())) + { + String userId = remoteUserMapper.getRemoteUser(request); + if (userId != null) + { + // authenticated by other + authenticationComponent.setCurrentUser(userId); + + request.getSession().setAttribute(USER_SESSION_ATTRIBUTE, new User(userId, authenticationService.getCurrentTicket(), personService.getPerson(userId))); + return true; + } + } + } } else { try { - authenticationService.validate(user.getTicket()); - authenticationListener.userAuthenticated(new TicketCredentials(user.getTicket())); + authenticationService.validate(sessionUser.getTicket()); + authenticationListener.userAuthenticated(new TicketCredentials(sessionUser.getTicket())); return true; } catch (AuthenticationException ex) { - authenticationListener.authenticationFailed(new TicketCredentials(user.getTicket()), ex); + authenticationListener.authenticationFailed(new TicketCredentials(sessionUser.getTicket()), ex); session.invalidate(); } } @@ -171,4 +189,16 @@ public class BasicAuthenticationHandler extends AbstractAuthenticationHandler im { return "Basic realm=\"Alfresco Server\""; } + + public void setRemoteUserMapper(RemoteUserMapper remoteUserMapper) + { + this.remoteUserMapper = remoteUserMapper; + } + + public void setAuthenticationComponent(AuthenticationComponent authenticationComponent) + { + this.authenticationComponent = authenticationComponent; + } + + } From 833aff69dcc4bbb8ee936f9c486f7851a10bd498 Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Tue, 5 Nov 2013 12:31:19 +0000 Subject: [PATCH 12/29] Merged V4.1-BUG-FIX (4.1.8) to V4.2-BUG-FIX (4.2.1) - Correct merge error 57582: Merged DEV to V4.1-BUG-FIX (4.1.8) with corrections 56334: MNT-9712: VTI doesn't allow external authentication. - Modify org.alfresco.web.sharepoint.auth.BasicAuthenticationHandler to check Remote User - Add unit test. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/V4.2-BUG-FIX/root@57656 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../web/sharepoint/auth/BasicAuthenticationHandler.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/java/org/alfresco/web/sharepoint/auth/BasicAuthenticationHandler.java b/source/java/org/alfresco/web/sharepoint/auth/BasicAuthenticationHandler.java index f31947a9ae..a1408adb7b 100644 --- a/source/java/org/alfresco/web/sharepoint/auth/BasicAuthenticationHandler.java +++ b/source/java/org/alfresco/web/sharepoint/auth/BasicAuthenticationHandler.java @@ -30,7 +30,9 @@ import org.alfresco.repo.SessionUser; import org.alfresco.repo.management.subsystems.ActivateableBean; import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.repo.security.authentication.AuthenticationException; +import org.alfresco.repo.webdav.auth.RemoteUserMapper; import org.alfresco.repo.web.auth.AuthenticationListener; +import org.alfresco.repo.web.auth.TicketCredentials; import org.alfresco.repo.web.auth.BasicAuthCredentials; import org.alfresco.repo.webdav.auth.SharepointConstants; import org.alfresco.web.bean.repository.User; From e9ce4b2464e11e3bfc484a7fadd6984961ef46cf Mon Sep 17 00:00:00 2001 From: Alex Mukha Date: Fri, 22 Nov 2013 12:11:01 +0000 Subject: [PATCH 13/29] Merged DEV no V4.2-BUG-FIX (4.2.1) 58127: MNT-10027 : IE10 specific: The buttons "Create Space", "Advanced Space Wizard", "Manage Space Users", "Manage Content Rules" etc. don't work Changed width of menus to auto to correctly display it in IE 10. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/V4.2-BUG-FIX/root@58138 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- source/java/org/alfresco/web/ui/common/component/UIMenu.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/java/org/alfresco/web/ui/common/component/UIMenu.java b/source/java/org/alfresco/web/ui/common/component/UIMenu.java index b01aa639b0..ed9b8f8035 100644 --- a/source/java/org/alfresco/web/ui/common/component/UIMenu.java +++ b/source/java/org/alfresco/web/ui/common/component/UIMenu.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2012 Alfresco Software Limited. + * Copyright (C) 2005-2013 Alfresco Software Limited. * * This file is part of Alfresco * @@ -86,7 +86,8 @@ public class UIMenu extends SelfRenderingComponent out.write(menuId); // NOTE: the use of "*width:0px" is an IE6/7 specific hack to ensure that the CSS is processed // only by IE (which needs the width value) and _not_ FireFox which doesn't...! - out.write("' style=\"position:absolute;display:none;padding-left:2px;*width:0px\">"); + // Changed the width to "auto" to support IE 10, see MNT-10027 + out.write("' style=\"position:absolute;display:none;padding-left:2px;*width:auto\">"); out.write(" Date: Fri, 22 Nov 2013 12:33:40 +0000 Subject: [PATCH 14/29] Merged DEV to V4.2-BUG-FIX (4.2.1) 49098 : MNT-7059 : Search description in search result not sensible when using only advanced fields. - Added a method, that get a search value by fields "title", "description", "author" for advanced search in Alfresco Explorer git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/V4.2-BUG-FIX/root@58139 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../web/bean/search/SearchContext.java | 40 +++++++++++++++++++ source/web/jsp/browse/browse.jsp | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/source/java/org/alfresco/web/bean/search/SearchContext.java b/source/java/org/alfresco/web/bean/search/SearchContext.java index 53c793202f..fcd5a1ed56 100644 --- a/source/java/org/alfresco/web/bean/search/SearchContext.java +++ b/source/java/org/alfresco/web/bean/search/SearchContext.java @@ -39,6 +39,7 @@ import org.alfresco.service.cmr.repository.Path; import org.alfresco.service.namespace.NamespaceService; import org.alfresco.service.namespace.QName; import org.alfresco.util.ISO9075; +import org.alfresco.web.app.Application; import org.alfresco.web.bean.repository.Repository; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -648,6 +649,45 @@ public class SearchContext implements Serializable this.mode = mode; } + public String getSearchText() + { + if (this.text != null && this.text.trim().length() > 0) + { + return getText(); + } + StringBuilder res = new StringBuilder(); + for (QName attrName : this.queryAttributes.keySet()) + { + if (ContentModel.PROP_TITLE.isMatch(attrName)) + { + res.append(res.length() > 0 ? ", " : ""); + res.append(Application.getMessage(FacesContext.getCurrentInstance(), "title")); + res.append(": "); + res.append(this.queryAttributes.get(attrName)); + } + else if (ContentModel.PROP_DESCRIPTION.isMatch(attrName)) + { + res.append(res.length() > 0 ? ", " : ""); + res.append(Application.getMessage(FacesContext.getCurrentInstance(), "description")); + res.append(": "); + res.append(this.queryAttributes.get(attrName)); + } + else if (ContentModel.PROP_AUTHOR.isMatch(attrName)) + { + res.append(res.length() > 0 ? ", " : ""); + res.append(Application.getMessage(FacesContext.getCurrentInstance(), "author")); + res.append(": "); + res.append(this.queryAttributes.get(attrName)); + } + else + { + res.append(res.length() > 0 ? ", " : ""); + res.append(this.queryAttributes.get(attrName)); + } + } + return res.toString(); + } + /** * @return Returns the search text string. */ diff --git a/source/web/jsp/browse/browse.jsp b/source/web/jsp/browse/browse.jsp index c1a7821008..c8f73def6c 100644 --- a/source/web/jsp/browse/browse.jsp +++ b/source/web/jsp/browse/browse.jsp @@ -153,7 +153,7 @@
<%-- Summary --%>
-
+
From 357d8b96713fdcbf5ab5a3ac41647dff57a3125f Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Fri, 22 Nov 2013 17:27:02 +0000 Subject: [PATCH 15/29] Merged V4.1-BUG-FIX (4.1.8) to V4.2-BUG-FIX (4.2.1) 58177: Merged V3.4-BUG-FIX (3.4.14) to V4.1-BUG-FIX (4.1.8) 57174: Merged DEV to V3.4-BUG-FIX (3.4.14) 56813: MNT-9749: AVM - copy and pasted link in TinyMCE (xs:string) renders full url and not relative URL in Firefox - Remove current host:port from links. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/V4.2-BUG-FIX/root@58182 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- config/alfresco/web-client-config-wcm.xml | 2 +- source/web/scripts/ajax/tiny_mce_wcm_extensions.js | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/config/alfresco/web-client-config-wcm.xml b/config/alfresco/web-client-config-wcm.xml index 1065310863..41078f2394 100644 --- a/config/alfresco/web-client-config-wcm.xml +++ b/config/alfresco/web-client-config-wcm.xml @@ -64,7 +64,7 @@ true p true - table + table,paste tablecontrols + productionModetrueVaadin production mode CMIS security context cleaning filter @@ -380,7 +380,7 @@ com.sun.xml.ws.transport.http.servlet.WSServletContextListener - + org.springframework.web.context.request.RequestContextListener @@ -631,7 +631,7 @@ - + Vaadin Application Servletorg.activiti.explorer.servlet.ExplorerApplicationServlet Faces Servlet @@ -831,7 +831,8 @@ CMISTCK --> - + Vaadin Application Servlet/activiti-admin/* + Vaadin Application Servlet/VAADIN/* 60 diff --git a/source/web/jsp/dialog/about.jsp b/source/web/jsp/dialog/about.jsp index 97a7406e78..7c39594001 100644 --- a/source/web/jsp/dialog/about.jsp +++ b/source/web/jsp/dialog/about.jsp @@ -1,218 +1,202 @@ -<%-- - * Copyright (C) 2005-2014 Alfresco Software Limited. - * - * This file is part of Alfresco - * - * Alfresco is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Alfresco 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . ---%> -<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> -<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> - -<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> -<%@ page isELIgnored="false" %> -<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> - - - - - - -
- -
- Alfresco -
-
- http://www.alfresco.com -

- Alfresco Software Inc. © 2005-2014 All rights reserved. Legal and License -

- -
- Alfresco Software utilises components or libraries from the following software vendors and companies -
- -

 

- -
- - Spring Framework - - - Mybatis - - - Ibatis - -
-
- - The Apache Software Foundation - -
-
- - The Apache Jakarta Project - -
-
- - Java - - - JBoss - - - My Faces - -
-
- - Lucene - - - Solr - - - Hazelcast - - - Code Generation Library - -
-
- - PDFBox - - - TinyMCE - - - LibreOffice - - - JooReports - - - FreeMarker - -
- -

 

-

 

- -
- Alfresco Development tools: -
- -
- - Subversion - - - eclipse - -
- -

 

-

 

- -
- Alfresco Software contributors -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Meta Data Extraction Framework and PDF/Open Office Format meta data extraction: -  •  - Jesper Steen Møller -
- Open Document Format meta data extraction: -  •  - Antti Jokipii -
- Multilingual Document Management: -  •  - CEC -
- Category Browsing: -  •  - Atol Conseils et Développements -
- Fixes and improvements: -  •  - Ray Gauss II, - Dave Gillen, - Michael Kriske, - Carina Lansing, - DMC.de, - Optaros -
- Language and translation packs: -  •  - Camille Bégnis, - Andrejus Chaliapinas, - Laurent Genier, - Antti Jokipii, - Henning Kristensen, - Betty Mai, - Fabian Mandelbaum, - Theodoros Papageorgiou, - Helio Silvio Piccinatto, - Gian Luca Farina Perseu, - Alex Revesz, - Christian Roy, - Philippe Seillier, - Frank Shipley, - Michiel Steltman, - Gert Thiel, - cnalfresco -
- -
-
+<%-- + * Copyright (C) 2005-2014 Alfresco Software Limited. + * + * This file is part of Alfresco + * + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Alfresco 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . +--%> +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> +<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> + +<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> +<%@ page isELIgnored="false" %> +<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> + + + + + + +
+ +
+ Alfresco +
+
+ http://www.alfresco.com +

+ Alfresco Software Inc. © 2005-2014 All rights reserved. Legal and License +

+ +
+ Alfresco Software utilises components or libraries from the following software vendors and companies +
+ +

 

+ +
+ + Spring Framework + + + Mybatis + + + Ibatis + +
+
+ + The Apache Software Foundation + +
+
+ + The Apache Jakarta Project + +
+
+ + Java + + + JBoss + + + My Faces + +
+
+ + Lucene + + + Solr + + + Hazelcast + + + Code Generation Library + +
+
+ + PDFBox + + + TinyMCE + + + LibreOffice + + + JooReports + + + FreeMarker + +
+ +

 

+

 

+ +
+ Alfresco Development tools: +
+ +
+ + Subversion + + + eclipse + +
+ +

 

+

 

+ +
+ Alfresco Software contributors +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Meta Data Extraction Framework and PDF/Open Office Format meta data extraction: +  •  + Jesper Steen Møller +
+ Open Document Format meta data extraction: +  •  + Antti Jokipii +
+ Multilingual Document Management: +  •  + CEC +
+ Category Browsing: +  •  + Atol Conseils et Développements +
+ Fixes and improvements: +  •  + Ray Gauss II, + Dave Gillen, + Michael Kriske, + Carina Lansing, + DMC.de, + Optaros +
+ Supported language packs: +  •  + French, German, Italian, (European) Spanish and Japanese. +
+ +
+
\ No newline at end of file From bf6a628aa2d3bdd5868e63e906273642d4e5f12c Mon Sep 17 00:00:00 2001 From: Pavel Yurke Date: Wed, 8 Jan 2014 11:24:59 +0000 Subject: [PATCH 25/29] Reverse Merged - Wrong commit was made 59504 : MNT-10255: Merged DEV to V4.2-BUG-FIX (4.2.1). 59393: MNT-10255 Mac OS -CIFS: Collaborator/editor can delete content created by other site members after editing. - In ScenarioTempDeleteShuffle.createInstance() was added check: (operation instanceof MoveFileOperation). git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/V4.2-BUG-FIX/root@59507 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../org/alfresco/web/ui/repo/tag/PageTag.java | 772 +++++++++--------- source/web/WEB-INF/web.xml | 9 +- source/web/jsp/dialog/about.jsp | 418 +++++----- 3 files changed, 613 insertions(+), 586 deletions(-) diff --git a/source/java/org/alfresco/web/ui/repo/tag/PageTag.java b/source/java/org/alfresco/web/ui/repo/tag/PageTag.java index aa2697e234..3f1b47c078 100644 --- a/source/java/org/alfresco/web/ui/repo/tag/PageTag.java +++ b/source/java/org/alfresco/web/ui/repo/tag/PageTag.java @@ -1,380 +1,392 @@ -/* - * Copyright (C) 2005-2014 Alfresco Software Limited. - * - * This file is part of Alfresco - * - * Alfresco is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Alfresco 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . - */ - -/* Enterprise overlay */ - -package org.alfresco.web.ui.repo.tag; - -import java.io.IOException; -import java.io.Writer; - -import javax.faces.context.FacesContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.jsp.JspException; -import javax.servlet.jsp.tagext.TagSupport; - -import org.alfresco.web.app.Application; -import org.alfresco.web.app.servlet.FacesHelper; -import org.alfresco.web.bean.coci.CCProperties; -import org.alfresco.web.config.ClientConfigElement; -import org.alfresco.web.ui.common.Utils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * A non-JSF tag library that adds the HTML begin and end tags if running in servlet mode - * - * @author gavinc - */ -public class PageTag extends TagSupport -{ - private static final long serialVersionUID = 8142765393181557228L; - - private final static String SCRIPTS_START = "\n"; - private final static String STYLES_START = "\n"; - - private final static String[] SCRIPTS = - { - // menu javascript - "/scripts/menu.js", - // webdav javascript - "/scripts/webdav.js", - // base yahoo file - "/scripts/ajax/yahoo/yahoo/yahoo-min.js", - // io handling (AJAX) - "/scripts/ajax/yahoo/connection/connection-min.js", - // event handling - "/scripts/ajax/yahoo/event/event-min.js", - // mootools - "/scripts/ajax/mootools.v1.11.js", - // common Alfresco util methods - "/scripts/ajax/common.js", - // pop-up panel helper objects - "/scripts/ajax/summary-info.js", - // ajax pickers - "/scripts/ajax/picker.js", - "/scripts/ajax/tagger.js", - // validation handling - "/scripts/validation.js" - }; - - private final static String[] CSS = - { - "/css/main.css", - "/css/picker.css" - }; - -/** - * Please ensure you understand the terms of the license before changing the contents of this file. - */ - - private final static String ALF_URL = "http://www.alfresco.com"; - private final static String ALF_LOGO = "/images/logo/alfresco_enterprise.gif"; - private final static String ALF_TEXT = "Alfresco Enterprise"; - private final static String ALF_COPY = "Certified and supported. Alfresco Software Inc. © 2005-2014 All rights reserved."; - - private final static Log logger = LogFactory.getLog(PageTag.class); - private static String alfresco = null; - private static String loginPage = null; - - private long startTime = 0; - private String title; - private String titleId; - private String doctypeRootElement; - private String doctypePublic; - private String doctypeSystem; - - /** - * @return The title for the page - */ - public String getTitle() - { - return title; - } - - /** - * @param title Sets the page title - */ - public void setTitle(String title) - { - this.title = title; - } - - /** - * @return The title message Id for the page - */ - public String getTitleId() - { - return titleId; - } - - /** - * @param titleId Sets the page title message Id - */ - public void setTitleId(String titleId) - { - this.titleId = titleId; - } - - public String getDoctypeRootElement() - { - return this.doctypeRootElement; - } - - public void setDoctypeRootElement(final String doctypeRootElement) - { - this.doctypeRootElement = doctypeRootElement; - } - - public String getDoctypePublic() - { - return this.doctypePublic; - } - - public void setDoctypePublic(final String doctypePublic) - { - this.doctypePublic = doctypePublic; - } - - public String getDoctypeSystem() - { - return this.doctypeSystem; - } - - public void setDoctypeSystem(final String doctypeSystem) - { - this.doctypeSystem = doctypeSystem; - } - - public void release() - { - super.release(); - this.title = null; - this.titleId = null; - this.doctypeRootElement = null; - this.doctypeSystem = null; - this.doctypePublic = null; - } - - /** - * @see javax.servlet.jsp.tagext.TagSupport#doStartTag() - */ - public int doStartTag() throws JspException - { - if (logger.isDebugEnabled()) - startTime = System.currentTimeMillis(); - - try - { - String reqPath = ((HttpServletRequest)pageContext.getRequest()).getContextPath(); - Writer out = pageContext.getOut(); - - if (!Application.inPortalServer()) - { - if (this.getDoctypeRootElement() != null && - this.getDoctypePublic() != null) - { - out.write("\n"); - } - else - { - out.write("\n"); - } - out.write(""); - out.write("\n"); - out.write(""); - if (this.titleId != null && this.titleId.length() != 0) - { - out.write(Utils.encode(Application.getMessage(pageContext.getSession(), this.titleId))); - } - else if (this.title != null && this.title.length() != 0) - { - out.write(Utils.encode(this.title)); - } - else - { - out.write("Alfresco Web Client"); - } - out.write("\n"); - out.write("\n"); - out.write("\n"); - } - - // CSS style includes - for (final String css : PageTag.CSS) - { - out.write(STYLES_START); - out.write(reqPath); - out.write(css); - out.write(STYLES_MAIN); - } - - // JavaScript includes - for (final String s : PageTag.SCRIPTS) - { - out.write(SCRIPTS_START); - out.write(reqPath); - out.write(s); - out.write(SCRIPTS_END); - } - - out.write("\n"); // end - generate naked javascript code - - if (!Application.inPortalServer()) - { - out.write(""); - out.write("\n"); - } - } - catch (IOException ioe) - { - throw new JspException(ioe.toString()); - } - - return EVAL_BODY_INCLUDE; - } - - /** - * @see javax.servlet.jsp.tagext.TagSupport#doEndTag() - */ - public int doEndTag() throws JspException - { - try - { - HttpServletRequest req = (HttpServletRequest)pageContext.getRequest(); - if (req.getRequestURI().endsWith(getLoginPage()) == false) - { - pageContext.getOut().write(getAlfrescoButton()); - } - - if (!Application.inPortalServer()) - { - pageContext.getOut().write("\n"); - } - } - catch (IOException ioe) - { - throw new JspException(ioe.toString()); - } - - if (logger.isDebugEnabled()) - { - long endTime = System.currentTimeMillis(); - logger.debug("Time to generate page: " + (endTime - startTime) + "ms"); - } - - return super.doEndTag(); - } - - private String getLoginPage() - { - if (PageTag.loginPage == null) - { - PageTag.loginPage = Application.getLoginPage(pageContext.getServletContext()); - } - - return PageTag.loginPage; - } - -/** - * Please ensure you understand the terms of the license before changing the contents of this file. - */ - - private String getAlfrescoButton() - { - if (PageTag.alfresco == null) - { - final String reqPath = ((HttpServletRequest)pageContext.getRequest()).getContextPath(); - PageTag.alfresco = ("
" + - "" + - "" + - "" + - "" + ALF_COPY + - "
"); - } - return PageTag.alfresco; - } - - /** - * This method generate code for setting window.onload reference as - * we need to open WebDav or CIFS URL in a new window. - * - * Executes via javascript code(function onloadFunc()) in "onload.js" include file. - * - * @return Returns window.onload javascript code - */ - private static void generateWindowOnloadCode(Writer out) - throws IOException - { - FacesContext fc = FacesContext.getCurrentInstance(); - if (fc != null) - { - CCProperties ccProps = (CCProperties)FacesHelper.getManagedBean(fc, "CCProperties"); - if (ccProps.getWebdavUrl() != null || ccProps.getCifsPath() != null) - { - out.write("window.onload=function(){onloadFunc(\""); - if (ccProps.getWebdavUrl() != null) - { - out.write(ccProps.getWebdavUrl()); - } - out.write("\",\""); - if (ccProps.getCifsPath() != null) - { - String val = ccProps.getCifsPath(); - val = Utils.replace(val, "\\", "\\\\"); // encode escape character - out.write(val); - } - out.write("\");};"); - - // reset session bean state - ccProps.setCifsPath(null); - ccProps.setWebdavUrl(null); - } - } - } -} +/* + * Copyright (C) 2005-2014 Alfresco Software Limited. + * + * This file is part of Alfresco + * + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Alfresco 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +/* + * There is an Enterprise overlay for this file + */ + +package org.alfresco.web.ui.repo.tag; + +import java.io.IOException; +import java.io.Writer; + +import javax.faces.context.FacesContext; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.tagext.TagSupport; + +import org.alfresco.web.app.Application; +import org.alfresco.web.app.servlet.FacesHelper; +import org.alfresco.web.bean.coci.CCProperties; +import org.alfresco.web.config.ClientConfigElement; +import org.alfresco.web.ui.common.Utils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * A non-JSF tag library that adds the HTML begin and end tags if running in servlet mode + * + * @author gavinc + */ +public class PageTag extends TagSupport +{ + private static final long serialVersionUID = 8142765393181557228L; + + private final static String SCRIPTS_START = "\n"; + private final static String STYLES_START = "\n"; + + private final static String[] SCRIPTS = + { + // menu javascript + "/scripts/menu.js", + // webdav javascript + "/scripts/webdav.js", + // base yahoo file + "/scripts/ajax/yahoo/yahoo/yahoo-min.js", + // io handling (AJAX) + "/scripts/ajax/yahoo/connection/connection-min.js", + // event handling + "/scripts/ajax/yahoo/event/event-min.js", + // mootools + "/scripts/ajax/mootools.v1.11.js", + // common Alfresco util methods + "/scripts/ajax/common.js", + // pop-up panel helper objects + "/scripts/ajax/summary-info.js", + // ajax pickers + "/scripts/ajax/picker.js", + "/scripts/ajax/tagger.js", + // validation handling + "/scripts/validation.js" + }; + + private final static String[] CSS = + { + "/css/main.css", + "/css/picker.css" + }; + +/** + * Please ensure you understand the terms of the license before changing the contents of this file. + */ + + private final static String ALF_LOGO_HTTP = "http://www.alfresco.com/assets/images/logos/community-4.2.png"; + private final static String ALF_LOGO_HTTPS = "https://www.alfresco.com/assets/images/logos/community-4.2.png"; + private final static String ALF_URL = "http://www.alfresco.com"; + private final static String ALF_TEXT = "Alfresco Community"; + private final static String ALF_COPY = "Supplied free of charge with " + + "no support, " + + "no certification, " + + "no maintenance, " + + "no warranty and " + + "no indemnity by " + + "Alfresco or its " + + "Certified Partners. " + + "Click here for support. " + + "Alfresco Software Inc. © 2005-2014 All rights reserved."; + + private final static Log logger = LogFactory.getLog(PageTag.class); + private static String alfresco = null; + private static String loginPage = null; + + private long startTime = 0; + private String title; + private String titleId; + private String doctypeRootElement; + private String doctypePublic; + private String doctypeSystem; + + /** + * @return The title for the page + */ + public String getTitle() + { + return title; + } + + /** + * @param title Sets the page title + */ + public void setTitle(String title) + { + this.title = title; + } + + /** + * @return The title message Id for the page + */ + public String getTitleId() + { + return titleId; + } + + /** + * @param titleId Sets the page title message Id + */ + public void setTitleId(String titleId) + { + this.titleId = titleId; + } + + public String getDoctypeRootElement() + { + return this.doctypeRootElement; + } + + public void setDoctypeRootElement(final String doctypeRootElement) + { + this.doctypeRootElement = doctypeRootElement; + } + + public String getDoctypePublic() + { + return this.doctypePublic; + } + + public void setDoctypePublic(final String doctypePublic) + { + this.doctypePublic = doctypePublic; + } + + public String getDoctypeSystem() + { + return this.doctypeSystem; + } + + public void setDoctypeSystem(final String doctypeSystem) + { + this.doctypeSystem = doctypeSystem; + } + + public void release() + { + super.release(); + this.title = null; + this.titleId = null; + this.doctypeRootElement = null; + this.doctypeSystem = null; + this.doctypePublic = null; + } + + /** + * @see javax.servlet.jsp.tagext.TagSupport#doStartTag() + */ + public int doStartTag() throws JspException + { + if (logger.isDebugEnabled()) + startTime = System.currentTimeMillis(); + + try + { + String reqPath = ((HttpServletRequest)pageContext.getRequest()).getContextPath(); + Writer out = pageContext.getOut(); + + if (!Application.inPortalServer()) + { + if (this.getDoctypeRootElement() != null && + this.getDoctypePublic() != null) + { + out.write("\n"); + } + else + { + out.write("\n"); + } + out.write(""); + out.write("\n"); + out.write(""); + if (this.titleId != null && this.titleId.length() != 0) + { + out.write(Utils.encode(Application.getMessage(pageContext.getSession(), this.titleId))); + } + else if (this.title != null && this.title.length() != 0) + { + out.write(Utils.encode(this.title)); + } + else + { + out.write("Alfresco Web Client"); + } + out.write("\n"); + out.write("\n"); + out.write("\n"); + } + + // CSS style includes + for (final String css : PageTag.CSS) + { + out.write(STYLES_START); + out.write(reqPath); + out.write(css); + out.write(STYLES_MAIN); + } + + // JavaScript includes + for (final String s : PageTag.SCRIPTS) + { + out.write(SCRIPTS_START); + out.write(reqPath); + out.write(s); + out.write(SCRIPTS_END); + } + + out.write("\n"); // end - generate naked javascript code + + if (!Application.inPortalServer()) + { + out.write(""); + out.write("\n"); + } + } + catch (IOException ioe) + { + throw new JspException(ioe.toString()); + } + + return EVAL_BODY_INCLUDE; + } + + /** + * @see javax.servlet.jsp.tagext.TagSupport#doEndTag() + */ + public int doEndTag() throws JspException + { + try + { + HttpServletRequest req = (HttpServletRequest)pageContext.getRequest(); + if (req.getRequestURI().endsWith(getLoginPage()) == false) + { + pageContext.getOut().write(getAlfrescoButton()); + } + + if (!Application.inPortalServer()) + { + pageContext.getOut().write("\n"); + } + } + catch (IOException ioe) + { + throw new JspException(ioe.toString()); + } + + if (logger.isDebugEnabled()) + { + long endTime = System.currentTimeMillis(); + logger.debug("Time to generate page: " + (endTime - startTime) + "ms"); + } + + return super.doEndTag(); + } + + private String getLoginPage() + { + if (PageTag.loginPage == null) + { + PageTag.loginPage = Application.getLoginPage(pageContext.getServletContext()); + } + + return PageTag.loginPage; + } + +/** + * Please ensure you understand the terms of the license before changing the contents of this file. + */ + + private String getAlfrescoButton() + { + if (PageTag.alfresco == null) + { + final HttpServletRequest req = (HttpServletRequest)pageContext.getRequest(); + PageTag.alfresco = ("
" + + "" + + "" +"" + + "" + ALF_COPY + + "
"); + } + return PageTag.alfresco; + } + + /** + * This method generate code for setting window.onload reference as + * we need to open WebDav or CIFS URL in a new window. + * + * Executes via javascript code(function onloadFunc()) in "onload.js" include file. + * + * @return Returns window.onload javascript code + */ + private static void generateWindowOnloadCode(Writer out) + throws IOException + { + FacesContext fc = FacesContext.getCurrentInstance(); + if (fc != null) + { + CCProperties ccProps = (CCProperties)FacesHelper.getManagedBean(fc, "CCProperties"); + if (ccProps.getWebdavUrl() != null || ccProps.getCifsPath() != null) + { + out.write("window.onload=function(){onloadFunc(\""); + if (ccProps.getWebdavUrl() != null) + { + out.write(ccProps.getWebdavUrl()); + } + out.write("\",\""); + if (ccProps.getCifsPath() != null) + { + String val = ccProps.getCifsPath(); + val = Utils.replace(val, "\\", "\\\\"); // encode escape character + out.write(val); + } + out.write("\");};"); + + // reset session bean state + ccProps.setCifsPath(null); + ccProps.setWebdavUrl(null); + } + } + } +} diff --git a/source/web/WEB-INF/web.xml b/source/web/WEB-INF/web.xml index b46f9368ca..04209ba9b9 100644 --- a/source/web/WEB-INF/web.xml +++ b/source/web/WEB-INF/web.xml @@ -100,7 +100,7 @@ false - productionModetrueVaadin production mode + CMIS security context cleaning filter @@ -380,7 +380,7 @@ com.sun.xml.ws.transport.http.servlet.WSServletContextListener - org.springframework.web.context.request.RequestContextListener + @@ -631,7 +631,7 @@ - Vaadin Application Servletorg.activiti.explorer.servlet.ExplorerApplicationServlet + Faces Servlet @@ -831,8 +831,7 @@ CMISTCK --> - Vaadin Application Servlet/activiti-admin/* - Vaadin Application Servlet/VAADIN/* + 60 diff --git a/source/web/jsp/dialog/about.jsp b/source/web/jsp/dialog/about.jsp index 7c39594001..97a7406e78 100644 --- a/source/web/jsp/dialog/about.jsp +++ b/source/web/jsp/dialog/about.jsp @@ -1,202 +1,218 @@ -<%-- - * Copyright (C) 2005-2014 Alfresco Software Limited. - * - * This file is part of Alfresco - * - * Alfresco is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Alfresco 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . ---%> -<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> -<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> - -<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> -<%@ page isELIgnored="false" %> -<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> - - - - - - -
- -
- Alfresco -
-
- http://www.alfresco.com -

- Alfresco Software Inc. © 2005-2014 All rights reserved. Legal and License -

- -
- Alfresco Software utilises components or libraries from the following software vendors and companies -
- -

 

- -
- - Spring Framework - - - Mybatis - - - Ibatis - -
-
- - The Apache Software Foundation - -
-
- - The Apache Jakarta Project - -
-
- - Java - - - JBoss - - - My Faces - -
-
- - Lucene - - - Solr - - - Hazelcast - - - Code Generation Library - -
-
- - PDFBox - - - TinyMCE - - - LibreOffice - - - JooReports - - - FreeMarker - -
- -

 

-

 

- -
- Alfresco Development tools: -
- -
- - Subversion - - - eclipse - -
- -

 

-

 

- -
- Alfresco Software contributors -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Meta Data Extraction Framework and PDF/Open Office Format meta data extraction: -  •  - Jesper Steen Møller -
- Open Document Format meta data extraction: -  •  - Antti Jokipii -
- Multilingual Document Management: -  •  - CEC -
- Category Browsing: -  •  - Atol Conseils et Développements -
- Fixes and improvements: -  •  - Ray Gauss II, - Dave Gillen, - Michael Kriske, - Carina Lansing, - DMC.de, - Optaros -
- Supported language packs: -  •  - French, German, Italian, (European) Spanish and Japanese. -
- -
-
+<%-- + * Copyright (C) 2005-2014 Alfresco Software Limited. + * + * This file is part of Alfresco + * + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Alfresco 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . +--%> +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> +<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> + +<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> +<%@ page isELIgnored="false" %> +<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> + + + + + + +
+ +
+ Alfresco +
+
+ http://www.alfresco.com +

+ Alfresco Software Inc. © 2005-2014 All rights reserved. Legal and License +

+ +
+ Alfresco Software utilises components or libraries from the following software vendors and companies +
+ +

 

+ +
+ + Spring Framework + + + Mybatis + + + Ibatis + +
+
+ + The Apache Software Foundation + +
+
+ + The Apache Jakarta Project + +
+
+ + Java + + + JBoss + + + My Faces + +
+
+ + Lucene + + + Solr + + + Hazelcast + + + Code Generation Library + +
+
+ + PDFBox + + + TinyMCE + + + LibreOffice + + + JooReports + + + FreeMarker + +
+ +

 

+

 

+ +
+ Alfresco Development tools: +
+ +
+ + Subversion + + + eclipse + +
+ +

 

+

 

+ +
+ Alfresco Software contributors +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Meta Data Extraction Framework and PDF/Open Office Format meta data extraction: +  •  + Jesper Steen Møller +
+ Open Document Format meta data extraction: +  •  + Antti Jokipii +
+ Multilingual Document Management: +  •  + CEC +
+ Category Browsing: +  •  + Atol Conseils et Développements +
+ Fixes and improvements: +  •  + Ray Gauss II, + Dave Gillen, + Michael Kriske, + Carina Lansing, + DMC.de, + Optaros +
+ Language and translation packs: +  •  + Camille Bégnis, + Andrejus Chaliapinas, + Laurent Genier, + Antti Jokipii, + Henning Kristensen, + Betty Mai, + Fabian Mandelbaum, + Theodoros Papageorgiou, + Helio Silvio Piccinatto, + Gian Luca Farina Perseu, + Alex Revesz, + Christian Roy, + Philippe Seillier, + Frank Shipley, + Michiel Steltman, + Gert Thiel, + cnalfresco +
+ +
+
\ No newline at end of file From 40b4d6ababe826920b55c3663f0b5d5685de65d7 Mon Sep 17 00:00:00 2001 From: Tatyana Valkevych Date: Wed, 8 Jan 2014 13:42:27 +0000 Subject: [PATCH 26/29] Merged V4.1-BUG-FIX (4.1.8) to V4.2-BUG-FIX (4.2.1) 59442: Merged DEV to V4.1-BUG-FIX (4.1.8) 59317: MNT-9900 : Alfresco Explorer is using URL Encoding when downloading a file Removed additional encoding of file name for IE browser. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/V4.2-BUG-FIX/root@59519 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../web/app/servlet/BaseDownloadContentServlet.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/source/java/org/alfresco/web/app/servlet/BaseDownloadContentServlet.java b/source/java/org/alfresco/web/app/servlet/BaseDownloadContentServlet.java index 3509065c6d..ae20e69175 100644 --- a/source/java/org/alfresco/web/app/servlet/BaseDownloadContentServlet.java +++ b/source/java/org/alfresco/web/app/servlet/BaseDownloadContentServlet.java @@ -390,11 +390,7 @@ public abstract class BaseDownloadContentServlet extends BaseServlet // IE requires that "Content-Disposition" header in case of "attachment" type should include // "filename" part. See MNT-9900 String userAgent = req.getHeader(HEADER_USER_AGENT); - if (userAgent != null && userAgent.toLowerCase().contains("msie")) - { - res.setHeader(HEADER_CONTENT_DISPOSITION, "attachment; filename=\"" + URLEncoder.encode(filename) + "\""); - } - else if (userAgent != null && (userAgent.toLowerCase().contains("firefox") || userAgent.toLowerCase().contains("safari"))) + if (userAgent != null && (userAgent.toLowerCase().contains("firefox") || userAgent.toLowerCase().contains("safari"))) { res.setHeader(HEADER_CONTENT_DISPOSITION, "attachment; filename=\"" + URLDecoder.decode(filename) + "\""); } From 7a0c91dbd583180b94b8123998b6b355e6529156 Mon Sep 17 00:00:00 2001 From: Samuel Langlois Date: Wed, 8 Jan 2014 16:55:44 +0000 Subject: [PATCH 27/29] MNT-10118 Fix Maven dependencies to web-framework-commons Deploy alfresco-web-framework-commons jar one more time in Maven Repo with a 'classes' classifier, and declare its war dependency as optional, so that both Ant and Maven builds succeed. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/V4.2-BUG-FIX/root@59560 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- pom.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pom.xml b/pom.xml index 7f0de6cad9..29003a74a4 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,6 @@ alfresco-web-framework-commons ${project.version} classes - provided ${project.groupId} @@ -170,13 +169,10 @@ standard 1.1.0 - - org.apache.chemistry.opencmis chemistry-opencmis-test-browser ${dependency.opencmis.version} - provided From 4c439e9facdb9b2c7eb2709ce709adc60f469111 Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Sat, 1 Feb 2014 20:05:48 +0000 Subject: [PATCH 28/29] MNT-10589: Merged V4.2-BUG-FIX (4.2.2) to V4.2.1 (4.2.1) 60891: Merged BRANCHES/DEV/V4.1-BUG-FIX to BRANCHES/DEV/V4.2-BUG-FIX: 60889: Merged BRANCHES/DEV/V3.4-BUG-FIX to BRANCHES/DEV/V4.1-BUG-FIX: 60873: MNT-10560: Security: The Apache Xerces XML parser exposes security vulnerabilities 60876: MNT-10560: Security: The Apache Xerces XML parser exposes security vulnerabilities 60887: MNT-10560: Security: The Apache Xerces XML parser exposes security vulnerabilities git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/PATCHES/V4.2.1/root@60909 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- source/java/org/alfresco/web/forms/FormDataFunctions.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/java/org/alfresco/web/forms/FormDataFunctions.java b/source/java/org/alfresco/web/forms/FormDataFunctions.java index 1c46483ca5..a1838ac924 100644 --- a/source/java/org/alfresco/web/forms/FormDataFunctions.java +++ b/source/java/org/alfresco/web/forms/FormDataFunctions.java @@ -30,6 +30,7 @@ import org.alfresco.model.WCMAppModel; import org.alfresco.repo.domain.PropertyValue; import org.alfresco.service.cmr.avm.AVMNodeDescriptor; import org.alfresco.service.cmr.remote.AVMRemote; +import org.alfresco.util.XMLUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.w3c.dom.Document; @@ -147,10 +148,8 @@ public class FormDataFunctions DocumentBuilderFactory localDbf = dbf.get(); if (localDbf == null) { - localDbf = DocumentBuilderFactory.newInstance(); + localDbf = XMLUtil.getDocumentBuilderFactory(true, false); } - localDbf.setNamespaceAware(true); - localDbf.setValidating(false); dbf.set(localDbf); DocumentBuilder builder = localDbf.newDocumentBuilder(); result = builder.parse(is); From 2ddad25b14cff29603514070b83747ae3a2fbb6a Mon Sep 17 00:00:00 2001 From: Brian Remmington Date: Tue, 18 Feb 2014 11:06:27 +0000 Subject: [PATCH 29/29] MNT-10722: Fixed up Eclipse classpath on data-model and web-client projects to use patched Xerces lib and new XML factory lib git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/PATCHES/V4.2.1/root@62725 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .classpath | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.classpath b/.classpath index 0b2ff431b3..8a024fcc43 100644 --- a/.classpath +++ b/.classpath @@ -9,7 +9,8 @@ - + +