diff --git a/.classpath b/.classpath index dcad915cad..0b2ff431b3 100644 --- a/.classpath +++ b/.classpath @@ -1,6 +1,7 @@ + @@ -8,7 +9,7 @@ - + diff --git a/config/alfresco/messages/portlets_nb_NO.properties b/config/alfresco/messages/portlets_nb_NO.properties index 0370247320..29deb657f7 100755 --- a/config/alfresco/messages/portlets_nb_NO.properties +++ b/config/alfresco/messages/portlets_nb_NO.properties @@ -16,7 +16,7 @@ portlets.doclist.pdf_documents=PDF-dokumenter portlets.doclist.recently_modified=Nylig modifisert portlets.panel.description=Beskrivelse -portlets.panel.modified=Endret +portlets.panel.modified=Modifisert portlets.panel.modified_by=Modifisert av portlets.panel.created=Opprettet portlets.panel.created_by=Opprettet av: diff --git a/config/alfresco/messages/webclient_de.properties b/config/alfresco/messages/webclient_de.properties index 52db9441e5..ca01c21435 100644 --- a/config/alfresco/messages/webclient_de.properties +++ b/config/alfresco/messages/webclient_de.properties @@ -1738,7 +1738,7 @@ edit_properties=Eigenschaften des Inhalts bearbeiten save_changes=\u00c4nderungen speichern no_tasks=Keine Aufgaben gefunden. no_resources=Keine Ressourcen gefunden. -in_progress=l\u00e4uft +in_progress=in Bearbeitung by=von assignee=Bevollm\u00e4chtigter comment=Kommentar diff --git a/config/alfresco/messages/webclient_nb_NO.properties b/config/alfresco/messages/webclient_nb_NO.properties index b05d3644ca..8b5cbc2cc5 100755 --- a/config/alfresco/messages/webclient_nb_NO.properties +++ b/config/alfresco/messages/webclient_nb_NO.properties @@ -65,7 +65,7 @@ step3_edition_summary_desc=Tredje trinn, vis sammendrag av den nye utgaven step2_new_edition_summary_title=Andre trinn - Sammendrag step3_new_edition_summary_title=Tredje trinn - Sammendrag new_edition_summary_desc=Informasjonen du skrev inn, vises nedenfor. -new_edition_finish_instruction=Hvis du vil lukke denne veiviseren og bruke endringene, klikker du Avslutt. +new_edition_finish_instruction=Klikk p\u00e5 Fullf\u00f8rt for \u00e5 lukke denne veiviseren og bruke endringene dine. edition_properties=Egenskaper for utgave edition_notes=Utgavemerknader modify_translation_properties=Endre oversettelsesegenskapene n\u00e5r denne veiviseren er ferdig. @@ -90,9 +90,9 @@ view_versioned_properties=Egenskaper fra versjonsinnhold view_versioned_properties_description=Vis egenskapene for et versjonsinnhold. # Date Pattern -date_pattern=d. MMMM \u00e5\u00e5\u00e5\u00e5 -date_time_pattern=d. MMMM \u00e5\u00e5\u00e5\u00e5 kl. TT.mm -time_pattern=TT.mm +date_pattern=d MMMM yyyy +date_time_pattern=d MMMM yyyy HH:mm +time_pattern=HH:mm # General UI product_name=Alfresco @@ -150,7 +150,7 @@ offline_editing=Frakoblet redigering offline_title=Nedlasting av ''{0}'' for frakoblet redigering. # UI Component messages -done=Ferdig +done=Fullf\u00f8rt yes=Ja no=Nei error=Feil @@ -159,7 +159,7 @@ kilobyte=KB megabyte=MB gigabyte=GB locked_you=Element l\u00e5st av deg -locked_user=Element l\u00e5st av {0,choice,0#SHOULD_NOT_HAPPEN|1#user|1 +create_form_form_details_no_elements_in_schema=Dette skjemaet inneholder ikke noen elementdeklareringer. Et skjema m\u00e5 inneholde minst \u00e9n elementdeklarering for \u00e5 generere et skjema. +create_form_form_details_no_schema_selected= create_form_form_details_associated_web_projects=Dette skjemaet er for \u00f8yeblikket konfigurert for f\u00f8lgende Webprosjekter: create_form_configure_rendering_engine_templates_title=Konfigurer maler create_form_configure_rendering_engine_templates_step_title=Andre trinn \u2013 Konfigurer maler @@ -954,7 +954,7 @@ form_associated_with_form_instance_data_not_configured_for_web_project=Skjemaet run_action_title=Veiviser for kj\u00f8ring av handling run_action_desc=Denne veiviseren hjelper deg med \u00e5 kj\u00f8re en handling run_action_step1_title=F\u00f8rste trinn \u2013 Valgte handlinger -run_action_finish_instruction=Hvis du vil utf\u00f8re handlingen, klikker du Fullf\u00f8r. Hvis du vil g\u00e5 gjennom eller endre valgene dine, klikker du Tilbake. +run_action_finish_instruction=Hvis du vil utf\u00f8re handlingen, klikker du Fullf\u00f8r. Hvis du vil g\u00e5 gjennom eller endre valgene, klikker du Tilbake. create_rule_title=Veiviser for opprettelse av regel create_rule_desc=Denne veiviseren hjelper deg med \u00e5 opprette en ny regel. create_rule_step1_title=F\u00f8rste trinn \u2013 Velg vilk\u00e5r @@ -1061,7 +1061,7 @@ create_space_step2_title=Andre trinn \u2013 Alternativer for omr\u00e5de create_space_step2_desc=Velg alternativer for omr\u00e5de. create_space_step3_title=Tredje trinn \u2013 Detaljer for omr\u00e5de create_space_step3_desc=Skriv inn informasjon om omr\u00e5det. -create_space_finish_instruction=Hvis du vil lukke veiviseren og opprette omr\u00e5det, klikker du Fullf\u00f8r. Hvis du vil g\u00e5 gjennom og endre valgene dine, klikker du Tilbake. +create_space_finish_instruction=Hvis du vil lukke veiviseren og opprette omr\u00e5det, klikker du Fullf\u00f8r. Hvis du vil g\u00e5 gjennom eller endre valgene, klikker du Tilbake. scratch=Kladd an_existing_space=Et eksisterende omr\u00e5de a_template=En mal @@ -1081,13 +1081,13 @@ existing_space=Eksisterende omr\u00e5de copy_existing_space=Kopier eksisterende omr\u00e5de structure=Struktur structure_contents=Struktur og innhold -space_copy_note=Merk: Eventuelle innholdsregler for omr\u00e5der kopieres ogs\u00e5. +space_copy_note=Merk: Eventuelle innholdsregler for plasser kopieres ogs\u00e5. space_type=Type omr\u00e5de space_type_create=Velg typen omr\u00e5de du vil opprette. container=Mappeomr\u00e5de container_desc=Et omr\u00e5de for oppbevaring og ordning av dokumenter og andre omr\u00e5der. forums_desc=Et omr\u00e5de for \u00e5 diskutere innhold med andre brukere. -space_type_note=Merk: Hvis du bare kan se \u00e9n type omr\u00e5de, er kanskje ikke andre typer omr\u00e5der aktivert. Se systemadministratoren for ytterligere hjelp. +space_type_note=Merk: Hvis du bare kan se \u00e9n type plass, er kanskje ikke andre typer plasser aktivert. Se systemadministratoren for ytterligere hjelp. template_space=Malomr\u00e5de select_template=Velg malen du vil bruke. @@ -1100,7 +1100,7 @@ create_website_step1_title=F\u00f8rste trinn \u2013 Detaljer for Webprosjekt create_website_step1_desc=Skriv inn informasjonen om Webprosjektet. website_dnsname=DNS-navn website_preview_provider=Forh\u00e5ndsvis leverand\u00f8r -validation_invalid_dns_name=Ugyldig DNS-navn for Webomr\u00e5de: kun alfanumeriske tegn og bindestrek, s\u00e5 lenge den ikke kommer f\u00f8rst eller sist, godtas (makslengde < 64). +validation_invalid_dns_name=Ugyldig DNS-navn for webomr\u00e5de: kun alfanumeriske tegn og bindestrek, s\u00e5 lenge den ikke kommer f\u00f8rst eller sist, godtas (makslengde <64). website_webapp=Standard Webapp website_createfrom=Opprett fra eksisterende Webprosjekt create_website_step2_title=Andre trinn \u2013 Opprett fra eksisterende Webprosjekt @@ -1148,12 +1148,12 @@ create_website_step6_desc=Velg brukere og rollene deres. website_notify=Send e-post til brukere create_website_step7_title=Sjuende trinn \u2013 Send e-post til brukere create_website_step7_desc=Varsle brukere av Webomr\u00e5det. -create_website_finish_instruction=Hvis du vil lukke veiviseren og opprette omr\u00e5det for Webprosjekt, klikker du Fullf\u00f8r. Hvis du vil g\u00e5 gjennom eller endre valgene dine, klikker du Tilbake. +create_website_finish_instruction=Hvis du vil lukke veiviseren og opprette omr\u00e5det for Webprosjekt, klikker du Fullf\u00f8r. Hvis du vil g\u00e5 gjennom eller endre valgene, klikker du Tilbake. create_website_summary_users=Brukere og roller server_already_exist=Server med navn {0} finnes allerede. edit_website_title=Veiviser for redigering av Webprosjekt edit_website_desc=Denne veiviseren hjelper deg med \u00e5 endre innstillingene for et omr\u00e5de for Webprosjekt. -edit_website_finish_instruction=Hvis du vil lukke denne veiviseren og lagre de endrede innstillingene for omr\u00e5det for Webprosjekt, klikker du Fullf\u00f8r. Hvis du vil g\u00e5 gjennom eller endre innstillingene, klikker du Tilbake. +edit_website_finish_instruction=Hvis du vil lukke denne veiviseren og lagre de endrede innstillingene for omr\u00e5det for Webprosjekt, klikker du Fullf\u00f8r. Hvis du vil g\u00e5 gjennom eller endre valgene, klikker du Tilbake. edit_website=Rediger innstillinger for Webprosjekt workflow_settings=Innstillinger for arbeidsflyt workflow_not_configured=Arbeidsflyt ikke konfigurert @@ -1175,7 +1175,7 @@ invite_webusers_step1_title=F\u00f8rste trinn \u2013 Inviter brukere invite_webusers_step1_desc=Velg brukere og rollene deres. invite_webusers_step2_title=Andre trinn \u2013 Varsle brukere invite_webusers_step2_desc=Varsle de inviterte brukerne. -invite_webusers_finish_instruction=Hvis du vil lukke veiviseren og opprette brukersandkasser, klikker du Fullf\u00f8r. Hvis du vil g\u00e5 gjennom eller endre valgene dine, klikker du Tilbake. +invite_webusers_finish_instruction=Hvis du vil lukke veiviseren og opprette brukersandkasser, klikker du Fullf\u00f8r. Hvis du vil g\u00e5 gjennom eller endre valgene, klikker du Tilbake. # Delete Website Dialog messages delete_website=Slett Webprosjekt @@ -1221,14 +1221,14 @@ store_created_by=Opprettet av: store_working_users=Det {0,choice,0#er ingen brukere|1#er en bruker|1 - - - - - - - - - - org.alfresco.globalConfigTransactionalCache - - - 10 - + + - - + @@ -72,7 +59,6 @@ - diff --git a/config/alfresco/web-client-config-workflow-actions.xml b/config/alfresco/web-client-config-workflow-actions.xml index 57e3c952d4..065a6a30e9 100644 --- a/config/alfresco/web-client-config-workflow-actions.xml +++ b/config/alfresco/web-client-config-workflow-actions.xml @@ -371,4 +371,9 @@ + + + activiti$cloudWorkflow + + diff --git a/config/alfresco/web-client-config.xml b/config/alfresco/web-client-config.xml index 71fc127d79..a1ae9748ef 100644 --- a/config/alfresco/web-client-config.xml +++ b/config/alfresco/web-client-config.xml @@ -49,6 +49,9 @@ 500 + + true + 500 diff --git a/pom.xml b/pom.xml index 2e0d90c842..42ef708778 100644 --- a/pom.xml +++ b/pom.xml @@ -8,14 +8,21 @@ org.alfresco alfresco-parent - 4.2.d-SNAPSHOT - ../../pom-experimental.xml + 4.2.0-QA-SNAPSHOT + ../../pom.xml alfresco war Alfresco Web Client Alfresco Web Client + + /alfresco + ${tomcat.default.alfresco.port} + webapp + ${project.build.directory}/patches + + ${project.groupId} @@ -53,6 +60,7 @@ ${project.groupId} alfresco-web-framework-commons ${project.version} + classes ${project.groupId} @@ -101,6 +109,10 @@ xml-apis xml-apis + + xerces + xerces + @@ -116,8 +128,17 @@ xml-apis xml-apis + + commons-digester + commons-digester + + + commons-logging + commons-logging + 1.1.1 + net.sf.chiba chiba @@ -148,15 +169,10 @@ standard 1.1.0 - - - ${project.groupId} - alfresco-web-framework-commons - ${project.version} - webapp - war - provided + org.apache.chemistry.opencmis + chemistry-opencmis-test-browser + ${dependency.opencmis.version} @@ -268,42 +284,143 @@ - maven-war-plugin - - - ${project.groupId} - alfresco-web-framework-commons - webapp - - WEB-INF/classes/* - - - - true - true + true + false + + + + ../../projects/remote-api/source/web + + WEB-INF/server-config.wsdd + + + + + + + pre-exploded-war + + exploded + + prepare-package + + + - - - enterprise - - - ${project.groupId} - alfresco-enterprise-repository - ${project.version} - - - ${project.groupId} - alfresco-enterprise-remote-api - ${project.version} - - - - + + solr-http + + + + maven-resources-plugin + + + copy-web-xml + process-resources + + copy-resources + + + ${project.build.patchesDirectory} + + + source/web + false + + WEB-INF/web.xml + + + + + + + + + + com.google.code.maven-replacer-plugin + replacer + + + disable-securecomms + process-resources + + replace + + + + + true + ${project.build.patchesDirectory}/WEB-INF/web.xml + + + ]]> + + + + ]]> + ]]> + + + + + + + maven-war-plugin + + + + ${project.build.patchesDirectory} + + + + + + + + + run + + + + org.apache.tomcat.maven + tomcat7-maven-plugin + + + run-exploded-webapp + prepare-package + + run-war-only + + + + + + + + + + m2e + + + commons-logging + commons-logging + 1.1.1 + + runtime + + + mysql + mysql-connector-java + 5.1.14 + + + + diff --git a/source/java/org/alfresco/web/app/Application.java b/source/java/org/alfresco/web/app/Application.java index af6c4038af..ac0d76656e 100644 --- a/source/java/org/alfresco/web/app/Application.java +++ b/source/java/org/alfresco/web/app/Application.java @@ -391,25 +391,8 @@ public class Application { session.invalidate(); } - - // remove the username cookie value - Cookie authCookie = AuthenticationHelper.getAuthCookie(request); - if (authCookie != null) - { - HttpServletResponse response = (HttpServletResponse) context.getExternalContext().getResponse(); - if (response.isCommitted()) - { - // It's too late to do it now, but we can ask the login page to do it - request.getSession().setAttribute(AuthenticationHelper.SESSION_INVALIDATED, true); - } - else - { - authCookie.setMaxAge(0); - response.addCookie(authCookie); - } - } } - + // Explicitly invalidate the Alfresco ticket. This no longer happens on session expiry to allow for ticket // 'sharing' WebApplicationContext wc = FacesContextUtils.getRequiredWebApplicationContext(context); diff --git a/source/java/org/alfresco/web/app/ContextListener.java b/source/java/org/alfresco/web/app/ContextListener.java index 6bc4ea5a67..da1eb2e87a 100644 --- a/source/java/org/alfresco/web/app/ContextListener.java +++ b/source/java/org/alfresco/web/app/ContextListener.java @@ -53,8 +53,6 @@ public class ContextListener implements ServletContextListener, HttpSessionListe private static Log logger = LogFactory.getLog(ContextListener.class); private ServletContext servletContext; - private ServletContextListener enterpriseListener; - private String enterpriseListenerClass = "org.alfresco.enterprise.repo.EnterpriseContextListener"; /** * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent) @@ -124,51 +122,15 @@ public class ContextListener implements ServletContextListener, HttpSessionListe } catch (Exception ex) {} } - synchronized(this) - { - findEnterpriseListener(); - if (enterpriseListener != null) - { - // Perform any extra context initialisation required for enterprise. - enterpriseListener.contextInitialized(event); - } - } } - protected void findEnterpriseListener() - { - try - { - Class c = Class.forName(enterpriseListenerClass); - enterpriseListener = (ServletContextListener) c.newInstance(); - } - catch (ClassNotFoundException e) - { - // It's OK not to have the enterprise context destroyer available. - } - catch (InstantiationException e) - { - logger.error("Failed to instantiate enterprise ServletContextListener.", e); - } - catch (IllegalAccessException e) - { - logger.error("Failed to instantiate enterprise ServletContextListener.", e); - } - } /** * {@inheritDoc} */ public void contextDestroyed(ServletContextEvent event) { - synchronized(this) - { - if (enterpriseListener != null) - { - // Perform any extra destruction required for enterprise. - enterpriseListener.contextDestroyed(event); - } - } + // NOOP } /** @@ -188,16 +150,4 @@ public class ContextListener implements ServletContextListener, HttpSessionListe if (logger.isDebugEnabled()) logger.debug("HTTP session destroyed: " + event.getSession().getId()); } - - /** - * Inject a different class name (from the default) for the enterprise ServletContextListener. - *

