diff --git a/pom.xml b/pom.xml index 1c11f455b1..cf9a65ebcf 100644 --- a/pom.xml +++ b/pom.xml @@ -35,13 +35,13 @@ ${project.build.directory}/alf_data convert - 7.57 - 7.9 - 8.29 + 7.58 + 7.10 + 8.30 1.1 2.9.8 - 6.21 + 7.0 1.0.0 5.1.6.RELEASE 42.2.5 diff --git a/src/main/java/org/alfresco/repo/utils/FacesImageResolver.java b/src/main/java/org/alfresco/repo/utils/FacesImageResolver.java deleted file mode 100644 index 5de44e4886..0000000000 --- a/src/main/java/org/alfresco/repo/utils/FacesImageResolver.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * #%L - * Alfresco Remote API - * %% - * Copyright (C) 2005 - 2016 Alfresco Software Limited - * %% - * This file is part of the Alfresco software. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * 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 . - * #L% - */ -package org.alfresco.repo.utils; - -import javax.faces.context.FacesContext; - -import org.alfresco.repo.web.scripts.FileTypeImageUtils; -import org.alfresco.service.cmr.repository.FileTypeImageSize; -import org.alfresco.service.cmr.repository.TemplateImageResolver; - -/** - * Default implementation of {@link TemplateImageResolver} interface, based on {@link FileTypeImageUtils} utility. It relies on availability of {@link FacesContext} instance - * - * @author Dmitry Velichkevich - */ -public class FacesImageResolver implements TemplateImageResolver -{ - private static final long serialVersionUID = 1L; - - /* (non-Javadoc) - * @see org.alfresco.service.cmr.repository.TemplateImageResolver#resolveImagePathForName(java.lang.String, org.alfresco.service.cmr.repository.FileTypeImageSize) - */ - @Override - public String resolveImagePathForName(String filename, FileTypeImageSize size) - { - if (FacesContext.getCurrentInstance() != null) - { - return FileTypeImageUtils.getFileTypeImage(FacesContext.getCurrentInstance(), filename, size); - } - else - { - return null; - } - } -} diff --git a/src/main/java/org/alfresco/repo/web/scripts/FileTypeImageUtils.java b/src/main/java/org/alfresco/repo/web/scripts/FileTypeImageUtils.java index dc6b82a8bc..6a33e73523 100644 --- a/src/main/java/org/alfresco/repo/web/scripts/FileTypeImageUtils.java +++ b/src/main/java/org/alfresco/repo/web/scripts/FileTypeImageUtils.java @@ -1,34 +1,33 @@ -/* - * #%L - * Alfresco Remote API - * %% - * Copyright (C) 2005 - 2016 Alfresco Software Limited - * %% - * This file is part of the Alfresco software. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * 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 . - * #L% - */ +/* + * #%L + * Alfresco Remote API + * %% + * Copyright (C) 2005 - 2016 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * 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 . + * #L% + */ package org.alfresco.repo.web.scripts; import java.util.HashMap; import java.util.Map; -import javax.faces.context.FacesContext; import javax.servlet.ServletContext; import org.alfresco.api.AlfrescoPublicApi; @@ -52,49 +51,7 @@ public class FileTypeImageUtils private static final String DEFAULT_FILE_IMAGE64 = IMAGE_PREFIX64 + "_default" + IMAGE_POSTFIX_PNG; private static final Map s_fileExtensionMap = new HashMap(89, 1.0f); - - /** - * Return the image path to the filetype icon for the specified file name string - * - * @param name File name to build filetype icon path for - * @param small True for the small 16x16 icon or false for the large 32x32 - * - * @return the image path for the specified node type or the default icon if not found - */ - public static String getFileTypeImage(String name, boolean small) - { - return getFileTypeImage(FacesContext.getCurrentInstance(), null, name, - (small ? FileTypeImageSize.Small : FileTypeImageSize.Medium)); - } - - /** - * Return the image path to the filetype icon for the specified file name string - * - * @param fc FacesContext - * @param name File name to build filetype icon path for - * @param small True for the small 16x16 icon or false for the large 32x32 - * - * @return the image path for the specified node type or the default icon if not found - */ - public static String getFileTypeImage(FacesContext fc, String name, boolean small) - { - return getFileTypeImage(fc, null, name, (small ? FileTypeImageSize.Small : FileTypeImageSize.Medium)); - } - - /** - * Return the image path to the filetype icon for the specified file name string - * - * @param fc FacesContext - * @param name File name to build filetype icon path for - * @param size Size of the icon to return - * - * @return the image path for the specified node type or the default icon if not found - */ - public static String getFileTypeImage(FacesContext fc, String name, FileTypeImageSize size) - { - return getFileTypeImage(fc, null, name, size); - } - + /** * Return the image path to the filetype icon for the specified file name string * @@ -106,7 +63,7 @@ public class FileTypeImageUtils */ public static String getFileTypeImage(ServletContext sc, String name, boolean small) { - return getFileTypeImage(null, sc, name, (small ? FileTypeImageSize.Small : FileTypeImageSize.Medium)); + return getFileTypeImage(sc, name, (small ? FileTypeImageSize.Small : FileTypeImageSize.Medium)); } /** @@ -119,11 +76,6 @@ public class FileTypeImageUtils * @return the image path for the specified node type or the default icon if not found */ public static String getFileTypeImage(ServletContext sc, String name, FileTypeImageSize size) - { - return getFileTypeImage(null, sc, name, size); - } - - private static String getFileTypeImage(FacesContext fc, ServletContext sc, String name, FileTypeImageSize size) { String image = null; String defaultImage = null; @@ -161,15 +113,14 @@ public class FileTypeImageUtils } // does this image exist on the web-server? - if ((fc != null && fc.getExternalContext().getResourceAsStream(image) != null) || - (sc != null && sc.getResourceAsStream(image) != null)) + if (sc != null && sc.getResourceAsStream(image) != null) { // found the image for this extension - save it for later s_fileExtensionMap.put(key, image); } - else if ((fc == null) && (sc == null)) + else if (sc == null) { - // we have neither FacesContext nor ServerContext so return the default image but don't cache it + // we have no ServerContext so return the default image but don't cache it image = defaultImage; } else @@ -184,5 +135,4 @@ public class FileTypeImageUtils return (image != null ? image : defaultImage); } - } diff --git a/src/main/resources/alfresco/remote-api-context.xml b/src/main/resources/alfresco/remote-api-context.xml index c3f3816939..3e6d8ec8d1 100644 --- a/src/main/resources/alfresco/remote-api-context.xml +++ b/src/main/resources/alfresco/remote-api-context.xml @@ -80,8 +80,6 @@ - - diff --git a/src/main/resources/alfresco/templates/webscripts/org/alfresco/repository/search/keywordsearch.get.desc.xml b/src/main/resources/alfresco/templates/webscripts/org/alfresco/repository/search/keywordsearch.get.desc.xml index 31c5824e43..f634029145 100644 --- a/src/main/resources/alfresco/templates/webscripts/org/alfresco/repository/search/keywordsearch.get.desc.xml +++ b/src/main/resources/alfresco/templates/webscripts/org/alfresco/repository/search/keywordsearch.get.desc.xml @@ -7,7 +7,6 @@ /search/keyword.atom?q={searchTerms}&p={startPage?}&c={count?}&l={language?} /api/search/keyword.rss?q={searchTerms}&p={startPage?}&c={count?}&l={language?} /search/keyword.rss?q={searchTerms}&p={startPage?}&c={count?}&l={language?} - /api/search/keyword.portlet?q={searchTerms}&p={startPage?}&c={count?}&l={language?} guest required limited_support diff --git a/src/main/resources/alfresco/templates/webscripts/org/alfresco/repository/search/personsearch.get.desc.xml b/src/main/resources/alfresco/templates/webscripts/org/alfresco/repository/search/personsearch.get.desc.xml index 336207f912..a5d4b0f88e 100644 --- a/src/main/resources/alfresco/templates/webscripts/org/alfresco/repository/search/personsearch.get.desc.xml +++ b/src/main/resources/alfresco/templates/webscripts/org/alfresco/repository/search/personsearch.get.desc.xml @@ -7,7 +7,6 @@ /search/person.atom?q={searchTerms}&p={startPage?}&c={count?}&l={language?} /api/search/person.rss?q={searchTerms}&p={startPage?}&c={count?}&l={language?} /search/person.rss?q={searchTerms}&p={startPage?}&c={count?}&l={language?} - /api/search/person.portlet?q={searchTerms}&p={startPage?}&c={count?}&l={language?} guest required limited_support diff --git a/src/test/java/org/alfresco/repo/web/scripts/search/PersonSearchTest.java b/src/test/java/org/alfresco/repo/web/scripts/search/PersonSearchTest.java index 6519382de1..6784bca113 100644 --- a/src/test/java/org/alfresco/repo/web/scripts/search/PersonSearchTest.java +++ b/src/test/java/org/alfresco/repo/web/scripts/search/PersonSearchTest.java @@ -132,12 +132,6 @@ public class PersonSearchTest extends BaseWebScriptTest sendRequest(new GetRequest("/api/search/person?"), Status.STATUS_INTERNAL_SERVER_ERROR); } - public void testPortletSearch() throws Exception - { - Response response = sendRequest(new GetRequest("/api/search/person.portlet?q=*"), Status.STATUS_OK); - logger.debug(response.getContentAsString()); - } - public void testAtomSearch() throws Exception { Response response = sendRequest(new GetRequest("/api/search/person.atom?q=*"), Status.STATUS_OK);