Files
alfresco-community-repo/source/java/org/alfresco/web/bean/wcm/InviteWebsiteUsersWizard.java
Dave Ward 5e6d266b3e Merged V3.4-BUG-FIX to HEAD
27967: Fixes: ALF-8696. L10N updates
   27969: Fixes: ALF-8698 - FR L10N string updates
   28011: Fixes: ALF-8776 - IT L10N updates
   28035: Fix for ALF-2711 - Spring Surf contrib: Unable to upload files over 2GB
   28052: Fixes: ALF-8724
   28054: Merged PATCHES/V3.4.1 to V3.4-BUG-FIX
      27765: ALF-8607: Detect and invalidate stale cached nodes during transaction tracking
         - Also increased debug logging around IndexTransactionTracker
      27953: ALF-8607: Store FTSSTATUS on a supplementary document in the index for each transaction, so that we don't forget to FTS reindex the document if it has already been updated by a later transaction.
      27965: ALF-8607: Complete query parsers' handling of new FTSREF field
      28033: ALF-8811: Removed invalid caching of permissions from Invite wizards. Finish off ALF-4597
      28053: ALF-8815: Make it possible to copy a node with the cm:storeSelector aspect
         - The copied node's content will already be in the target store when its properties (including storeName) are first applied
   28055: Merged PATCHES/V3.3.4 to V3.4-BUG-FIX (RECORD ONLY)
      27830: ALF-8476: Possible fix to StackOverflowError when searching a transaction with a huge number of deletions
      27854: Merged V3.3 to PATCHES/V3.3.4
         27851: Fix for ALF-8476: CLONE - Query consuming all heap and receiving an OOM exception
            - actually fixes stack overflow with skipTo when there are lots of deleted docs in an index in a row (<10000 on the default settings)
   28060: ALF-8779: I18N Fix from Bitrock.
   28065: ALF-8105: Correction to ETWOTWO-1384 fix: do not embed schema in XForm definition if it references externals to avoid performance issues
   - Previous fix embedded a partial, invalid schema that caused XML parser warnings
   28070: Suggested fix for ALF-8852. Upgrading pdfbox,fontbox,jempbox from 1.3.1 to 1.5.0.
   28071: Fix for symptom raised in ALF-8780: Forms system does not show control for associations of cm:person type
   
   This hides the rn:rendition association from default forms as it should never be edited by a user. The proper fix for the bug is to supply form config for the custom type.
   28072: Fixed ALF-8050: Inconsistency in validation of webforms with maxOccurs="*"
   28077: ALF-6293: Fix from Bitrock
   - Installing the tomcat service logs more stuff on Linux and Windows
   28084: ALF-8877: Upgraded freemarker to 2.3.18
   28090: Fix failing forms related tests
   28118: ALF-8557 Added NullScope object used by JbpmNode. 
   28123: Fix for ALF-8207
   28124: ALF-7708 The JavaScript expressions in workflows should no longer be re-formatted.
   28134: Incremented version revision for 3.4.3
   28135: Merged V3.4 to V3.4-BUG-FIX
      27962: Update to Bitrock 7.1.1 + use absolute path to Bitrock license under protected build-classpath directory
      27971: Fix for ALF-8704 - RM search doesn't work
      27984: ALF-8771: Installer now uses cmd /C start /MIN /WAIT to run minimized commands synchronously rather than asynchronously!
      - Also uses -w flag when registering postgres service to make its startup synchronous
      - Should mean that the install waits for postgres to start before issuing commands to it!
      27987: ALF-8666: Bitrock service run and install scripts now execute commands sequentially
      - start /MIN /WAIT cmd /C used instead of start /MIN
      27993: ALF-8761: getWindowsACL fix from Bitrock
      27996: ALF-8710: Run servicerun.bat as admin user
      27998: ALF-7164: NFS: User with editor role cannot edit content
      28021: ALF-8823: PostgreSQL Windows service is registered under SYSTEM user. Therefore initial initdb must be done as this user for service to start.
      28022: ALF-8823: Additional fix from Bitrock
      28041: Another try at fixing ALF-8704 - RM search doesn't work
      28119: ALF-8853: I18N fallout from ALF-6469. TransferService default group must be looked up by QName rather than cm:name


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28137 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2011-06-01 09:22:18 +00:00

216 lines
6.0 KiB
Java

