mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.1 to HEAD
13129: Merged V2.1-A to V3.1 8598: Fix for ADB-41 (ACT 1657) 13139: Merged V2.1-A to V3.1 8674: First phase of using group display name in UI 13148: Merged V2.1-A to V3.1 8679: Completion of using group display name in UI 13149: Merged V2.1-A to V3.1 8690: Fixed ADB-33 again 13150: Merged V2.1-A to V3.1 8775: Fix ACT-2399 13152: Merged V2.1-A to V3.1 8941: ACT-2631: added max users message to send email action page git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13565 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -25,27 +25,31 @@ package org.alfresco.web.app.servlet;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.ServletConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.alfresco.config.ConfigService;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.util.TempFileProvider;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.FileUploadBean;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.alfresco.web.config.ClientConfigElement;
|
||||
import org.apache.commons.fileupload.FileItem;
|
||||
import org.apache.commons.fileupload.RequestContext;
|
||||
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
|
||||
import org.apache.commons.fileupload.servlet.ServletFileUpload;
|
||||
import org.apache.commons.fileupload.servlet.ServletRequestContext;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
import org.springframework.web.context.support.WebApplicationContextUtils;
|
||||
|
||||
/**
|
||||
* Servlet that takes a file uploaded via a browser and represents it as an
|
||||
@@ -58,6 +62,21 @@ public class UploadFileServlet extends BaseServlet
|
||||
private static final long serialVersionUID = -5482538466491052873L;
|
||||
private static final Log logger = LogFactory.getLog(UploadFileServlet.class);
|
||||
|
||||
private ConfigService configService;
|
||||
|
||||
|
||||
/**
|
||||
* @see javax.servlet.GenericServlet#init()
|
||||
*/
|
||||
@Override
|
||||
public void init(ServletConfig sc) throws ServletException
|
||||
{
|
||||
super.init(sc);
|
||||
|
||||
WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(sc.getServletContext());
|
||||
this.configService = (ConfigService)ctx.getBean("webClientConfigService");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.servlet.http.HttpServlet#service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
|
||||
*/
|
||||
@@ -103,7 +122,7 @@ public class UploadFileServlet extends BaseServlet
|
||||
{
|
||||
returnPage = item.getString();
|
||||
}
|
||||
else if (item.getFieldName().equalsIgnoreCase("upload-id"))
|
||||
else if (item.getFieldName().equalsIgnoreCase("upload-id"))
|
||||
{
|
||||
uploadId = item.getString();
|
||||
}
|
||||
@@ -117,19 +136,30 @@ public class UploadFileServlet extends BaseServlet
|
||||
{
|
||||
logger.debug("Processing uploaded file: " + filename);
|
||||
}
|
||||
// workaround a bug in IE where the full path is returned
|
||||
// IE is only available for Windows so only check for the Windows path separator
|
||||
filename = FilenameUtils.getName(filename);
|
||||
final File tempFile = TempFileProvider.createTempFile("alfresco", ".upload");
|
||||
item.write(tempFile);
|
||||
bean.setFile(tempFile);
|
||||
bean.setFileName(filename);
|
||||
bean.setFilePath(tempFile.getAbsolutePath());
|
||||
if (logger.isDebugEnabled())
|
||||
|
||||
// ADB-41: Ignore non-existent files i.e. 0 byte streams.
|
||||
if (allowZeroByteFiles() == true || item.getSize() > 0)
|
||||
{
|
||||
logger.debug("Temp file: " + tempFile.getAbsolutePath() +
|
||||
" size " + tempFile.length() +
|
||||
" bytes created from upload filename: " + filename);
|
||||
// workaround a bug in IE where the full path is returned
|
||||
// IE is only available for Windows so only check for the Windows path separator
|
||||
filename = FilenameUtils.getName(filename);
|
||||
final File tempFile = TempFileProvider.createTempFile("alfresco", ".upload");
|
||||
item.write(tempFile);
|
||||
bean.setFile(tempFile);
|
||||
bean.setFileName(filename);
|
||||
bean.setFilePath(tempFile.getAbsolutePath());
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Temp file: " + tempFile.getAbsolutePath() +
|
||||
" size " + tempFile.length() +
|
||||
" bytes created from upload filename: " + filename);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (logger.isWarnEnabled())
|
||||
logger.warn("Ignored file '" + filename + "' as there was no content, this is either " +
|
||||
"caused by uploading an empty file or a file path that does not exist on the client.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -137,10 +167,11 @@ public class UploadFileServlet extends BaseServlet
|
||||
|
||||
session.setAttribute(FileUploadBean.getKey(uploadId), bean);
|
||||
|
||||
if (bean.getFile() == null)
|
||||
if (bean.getFile() == null && uploadId != null && logger.isWarnEnabled())
|
||||
{
|
||||
logger.warn("no file uploaded for upload " + uploadId);
|
||||
logger.warn("no file uploaded for upload id: " + uploadId);
|
||||
}
|
||||
|
||||
if (returnPage == null || returnPage.length() == 0)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("return-page parameter has not been supplied");
|
||||
@@ -184,4 +215,11 @@ public class UploadFileServlet extends BaseServlet
|
||||
logger.debug("upload complete");
|
||||
}
|
||||
}
|
||||
|
||||
private boolean allowZeroByteFiles()
|
||||
{
|
||||
ClientConfigElement clientConfig = (ClientConfigElement)configService.getGlobalConfig().getConfigElement(
|
||||
ClientConfigElement.CONFIG_ELEMENT_ID);
|
||||
return clientConfig.isZeroByteFileUploads();
|
||||
}
|
||||
}
|
||||
|
@@ -571,14 +571,21 @@ public class EmailSpaceUsersDialog extends BaseDialogBean implements IContextLis
|
||||
{
|
||||
// need a map (dummy node) to represent props for this Group Authority
|
||||
node = new HashMap<String, Object>(8, 1.0f);
|
||||
if (authority.startsWith(PermissionService.GROUP_PREFIX) == true)
|
||||
|
||||
String groupDisplayName = this.authorityService.getAuthorityDisplayName(authority);
|
||||
if (groupDisplayName == null || groupDisplayName.length() == 0)
|
||||
{
|
||||
node.put(PROP_FULLNAME, authority.substring(PermissionService.GROUP_PREFIX.length()));
|
||||
}
|
||||
else
|
||||
{
|
||||
node.put(PROP_FULLNAME, authority);
|
||||
if (authority.startsWith(PermissionService.GROUP_PREFIX) == true)
|
||||
{
|
||||
groupDisplayName = authority.substring(PermissionService.GROUP_PREFIX.length());
|
||||
}
|
||||
else
|
||||
{
|
||||
groupDisplayName = authority;
|
||||
}
|
||||
}
|
||||
|
||||
node.put(PROP_FULLNAME, groupDisplayName);
|
||||
node.put(PROP_USERNAME, authority);
|
||||
node.put(PROP_ID, authority);
|
||||
node.put(PROP_ICON, WebResources.IMAGE_GROUP);
|
||||
|
@@ -49,6 +49,7 @@ import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.search.SearchService;
|
||||
import org.alfresco.service.cmr.security.AccessPermission;
|
||||
import org.alfresco.service.cmr.security.AccessStatus;
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.alfresco.service.cmr.security.AuthorityType;
|
||||
import org.alfresco.service.cmr.security.OwnableService;
|
||||
import org.alfresco.service.cmr.security.PermissionService;
|
||||
@@ -101,6 +102,9 @@ public abstract class UserMembersBean extends BaseDialogBean implements IContext
|
||||
/** PermissionService bean reference */
|
||||
transient private PermissionService permissionService;
|
||||
|
||||
/** AuthorityService bean reference */
|
||||
transient private AuthorityService authorityService;
|
||||
|
||||
/** PersonService bean reference */
|
||||
transient private PersonService personService;
|
||||
|
||||
@@ -200,6 +204,23 @@ public abstract class UserMembersBean extends BaseDialogBean implements IContext
|
||||
return permissionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param authorityService The AuthorityService to set.
|
||||
*/
|
||||
public void setAuthorityService(AuthorityService authorityService)
|
||||
{
|
||||
this.authorityService = authorityService;
|
||||
}
|
||||
|
||||
protected AuthorityService getAuthorityService()
|
||||
{
|
||||
if (authorityService == null)
|
||||
{
|
||||
authorityService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getAuthorityService();
|
||||
}
|
||||
return authorityService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ownableService The ownableService to set.
|
||||
*/
|
||||
@@ -410,6 +431,7 @@ public abstract class UserMembersBean extends BaseDialogBean implements IContext
|
||||
// it is much better for performance to do this now rather than during page bind
|
||||
Map<String, Object> props = node.getProperties();
|
||||
props.put("fullName", ((String)props.get("firstName")) + ' ' + ((String)props.get("lastName")));
|
||||
props.put("userNameLabel", props.get("userName"));
|
||||
props.put("roles", roleListToString(context, permissionMap.get(authority)));
|
||||
props.put("icon", WebResources.IMAGE_PERSON);
|
||||
props.put("isGroup", Boolean.FALSE);
|
||||
@@ -422,14 +444,22 @@ public abstract class UserMembersBean extends BaseDialogBean implements IContext
|
||||
{
|
||||
// need a map (dummy node) to represent props for this Group Authority
|
||||
Map<String, Object> node = new HashMap<String, Object>(8, 1.0f);
|
||||
if (authority.startsWith(PermissionService.GROUP_PREFIX) == true)
|
||||
|
||||
String groupDisplayName = getAuthorityService().getAuthorityDisplayName(authority);
|
||||
if (groupDisplayName == null || groupDisplayName.length() == 0)
|
||||
{
|
||||
node.put("fullName", authority.substring(PermissionService.GROUP_PREFIX.length()));
|
||||
}
|
||||
else
|
||||
{
|
||||
node.put("fullName", authority);
|
||||
if (authority.startsWith(PermissionService.GROUP_PREFIX) == true)
|
||||
{
|
||||
groupDisplayName = authority.substring(PermissionService.GROUP_PREFIX.length());
|
||||
}
|
||||
else
|
||||
{
|
||||
groupDisplayName = authority;
|
||||
}
|
||||
}
|
||||
|
||||
node.put("fullName", groupDisplayName);
|
||||
node.put("userNameLabel", groupDisplayName);
|
||||
node.put("userName", authority);
|
||||
node.put("id", authority);
|
||||
node.put("roles", roleListToString(context, permissionMap.get(authority)));
|
||||
@@ -621,7 +651,13 @@ public abstract class UserMembersBean extends BaseDialogBean implements IContext
|
||||
}
|
||||
else
|
||||
{
|
||||
setPersonName(authority);
|
||||
String label = params.get("userNameLabel");
|
||||
if (label == null || label.length() == 0)
|
||||
{
|
||||
label = authority;
|
||||
}
|
||||
|
||||
setPersonName(label);
|
||||
}
|
||||
|
||||
// setup roles for this Authority
|
||||
|
@@ -295,9 +295,24 @@ public abstract class BaseInviteUsersWizard extends BaseWizardBean
|
||||
}
|
||||
}
|
||||
|
||||
// reset max users flag
|
||||
this.maxUsersReturned = false;
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.bean.dialog.BaseDialogBean#cancel()
|
||||
*/
|
||||
@Override
|
||||
public String cancel()
|
||||
{
|
||||
// reset max users flag
|
||||
this.maxUsersReturned = false;
|
||||
|
||||
return super.cancel();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.web.bean.dialog.BaseDialogBean#getFinishButtonDisabled()
|
||||
*/
|
||||
@@ -366,19 +381,30 @@ public abstract class BaseInviteUsersWizard extends BaseWizardBean
|
||||
// Use lucene search to retrieve user details
|
||||
String term = QueryParser.escape(contains.trim());
|
||||
StringBuilder query = new StringBuilder(128);
|
||||
query.append("@").append(NamespaceService.CONTENT_MODEL_PREFIX).append("\\:firstName:\"*");
|
||||
query.append(term);
|
||||
query.append("*\" @").append(NamespaceService.CONTENT_MODEL_PREFIX).append("\\:lastName:\"*");
|
||||
query.append(term);
|
||||
query.append("*\" @").append(NamespaceService.CONTENT_MODEL_PREFIX).append("\\:userName:");
|
||||
query.append(term);
|
||||
query.append("*");
|
||||
|
||||
if (contains == null || contains.length() == 0)
|
||||
{
|
||||
// if there is no search term, search for all people
|
||||
query.append("+TYPE:\"");
|
||||
query.append(ContentModel.TYPE_PERSON.toString());
|
||||
query.append("\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
query.append("@").append(NamespaceService.CONTENT_MODEL_PREFIX).append("\\:firstName:\"*");
|
||||
query.append(term);
|
||||
query.append("*\" @").append(NamespaceService.CONTENT_MODEL_PREFIX).append("\\:lastName:\"*");
|
||||
query.append(term);
|
||||
query.append("*\" @").append(NamespaceService.CONTENT_MODEL_PREFIX).append("\\:userName:");
|
||||
query.append(term);
|
||||
query.append("*");
|
||||
}
|
||||
|
||||
int maxResults = Application.getClientConfig(context).getInviteUsersMaxResults();
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Maximum invite users results size: " + maxResults);
|
||||
logger.debug("Using query to find users: " + query.toString());
|
||||
}
|
||||
|
||||
SearchParameters searchParams = new SearchParameters();
|
||||
@@ -428,12 +454,19 @@ public abstract class BaseInviteUsersWizard extends BaseWizardBean
|
||||
groups.addAll(getAuthorityService().getAllAuthorities(AuthorityType.EVERYONE));
|
||||
|
||||
String containsLower = contains.trim().toLowerCase();
|
||||
int offset = PermissionService.GROUP_PREFIX.length();
|
||||
String groupDisplayName;
|
||||
for (String group : groups)
|
||||
{
|
||||
if (group.toLowerCase().indexOf(containsLower, offset) != -1)
|
||||
// get display name, if not present strip prefix from group id
|
||||
groupDisplayName = authorityService.getAuthorityDisplayName(group);
|
||||
if (groupDisplayName == null || groupDisplayName.length() == 0)
|
||||
{
|
||||
results.add(new SortableSelectItem(group, group.substring(offset), group));
|
||||
groupDisplayName = group.substring(PermissionService.GROUP_PREFIX.length());
|
||||
}
|
||||
|
||||
if (groupDisplayName.toLowerCase().indexOf(containsLower) != -1)
|
||||
{
|
||||
results.add(new SortableSelectItem(group, groupDisplayName, groupDisplayName));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -684,8 +717,14 @@ public abstract class BaseInviteUsersWizard extends BaseWizardBean
|
||||
*/
|
||||
public String buildLabelForGroupAuthorityRole(String authority, String role)
|
||||
{
|
||||
String groupDisplayName = this.authorityService.getAuthorityDisplayName(authority);
|
||||
if (groupDisplayName == null || groupDisplayName.length() == 0)
|
||||
{
|
||||
groupDisplayName = authority.substring(PermissionService.GROUP_PREFIX.length());
|
||||
}
|
||||
|
||||
StringBuilder buf = new StringBuilder(100);
|
||||
buf.append(authority.substring(PermissionService.GROUP_PREFIX.length()))
|
||||
buf.append(groupDisplayName)
|
||||
.append(" (")
|
||||
.append(Application.getMessage(FacesContext.getCurrentInstance(), role))
|
||||
.append(")");
|
||||
|
@@ -82,6 +82,7 @@ public class ClientConfigElement extends ConfigElementAdapter
|
||||
private String breadcrumbMode = BREADCRUMB_PATH;
|
||||
private String cifsURLSuffix;
|
||||
private boolean languageSelect = true;
|
||||
private boolean zeroByteFileUploads = true;
|
||||
|
||||
|
||||
/**
|
||||
@@ -263,6 +264,11 @@ public class ClientConfigElement extends ConfigElementAdapter
|
||||
combinedElement.setLanguageSelect(newElement.isLanguageSelect());
|
||||
}
|
||||
|
||||
if (newElement.isZeroByteFileUploads() != combinedElement.isZeroByteFileUploads())
|
||||
{
|
||||
combinedElement.setZeroByteFileUploads(newElement.isZeroByteFileUploads());
|
||||
}
|
||||
|
||||
return combinedElement;
|
||||
}
|
||||
|
||||
@@ -744,4 +750,20 @@ public class ClientConfigElement extends ConfigElementAdapter
|
||||
{
|
||||
this.languageSelect = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if zero byte file uploads are allowed, false otherwise
|
||||
*/
|
||||
public boolean isZeroByteFileUploads()
|
||||
{
|
||||
return this.zeroByteFileUploads;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param zeroByteFileUploads true if zero byte file uploads are allowed, false otherwise
|
||||
*/
|
||||
/*package*/ void setZeroByteFileUploads(boolean zeroByteFileUploads)
|
||||
{
|
||||
this.zeroByteFileUploads = zeroByteFileUploads;
|
||||
}
|
||||
}
|
||||
|
@@ -67,6 +67,7 @@ public class ClientElementReader implements ConfigElementReader
|
||||
public static final String ELEMENT_BREADCRUMB_MODE = "breadcrumb-mode";
|
||||
public static final String ELEMENT_CIFSURLSUFFIX = "cifs-url-suffix";
|
||||
public static final String ELEMENT_LANGUAGESELECT = "language-select";
|
||||
public static final String ELEMENT_ZEROBYTEFILEUPLOADS = "zero-byte-file-uploads";
|
||||
|
||||
|
||||
/**
|
||||
@@ -283,6 +284,13 @@ public class ClientElementReader implements ConfigElementReader
|
||||
{
|
||||
configElement.setLanguageSelect(Boolean.parseBoolean(langSelect.getTextTrim()));
|
||||
}
|
||||
|
||||
// get the zero byte file upload mode
|
||||
Element zeroByteFiles = element.element(ELEMENT_ZEROBYTEFILEUPLOADS);
|
||||
if (zeroByteFiles != null)
|
||||
{
|
||||
configElement.setZeroByteFileUploads(Boolean.parseBoolean(zeroByteFiles.getTextTrim()));
|
||||
}
|
||||
}
|
||||
|
||||
return configElement;
|
||||
|
@@ -726,10 +726,17 @@ public abstract class BaseAssociationEditor extends UIInput
|
||||
}
|
||||
else if (ContentModel.TYPE_AUTHORITY_CONTAINER.equals(nodeService.getType(targetRef)))
|
||||
{
|
||||
int offset = PermissionService.GROUP_PREFIX.length();
|
||||
String group = (String)nodeService.getProperty(targetRef,
|
||||
ContentModel.PROP_AUTHORITY_NAME);
|
||||
out.write(group.substring(offset));
|
||||
// get display name, if not present strip prefix from group id
|
||||
String groupDisplayName = (String)nodeService.getProperty(targetRef,
|
||||
ContentModel.PROP_AUTHORITY_DISPLAY_NAME);
|
||||
if (groupDisplayName == null || groupDisplayName.length() == 0)
|
||||
{
|
||||
String group = (String)nodeService.getProperty(targetRef,
|
||||
ContentModel.PROP_AUTHORITY_NAME);
|
||||
groupDisplayName = group.substring(PermissionService.GROUP_PREFIX.length());
|
||||
}
|
||||
|
||||
out.write(groupDisplayName);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -867,15 +874,24 @@ public abstract class BaseAssociationEditor extends UIInput
|
||||
}
|
||||
else if (ContentModel.TYPE_AUTHORITY_CONTAINER.equals(nodeService.getType(item)))
|
||||
{
|
||||
// if the node represents a group, show the authority name instead of the name
|
||||
int offset = PermissionService.GROUP_PREFIX.length();
|
||||
String group = (String)nodeService.getProperty(item,
|
||||
ContentModel.PROP_AUTHORITY_NAME);
|
||||
// if the node represents a group, show the authority display name instead of the name
|
||||
String groupDisplayName = (String)nodeService.getProperty(item,
|
||||
ContentModel.PROP_AUTHORITY_DISPLAY_NAME);
|
||||
if (groupDisplayName == null || groupDisplayName.length() == 0)
|
||||
{
|
||||
String group = (String)nodeService.getProperty(item,
|
||||
ContentModel.PROP_AUTHORITY_NAME);
|
||||
groupDisplayName = group.substring(PermissionService.GROUP_PREFIX.length());
|
||||
}
|
||||
|
||||
out.write("<option value='");
|
||||
out.write(item.toString());
|
||||
out.write("'>");
|
||||
out.write(group.substring(offset));
|
||||
out.write(groupDisplayName);
|
||||
out.write("</option>");
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -949,15 +965,22 @@ public abstract class BaseAssociationEditor extends UIInput
|
||||
if (authorityDAO != null)
|
||||
{
|
||||
List<String> matchingGroups = new ArrayList<String>();
|
||||
int offset = PermissionService.GROUP_PREFIX.length();
|
||||
|
||||
String groupDisplayName;
|
||||
for (String group : groups)
|
||||
{
|
||||
// get display name, if not present strip prefix from group id
|
||||
groupDisplayName = authorityService.getAuthorityDisplayName(group);
|
||||
if (groupDisplayName == null || groupDisplayName.length() == 0)
|
||||
{
|
||||
groupDisplayName = group.substring(PermissionService.GROUP_PREFIX.length());
|
||||
}
|
||||
|
||||
// if a search string is present make sure the group matches
|
||||
// otherwise just add the group name to the sorted set
|
||||
if (safeContains != null)
|
||||
{
|
||||
if (group.toLowerCase().indexOf(safeContains, offset) != -1)
|
||||
if (groupDisplayName.toLowerCase().indexOf(safeContains) != -1)
|
||||
{
|
||||
matchingGroups.add(group);
|
||||
}
|
||||
|
@@ -175,11 +175,17 @@ public class UIAssociationEditor extends BaseAssociationEditor
|
||||
}
|
||||
else if (ContentModel.TYPE_AUTHORITY_CONTAINER.equals(nodeService.getType(targetNode)))
|
||||
{
|
||||
// if the node represents a group, show the group name instead of the name
|
||||
int offset = PermissionService.GROUP_PREFIX.length();
|
||||
String group = (String)nodeService.getProperty(targetNode,
|
||||
ContentModel.PROP_AUTHORITY_NAME);
|
||||
out.write(group.substring(offset));
|
||||
// if the node represents a group, show the group display name instead of the name
|
||||
String groupDisplayName = (String)nodeService.getProperty(targetNode,
|
||||
ContentModel.PROP_AUTHORITY_DISPLAY_NAME);
|
||||
if (groupDisplayName == null || groupDisplayName.length() == 0)
|
||||
{
|
||||
String group = (String)nodeService.getProperty(targetNode,
|
||||
ContentModel.PROP_AUTHORITY_NAME);
|
||||
groupDisplayName = group.substring(PermissionService.GROUP_PREFIX.length());
|
||||
}
|
||||
|
||||
out.write(groupDisplayName);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -172,11 +172,17 @@ public class UIChildAssociationEditor extends BaseAssociationEditor
|
||||
}
|
||||
else if (ContentModel.TYPE_AUTHORITY_CONTAINER.equals(nodeService.getType(targetNode)))
|
||||
{
|
||||
// if the node represents a group, show the group name instead of the name
|
||||
int offset = PermissionService.GROUP_PREFIX.length();
|
||||
String group = (String)nodeService.getProperty(targetNode,
|
||||
ContentModel.PROP_AUTHORITY_NAME);
|
||||
out.write(group.substring(offset));
|
||||
// if the node represents a group, show the group display name instead of the name
|
||||
String groupDisplayName = (String)nodeService.getProperty(targetNode,
|
||||
ContentModel.PROP_AUTHORITY_DISPLAY_NAME);
|
||||
if (groupDisplayName == null || groupDisplayName.length() == 0)
|
||||
{
|
||||
String group = (String)nodeService.getProperty(targetNode,
|
||||
ContentModel.PROP_AUTHORITY_NAME);
|
||||
groupDisplayName = group.substring(PermissionService.GROUP_PREFIX.length());
|
||||
}
|
||||
|
||||
out.write(groupDisplayName);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user