- * Useful for testing. - * - * @param listenerClass Class name to use. - */ - protected void setEnterpriseListenerClass(String listenerClass) - { - this.enterpriseListenerClass = listenerClass; - } } diff --git a/source/java/org/alfresco/web/app/ContextListenerTest.java b/source/java/org/alfresco/web/app/ContextListenerTest.java deleted file mode 100644 index bc06ac112b..0000000000 --- a/source/java/org/alfresco/web/app/ContextListenerTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2005-2012 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 . - */ -package org.alfresco.web.app; - -import static org.junit.Assert.*; - -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; - -/** - * Tests for the ContextListener class. - * - * @author Matt Ward - */ -@RunWith(MockitoJUnitRunner.class) -public class ContextListenerTest -{ - private ContextListener contextListener; - private @Mock ServletContextEvent event; - - - @Before - public void setUp() throws Exception - { - contextListener = new ContextListener(); - contextListener.setEnterpriseListenerClass("org.alfresco.web.app.ContextListenerTest$StubEnterpriseListener"); - StubEnterpriseListener.enterpriseDestroyed = false; - } - - @Test - public void testContextDestroyed() - { - contextListener.findEnterpriseListener(); - contextListener.contextDestroyed(event); - - assertTrue("Enterprise contextDestroyed() not executed.", StubEnterpriseListener.enterpriseDestroyed); - } - - - /** - * ServletContextListener to simulate an enterprise-specific context listener. - */ - protected static class StubEnterpriseListener implements ServletContextListener - { - static boolean enterpriseDestroyed; - - @Override - public void contextDestroyed(ServletContextEvent arg0) - { - enterpriseDestroyed = true; - } - - @Override - public void contextInitialized(ServletContextEvent arg0) - { - // Noop - } - } -} diff --git a/source/java/org/alfresco/web/app/servlet/AuthenticationFilter.java b/source/java/org/alfresco/web/app/servlet/AuthenticationFilter.java index 4bc60b1d29..e88781abbf 100644 --- a/source/java/org/alfresco/web/app/servlet/AuthenticationFilter.java +++ b/source/java/org/alfresco/web/app/servlet/AuthenticationFilter.java @@ -29,6 +29,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.extensions.config.ConfigService; +import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.web.filter.beans.DependencyInjectedFilter; import org.springframework.extensions.surf.util.AbstractLifecycleBean; import org.alfresco.web.config.ClientConfigElement; @@ -114,6 +115,7 @@ public class AuthenticationFilter extends AbstractLifecycleBean implements Depen { // continue filter chaining chain.doFilter(req, res); + AuthenticationUtil.clearCurrentSecurityContext(); } } } diff --git a/source/java/org/alfresco/web/app/servlet/AuthenticationHelper.java b/source/java/org/alfresco/web/app/servlet/AuthenticationHelper.java index 4f629fc467..b1051c4f40 100644 --- a/source/java/org/alfresco/web/app/servlet/AuthenticationHelper.java +++ b/source/java/org/alfresco/web/app/servlet/AuthenticationHelper.java @@ -39,10 +39,10 @@ import org.alfresco.repo.security.permissions.AccessDeniedException; import org.alfresco.repo.transaction.RetryingTransactionHelper; import org.alfresco.repo.webdav.auth.RemoteUserMapper; import org.alfresco.service.ServiceRegistry; -import org.alfresco.service.cmr.repository.InvalidNodeRefException; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.security.AuthenticationService; +import org.alfresco.service.cmr.security.AuthorityService; import org.alfresco.service.cmr.security.PersonService; import org.alfresco.web.app.Application; import org.alfresco.web.app.portlet.AlfrescoFacesPortlet; @@ -85,6 +85,7 @@ public final class AuthenticationHelper private static final String REMOTE_USER_MAPPER = "RemoteUserMapper"; private static final String UNPROTECTED_AUTH_SERVICE = "authenticationService"; private static final String PERSON_SERVICE = "personService"; + private static final String AUTHORITY_SERVICE = "AuthorityService"; /** cookie names */ private static final String COOKIE_ALFUSER = "alfUser0"; @@ -604,8 +605,9 @@ public final class AuthenticationHelper // If the remote user mapper is configured, we may be able to map in an externally authenticated user if (userId != null) { + AuthorityService authorityService = (AuthorityService) wc.getBean(AUTHORITY_SERVICE); // We have a previously-cached user with the wrong identity - replace them - if (user != null && !user.getUserName().equals(userId)) + if (user != null && !authorityService.isGuestAuthority(user.getUserName()) && !user.getUserName().equals(userId)) { if (logger.isDebugEnabled()) logger.debug("We have a previously-cached user with the wrong identity - replace them"); diff --git a/source/java/org/alfresco/web/app/servlet/CmisSecurityContextCleanerFilter.java b/source/java/org/alfresco/web/app/servlet/CmisSecurityContextCleanerFilter.java new file mode 100644 index 0000000000..8f814d02be --- /dev/null +++ b/source/java/org/alfresco/web/app/servlet/CmisSecurityContextCleanerFilter.java @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2005-2013 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 . + */ +package org.alfresco.web.app.servlet; + +import java.io.IOException; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; + +import net.sf.acegisecurity.context.ContextHolder; + +/** + * Clears security context. It should follow Authentication filters in the chain and should be mapped for CMIS requests only + * + * @author Dmitry Velichkevich + * @since 4.1.5 + */ +public class CmisSecurityContextCleanerFilter implements Filter +{ + @Override + public void destroy() + { + } + + @Override + public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain) throws IOException, ServletException + { + ContextHolder.setContext(null); + chain.doFilter(servletRequest, servletResponse); + } + + @Override + public void init(FilterConfig config) throws ServletException + { + } +} diff --git a/source/java/org/alfresco/web/bean/BrowseBean.java b/source/java/org/alfresco/web/bean/BrowseBean.java index 0060afa903..d1208ca193 100644 --- a/source/java/org/alfresco/web/bean/BrowseBean.java +++ b/source/java/org/alfresco/web/bean/BrowseBean.java @@ -1093,6 +1093,8 @@ public class BrowseBean implements IContextListener, Serializable sp.setLimit(searchLimit); } + sp.setBulkFetchEnabled(Application.getClientConfig(FacesContext.getCurrentInstance()).isBulkFetchEnabled()); + results = this.getSearchService().query(sp); if (logger.isDebugEnabled()) logger.debug("Search results returned: " + results.length()); diff --git a/source/java/org/alfresco/web/bean/LoginBean.java b/source/java/org/alfresco/web/bean/LoginBean.java index 61a9a79c51..fa6efb3c2b 100644 --- a/source/java/org/alfresco/web/bean/LoginBean.java +++ b/source/java/org/alfresco/web/bean/LoginBean.java @@ -30,6 +30,8 @@ import javax.faces.component.UIComponent; import javax.faces.component.UIInput; import javax.faces.context.FacesContext; import javax.faces.validator.ValidatorException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import org.alfresco.model.ContentModel; import org.alfresco.repo.security.authentication.AuthenticationDisallowedException; @@ -379,6 +381,9 @@ public class LoginBean implements Serializable // the app to continue without redirecting to the login page Application.setCurrentUser(fc, user); + // Save the current username to cookie + AuthenticationHelper.setUsernameCookie((HttpServletRequest) fc.getExternalContext().getRequest(),(HttpServletResponse) fc.getExternalContext().getResponse(), this.username); + // Programatically retrieve the LoginOutcomeBean from JSF LoginOutcomeBean loginOutcomeBean = (LoginOutcomeBean) fc.getApplication().createValueBinding( "#{LoginOutcomeBean}").getValue(fc); @@ -388,7 +393,7 @@ public class LoginBean implements Serializable String redirectURL = loginOutcomeBean.getRedirectURL(); // ALF-10312: Validate we are redirecting within this web app - if (redirectURL != null && !redirectURL.startsWith(fc.getExternalContext().getRequestContextPath())) + if (redirectURL != null && !redirectURL.isEmpty() && !redirectURL.startsWith(fc.getExternalContext().getRequestContextPath())) { if (logger.isWarnEnabled()) logger.warn("Security violation. Unable to redirect to external location: " + redirectURL); diff --git a/source/java/org/alfresco/web/bean/SpaceLinkDetailsDialog.java b/source/java/org/alfresco/web/bean/SpaceLinkDetailsDialog.java index f0446b539a..a3c67e4eb3 100644 --- a/source/java/org/alfresco/web/bean/SpaceLinkDetailsDialog.java +++ b/source/java/org/alfresco/web/bean/SpaceLinkDetailsDialog.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2010 Alfresco Software Limited. + * Copyright (C) 2005-2012 Alfresco Software Limited. * * This file is part of Alfresco * @@ -18,6 +18,7 @@ */ package org.alfresco.web.bean; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -33,6 +34,8 @@ import org.alfresco.web.app.Application; import org.alfresco.web.bean.dialog.NavigationSupport; import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Repository; +import org.alfresco.web.ui.common.NodeListUtils; +import org.alfresco.web.ui.common.NodePropertyComparator; import org.alfresco.web.ui.common.component.UIActionLink; public class SpaceLinkDetailsDialog extends BaseDetailsBean implements NavigationSupport @@ -106,7 +109,6 @@ public class SpaceLinkDetailsDialog extends BaseDetailsBean implements Navigatio public void nextItem(ActionEvent event) { - boolean foundNextItem = false; UIActionLink link = (UIActionLink) event.getComponent(); Map params = link.getParameterMap(); String id = params.get("id"); @@ -114,41 +116,16 @@ public class SpaceLinkDetailsDialog extends BaseDetailsBean implements Navigatio { NodeRef currNodeRef = new NodeRef(Repository.getStoreRef(), id); List nodes = this.browseBean.getParentNodes(currNodeRef); + Node next = null; if (nodes.size() > 1) { - // perform a linear search - this is slow but stateless - // otherwise we would have to manage state of last selected node - // this gets very tricky as this bean is instantiated once and never - // reset - it does not know when the document has changed etc. - for (int i = 0; i < nodes.size(); i++) - { - if (id.equals(nodes.get(i).getId()) == true) - { - Node next; - // found our item - navigate to next - if (i != nodes.size() - 1) - { - next = nodes.get(i + 1); - } - else - { - // handle wrapping case - next = nodes.get(0); - } - - // prepare for showing details for this node - this.browseBean.setupSpaceAction(next.getId(), false); - - // we found a next item - foundNextItem = true; - } - } + String currentSortColumn = this.browseBean.getSpacesRichList().getCurrentSortColumn(); + boolean currentSortDescending = this.browseBean.getSpacesRichList().isCurrentSortDescending(); + Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending)); + next = NodeListUtils.nextItem(nodes, id); + this.browseBean.setupSpaceAction(next.getId(), false); } - - // if we did not find a next item make sure the current node is - // in the dispatch context otherwise the details screen will go back - // to the default one. - if (foundNextItem == false) + if (next == null) { Node currNode = new Node(currNodeRef); this.navigator.setupDispatchContext(currNode); @@ -159,7 +136,6 @@ public class SpaceLinkDetailsDialog extends BaseDetailsBean implements Navigatio public void previousItem(ActionEvent event) { - boolean foundPreviousItem = false; UIActionLink link = (UIActionLink) event.getComponent(); Map params = link.getParameterMap(); String id = params.get("id"); @@ -167,38 +143,16 @@ public class SpaceLinkDetailsDialog extends BaseDetailsBean implements Navigatio { NodeRef currNodeRef = new NodeRef(Repository.getStoreRef(), id); List nodes = this.browseBean.getParentNodes(currNodeRef); + Node previous = null; if (nodes.size() > 1) { - // see above - for (int i = 0; i < nodes.size(); i++) - { - if (id.equals(nodes.get(i).getId()) == true) - { - Node previous; - // found our item - navigate to previous - if (i != 0) - { - previous = nodes.get(i - 1); - } - else - { - // handle wrapping case - previous = nodes.get(nodes.size() - 1); - } - - // show details for this node - this.browseBean.setupSpaceAction(previous.getId(), false); - - // we found a next item - foundPreviousItem = true; - } - } + String currentSortColumn = this.browseBean.getSpacesRichList().getCurrentSortColumn(); + boolean currentSortDescending = this.browseBean.getSpacesRichList().isCurrentSortDescending(); + Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending)); + previous = NodeListUtils.previousItem(nodes, id); + this.browseBean.setupSpaceAction(previous.getId(), false); } - - // if we did not find a previous item make sure the current node is - // in the dispatch context otherwise the details screen will go back - // to the default one. - if (foundPreviousItem == false) + if (previous == null) { Node currNode = new Node(currNodeRef); this.navigator.setupDispatchContext(currNode); diff --git a/source/java/org/alfresco/web/bean/TemplateMailHelperBean.java b/source/java/org/alfresco/web/bean/TemplateMailHelperBean.java index e6b99efd5b..690ffb5438 100644 --- a/source/java/org/alfresco/web/bean/TemplateMailHelperBean.java +++ b/source/java/org/alfresco/web/bean/TemplateMailHelperBean.java @@ -28,6 +28,7 @@ import javax.mail.MessagingException; import javax.mail.internet.MimeMessage; import org.alfresco.model.ContentModel; +import org.alfresco.repo.action.executer.MailActionExecuter; import org.alfresco.repo.template.I18NMessageMethod; import org.alfresco.service.ServiceRegistry; import org.alfresco.service.cmr.repository.ContentReader; @@ -168,7 +169,7 @@ public class TemplateMailHelperBean implements Serializable MimeMessageHelper message = new MimeMessageHelper(mimeMessage); message.setTo(to); message.setSubject(subject); - message.setText(finalBody); + message.setText(finalBody, MailActionExecuter.isHTML(finalBody)); message.setFrom(from); } }; diff --git a/source/java/org/alfresco/web/bean/clipboard/WorkspaceClipboardItem.java b/source/java/org/alfresco/web/bean/clipboard/WorkspaceClipboardItem.java index 66404d1e37..e65c1e14f6 100644 --- a/source/java/org/alfresco/web/bean/clipboard/WorkspaceClipboardItem.java +++ b/source/java/org/alfresco/web/bean/clipboard/WorkspaceClipboardItem.java @@ -136,7 +136,7 @@ public class WorkspaceClipboardItem extends AbstractClipboardItem public boolean paste(final FacesContext fc, String viewId, final int action) { final ServiceRegistry serviceRegistry = getServiceRegistry(); - final RetryingTransactionHelper retryingTransactionHelper = serviceRegistry.getRetryingTransactionHelper(); + final RetryingTransactionHelper retryingTransactionHelper = serviceRegistry.getTransactionService().getRetryingTransactionHelper(); if (super.canCopyToViewId(viewId) || WORKSPACE_PASTE_VIEW_ID.equals(viewId) || FORUMS_PASTE_VIEW_ID.equals(viewId) || FORUM_PASTE_VIEW_ID.equals(viewId)) { diff --git a/source/java/org/alfresco/web/bean/content/DocumentDetailsDialog.java b/source/java/org/alfresco/web/bean/content/DocumentDetailsDialog.java index 7965fdab17..ea88e1cf5d 100644 --- a/source/java/org/alfresco/web/bean/content/DocumentDetailsDialog.java +++ b/source/java/org/alfresco/web/bean/content/DocumentDetailsDialog.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2010 Alfresco Software Limited. + * Copyright (C) 2005-2012 Alfresco Software Limited. * * This file is part of Alfresco * @@ -22,6 +22,7 @@ import java.io.Serializable; import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Locale; @@ -59,6 +60,8 @@ import org.alfresco.web.bean.ml.SingleEditionBean; import org.alfresco.web.bean.repository.MapNode; import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Repository; +import org.alfresco.web.ui.common.NodePropertyComparator; +import org.alfresco.web.ui.common.NodeListUtils; import org.alfresco.web.ui.common.ReportedException; import org.alfresco.web.ui.common.Utils; import org.alfresco.web.ui.common.Utils.URLMode; @@ -711,32 +714,12 @@ public class DocumentDetailsDialog extends BaseDetailsBean implements Navigatio List nodes = this.browseBean.getContent(); if (nodes.size() > 1) { - // perform a linear search - this is slow but stateless - // otherwise we would have to manage state of last selected node - // this gets very tricky as this bean is instantiated once and never - // reset - it does not know when the document has changed etc. - for (int i=0; i nodes = this.browseBean.getContent(); if (nodes.size() > 1) { - // see above - for (int i=0; i nodes = this.browseBean.getContent(); if (nodes.size() > 1) { - // perform a linear search - this is slow but stateless - // otherwise we would have to manage state of last selected node - // this gets very tricky as this bean is instantiated once and never - // reset - it does not know when the document has changed etc. - for (int i=0; i nodes = this.browseBean.getContent(); if (nodes.size() > 1) { - // see above - for (int i=0; i params = link.getParameterMap(); String id = params.get("id"); @@ -131,41 +133,16 @@ public class ForumDetailsDialog extends BaseDetailsBean implements NavigationSup { NodeRef currNodeRef = new NodeRef(Repository.getStoreRef(), id); List nodes = this.browseBean.getParentNodes(currNodeRef); + Node next = null; if (nodes.size() > 1) { - // perform a linear search - this is slow but stateless - // otherwise we would have to manage state of last selected node - // this gets very tricky as this bean is instantiated once and never - // reset - it does not know when the document has changed etc. - for (int i = 0; i < nodes.size(); i++) - { - if (id.equals(nodes.get(i).getId()) == true) - { - Node next; - // found our item - navigate to next - if (i != nodes.size() - 1) - { - next = nodes.get(i + 1); - } - else - { - // handle wrapping case - next = nodes.get(0); - } - - // prepare for showing details for this node - this.browseBean.setupSpaceAction(next.getId(), false); - - // we found a next item - foundNextItem = true; - } - } + String currentSortColumn = this.browseBean.getSpacesRichList().getCurrentSortColumn(); + boolean currentSortDescending = this.browseBean.getSpacesRichList().isCurrentSortDescending(); + Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending)); + next = NodeListUtils.nextItem(nodes, id); + this.browseBean.setupSpaceAction(next.getId(), false); } - - // if we did not find a next item make sure the current node is - // in the dispatch context otherwise the details screen will go back - // to the default one. - if (foundNextItem == false) + if (next == null) { Node currNode = new Node(currNodeRef); this.navigator.setupDispatchContext(currNode); @@ -176,7 +153,6 @@ public class ForumDetailsDialog extends BaseDetailsBean implements NavigationSup public void previousItem(ActionEvent event) { - boolean foundPreviousItem = false; UIActionLink link = (UIActionLink) event.getComponent(); Map params = link.getParameterMap(); String id = params.get("id"); @@ -184,38 +160,16 @@ public class ForumDetailsDialog extends BaseDetailsBean implements NavigationSup { NodeRef currNodeRef = new NodeRef(Repository.getStoreRef(), id); List nodes = this.browseBean.getParentNodes(currNodeRef); + Node previous = null; if (nodes.size() > 1) { - // see above - for (int i = 0; i < nodes.size(); i++) - { - if (id.equals(nodes.get(i).getId()) == true) - { - Node previous; - // found our item - navigate to previous - if (i != 0) - { - previous = nodes.get(i - 1); - } - else - { - // handle wrapping case - previous = nodes.get(nodes.size() - 1); - } - - // show details for this node - this.browseBean.setupSpaceAction(previous.getId(), false); - - // we found a next item - foundPreviousItem = true; - } - } + String currentSortColumn = this.browseBean.getSpacesRichList().getCurrentSortColumn(); + boolean currentSortDescending = this.browseBean.getSpacesRichList().isCurrentSortDescending(); + Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending)); + previous = NodeListUtils.previousItem(nodes, id); + this.browseBean.setupSpaceAction(previous.getId(), false); } - - // if we did not find a previous item make sure the current node is - // in the dispatch context otherwise the details screen will go back - // to the default one. - if (foundPreviousItem == false) + if (previous == null) { Node currNode = new Node(currNodeRef); this.navigator.setupDispatchContext(currNode); diff --git a/source/java/org/alfresco/web/bean/forums/ForumsDetailsDialog.java b/source/java/org/alfresco/web/bean/forums/ForumsDetailsDialog.java index 7ac15e60db..08bf237d3b 100644 --- a/source/java/org/alfresco/web/bean/forums/ForumsDetailsDialog.java +++ b/source/java/org/alfresco/web/bean/forums/ForumsDetailsDialog.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2010 Alfresco Software Limited. + * Copyright (C) 2005-2012 Alfresco Software Limited. * * This file is part of Alfresco * @@ -18,6 +18,7 @@ */ package org.alfresco.web.bean.forums; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -34,6 +35,8 @@ import org.alfresco.web.bean.BaseDetailsBean; import org.alfresco.web.bean.dialog.NavigationSupport; import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Repository; +import org.alfresco.web.ui.common.NodeListUtils; +import org.alfresco.web.ui.common.NodePropertyComparator; import org.alfresco.web.ui.common.component.UIActionLink; public class ForumsDetailsDialog extends BaseDetailsBean implements NavigationSupport @@ -123,7 +126,6 @@ public class ForumsDetailsDialog extends BaseDetailsBean implements NavigationSu public void nextItem(ActionEvent event) { - boolean foundNextItem = false; UIActionLink link = (UIActionLink) event.getComponent(); Map params = link.getParameterMap(); String id = params.get("id"); @@ -131,41 +133,16 @@ public class ForumsDetailsDialog extends BaseDetailsBean implements NavigationSu { NodeRef currNodeRef = new NodeRef(Repository.getStoreRef(), id); List nodes = this.browseBean.getParentNodes(currNodeRef); + Node next = null; if (nodes.size() > 1) { - // perform a linear search - this is slow but stateless - // otherwise we would have to manage state of last selected node - // this gets very tricky as this bean is instantiated once and never - // reset - it does not know when the document has changed etc. - for (int i = 0; i < nodes.size(); i++) - { - if (id.equals(nodes.get(i).getId()) == true) - { - Node next; - // found our item - navigate to next - if (i != nodes.size() - 1) - { - next = nodes.get(i + 1); - } - else - { - // handle wrapping case - next = nodes.get(0); - } - - // prepare for showing details for this node - this.browseBean.setupSpaceAction(next.getId(), false); - - // we found a next item - foundNextItem = true; - } - } + String currentSortColumn = this.browseBean.getSpacesRichList().getCurrentSortColumn(); + boolean currentSortDescending = this.browseBean.getSpacesRichList().isCurrentSortDescending(); + Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending)); + next = NodeListUtils.nextItem(nodes, id); + this.browseBean.setupSpaceAction(next.getId(), false); } - - // if we did not find a next item make sure the current node is - // in the dispatch context otherwise the details screen will go back - // to the default one. - if (foundNextItem == false) + if (next == null) { Node currNode = new Node(currNodeRef); this.navigator.setupDispatchContext(currNode); @@ -176,7 +153,6 @@ public class ForumsDetailsDialog extends BaseDetailsBean implements NavigationSu public void previousItem(ActionEvent event) { - boolean foundPreviousItem = false; UIActionLink link = (UIActionLink) event.getComponent(); Map params = link.getParameterMap(); String id = params.get("id"); @@ -184,38 +160,16 @@ public class ForumsDetailsDialog extends BaseDetailsBean implements NavigationSu { NodeRef currNodeRef = new NodeRef(Repository.getStoreRef(), id); List nodes = this.browseBean.getParentNodes(currNodeRef); + Node previous = null; if (nodes.size() > 1) { - // see above - for (int i = 0; i < nodes.size(); i++) - { - if (id.equals(nodes.get(i).getId()) == true) - { - Node previous; - // found our item - navigate to previous - if (i != 0) - { - previous = nodes.get(i - 1); - } - else - { - // handle wrapping case - previous = nodes.get(nodes.size() - 1); - } - - // show details for this node - this.browseBean.setupSpaceAction(previous.getId(), false); - - // we found a next item - foundPreviousItem = true; - } - } + String currentSortColumn = this.browseBean.getSpacesRichList().getCurrentSortColumn(); + boolean currentSortDescending = this.browseBean.getSpacesRichList().isCurrentSortDescending(); + Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending)); + previous = NodeListUtils.previousItem(nodes, id); + this.browseBean.setupSpaceAction(previous.getId(), false); } - - // if we did not find a previous item make sure the current node is - // in the dispatch context otherwise the details screen will go back - // to the default one. - if (foundPreviousItem == false) + if (previous == null) { Node currNode = new Node(currNodeRef); this.navigator.setupDispatchContext(currNode); diff --git a/source/java/org/alfresco/web/bean/forums/TopicDetailsDialog.java b/source/java/org/alfresco/web/bean/forums/TopicDetailsDialog.java index eb9f46d49a..36b16a6710 100644 --- a/source/java/org/alfresco/web/bean/forums/TopicDetailsDialog.java +++ b/source/java/org/alfresco/web/bean/forums/TopicDetailsDialog.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2010 Alfresco Software Limited. + * Copyright (C) 2005-2012 Alfresco Software Limited. * * This file is part of Alfresco * @@ -18,6 +18,7 @@ */ package org.alfresco.web.bean.forums; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -34,6 +35,8 @@ import org.alfresco.web.bean.BaseDetailsBean; import org.alfresco.web.bean.dialog.NavigationSupport; import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Repository; +import org.alfresco.web.ui.common.NodeListUtils; +import org.alfresco.web.ui.common.NodePropertyComparator; import org.alfresco.web.ui.common.component.UIActionLink; public class TopicDetailsDialog extends BaseDetailsBean implements NavigationSupport @@ -123,7 +126,6 @@ public class TopicDetailsDialog extends BaseDetailsBean implements NavigationSup public void nextItem(ActionEvent event) { - boolean foundNextItem = false; UIActionLink link = (UIActionLink) event.getComponent(); Map params = link.getParameterMap(); String id = params.get("id"); @@ -131,41 +133,16 @@ public class TopicDetailsDialog extends BaseDetailsBean implements NavigationSup { NodeRef currNodeRef = new NodeRef(Repository.getStoreRef(), id); List nodes = this.browseBean.getParentNodes(currNodeRef); + Node next = null; if (nodes.size() > 1) { - // perform a linear search - this is slow but stateless - // otherwise we would have to manage state of last selected node - // this gets very tricky as this bean is instantiated once and never - // reset - it does not know when the document has changed etc. - for (int i = 0; i < nodes.size(); i++) - { - if (id.equals(nodes.get(i).getId()) == true) - { - Node next; - // found our item - navigate to next - if (i != nodes.size() - 1) - { - next = nodes.get(i + 1); - } - else - { - // handle wrapping case - next = nodes.get(0); - } - - // prepare for showing details for this node - this.browseBean.setupSpaceAction(next.getId(), false); - - // we found a next item - foundNextItem = true; - } - } + String currentSortColumn = this.browseBean.getSpacesRichList().getCurrentSortColumn(); + boolean currentSortDescending = this.browseBean.getSpacesRichList().isCurrentSortDescending(); + Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending)); + next = NodeListUtils.nextItem(nodes, id); + this.browseBean.setupSpaceAction(next.getId(), false); } - - // if we did not find a next item make sure the current node is - // in the dispatch context otherwise the details screen will go back - // to the default one. - if (foundNextItem == false) + if (next == null) { Node currNode = new Node(currNodeRef); this.navigator.setupDispatchContext(currNode); @@ -176,7 +153,6 @@ public class TopicDetailsDialog extends BaseDetailsBean implements NavigationSup public void previousItem(ActionEvent event) { - boolean foundPreviousItem = false; UIActionLink link = (UIActionLink) event.getComponent(); Map params = link.getParameterMap(); String id = params.get("id"); @@ -184,38 +160,16 @@ public class TopicDetailsDialog extends BaseDetailsBean implements NavigationSup { NodeRef currNodeRef = new NodeRef(Repository.getStoreRef(), id); List nodes = this.browseBean.getParentNodes(currNodeRef); + Node previous = null; if (nodes.size() > 1) { - // see above - for (int i = 0; i < nodes.size(); i++) - { - if (id.equals(nodes.get(i).getId()) == true) - { - Node previous; - // found our item - navigate to previous - if (i != 0) - { - previous = nodes.get(i - 1); - } - else - { - // handle wrapping case - previous = nodes.get(nodes.size() - 1); - } - - // show details for this node - this.browseBean.setupSpaceAction(previous.getId(), false); - - // we found a next item - foundPreviousItem = true; - } - } + String currentSortColumn = this.browseBean.getSpacesRichList().getCurrentSortColumn(); + boolean currentSortDescending = this.browseBean.getSpacesRichList().isCurrentSortDescending(); + Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending)); + previous = NodeListUtils.previousItem(nodes, id); + this.browseBean.setupSpaceAction(previous.getId(), false); } - - // if we did not find a previous item make sure the current node is - // in the dispatch context otherwise the details screen will go back - // to the default one. - if (foundPreviousItem == false) + if (previous == null) { Node currNode = new Node(currNodeRef); this.navigator.setupDispatchContext(currNode); diff --git a/source/java/org/alfresco/web/bean/preview/DocumentPreviewBean.java b/source/java/org/alfresco/web/bean/preview/DocumentPreviewBean.java index f4800d5a14..37c438bd2f 100644 --- a/source/java/org/alfresco/web/bean/preview/DocumentPreviewBean.java +++ b/source/java/org/alfresco/web/bean/preview/DocumentPreviewBean.java @@ -1,23 +1,24 @@ /* - * Copyright (C) 2005-2010 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 + * Copyright (C) 2005-2012 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 . */ package org.alfresco.web.bean.preview; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -31,6 +32,8 @@ import org.alfresco.web.app.Application; import org.alfresco.web.bean.dialog.NavigationSupport; import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Repository; +import org.alfresco.web.ui.common.NodeListUtils; +import org.alfresco.web.ui.common.NodePropertyComparator; import org.alfresco.web.ui.common.component.UIActionLink; /** @@ -100,31 +103,11 @@ public class DocumentPreviewBean extends BasePreviewBean implements NavigationSu List nodes = this.browseBean.getContent(); if (nodes.size() > 1) { - // perform a linear search - this is slow but stateless - // otherwise we would have to manage state of last selected node - // this gets very tricky as this bean is instantiated once and never - // reset - it does not know when the document has changed etc. - for (int i = 0; i < nodes.size(); i++) - { - if (id.equals(nodes.get(i).getId()) == true) - { - Node next; - // found our item - navigate to next - if (i != nodes.size() - 1) - { - next = nodes.get(i + 1); - } - else - { - // handle wrapping case - next = nodes.get(0); - } - - // prepare for showing details for this node - this.browseBean.setupContentAction(next.getId(), false); - break; - } - } + String currentSortColumn = this.browseBean.getContentRichList().getCurrentSortColumn(); + boolean currentSortDescending = this.browseBean.getContentRichList().isCurrentSortDescending(); + Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending)); + Node next = NodeListUtils.nextItem(nodes, id); + this.browseBean.setupContentAction(next.getId(), false); } } } @@ -139,28 +122,11 @@ public class DocumentPreviewBean extends BasePreviewBean implements NavigationSu List nodes = this.browseBean.getContent(); if (nodes.size() > 1) { - // see above - for (int i = 0; i < nodes.size(); i++) - { - if (id.equals(nodes.get(i).getId()) == true) - { - Node previous; - // found our item - navigate to previous - if (i != 0) - { - previous = nodes.get(i - 1); - } - else - { - // handle wrapping case - previous = nodes.get(nodes.size() - 1); - } - - // prepare for showing details for this node - this.browseBean.setupContentAction(previous.getId(), false); - break; - } - } + String currentSortColumn = this.browseBean.getContentRichList().getCurrentSortColumn(); + boolean currentSortDescending = this.browseBean.getContentRichList().isCurrentSortDescending(); + Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending)); + Node previous = NodeListUtils.previousItem(nodes, id); + this.browseBean.setupContentAction(previous.getId(), false); } } } diff --git a/source/java/org/alfresco/web/bean/preview/SpacePreviewBean.java b/source/java/org/alfresco/web/bean/preview/SpacePreviewBean.java index fa77c6c48d..42398c51c4 100644 --- a/source/java/org/alfresco/web/bean/preview/SpacePreviewBean.java +++ b/source/java/org/alfresco/web/bean/preview/SpacePreviewBean.java @@ -1,23 +1,24 @@ /* - * Copyright (C) 2005-2010 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 + * Copyright (C) 2005-2012 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 . */ package org.alfresco.web.bean.preview; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -31,6 +32,8 @@ import org.alfresco.web.app.Application; import org.alfresco.web.bean.dialog.NavigationSupport; import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Repository; +import org.alfresco.web.ui.common.NodeListUtils; +import org.alfresco.web.ui.common.NodePropertyComparator; import org.alfresco.web.ui.common.component.UIActionLink; /** @@ -89,7 +92,6 @@ public class SpacePreviewBean extends BasePreviewBean implements NavigationSuppo public void nextItem(ActionEvent event) { - boolean foundNextItem = false; UIActionLink link = (UIActionLink) event.getComponent(); Map params = link.getParameterMap(); String id = params.get("id"); @@ -97,41 +99,16 @@ public class SpacePreviewBean extends BasePreviewBean implements NavigationSuppo { NodeRef currNodeRef = new NodeRef(Repository.getStoreRef(), id); List nodes = this.browseBean.getParentNodes(currNodeRef); + Node next = null; if (nodes.size() > 1) { - // perform a linear search - this is slow but stateless - // otherwise we would have to manage state of last selected node - // this gets very tricky as this bean is instantiated once and never - // reset - it does not know when the document has changed etc. - for (int i = 0; i < nodes.size(); i++) - { - if (id.equals(nodes.get(i).getId()) == true) - { - Node next; - // found our item - navigate to next - if (i != nodes.size() - 1) - { - next = nodes.get(i + 1); - } - else - { - // handle wrapping case - next = nodes.get(0); - } - - // prepare for showing details for this node - this.browseBean.setupSpaceAction(next.getId(), false); - - // we found a next item - foundNextItem = true; - } - } + String currentSortColumn = this.browseBean.getSpacesRichList().getCurrentSortColumn(); + boolean currentSortDescending = this.browseBean.getSpacesRichList().isCurrentSortDescending(); + Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending)); + next = NodeListUtils.nextItem(nodes, id); + this.browseBean.setupSpaceAction(next.getId(), false); } - - // if we did not find a next item make sure the current node is - // in the dispatch context otherwise the details screen will go back - // to the default one. - if (foundNextItem == false) + if (next == null) { Node currNode = new Node(currNodeRef); this.navigator.setupDispatchContext(currNode); @@ -142,7 +119,6 @@ public class SpacePreviewBean extends BasePreviewBean implements NavigationSuppo public void previousItem(ActionEvent event) { - boolean foundPreviousItem = false; UIActionLink link = (UIActionLink) event.getComponent(); Map params = link.getParameterMap(); String id = params.get("id"); @@ -150,38 +126,16 @@ public class SpacePreviewBean extends BasePreviewBean implements NavigationSuppo { NodeRef currNodeRef = new NodeRef(Repository.getStoreRef(), id); List nodes = this.browseBean.getParentNodes(currNodeRef); + Node previous = null; if (nodes.size() > 1) { - // see above - for (int i = 0; i < nodes.size(); i++) - { - if (id.equals(nodes.get(i).getId()) == true) - { - Node previous; - // found our item - navigate to previous - if (i != 0) - { - previous = nodes.get(i - 1); - } - else - { - // handle wrapping case - previous = nodes.get(nodes.size() - 1); - } - - // show details for this node - this.browseBean.setupSpaceAction(previous.getId(), false); - - // we found a next item - foundPreviousItem = true; - } - } + String currentSortColumn = this.browseBean.getSpacesRichList().getCurrentSortColumn(); + boolean currentSortDescending = this.browseBean.getSpacesRichList().isCurrentSortDescending(); + Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending)); + previous = NodeListUtils.previousItem(nodes, id); + this.browseBean.setupSpaceAction(previous.getId(), false); } - - // if we did not find a previous item make sure the current node is - // in the dispatch context otherwise the details screen will go back - // to the default one. - if (foundPreviousItem == false) + if (previous == null) { Node currNode = new Node(currNodeRef); this.navigator.setupDispatchContext(currNode); diff --git a/source/java/org/alfresco/web/bean/repository/User.java b/source/java/org/alfresco/web/bean/repository/User.java index efe59b3d2e..fcdb9332be 100644 --- a/source/java/org/alfresco/web/bean/repository/User.java +++ b/source/java/org/alfresco/web/bean/repository/User.java @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2005-2010 Alfresco Software Limited. * * This file is part of Alfresco @@ -14,184 +14,184 @@ * 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 . - */ -package org.alfresco.web.bean.repository; - -import java.io.Serializable; -import java.util.List; -import java.util.Map; - -import javax.faces.context.FacesContext; + * along with Alfresco. If not, see . + */ +package org.alfresco.web.bean.repository; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +import javax.faces.context.FacesContext; import javax.servlet.ServletContext; - -import org.alfresco.model.ApplicationModel; -import org.alfresco.model.ContentModel; -import org.alfresco.repo.SessionUser; -import org.alfresco.repo.configuration.ConfigurableService; -import org.alfresco.repo.transaction.RetryingTransactionHelper; -import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback; -import org.alfresco.service.ServiceRegistry; -import org.alfresco.service.cmr.repository.ChildAssociationRef; -import org.alfresco.service.cmr.repository.NodeRef; -import org.alfresco.service.cmr.repository.NodeService; -import org.alfresco.service.cmr.search.SearchService; -import org.alfresco.service.namespace.NamespaceService; -import org.alfresco.service.namespace.QName; -import org.alfresco.service.transaction.TransactionService; + +import org.alfresco.model.ApplicationModel; +import org.alfresco.model.ContentModel; +import org.alfresco.repo.SessionUser; +import org.alfresco.repo.configuration.ConfigurableService; +import org.alfresco.repo.transaction.RetryingTransactionHelper; +import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback; +import org.alfresco.service.ServiceRegistry; +import org.alfresco.service.cmr.repository.ChildAssociationRef; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.cmr.search.SearchService; +import org.alfresco.service.namespace.NamespaceService; +import org.alfresco.service.namespace.QName; +import org.alfresco.service.transaction.TransactionService; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; import org.springframework.web.jsf.FacesContextUtils; - -/** - * Bean that represents the currently logged in user - * - * @author gavinc - */ -public final class User implements SessionUser -{ - private static final long serialVersionUID = -90577901805847829L; - - private String companyRootId; - private String homeSpaceId; - private String userName; - private String ticket; - private NodeRef person; - private String fullName = null; - private Boolean administrator = null; - - private Preferences preferences = null; - - /** - * Constructor - * - * @param userName constructor for the user - */ - public User(String userName, String ticket, NodeRef person) - { - if (userName == null || ticket == null || person == null) - { - throw new IllegalArgumentException("All user details are mandatory!"); - } - - this.userName = userName; - this.ticket = ticket; - this.person = person; - } - - /** - * Forces a clear of any cached or calcluated values - */ - public void reset() - { - this.fullName = null; - this.administrator = null; - this.preferences = null; - } - - /** - * @return The user name - */ - public String getUserName() - { - return this.userName; - } - - /** - * Return the full name of the Person this User represents - * - * @param service NodeService to use - * - * @return The full name - */ - public String getFullName(NodeService service) - { - if (this.fullName == null) - { - String firstName = (String)service.getProperty(this.person, ContentModel.PROP_FIRSTNAME); - String lastName = (String)service.getProperty(this.person, ContentModel.PROP_LASTNAME); - this.fullName = (firstName != null ? firstName : "") + ' ' + (lastName != null ? lastName : ""); - } - - return this.fullName; - } - - /** - * @return Retrieves the user's home space (this may be the id of the company home space) - */ - public String getHomeSpaceId() - { - return this.homeSpaceId; - } - - /** - * @param homeSpaceId Sets the id of the users home space - */ - public void setHomeSpaceId(String homeSpaceId) - { - this.homeSpaceId = homeSpaceId; - } - - /** - * @return Retrieves the company home space - */ - public String getCompanyRootId() - { - return this.companyRootId; - } - - /** - * @param companyRootId Sets the id of the company home space - */ - public void setCompanyRootId(String companyRootId) - { - this.companyRootId = companyRootId; - } - - /** - * @return Returns the ticket. - */ - public String getTicket() - { - return this.ticket; - } - - /** - * @return Returns the person NodeRef - */ - public NodeRef getPerson() - { - return this.person; - } - - /** - * @return If the current user has Admin Authority - */ - public boolean isAdmin() - { - if (administrator == null) - { - administrator = Repository.getServiceRegistry(FacesContext.getCurrentInstance()) - .getAuthorityService().hasAdminAuthority(); - } - - return administrator; - } - - /** - * @return The Preferences for the User - */ + +/** + * Bean that represents the currently logged in user + * + * @author gavinc + */ +public final class User implements SessionUser +{ + private static final long serialVersionUID = -90577901805847829L; + + private String companyRootId; + private String homeSpaceId; + private String userName; + private String ticket; + private NodeRef person; + private String fullName = null; + private Boolean administrator = null; + + private Preferences preferences = null; + + /** + * Constructor + * + * @param userName constructor for the user + */ + public User(String userName, String ticket, NodeRef person) + { + if (userName == null || ticket == null || person == null) + { + throw new IllegalArgumentException("All user details are mandatory!"); + } + + this.userName = userName; + this.ticket = ticket; + this.person = person; + } + + /** + * Forces a clear of any cached or calcluated values + */ + public void reset() + { + this.fullName = null; + this.administrator = null; + this.preferences = null; + } + + /** + * @return The user name + */ + public String getUserName() + { + return this.userName; + } + + /** + * Return the full name of the Person this User represents + * + * @param service NodeService to use + * + * @return The full name + */ + public String getFullName(NodeService service) + { + if (this.fullName == null) + { + String firstName = (String)service.getProperty(this.person, ContentModel.PROP_FIRSTNAME); + String lastName = (String)service.getProperty(this.person, ContentModel.PROP_LASTNAME); + this.fullName = (firstName != null ? firstName : "") + ' ' + (lastName != null ? lastName : ""); + } + + return this.fullName; + } + + /** + * @return Retrieves the user's home space (this may be the id of the company home space) + */ + public String getHomeSpaceId() + { + return this.homeSpaceId; + } + + /** + * @param homeSpaceId Sets the id of the users home space + */ + public void setHomeSpaceId(String homeSpaceId) + { + this.homeSpaceId = homeSpaceId; + } + + /** + * @return Retrieves the company home space + */ + public String getCompanyRootId() + { + return this.companyRootId; + } + + /** + * @param companyRootId Sets the id of the company home space + */ + public void setCompanyRootId(String companyRootId) + { + this.companyRootId = companyRootId; + } + + /** + * @return Returns the ticket. + */ + public String getTicket() + { + return this.ticket; + } + + /** + * @return Returns the person NodeRef + */ + public NodeRef getPerson() + { + return this.person; + } + + /** + * @return If the current user has Admin Authority + */ + public boolean isAdmin() + { + if (administrator == null) + { + administrator = Repository.getServiceRegistry(FacesContext.getCurrentInstance()) + .getAuthorityService().hasAdminAuthority(); + } + + return administrator; + } + + /** + * @return The Preferences for the User + */ Preferences getPreferences(FacesContext fc) - { - if (this.preferences == null) - { + { + if (this.preferences == null) + { this.preferences = new Preferences(getUserPreferencesRef( FacesContextUtils.getRequiredWebApplicationContext(fc))); - } - return this.preferences; - } - - /** + } + return this.preferences; + } + + /** * @return The Preferences for the User */ Preferences getPreferences(ServletContext sc) @@ -205,88 +205,87 @@ public final class User implements SessionUser } /** - * Get or create the node used to store user preferences. - * Utilises the 'configurable' aspect on the Person linked to this user. - */ + * Get or create the node used to store user preferences. + * Utilises the 'configurable' aspect on the Person linked to this user. + */ synchronized NodeRef getUserPreferencesRef(WebApplicationContext context) - { - final ServiceRegistry registry = (ServiceRegistry) context.getBean("ServiceRegistry"); - final NodeService nodeService = registry.getNodeService(); - final SearchService searchService = registry.getSearchService(); - final NamespaceService namespaceService = registry.getNamespaceService(); - final TransactionService txService = registry.getTransactionService(); - final ConfigurableService configurableService = (ConfigurableService) context.getBean("ConfigurableService"); - RetryingTransactionHelper txnHelper = registry.getRetryingTransactionHelper(); - return txnHelper.doInTransaction(new RetryingTransactionCallback() - { - - public NodeRef execute() throws Throwable - { - NodeRef prefRef = null; - NodeRef person = getPerson(); - if (nodeService.hasAspect(person, ApplicationModel.ASPECT_CONFIGURABLE) == false) - { - // if the repository is in read-only mode just return null - if (txService.isReadOnly()) - { - return null; - } - else - { - // create the configuration folder for this Person node - configurableService.makeConfigurable(person); - } - } - - // target of the assoc is the configurations folder ref - NodeRef configRef = configurableService.getConfigurationFolder(person); - if (configRef == null) - { - throw new IllegalStateException("Unable to find associated 'configurations' folder for node: " - + person); - } - - String xpath = NamespaceService.APP_MODEL_PREFIX + ":" + "preferences"; - List nodes = searchService.selectNodes(configRef, xpath, null, namespaceService, false); - - if (nodes.size() == 1) - { - prefRef = nodes.get(0); - } - else - { - // create the preferences Node for this user (if repo is not read-only) - if (txService.isReadOnly() == false) + { + final ServiceRegistry registry = (ServiceRegistry) context.getBean("ServiceRegistry"); + final NodeService nodeService = registry.getNodeService(); + final SearchService searchService = registry.getSearchService(); + final NamespaceService namespaceService = registry.getNamespaceService(); + final TransactionService txService = registry.getTransactionService(); + final ConfigurableService configurableService = (ConfigurableService) context.getBean("ConfigurableService"); + RetryingTransactionHelper txnHelper = registry.getTransactionService().getRetryingTransactionHelper(); + return txnHelper.doInTransaction(new RetryingTransactionCallback() + { + public NodeRef execute() throws Throwable + { + NodeRef prefRef = null; + NodeRef person = getPerson(); + if (nodeService.hasAspect(person, ApplicationModel.ASPECT_CONFIGURABLE) == false) + { + // if the repository is in read-only mode just return null + if (txService.isReadOnly()) { - ChildAssociationRef childRef = nodeService.createNode(configRef, - ContentModel.ASSOC_CONTAINS, QName.createQName( - NamespaceService.APP_MODEL_1_0_URI, "preferences"), - ContentModel.TYPE_CMOBJECT); - - prefRef = childRef.getChildRef(); - } - } - return prefRef; - } - }); - } - - /** - * Returns the full name of the user represented by the given NodeRef - * - * @param nodeService The node service instance - * @param user The user to get the full name for - * @return The full name - */ - public static String getFullName(NodeService nodeService, NodeRef user) - { - Map props = nodeService.getProperties(user); - String firstName = (String)props.get(ContentModel.PROP_FIRSTNAME); - String lastName = (String)props.get(ContentModel.PROP_LASTNAME); - String fullName = firstName + ((lastName != null && lastName.length() > 0) ? " " + lastName : ""); - - return fullName; - } + return null; + } + else + { + // create the configuration folder for this Person node + configurableService.makeConfigurable(person); + } + } + + // target of the assoc is the configurations folder ref + NodeRef configRef = configurableService.getConfigurationFolder(person); + if (configRef == null) + { + throw new IllegalStateException("Unable to find associated 'configurations' folder for node: " + + person); + } + + String xpath = NamespaceService.APP_MODEL_PREFIX + ":" + "preferences"; + List nodes = searchService.selectNodes(configRef, xpath, null, namespaceService, false); + + if (nodes.size() == 1) + { + prefRef = nodes.get(0); + } + else + { + // create the preferences Node for this user (if repo is not read-only) + if (txService.isReadOnly() == false) + { + ChildAssociationRef childRef = nodeService.createNode(configRef, + ContentModel.ASSOC_CONTAINS, QName.createQName( + NamespaceService.APP_MODEL_1_0_URI, "preferences"), + ContentModel.TYPE_CMOBJECT); + + prefRef = childRef.getChildRef(); + } + } + return prefRef; + } + }); + } + + /** + * Returns the full name of the user represented by the given NodeRef + * + * @param nodeService The node service instance + * @param user The user to get the full name for + * @return The full name + */ + public static String getFullName(NodeService nodeService, NodeRef user) + { + Map props = nodeService.getProperties(user); + String firstName = (String)props.get(ContentModel.PROP_FIRSTNAME); + String lastName = (String)props.get(ContentModel.PROP_LASTNAME); + String fullName = firstName + ((lastName != null && lastName.length() > 0) ? " " + lastName : ""); + + return fullName; + } /** * Returns the full name of the user plus their userid in the form [id] @@ -313,4 +312,4 @@ public final class User implements SessionUser return nameAndId.toString(); } -} +} diff --git a/source/java/org/alfresco/web/bean/spaces/SpaceDetailsDialog.java b/source/java/org/alfresco/web/bean/spaces/SpaceDetailsDialog.java index ebefde152d..f3bcb41049 100644 --- a/source/java/org/alfresco/web/bean/spaces/SpaceDetailsDialog.java +++ b/source/java/org/alfresco/web/bean/spaces/SpaceDetailsDialog.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2010 Alfresco Software Limited. + * Copyright (C) 2005-2012 Alfresco Software Limited. * * This file is part of Alfresco * @@ -20,6 +20,7 @@ package org.alfresco.web.bean.spaces; import java.text.MessageFormat; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -39,6 +40,8 @@ import org.alfresco.web.bean.TemplateSupportBean; import org.alfresco.web.bean.dialog.NavigationSupport; import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Repository; +import org.alfresco.web.ui.common.NodeListUtils; +import org.alfresco.web.ui.common.NodePropertyComparator; import org.alfresco.web.ui.common.Utils; import org.alfresco.web.ui.common.Utils.URLMode; import org.alfresco.web.ui.common.component.UIActionLink; @@ -165,49 +168,23 @@ public class SpaceDetailsDialog extends BaseDetailsBean implements NavigationSup */ public void nextItem(ActionEvent event) { - boolean foundNextItem = false; UIActionLink link = (UIActionLink)event.getComponent(); Map params = link.getParameterMap(); String id = params.get("id"); if (id != null && id.length() != 0) { - NodeRef currNodeRef = new NodeRef(Repository.getStoreRef(), id); + NodeRef currNodeRef = new NodeRef(Repository.getStoreRef(), id); List nodes = this.browseBean.getParentNodes(currNodeRef); + Node next = null; if (nodes.size() > 1) { - // perform a linear search - this is slow but stateless - // otherwise we would have to manage state of last selected node - // this gets very tricky as this bean is instantiated once and never - // reset - it does not know when the document has changed etc. - for (int i=0; i params = link.getParameterMap(); String id = params.get("id"); if (id != null && id.length() != 0) { - NodeRef currNodeRef = new NodeRef(Repository.getStoreRef(), id); + NodeRef currNodeRef = new NodeRef(Repository.getStoreRef(), id); List nodes = this.browseBean.getParentNodes(currNodeRef); + Node previous = null; if (nodes.size() > 1) { - // see above - for (int i=0; i nodes = getNodes(); if (nodes.size() > 1) { - // perform a linear search - this is slow but stateless - // otherwise we would have to manage state of last selected node - // this gets very tricky as this bean is instantiated once and never - // reset - it does not know when the item has changed etc. - for (int i=0; i nodes = getNodes(); if (nodes.size() > 1) { - // see above - for (int i=0; i params = link.getParameterMap(); String id = params.get("id"); @@ -123,41 +125,16 @@ public class WebSiteDetailsDialog extends BaseDetailsBean implements NavigationS { NodeRef currNodeRef = new NodeRef(Repository.getStoreRef(), id); List nodes = this.browseBean.getParentNodes(currNodeRef); + Node next = null; if (nodes.size() > 1) { - // perform a linear search - this is slow but stateless - // otherwise we would have to manage state of last selected node - // this gets very tricky as this bean is instantiated once and never - // reset - it does not know when the document has changed etc. - for (int i = 0; i < nodes.size(); i++) - { - if (id.equals(nodes.get(i).getId()) == true) - { - Node next; - // found our item - navigate to next - if (i != nodes.size() - 1) - { - next = nodes.get(i + 1); - } - else - { - // handle wrapping case - next = nodes.get(0); - } - - // prepare for showing details for this node - this.browseBean.setupSpaceAction(next.getId(), false); - - // we found a next item - foundNextItem = true; - } - } + String currentSortColumn = this.browseBean.getSpacesRichList().getCurrentSortColumn(); + boolean currentSortDescending = this.browseBean.getSpacesRichList().isCurrentSortDescending(); + Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending)); + next = NodeListUtils.nextItem(nodes, id); + this.browseBean.setupSpaceAction(next.getId(), false); } - - // if we did not find a next item make sure the current node is - // in the dispatch context otherwise the details screen will go back - // to the default one. - if (foundNextItem == false) + if (next == null) { Node currNode = new Node(currNodeRef); this.navigator.setupDispatchContext(currNode); @@ -168,7 +145,6 @@ public class WebSiteDetailsDialog extends BaseDetailsBean implements NavigationS public void previousItem(ActionEvent event) { - boolean foundPreviousItem = false; UIActionLink link = (UIActionLink) event.getComponent(); Map params = link.getParameterMap(); String id = params.get("id"); @@ -176,38 +152,16 @@ public class WebSiteDetailsDialog extends BaseDetailsBean implements NavigationS { NodeRef currNodeRef = new NodeRef(Repository.getStoreRef(), id); List nodes = this.browseBean.getParentNodes(currNodeRef); + Node previous = null; if (nodes.size() > 1) { - // see above - for (int i = 0; i < nodes.size(); i++) - { - if (id.equals(nodes.get(i).getId()) == true) - { - Node previous; - // found our item - navigate to previous - if (i != 0) - { - previous = nodes.get(i - 1); - } - else - { - // handle wrapping case - previous = nodes.get(nodes.size() - 1); - } - - // show details for this node - this.browseBean.setupSpaceAction(previous.getId(), false); - - // we found a next item - foundPreviousItem = true; - } - } + String currentSortColumn = this.browseBean.getSpacesRichList().getCurrentSortColumn(); + boolean currentSortDescending = this.browseBean.getSpacesRichList().isCurrentSortDescending(); + Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending)); + previous = NodeListUtils.previousItem(nodes, id); + this.browseBean.setupSpaceAction(previous.getId(), false); } - - // if we did not find a previous item make sure the current node is - // in the dispatch context otherwise the details screen will go back - // to the default one. - if (foundPreviousItem == false) + if (previous == null) { Node currNode = new Node(currNodeRef); this.navigator.setupDispatchContext(currNode); diff --git a/source/java/org/alfresco/web/bean/workflow/StartWorkflowWizard.java b/source/java/org/alfresco/web/bean/workflow/StartWorkflowWizard.java index fc49485618..389cbcb1a3 100644 --- a/source/java/org/alfresco/web/bean/workflow/StartWorkflowWizard.java +++ b/source/java/org/alfresco/web/bean/workflow/StartWorkflowWizard.java @@ -34,7 +34,6 @@ import javax.faces.event.ActionEvent; import javax.faces.model.SelectItem; import javax.transaction.UserTransaction; -import org.springframework.extensions.config.ConfigElement; import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.repo.publishing.PublishingEventHelper; @@ -68,6 +67,7 @@ import org.alfresco.web.ui.common.component.UIActionLink; import org.alfresco.web.ui.common.component.data.UIRichList; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.springframework.extensions.config.ConfigElement; /** * Bean implementation for the Start Workflow Wizard. @@ -85,6 +85,7 @@ public class StartWorkflowWizard extends BaseWizardBean transient private Map workflows; protected List wcmWorkflows; + protected List excludedWorkflows; protected List invitationWorkflows; protected List publishingWorkflows; @@ -574,6 +575,7 @@ public class StartWorkflowWizard extends BaseWizardBean List configuredWcmWorkflows = this.getWCMWorkflowNames(); List configuredInvitationWorkflows = this.getInvitationServiceWorkflowNames(); List publishingWorkflows = this.getPublishingWorkflowNames(); + List excludedWorkflows = this.getExcludedWorkflows(); List workflowDefs = this.getWorkflowService().getDefinitions(); for (WorkflowDefinition workflowDef : workflowDefs) @@ -582,7 +584,8 @@ public class StartWorkflowWizard extends BaseWizardBean if (configuredWcmWorkflows.contains(name) == false && configuredInvitationWorkflows.contains(name) == false && - publishingWorkflows.contains(name) == false) + publishingWorkflows.contains(name) == false && + excludedWorkflows.contains(name) == false) { // add the workflow if it is not a WCM specific workflow String label = workflowDef.title; @@ -789,6 +792,36 @@ public class StartWorkflowWizard extends BaseWizardBean return wcmWorkflows; } + + /** + * Get the Names of globally excluded workflow-names. + * + * @return The names of the workflows to exclude. + */ + protected List getExcludedWorkflows() + { + if ((excludedWorkflows == null) || (Application.isDynamicConfig(FacesContext.getCurrentInstance()))) + { + FacesContext fc = FacesContext.getCurrentInstance(); + ConfigElement config = Application.getConfigService(fc).getGlobalConfig().getConfigElement("excluded-workflows"); + if (config != null) + { + StringTokenizer t = new StringTokenizer(config.getValue().trim(), ", "); + excludedWorkflows = new ArrayList(t.countTokens()); + while (t.hasMoreTokens()) + { + String wfName = t.nextToken(); + excludedWorkflows.add(wfName); + } + } + else + { + excludedWorkflows = Collections.emptyList(); + } + } + return excludedWorkflows; + } + /** * Get the Names of the Invitation Service Workflows * diff --git a/source/java/org/alfresco/web/bean/workflow/WorkflowTaskNode.java b/source/java/org/alfresco/web/bean/workflow/WorkflowTaskNode.java index 19c4d5862e..bb9ecf895a 100644 --- a/source/java/org/alfresco/web/bean/workflow/WorkflowTaskNode.java +++ b/source/java/org/alfresco/web/bean/workflow/WorkflowTaskNode.java @@ -11,6 +11,7 @@ import org.alfresco.service.cmr.workflow.WorkflowTransition; import org.alfresco.service.namespace.QName; import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.TransientMapNode; +import org.springframework.extensions.surf.util.I18NUtil; /** * Wrapper around a {@link WorkflowTask} to allow it to be approached as a {@link Node}. @@ -68,6 +69,16 @@ public class WorkflowTaskNode extends TransientMapNode { // add the task itself as a property propertyWrapper.put("workflowTask", workflowTask); } + + // Add an additional property, containing a human-friendly representation of the priority + Integer priority = (Integer) workflowTask.getProperties().get(WorkflowModel.PROP_PRIORITY); + String priorityMessage = ""; + if (priority != null) + { + priorityMessage = I18NUtil.getMessage(getPriorityMessageKey(priority), I18NUtil.getLocale()); + } + propertyWrapper.put("priorityMessage", priorityMessage); + } @Override @@ -112,4 +123,9 @@ public class WorkflowTaskNode extends TransientMapNode { return super.put(QName.resolveToQNameString(WorkflowTaskNode.this.getNamespacePrefixResolver(), key.toString()), value); } } + + protected String getPriorityMessageKey(int priority) + { + return "listconstraint.bpm_allowedPriority." + priority; + } } diff --git a/source/java/org/alfresco/web/config/ClientConfigElement.java b/source/java/org/alfresco/web/config/ClientConfigElement.java index 0ede9af8b8..7d123329e8 100644 --- a/source/java/org/alfresco/web/config/ClientConfigElement.java +++ b/source/java/org/alfresco/web/config/ClientConfigElement.java @@ -86,6 +86,7 @@ public class ClientConfigElement extends ConfigElementAdapter private int pickerSearchMinimum = 2; private boolean checkContextAgainstPath = false; private boolean allowUserScriptExecute = false; + private boolean isBulkFetchEnabled = true; /** @@ -963,4 +964,21 @@ public class ClientConfigElement extends ConfigElementAdapter { this.allowUserScriptExecute = allowUserScriptExecute; } + + /** + * @return true if bulk fetch is enabled + */ + public boolean isBulkFetchEnabled() + { + return isBulkFetchEnabled; + } + + /** + * @param isBulkFetchEnabled + */ + /*package*/ void setBulkFetchEnabled(boolean isBulkFetchEnabled) + { + this.isBulkFetchEnabled = isBulkFetchEnabled; + } + } diff --git a/source/java/org/alfresco/web/config/ClientElementReader.java b/source/java/org/alfresco/web/config/ClientElementReader.java index 36743b668c..bc5e21d7cc 100644 --- a/source/java/org/alfresco/web/config/ClientElementReader.java +++ b/source/java/org/alfresco/web/config/ClientElementReader.java @@ -43,6 +43,7 @@ public class ClientElementReader implements ConfigElementReader public static final String ELEMENT_SEARCHMINIMUM = "search-minimum"; public static final String ELEMENT_SEARCHANDTERMS = "search-and-terms"; public static final String ELEMENT_SEARCHMAXRESULTS = "search-max-results"; + public static final String ELEMENT_BULKFETCHENABLED = "bulk-fetch-enabled"; public static final String ELEMENT_SELECTORSSEARCHMAXRESULTS = "selectors-search-max-results"; public static final String ELEMENT_INVITESEARCHMAXRESULTS = "invite-users-max-results"; public static final String ELEMENT_TASKSCOMPLETEDMAXRESULTS = "tasks-completed-max-results"; @@ -141,6 +142,13 @@ public class ClientElementReader implements ConfigElementReader configElement.setSearchMaxResults(Integer.parseInt(searchMaxResults.getTextTrim())); } + // get the search max results size + Element isBulkFetchEnabled = element.element(ELEMENT_BULKFETCHENABLED); + if (isBulkFetchEnabled != null) + { + configElement.setBulkFetchEnabled(Boolean.parseBoolean(isBulkFetchEnabled.getTextTrim())); + } + // get the selectors search max results size Element selectorsSearchMaxResults = element.element(ELEMENT_SELECTORSSEARCHMAXRESULTS); if (selectorsSearchMaxResults != null) diff --git a/source/java/org/alfresco/web/forms/xforms/XFormsProcessor.java b/source/java/org/alfresco/web/forms/xforms/XFormsProcessor.java index 3f2bffd79a..2a1790f29c 100644 --- a/source/java/org/alfresco/web/forms/xforms/XFormsProcessor.java +++ b/source/java/org/alfresco/web/forms/xforms/XFormsProcessor.java @@ -426,8 +426,12 @@ public class XFormsProcessor implements FormProcessor { return result; } - throw new RuntimeException("widget definitions " + this + - " and " + other + " collide"); + + if (LOGGER.isInfoEnabled()) + { + LOGGER.info("widget definitions " + this + " and " + other + " may collide"); + } + return 0; } public String toString() diff --git a/source/java/org/alfresco/web/ui/common/NodeListUtils.java b/source/java/org/alfresco/web/ui/common/NodeListUtils.java new file mode 100644 index 0000000000..f9e2f814e3 --- /dev/null +++ b/source/java/org/alfresco/web/ui/common/NodeListUtils.java @@ -0,0 +1,100 @@ +/* + * Copyright (C) 2005-2012 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 . + */ +package org.alfresco.web.ui.common; + +import java.util.List; + +import org.alfresco.web.bean.repository.Node; + +/** + * Helper class to get next or previos node from the list of nodes. +* +* @author vdanilchenko +* @since 4.1.3 +*/ +public class NodeListUtils +{ + /** + * @param nodes the list of the nodes + * @param currentNodeId the current node ID + */ + public static Node nextItem(List nodes, String currentNodeId) + { + Node next = null; + + // perform a linear search - this is slow but stateless + // otherwise we would have to manage state of last selected node + // this gets very tricky as this bean is instantiated once and never + // reset - it does not know when the document has changed etc. + for (int i=0; i nodes, String currentNodeId) + { + Node previous = null; + + // perform a linear search - this is slow but stateless + // otherwise we would have to manage state of last selected node + // this gets very tricky as this bean is instantiated once and never + // reset - it does not know when the document has changed etc. + for (int i=0; i. + */ +package org.alfresco.web.ui.common; + +import org.alfresco.service.cmr.dictionary.PropertyDefinition; +import org.alfresco.web.bean.repository.DataDictionary; +import org.alfresco.web.bean.repository.Node; +import org.alfresco.web.app.Application; + +import org.springframework.web.jsf.FacesContextUtils; + +import java.util.Comparator; +import java.util.Date; +import java.util.Map; + +import javax.faces.context.FacesContext; + +/** + * Comparator to sort the list of nodes according theirs properties and sort order + * + * @author vdanilchenko + * @since 4.1.3 + */ +public class NodePropertyComparator implements Comparator +{ + private String propertyName; + private boolean isAscending; + private DataDictionary dataDictionary; + + /** + * @param propertyName the property name to sort + * @param isAscending sort order + */ + public NodePropertyComparator(String propertyName, boolean isAscending) + { + super(); + this.propertyName = propertyName; + this.isAscending = isAscending; + + FacesContext context = FacesContext.getCurrentInstance(); + dataDictionary = (DataDictionary)FacesContextUtils.getRequiredWebApplicationContext(context).getBean(Application.BEAN_DATA_DICTIONARY); + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + public int compare(Object node1, Object node2) + { + Map nodeProperties1 = ((Node)node1).getProperties(); + Map nodeProperties2 = ((Node)node2).getProperties(); + PropertyDefinition pd1 = dataDictionary.getPropertyDefinition((Node)node1, propertyName); + PropertyDefinition pd2 = dataDictionary.getPropertyDefinition((Node)node2, propertyName); + Comparable propertyValue1, propertyValue2; + if((pd1 != null) && (pd2 != null)) + { + String typeName = pd1.getDataType().getName().getLocalName(); + + if(typeName.equals("datetime")) + { + propertyValue1 = (Date) nodeProperties1.get(propertyName); + propertyValue2 = (Date) nodeProperties2.get(propertyName); + } + else if(typeName.equals("long")) + { + propertyValue1 = (Long) nodeProperties1.get(propertyName); + propertyValue2 = (Long) nodeProperties2.get(propertyName); + } + else if(typeName.equals("boolean")) + { + propertyValue1 = (Boolean) nodeProperties1.get(propertyName); + propertyValue2 = (Boolean) nodeProperties2.get(propertyName); + } + //string types: text, mltext + //non comparable types: locale, content + else + { + propertyValue1 = nodeProperties1.get(propertyName).toString(); + propertyValue2 = nodeProperties2.get(propertyName).toString(); + } + } + //additional properties doesn't contains in the node properties + //their type can't be resolved using DataDictionary + //QNameNodeMap resolves them on first invocation and puts them into the map of node properties + else + { + if(propertyName.equals("size")) + { + propertyValue1 = (Long) nodeProperties1.get(propertyName); + propertyValue2 = (Long) nodeProperties2.get(propertyName); + } + else + { + propertyValue1 = nodeProperties1.get(propertyName).toString(); + propertyValue2 = nodeProperties2.get(propertyName).toString(); + } + } + + if(isAscending) + { + return propertyValue1.compareTo(propertyValue2); + } + return propertyValue2.compareTo(propertyValue1); + } +} 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 24cdd141c9..1396aedff7 100644 --- a/source/java/org/alfresco/web/ui/repo/tag/PageTag.java +++ b/source/java/org/alfresco/web/ui/repo/tag/PageTag.java @@ -1,392 +1,380 @@ -/* - * Copyright (C) 2005-2013 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-2013 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); - } - } - } -} +/* + * Copyright (C) 2005-2013 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-2013 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); + } + } + } +} diff --git a/source/java/org/alfresco/web/app/ResourceBundleWrapperTest.java b/source/test-java/org/alfresco/web/app/ResourceBundleWrapperTest.java similarity index 100% rename from source/java/org/alfresco/web/app/ResourceBundleWrapperTest.java rename to source/test-java/org/alfresco/web/app/ResourceBundleWrapperTest.java diff --git a/source/test-java/org/alfresco/web/app/servlet/AuthenticationFilterTest.java b/source/test-java/org/alfresco/web/app/servlet/AuthenticationFilterTest.java new file mode 100644 index 0000000000..017eebb144 --- /dev/null +++ b/source/test-java/org/alfresco/web/app/servlet/AuthenticationFilterTest.java @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2005-2013 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 . + */ +package org.alfresco.web.app.servlet; + +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.*; + +import javax.servlet.FilterChain; +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.alfresco.repo.tenant.TenantContextHolder; +import org.alfresco.web.config.ClientConfigElement; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; +import org.springframework.context.ApplicationEvent; +import org.springframework.extensions.config.ConfigImpl; +import org.springframework.extensions.config.ConfigService; + +/** + * Test for the AuthenticationFilter class. + * + * @author alex.mukha + */ +@RunWith(MockitoJUnitRunner.class) +public class AuthenticationFilterTest +{ + private static String loginPage = "loginpage"; + + private String tenantDomain = "tenantDomain-" + System.currentTimeMillis(); + + private @Mock ServletContext context; + private @Mock HttpServletResponse res; + private @Mock FilterChain chain; + private @Mock ApplicationEvent event; + + /** + * Test for the fix for ALF-18611 + * @throws Exception + */ + @Test + public void testALF18611() throws Exception + { + ClientConfigElement clientConfigElementMock = mock(ClientConfigElement.class); + when(clientConfigElementMock.getLoginPage()).thenReturn(loginPage); + ConfigImpl configImplMock = mock(ConfigImpl.class); + when(configImplMock.getConfigElement(ClientConfigElement.CONFIG_ELEMENT_ID)).thenReturn(clientConfigElementMock); + ConfigService configServiceMock = mock(ConfigService.class); + when(configServiceMock.getGlobalConfig()).thenReturn(configImplMock); + + TenantContextHolder.setTenantDomain(tenantDomain); + assertTrue("Tenant domain should be equal", TenantContextHolder.getTenantDomain().equals(tenantDomain.toLowerCase())); + AuthenticationFilter authenticationFilter = new AuthenticationFilter(); + authenticationFilter.setConfigService(configServiceMock); + authenticationFilter.onBootstrap(event); + + HttpServletRequest reqMock = mock(HttpServletRequest.class); + when(reqMock.getRequestURI()).thenReturn(loginPage); + authenticationFilter.doFilter(context, reqMock, res, chain); + + assertTrue("Tenant domain should be empty", TenantContextHolder.getTenantDomain() == null); + } +} diff --git a/source/java/org/alfresco/web/app/servlet/DefaultRemoteUserMapperTest.java b/source/test-java/org/alfresco/web/app/servlet/DefaultRemoteUserMapperTest.java similarity index 100% rename from source/java/org/alfresco/web/app/servlet/DefaultRemoteUserMapperTest.java rename to source/test-java/org/alfresco/web/app/servlet/DefaultRemoteUserMapperTest.java diff --git a/source/java/org/alfresco/web/config/WebClientConfigTest.java b/source/test-java/org/alfresco/web/config/WebClientConfigTest.java similarity index 100% rename from source/java/org/alfresco/web/config/WebClientConfigTest.java rename to source/test-java/org/alfresco/web/config/WebClientConfigTest.java diff --git a/source/java/org/alfresco/web/forms/FormsTest.java b/source/test-java/org/alfresco/web/forms/FormsTest.java similarity index 100% rename from source/java/org/alfresco/web/forms/FormsTest.java rename to source/test-java/org/alfresco/web/forms/FormsTest.java diff --git a/source/java/org/alfresco/web/forms/XMLUtilTest.java b/source/test-java/org/alfresco/web/forms/XMLUtilTest.java similarity index 100% rename from source/java/org/alfresco/web/forms/XMLUtilTest.java rename to source/test-java/org/alfresco/web/forms/XMLUtilTest.java diff --git a/source/java/org/alfresco/web/forms/xforms/Schema2XFormsTest.java b/source/test-java/org/alfresco/web/forms/xforms/Schema2XFormsTest.java similarity index 100% rename from source/java/org/alfresco/web/forms/xforms/Schema2XFormsTest.java rename to source/test-java/org/alfresco/web/forms/xforms/Schema2XFormsTest.java diff --git a/source/java/org/alfresco/web/app/resourceBundleWrapperTest.properties b/source/test-resources/org/alfresco/web/app/resourceBundleWrapperTest.properties similarity index 100% rename from source/java/org/alfresco/web/app/resourceBundleWrapperTest.properties rename to source/test-resources/org/alfresco/web/app/resourceBundleWrapperTest.properties diff --git a/source/web/WEB-INF/wsdl/CMIS-Core.xsd b/source/web/WEB-INF/cmis10/CMIS-Core.xsd.template similarity index 100% rename from source/web/WEB-INF/wsdl/CMIS-Core.xsd rename to source/web/WEB-INF/cmis10/CMIS-Core.xsd.template diff --git a/source/web/WEB-INF/wsdl/CMIS-Messaging.xsd b/source/web/WEB-INF/cmis10/CMIS-Messaging.xsd.template similarity index 99% rename from source/web/WEB-INF/wsdl/CMIS-Messaging.xsd rename to source/web/WEB-INF/cmis10/CMIS-Messaging.xsd.template index a6ad7878c6..b889164c3e 100644 --- a/source/web/WEB-INF/wsdl/CMIS-Messaging.xsd +++ b/source/web/WEB-INF/cmis10/CMIS-Messaging.xsd.template @@ -22,7 +22,7 @@ jaxb:extensionBindingPrefixes="xjc" jaxb:version="2.1" elementFormDefault="qualified"> - diff --git a/source/web/WEB-INF/wsdl/CMISWS-Service.wsdl b/source/web/WEB-INF/cmis10/CMISWS-Service.wsdl.template similarity index 97% rename from source/web/WEB-INF/wsdl/CMISWS-Service.wsdl rename to source/web/WEB-INF/cmis10/CMISWS-Service.wsdl.template index b749511e81..913cdf04c5 100644 --- a/source/web/WEB-INF/wsdl/CMISWS-Service.wsdl +++ b/source/web/WEB-INF/cmis10/CMISWS-Service.wsdl.template @@ -22,9 +22,9 @@ - - @@ -1121,52 +1121,52 @@ + location="<%cmisbase%>/DiscoveryService" /> + location="<%cmisbase%>/MultiFilingService" /> + location="<%cmisbase%>/NavigationService" /> - + - + + location="<%cmisbase%>/RelationshipService" /> + location="<%cmisbase%>/RepositoryService" /> + location="<%cmisbase%>/VersioningService" /> - + diff --git a/source/web/WEB-INF/cmis11/CMIS-Core.xsd.template b/source/web/WEB-INF/cmis11/CMIS-Core.xsd.template new file mode 100644 index 0000000000..44ad01f06a --- /dev/null +++ b/source/web/WEB-INF/cmis11/CMIS-Core.xsd.template @@ -0,0 +1,1396 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is the property definition id for this + property instance. This is not required to be set when used + as a default value. This is required to be set when used for + query result set or returning properties on an object. + + + + + + + This is the localname as defined by the property + definition. + + + + + + + This is the displayname as defined by the property + definition. + + + + + + + This is the queryName. This must be specified if + this is the result of a query. If aliases are used, the alias is to + be specified here instead of the queryName. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is the id for the parent type definition. + If this is a base type, this is MUST NOT be present. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + If set, this field holds the principal who is + used for anonymous access. This principal can then be + passed to the ACL services to specify what permissions + anonymous users should have. + + + + + + + + If set, this field holds the principal who is + used for everyone's access. This principal can then be + passed to the ACL services to specify what permissions + everyone should have. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Multiple entries are OR'ed together. Any + permission that specified is sufficient to + provide rights required in key + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This user can be used on setting ACLs to specify + the permission this + user context should have. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is the root tag for a CMIS AllowableActions + Document Type + + + + + + + + This is the root tag for a CMIS Query Document Type + + + + + + + This is the root tag for a CMIS ACL Document Type + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/web/WEB-INF/cmis11/CMIS-Messaging.xsd.template b/source/web/WEB-INF/cmis11/CMIS-Messaging.xsd.template new file mode 100644 index 0000000000..f73091597b --- /dev/null +++ b/source/web/WEB-INF/cmis11/CMIS-Messaging.xsd.template @@ -0,0 +1,2309 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is an extension element to hold any + repository or + vendor-specific extensions + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/web/WEB-INF/cmis11/CMISWS-Service.wsdl.template b/source/web/WEB-INF/cmis11/CMISWS-Service.wsdl.template new file mode 100644 index 0000000000..9d049a3f41 --- /dev/null +++ b/source/web/WEB-INF/cmis11/CMISWS-Service.wsdl.template @@ -0,0 +1,1311 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/web/WEB-INF/sun-jaxws.xml b/source/web/WEB-INF/sun-jaxws.xml index 57b9672f85..5d8faa8332 100644 --- a/source/web/WEB-INF/sun-jaxws.xml +++ b/source/web/WEB-INF/sun-jaxws.xml @@ -19,8 +19,10 @@ --> - + + @@ -33,7 +35,7 @@ - - @@ -61,7 +63,7 @@ - - - - - - + + + + + + + org.apache.chemistry.opencmis.server.impl.webservices.AuthHandler + + + + + + + + + + org.apache.chemistry.opencmis.server.impl.webservices.AuthHandler + + + + + + + + + + org.apache.chemistry.opencmis.server.impl.webservices.AuthHandler + + + + + + + + + + org.apache.chemistry.opencmis.server.impl.webservices.AuthHandler + + + + + + + + + + org.apache.chemistry.opencmis.server.impl.webservices.AuthHandler + + + + + + + + + + org.apache.chemistry.opencmis.server.impl.webservices.AuthHandler + + + + + + + + + + org.apache.chemistry.opencmis.server.impl.webservices.AuthHandler + + + + + + + + + + org.apache.chemistry.opencmis.server.impl.webservices.AuthHandler + + + + + + + + + + org.apache.chemistry.opencmis.server.impl.webservices.AuthHandler + + + + + diff --git a/source/web/WEB-INF/web.xml b/source/web/WEB-INF/web.xml index 8fc85fc015..83689caf7b 100644 --- a/source/web/WEB-INF/web.xml +++ b/source/web/WEB-INF/web.xml @@ -102,6 +102,12 @@ + + CMIS security context cleaning filter + Cleans security context before authentication via the CMIS services or filters. Mapped only for CMIS + org.alfresco.web.app.servlet.CmisSecurityContextCleanerFilter + + Authentication Filter Authentication filter mapped only to faces URLs. Other URLs generally use proprietary means to talk to the AuthenticationComponent @@ -111,7 +117,7 @@ AuthenticationFilter - + Global Authentication Filter Authentication filter mapped to all authenticated URLs. Mainly for SSO support @@ -182,6 +188,16 @@ Global Localization Filter /* + + + CMIS security context cleaning filter + /cmisws/* + + + + CMIS security context cleaning filter + /cmisatom/* + Global Authentication Filter @@ -366,8 +382,8 @@ - com.sun.xml.ws.transport.http.servlet.WSServletContextListener - + com.sun.xml.ws.transport.http.servlet.WSServletContextListener + @@ -556,31 +572,49 @@ - - cmisws - org.apache.chemistry.opencmis.server.impl.webservices.CmisWebServicesServlet - 7 - + + cmisws10 + org.apache.chemistry.opencmis.server.impl.webservices.CmisWebServicesServlet + + cmisVersion + 1.0 + + 7 + + + + cmisws11 + org.apache.chemistry.opencmis.server.impl.webservices.CmisWebServicesServlet + + cmisVersion + 1.1 + + 7 + - - cmisatom - org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet - - callContextHandler - org.apache.chemistry.opencmis.server.shared.BasicAuthCallContextHandler - - 8 - + + cmisatom10 + org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet + + callContextHandler + org.apache.chemistry.opencmis.server.shared.BasicAuthCallContextHandler + + + cmisVersion + 1.0 + + 8 + - - cmisbrowser - org.apache.chemistry.opencmis.server.impl.browser.CmisBrowserBindingServlet - - callContextHandler - org.apache.chemistry.opencmis.server.shared.BasicAuthCallContextHandler - - 8 - + + cmisbrowser + org.apache.chemistry.opencmis.server.impl.browser.CmisBrowserBindingServlet + + callContextHandler + org.apache.chemistry.opencmis.server.shared.BasicAuthCallContextHandler + + 8 + cmistck @@ -592,6 +626,15 @@ authenticatorServlet org.alfresco.repo.web.scripts.servlet.AuthenticatorServlet + + + publicapiServlet + org.alfresco.rest.api.PublicApiWebScriptServlet + + authenticator + publicapi.authenticator + + @@ -682,7 +725,7 @@ axis - /api/* + /soapapi/* @@ -766,12 +809,12 @@ - cmisws + cmisws10 /cmisws/* - cmisatom + cmisatom10 /cmisatom/* @@ -779,6 +822,11 @@ cmisbrowser /cmisbrowser/* + + + publicapiServlet + /api/* + + SOLR @@ -880,6 +930,8 @@ repoclient + + A flag that globally enables or disables startup of the major Alfresco subsystems. properties/startup.enable diff --git a/source/web/WEB-INF/wsdl/xml.xsd b/source/web/WEB-INF/wsdl/xml.xsd deleted file mode 100644 index 052806ba41..0000000000 --- a/source/web/WEB-INF/wsdl/xml.xsd +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - See http://www.w3.org/TR/xmlbase/ for - information about this attribute. - - - - - - See http://www.w3.org/TR/xml-id/ for - information about this attribute. - - - - - - - - - - - \ No newline at end of file diff --git a/source/web/images/logo/hazelcast.png b/source/web/images/logo/hazelcast.png new file mode 100644 index 0000000000..a3e23142a7 Binary files /dev/null and b/source/web/images/logo/hazelcast.png differ diff --git a/source/web/images/logo/hibernate_logo.gif b/source/web/images/logo/hibernate_logo.gif deleted file mode 100644 index 52b21c1d1e..0000000000 Binary files a/source/web/images/logo/hibernate_logo.gif and /dev/null differ diff --git a/source/web/images/logo/ibatis.png b/source/web/images/logo/ibatis.png new file mode 100644 index 0000000000..7a5242d838 Binary files /dev/null and b/source/web/images/logo/ibatis.png differ diff --git a/source/web/images/logo/java.gif b/source/web/images/logo/java.gif index e88f047d11..27d1c15036 100644 Binary files a/source/web/images/logo/java.gif and b/source/web/images/logo/java.gif differ diff --git a/source/web/images/logo/libreoffice.png b/source/web/images/logo/libreoffice.png new file mode 100644 index 0000000000..c08e6b16cb Binary files /dev/null and b/source/web/images/logo/libreoffice.png differ diff --git a/source/web/images/logo/mybatis.png b/source/web/images/logo/mybatis.png new file mode 100644 index 0000000000..4c6e83f2e5 Binary files /dev/null and b/source/web/images/logo/mybatis.png differ diff --git a/source/web/images/logo/open-office.gif b/source/web/images/logo/open-office.gif deleted file mode 100644 index fc44c00680..0000000000 Binary files a/source/web/images/logo/open-office.gif and /dev/null differ diff --git a/source/web/images/logo/solr.png b/source/web/images/logo/solr.png new file mode 100644 index 0000000000..99d88512d9 Binary files /dev/null and b/source/web/images/logo/solr.png differ diff --git a/source/web/jsp/dialog/about.jsp b/source/web/jsp/dialog/about.jsp index 119f4f4052..d9ec12650f 100644 --- a/source/web/jsp/dialog/about.jsp +++ b/source/web/jsp/dialog/about.jsp @@ -1,209 +1,193 @@ -<%-- - * Copyright (C) 2005-2013 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-2013 All rights reserved. Legal and License -

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

 

- -
- - Spring Framework - - - Hibernate - -
-
- - The Apache Software Foundation - -
-
- - The Apache Jakarta Project - -
-
- - Java - - - JBoss - - - My Faces - -
-
- - Lucene - - - Code Generation Library - -
-
- - PDFBox - - - TinyMCE - - - OpenOffice.org - - - 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-2013 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-2013 All rights reserved. Legal and License +

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

 

+ +
+ + Spring Framework + + + Hibernate + +
+
+ + The Apache Software Foundation + +
+
+ + The Apache Jakarta Project + +
+
+ + Java + + + JBoss + + + My Faces + +
+
+ + Lucene + + + Code Generation Library + +
+
+ + PDFBox + + + TinyMCE + + + OpenOffice.org + + + 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 diff --git a/source/web/jsp/workflow/pooled-tasks-todo-dashlet.jsp b/source/web/jsp/workflow/pooled-tasks-todo-dashlet.jsp index 901947c14d..aee1e78591 100644 --- a/source/web/jsp/workflow/pooled-tasks-todo-dashlet.jsp +++ b/source/web/jsp/workflow/pooled-tasks-todo-dashlet.jsp @@ -79,7 +79,7 @@ - + <%-- Actions column --%> diff --git a/source/web/jsp/workflow/tasks-active-dashlet.jsp b/source/web/jsp/workflow/tasks-active-dashlet.jsp index 191e475528..0ee1e24c4e 100644 --- a/source/web/jsp/workflow/tasks-active-dashlet.jsp +++ b/source/web/jsp/workflow/tasks-active-dashlet.jsp @@ -87,7 +87,7 @@ - + <%-- Actions column --%> diff --git a/source/web/jsp/workflow/tasks-todo-dashlet.jsp b/source/web/jsp/workflow/tasks-todo-dashlet.jsp index eb99d1728b..20836f8756 100644 --- a/source/web/jsp/workflow/tasks-todo-dashlet.jsp +++ b/source/web/jsp/workflow/tasks-todo-dashlet.jsp @@ -74,12 +74,12 @@ - <%-- Priority column --%> + <%-- Priority column --%> - + <%-- Actions column --%> diff --git a/source/web/scripts/ajax/tiny_mce_wcm_extensions.js b/source/web/scripts/ajax/tiny_mce_wcm_extensions.js index b305352346..653c6e2aa8 100644 --- a/source/web/scripts/ajax/tiny_mce_wcm_extensions.js +++ b/source/web/scripts/ajax/tiny_mce_wcm_extensions.js @@ -30,6 +30,9 @@ if (!alfresco.log) alfresco.log = alfresco.constants.DEBUG ? log : Class.empty; } +//MNT-2080: AVM_WEBAPP url rendering in the html view of TinyMCE editor +tinyMCE.avmWebappUrl = alfresco.constants.AVM_WEBAPP_URL; + function alfresco_TinyMCE_urlconverter_callback(href, element, onsave) { var result = null; @@ -47,7 +50,7 @@ function alfresco_TinyMCE_urlconverter_callback(href, element, onsave) } else if (href.startsWith("/")) { - result = alfresco.constants.AVM_WEBAPP_URL + href; + result = alfresco.constants.AVM_WEBAPP_URL + href; } else if (href.startsWith(document.location.href)) { diff --git a/source/web/scripts/tiny_mce/themes/advanced/js/source_editor.js b/source/web/scripts/tiny_mce/themes/advanced/js/source_editor.js index 279328614c..fe5fd69015 100644 --- a/source/web/scripts/tiny_mce/themes/advanced/js/source_editor.js +++ b/source/web/scripts/tiny_mce/themes/advanced/js/source_editor.js @@ -13,7 +13,13 @@ function onLoadInit() { if (tinymce.isGecko) document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck"); - document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true}); + //MNT-2080: AVM_WEBAPP url rendering in the html view of TinyMCE editor + var src = tinyMCEPopup.editor.getContent({source_view : true}); + + if (tinyMCE.avmWebappUrl != null) + src = src.replace(new RegExp(tinyMCE.avmWebappUrl, 'g'), ""); + + document.getElementById('htmlSource').value = src; if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) { setWrap('soft');