/*
* 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
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.web.bean.wcm;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import javax.faces.context.FacesContext;
import org.alfresco.model.WCMAppModel;
import org.alfresco.wcm.util.WCMUtil;
import org.alfresco.wcm.webproject.WebProjectService;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.bean.wizard.BaseInviteUsersWizard;
import org.alfresco.web.ui.common.Utils;
/**
* Bean providing the ability to invite users to a web project space.
*
* @author kevinr
*/
public class InviteWebsiteUsersWizard extends BaseInviteUsersWizard
{
private static final long serialVersionUID = -8128781845465773847L;
/** the node representing the website */
private Node website;
/** root AVM store the users are invited into */
private String avmStore;
/** assume we are launching the wizard standalone */
private boolean standalone = true;
transient private WebProjectService wpService;
public void setWebProjectService(WebProjectService wpService)
{
this.wpService = wpService;
}
protected WebProjectService getWebProjectService()
{
if (wpService == null)
{
wpService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getWebProjectService();
}
return wpService;
}
/**
* @see org.alfresco.web.bean.wizard.BaseInviteUsersWizard#init(java.util.Map)
*/
@Override
public void init(Map<String, String> parameters)
{
super.init(parameters);
// only allow one selection per authority
this.allowDuplicateAuthorities = false;
this.website = null;
this.avmStore = null;
this.standalone = true;
}
public void reset()
{
this.isFinished = false;
this.allowDuplicateAuthorities = false;
this.website = null;
this.avmStore = null;
this.standalone = true;
}
/**
* @see org.alfresco.web.bean.wizard.BaseInviteUsersWizard#finishImpl(javax.faces.context.FacesContext, java.lang.String)
*/
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
super.finishImpl(context, outcome);
Map<String, String> selectedInvitees = new HashMap<String, String>(this.userGroupRoles.size());
for (UserGroupRole userRole : this.userGroupRoles)
{
selectedInvitees.put(userRole.getAuthority(), userRole.getRole());
}
getWebProjectService().inviteWebUsersGroups(this.getNode().getNodeRef(), selectedInvitees, true);
return outcome;
}
/**
* @return summary text for the wizard
*/
public String getSummary()
{
FacesContext fc = FacesContext.getCurrentInstance();
// build a summary section to list the invited users and there roles
StringBuilder buf = new StringBuilder(128);
String currentUser = Application.getCurrentUser(fc).getUserName();
boolean foundCurrentUser = false;
for (UserGroupRole userRole : this.userGroupRoles)
{
if (currentUser.equals(userRole.getAuthority()))
{
foundCurrentUser = true;
}
buf.append(Utils.encode(userRole.getLabel()));
buf.append("<br>");
}
if (isStandalone() == false && foundCurrentUser == false)
{
buf.append(buildLabelForUserAuthorityRole(
currentUser, WCMUtil.ROLE_CONTENT_MANAGER));
}
return buildSummary(
new String[] {Application.getMessage(fc, MSG_USERROLES)},
new String[] {buf.toString()});
}
@Override
protected Set<String> getPermissionsForType()
{
// Let the permission service do the caching to allow for dynamic model updates, etc.
return this.permissionService.getSettablePermissions(WCMAppModel.TYPE_AVMWEBFOLDER);
}
protected void setNode(Node node)
{
this.website = node;
}
@Override
protected Node getNode()
{
if (this.website != null)
{
return this.website;
}
else
{
return this.browseBean.getActionSpace();
}
}
/**
* @return Returns the root AVM store.
*/
public String getAvmStore()
{
if (this.avmStore == null)
{
this.avmStore = (String)getNode().getProperties().get(WCMAppModel.PROP_AVMSTORE);
}
return this.avmStore;
}
/**
* @param avmStore The root AVM store to set.
*/
public void setAvmStore(String avmStore)
{
this.avmStore = avmStore;
}
/**
* @return Returns the edit mode.
*/
public boolean isStandalone()
{
return this.standalone;
}
/**
* @param editMode The edit mode to set.
*/
public void setStandalone(boolean editMode)
{
this.standalone = editMode;
}
@Override
protected String getEmailTemplateXPath()
{
FacesContext fc = FacesContext.getCurrentInstance();
String xpath = Application.getRootPath(fc) + "/" +
Application.getGlossaryFolderName(fc) + "/" +
Application.getEmailTemplatesFolderName(fc) + "/" +
Application.getInviteEmailTemplatesFolderName(fc) + "//*";
return xpath;
}
}