. "Paste As Link" and link object support in the web-client:

. Filetype icons for PSD (Photoshop) file-format
. Import, Export and Manage Space Users actions added to Forums details page
. Manage Space Users action added to Forum and Topic details pages
. Removed some obsolete JSF navigation outcomes from dialogs/faces-config
. Approx 10% performance improvement when showing large search results pages

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2582 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-03-27 15:46:20 +00:00
parent 9be6273144
commit 8187b27ecf
41 changed files with 1578 additions and 199 deletions

View File

@@ -523,12 +523,14 @@ public final class Utils
* The supported values for the usage parameter are of URLMode enum type
* @see URLMode
*
* @param context Faces context
* @param node The node to generate the URL for
* @param usage What the URL is going to be used for
* @param context Faces context
* @param node The node to generate the URL for
* @param name Name to use for the download file part of the link if any
* @param usage What the URL is going to be used for
*
* @return The URL for the requested usage without the context path
*/
public static String generateURL(FacesContext context, Node node, URLMode usage)
public static String generateURL(FacesContext context, Node node, String name, URLMode usage)
{
String url = null;
@@ -612,13 +614,13 @@ public final class Utils
case HTTP_DOWNLOAD:
{
url = DownloadContentServlet.generateDownloadURL(node.getNodeRef(), node.getName());
url = DownloadContentServlet.generateDownloadURL(node.getNodeRef(), name);
break;
}
case HTTP_INLINE:
{
url = DownloadContentServlet.generateBrowserURL(node.getNodeRef(), node.getName());
url = DownloadContentServlet.generateBrowserURL(node.getNodeRef(), name);
break;
}
@@ -652,6 +654,23 @@ public final class Utils
return url;
}
/**
* Generates a URL for the given usage for the given node.
*
* The supported values for the usage parameter are of URLMode enum type
* @see URLMode
*
* @param context Faces context
* @param node The node to generate the URL for
* @param usage What the URL is going to be used for
*
* @return The URL for the requested usage without the context path
*/
public static String generateURL(FacesContext context, Node node, URLMode usage)
{
return generateURL(context, node, node.getName(), usage);
}
/**
* Build a context path safe image tag for the supplied image path.
* Image path should be supplied with a leading slash '/'.
@@ -665,7 +684,8 @@ public final class Utils
*
* @return Populated <code>img</code> tag
*/
public static String buildImageTag(FacesContext context, String image, int width, int height, String alt, String onclick)
public static String buildImageTag(FacesContext context, String image, int width, int height,
String alt, String onclick)
{
return buildImageTag(context, image, width, height, alt, onclick, null);
}
@@ -684,7 +704,8 @@ public final class Utils
*
* @return Populated <code>img</code> tag
*/
public static String buildImageTag(FacesContext context, String image, int width, int height, String alt, String onclick, String align)
public static String buildImageTag(FacesContext context, String image, int width, int height,
String alt, String onclick, String align)
{
StringBuilder buf = new StringBuilder(200);

View File

@@ -0,0 +1,91 @@
/*
* Copyright (C) 2005 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.alfresco.web.ui.common.converter;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
import org.alfresco.repo.security.permissions.AccessDeniedException;
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.repository.Path;
import org.alfresco.web.bean.repository.Repository;
/**
* Converter class to convert a Path or NodeRef reference value (including null) into a human readable form.
*
* @author Kevin Roast
*/
public class DisplayPathConverter implements Converter
{
/**
* <p>The standard converter id for this converter.</p>
*/
public static final String CONVERTER_ID = "org.alfresco.faces.DisplayPathConverter";
/**
* @see javax.faces.convert.Converter#getAsObject(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String)
*/
public Object getAsObject(FacesContext context, UIComponent component, String value)
throws ConverterException
{
return null;
}
/**
* @see javax.faces.convert.Converter#getAsString(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.Object)
*/
public String getAsString(FacesContext context, UIComponent component, Object value)
throws ConverterException
{
String result = "";
if (value != null)
{
try
{
NodeService nodeService = Repository.getServiceRegistry(context).getNodeService();
Path path = null;
if (value instanceof NodeRef)
{
path = nodeService.getPath((NodeRef)value);
}
else if (value instanceof Path)
{
path = (Path)value;
}
if (path != null)
{
result = Repository.getNamePath(nodeService, path, null, "/", null);
}
}
catch (AccessDeniedException accessErr)
{
// use default if this occurs
}
catch (InvalidNodeRefException nodeErr)
{
// use default if this occurs
}
}
return result;
}
}

View File

@@ -30,6 +30,7 @@ public class WebResources extends org.alfresco.web.ui.common.WebResources
public static final String IMAGE_COPY = "/images/icons/copy.gif";
public static final String IMAGE_CUT = "/images/icons/cut.gif";
public static final String IMAGE_PASTE = "/images/icons/paste.gif";
public static final String IMAGE_PASTE_LINK = "/images/icons/paste_link.gif";
public static final String IMAGE_LOCK = "/images/icons/locked.gif";
public static final String IMAGE_LOCK_OWNER = "/images/icons/locked_owner.gif";
public static final String IMAGE_PERSON = "/images/icons/person.gif";

View File

@@ -184,7 +184,7 @@ public class UIClipboardShelfItem extends UIShelfItem
}
out.write(Utils.buildImageTag(context, icon, 16, 16, null, null, "absmiddle"));
}
else if (dd.isSubClass(item.Node.getType(), ContentModel.TYPE_CONTENT))
else
{
String image = Utils.getFileTypeImage(item.Node.getName(), true);
out.write(Utils.buildImageTag(context, image, null, "absmiddle"));
@@ -200,11 +200,11 @@ public class UIClipboardShelfItem extends UIShelfItem
out.write(buildActionLink(ACTION_REMOVE_ITEM, i, bundle.getString(MSG_REMOVE_ITEM), WebResources.IMAGE_REMOVE));
out.write("&nbsp;");
out.write(buildActionLink(ACTION_PASTE_ITEM, i, bundle.getString(MSG_PASTE_ITEM), WebResources.IMAGE_PASTE));
//if (item.Mode == ClipboardStatus.COPY)
//{
// out.write("&nbsp;");
// out.write(buildActionLink(ACTION_PASTE_LINK, i, bundle.getString(MSG_PASTE_LINK), WebResources.IMAGE_PASTE_LINK));
//}
if (item.Mode == ClipboardStatus.COPY)
{
out.write("&nbsp;");
out.write(buildActionLink(ACTION_PASTE_LINK, i, bundle.getString(MSG_PASTE_LINK), WebResources.IMAGE_PASTE_LINK));
}
// end actions cell and end row
out.write("</nobr></td></tr>");