Commit aeb27e94 authored by Bonita CI's avatar Bonita CI
Browse files

Merge branch 'MasterBugFixing' into 'master'

parents e4e52e29 90ab777d
......@@ -3,15 +3,21 @@
<product name="BonitaBPM" uid="org.bonitasoft.studio.product" id="org.bonitasoft.studio.product" application="org.bonitasoft.studio.application.application" version="6.4.0.qualifier" useFeatures="true" includeLaunchers="true">
<configIni use="default">
</configIni>
<launcherArgs>
<programArgs>--launcher.XXMaxPermSize512m -groovy.compiler.level 18 -clearPersistedState</programArgs>
<vmArgs>-Dosgi.requiredJavaVersion=1.6 -Dfile.encoding=UTF8 -Xmx512m -Xms128m -XX:MaxPermSize=256m</vmArgs>
<vmArgsLin>-Dorg.eclipse.swt.browser.UseWebKitGTK=False -Dorg.eclipse.swt.browser.DefaultType=mozilla -Djava.endorsed.dirs=endorsed</vmArgsLin>
<vmArgsMac>-Xdock:name=BonitaBPM -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Dorg.eclipse.swt.browser.DefaultType=webkit -Djava.endorsed.dirs=../../../endorsed</vmArgsMac>
<vmArgsWin>-Dgreclipse.nonlocking=true -Djava.endorsed.dirs=endorsed</vmArgsWin>
<programArgs>--launcher.XXMaxPermSize512m -groovy.compiler.level 18 -clearPersistedState
</programArgs>
<vmArgs>-Dosgi.requiredJavaVersion=1.6 -Dfile.encoding=UTF8 -Xmx512m -Xms128m -XX:MaxPermSize=256m
</vmArgs>
<vmArgsLin>-Dorg.eclipse.swt.browser.UseWebKitGTK=False -Dorg.eclipse.swt.browser.DefaultType=mozilla -Djava.endorsed.dirs=endorsed
</vmArgsLin>
<vmArgsMac>-Xdock:name=BonitaBPM -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Dorg.eclipse.swt.browser.DefaultType=webkit -Djava.endorsed.dirs=../../../endorsed
</vmArgsMac>
<vmArgsWin>-Dgreclipse.nonlocking=true -Djava.endorsed.dirs=endorsed
</vmArgsWin>
</launcherArgs>
<windowImages/>
......@@ -25,11 +31,12 @@
<macosx icon="icons/bonitasoft-icon-128-128-transparent.icns"/>
<solaris/>
<win useIco="true">
<ico path="icons/bonitasoft-icon-128-128-transparent.ico"/>
<ico path="icons/bonitasoft.ico"/>
<bmp/>
</win>
</launcher>
<vm>
<linux include="false">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6</linux>
<macos include="false">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6</macos>
......
......@@ -6,7 +6,8 @@
<parent>
<groupId>org.bonitasoft.studio</groupId>
<artifactId>studio</artifactId>
<version>6.4.0-SNAPSHOT</version>
<version>6.4.0-SNAPSHOT</version>
</parent>
<groupId>org.bonitasoft.studio</groupId>
......
......@@ -2945,6 +2945,15 @@
href="../form.ecore#//FileWidget"/>
<domainInitializer
xsi:type="gmfmap:FeatureSeqInitializer">
<initializers
xsi:type="gmfmap:FeatureValueSpec">
<feature
xsi:type="ecore:EAttribute"
href="../form.ecore#//FileWidget/inputType"/>
<value
body="return org.bonitasoft.studio.common.emf.tools.ModelHelper.getDefaultFileWidgetInputType(self);"
language="java"/>
</initializers>
<initializers
xsi:type="gmfmap:FeatureValueSpec">
<feature
......@@ -3116,6 +3125,14 @@
body="return org.bonitasoft.studio.common.emf.tools.WidgetModifiersSwitch.ENGINE_DOCUMENT_QUALIFIED_NAME;"
language="java"/>
</initializers>
<initializers
xsi:type="gmfmap:FeatureValueSpec">
<feature
xsi:type="ecore:EAttribute"
href="../form.ecore#//FileWidget/initialResourcePath"/>
<value
body="''"/>
</initializers>
</domainInitializer>
<labelMappings
xsi:type="gmfmap:FeatureLabelMapping">
......
......@@ -6,13 +6,12 @@
<parent>
<groupId>org.bonitasoft.studio.bundles</groupId>
<artifactId>plugins</artifactId>
<version>6.4.0-SNAPSHOT</version>
<version>6.4.0-SNAPSHOT</version>
</parent>
<groupId>org.bonitasoft.studio.plugins</groupId>
<artifactId>org.bonitasoft.studio-models</artifactId>
<packaging>eclipse-plugin</packaging>
<profiles>
<profile>
<id>generate</id>
......
......@@ -8746,5 +8746,8 @@
featureName="eType" referenceValue="form.ecore#//FileWidgetDownloadType"/>
<changes xsi:type="history:MigrationChange" migration="org.bonitasoft.studio.migration.custom.migration.form.FileWidgetResourceMigration"/>
</releases>
<releases date="2014-11-04T10:45:10.092+0100" label="6.4.0-005">
<changes xsi:type="history:MigrationChange" migration="org.bonitasoft.studio.migration.custom.migration.connector.UpdateGroovyConnectorVersionTo101"/>
</releases>
<releases/>
</history:History>
......@@ -256,3 +256,6 @@ nameLimitSize=the name is limited to 50 char
displayNameLimitSize=the display name is limited to 75 char
labelExplicationCustomUserInformation=The information below (default and custom) applies to all users. Custom information can be used in the processes (e.g. by implementing actor filters on tasks).
details=Details
groupDisplayLengthTooLong=Group display name \"{0}\" exceed max length of 75 characters.
importOrganizationWithWarningTitle=Import completed with errors
importOrganizationWithWarningMessage=The import of organization completed but some errors has been found.\n{0}
\ No newline at end of file
......@@ -5,7 +5,7 @@
<parent>
<groupId>org.bonitasoft.studio.bundles</groupId>
<artifactId>plugins</artifactId>
<version>6.4.0-SNAPSHOT</version>
<version>6.4.0-SNAPSHOT</version>
</parent>
<groupId>org.bonitasoft.studio.bundles.plugins</groupId>
<artifactId>org.bonitasoft.studio.actors</artifactId>
......
......@@ -279,6 +279,9 @@ public class Messages extends NLS {
public static String labelExplicationCustomUserInformation;
public static String customUserInfoValueLimitSize;
public static String userNameIsEmpty;
public static String groupDisplayLengthTooLong;
public static String importOrganizationWithWarningTitle;
public static String importOrganizationWithWarningMessage;
}
......@@ -25,7 +25,6 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CancellationException;
import org.bonitasoft.studio.actors.ActorsPlugin;
import org.bonitasoft.studio.actors.i18n.Messages;
......@@ -36,7 +35,6 @@ import org.bonitasoft.studio.actors.model.organization.util.OrganizationAdapterF
import org.bonitasoft.studio.actors.model.organization.util.OrganizationResourceFactoryImpl;
import org.bonitasoft.studio.actors.model.organization.util.OrganizationResourceImpl;
import org.bonitasoft.studio.actors.model.organization.util.OrganizationXMLProcessor;
import org.bonitasoft.studio.actors.ui.wizard.page.OrganizationUserValidator;
import org.bonitasoft.studio.common.FileUtil;
import org.bonitasoft.studio.common.ProjectUtil;
import org.bonitasoft.studio.common.jface.FileActionDialog;
......@@ -46,7 +44,6 @@ import org.bonitasoft.studio.common.repository.Repository;
import org.bonitasoft.studio.common.repository.store.AbstractEMFRepositoryStore;
import org.bonitasoft.studio.pics.Pics;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
......@@ -133,20 +130,10 @@ public class OrganizationRepositoryStore extends AbstractEMFRepositoryStore<Orga
final Organization orga = fileStore.getContent() ;
if(orga != null && (orga.getName() == null || orga.getName().isEmpty())){
orga.setName(newFileName.substring(0,newFileName.length()-ORGANIZATION_EXT.length() - 1)) ;
final IStatus status = new OrganizationUserValidator().validate(orga);
if(status.isOK()){
fileStore.save(orga) ;
}else{
fileStore.delete();
throw new CancellationException(status.getMessage());
}
fileStore.save(orga);
}
}
}catch(final Exception e){
if(e instanceof CancellationException){
throw (CancellationException)e;
}
BonitaStudioLog.error(e) ;
return null;
}
......
......@@ -25,6 +25,7 @@ import java.util.concurrent.CancellationException;
import org.bonitasoft.studio.actors.i18n.Messages;
import org.bonitasoft.studio.actors.repository.OrganizationFileStore;
import org.bonitasoft.studio.actors.repository.OrganizationRepositoryStore;
import org.bonitasoft.studio.actors.ui.wizard.page.OrganizationValidator;
import org.bonitasoft.studio.common.jface.BonitaErrorDialog;
import org.bonitasoft.studio.common.jface.FileActionDialog;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
......@@ -33,6 +34,7 @@ import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.swt.SWT;
......@@ -51,28 +53,37 @@ public class ImportOrganizationHandler extends AbstractHandler {
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final OrganizationRepositoryStore organizationStore = (OrganizationRepositoryStore) RepositoryManager.getInstance().getRepositoryStore(OrganizationRepositoryStore.class) ;
FileDialog fd = new FileDialog(Display.getDefault().getActiveShell(),SWT.OPEN) ;
public Object execute(final ExecutionEvent event) throws ExecutionException {
final OrganizationRepositoryStore organizationStore = RepositoryManager.getInstance().getRepositoryStore(OrganizationRepositoryStore.class) ;
final FileDialog fd = new FileDialog(Display.getDefault().getActiveShell(),SWT.OPEN) ;
fd.setFilterExtensions(new String[]{"*.xml;*.zip"}) ;
final String filePath = fd.open() ;
if(filePath != null){
IProgressService service = PlatformUI.getWorkbench().getProgressService() ;
final IProgressService service = PlatformUI.getWorkbench().getProgressService() ;
try {
service.run(false, false, new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException,
public void run(final IProgressMonitor monitor) throws InvocationTargetException,
InterruptedException {
monitor.beginTask(Messages.importingOrganization, IProgressMonitor.UNKNOWN) ;
FileInputStream fis = null ;
try {
fis = new FileInputStream(filePath);
String id = new File(filePath).getName() ;
final String id = new File(filePath).getName() ;
FileActionDialog.setThrowExceptionOnCancel(true);
OrganizationFileStore file = organizationStore.importInputStream(id, fis) ;
final OrganizationFileStore file = organizationStore.importInputStream(id, fis) ;
if(file != null && file.isCorrectlySyntaxed()){
MessageDialog.openInformation(Display.getDefault().getActiveShell(), Messages.importOrganizationSuccessfullTitle, Messages.importOrganizationSuccessfullMessage);
final IStatus status = new OrganizationValidator().validate(file.getContent());
if (!status.isOK()) {
MessageDialog.openWarning(Display.getDefault().getActiveShell(), Messages.importOrganizationWithWarningTitle,
Messages.bind(Messages.importOrganizationWithWarningMessage,status.getMessage()));
} else {
MessageDialog.openInformation(Display.getDefault().getActiveShell(), Messages.importOrganizationSuccessfullTitle,
Messages.importOrganizationSuccessfullMessage);
}
} else {
fis.close();
if( file != null){
......@@ -80,15 +91,15 @@ public class ImportOrganizationHandler extends AbstractHandler {
}
MessageDialog.openError(Display.getDefault().getActiveShell(), Messages.importOrganizationFailedTitle, Messages.importOrganizationFailedMessage);
}
} catch(CancellationException ce) {
} catch(final CancellationException ce) {
String message = Messages.importOrganizationCancelledMessage;
if(ce.getMessage() != null){
message = Messages.importOrganizationCancelledMessage + ":\n"+ce.getMessage();
}
MessageDialog.openWarning(Display.getDefault().getActiveShell(), Messages.importOrganizationCancelledTitle, message);
} catch (Exception e) {
BonitaStudioLog.error(e) ;
OrganizationFileStore file = organizationStore.getChild(new File(filePath).getName().replace(".xml", "."+OrganizationRepositoryStore.ORGANIZATION_EXT));
} catch (final Exception e) {
BonitaStudioLog.error(e) ;
final OrganizationFileStore file = organizationStore.getChild(new File(filePath).getName().replace(".xml", "."+OrganizationRepositoryStore.ORGANIZATION_EXT));
if( file != null){
file.delete();
}
......@@ -98,7 +109,7 @@ public class ImportOrganizationHandler extends AbstractHandler {
if(fis != null){
try {
fis.close() ;
} catch (IOException e) {
} catch (final IOException e) {
}
}
......@@ -106,7 +117,7 @@ public class ImportOrganizationHandler extends AbstractHandler {
}
});
} catch (Exception e) {
} catch (final Exception e) {
BonitaStudioLog.error(e) ;
} finally {
FileActionDialog.setThrowExceptionOnCancel(false);
......
......@@ -28,7 +28,7 @@ import org.bonitasoft.studio.actors.repository.OrganizationRepositoryStore;
import org.bonitasoft.studio.actors.ui.wizard.page.AbstractOrganizationWizardPage;
import org.bonitasoft.studio.actors.ui.wizard.page.GroupsWizardPage;
import org.bonitasoft.studio.actors.ui.wizard.page.ManageOrganizationWizardPage;
import org.bonitasoft.studio.actors.ui.wizard.page.OrganizationUserValidator;
import org.bonitasoft.studio.actors.ui.wizard.page.OrganizationValidator;
import org.bonitasoft.studio.actors.ui.wizard.page.RolesWizardPage;
import org.bonitasoft.studio.actors.ui.wizard.page.UsersWizardPage;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
......@@ -65,7 +65,7 @@ public class ManageOrganizationWizard extends Wizard {
private final List<Organization> organizations;
private final List<Organization> organizationsWorkingCopy;
private final OrganizationRepositoryStore store;
private final OrganizationUserValidator validator = new OrganizationUserValidator();
private final OrganizationValidator validator = new OrganizationValidator();
private Organization activeOrganization;
private boolean activeOrganizationHasBeenModified = false;
String userName;
......
/**
* Copyright (C) 2014 BonitaSoft S.A.
* BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.studio.actors.ui.wizard;
import org.eclipse.core.runtime.IStatus;
/**
* @author Romain Bioteau
*
*/
public class OrganizationValidationException extends Exception {
private static final long serialVersionUID = 578679768520738028L;
public OrganizationValidationException(final IStatus status) {
super(status.getMessage());
}
}
......@@ -22,7 +22,9 @@ import org.bonitasoft.studio.actors.i18n.Messages;
import org.bonitasoft.studio.actors.model.organization.Organization;
import org.bonitasoft.studio.actors.model.organization.User;
import org.bonitasoft.studio.actors.preference.ActorsPreferenceConstants;
import org.bonitasoft.studio.actors.repository.OrganizationFileStore;
import org.bonitasoft.studio.actors.ui.wizard.page.DefaultUserOrganizationWizardPage;
import org.bonitasoft.studio.actors.ui.wizard.page.OrganizationValidator;
import org.bonitasoft.studio.actors.ui.wizard.page.SynchronizeOrganizationWizardPage;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
import org.bonitasoft.studio.common.repository.model.IRepositoryFileStore;
......@@ -33,6 +35,7 @@ import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.Parameterization;
import org.eclipse.core.commands.ParameterizedCommand;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.IPreferenceStore;
......@@ -53,12 +56,14 @@ public class SynchronizeOrganizationWizard extends Wizard {
private SynchronizeOrganizationWizardPage page;
private DefaultUserOrganizationWizardPage userPage;
private Organization activeOrganization;
private final OrganizationValidator validator;
public SynchronizeOrganizationWizard(){
setWindowTitle(Messages.synchronizeOrganizationTitle);
setDefaultPageImageDescriptor(Pics.getWizban()) ;
setForcePreviousAndNextButtons(false) ;
setNeedsProgressMonitor(true) ;
validator = new OrganizationValidator();
}
@Override
......@@ -75,7 +80,7 @@ public class SynchronizeOrganizationWizard extends Wizard {
@Override
public IWizardPage getNextPage(final IWizardPage page) {
if(page instanceof SynchronizeOrganizationWizardPage){
activeOrganization = (Organization) ((SynchronizeOrganizationWizardPage)page).getFileStore().getContent();
activeOrganization = ((SynchronizeOrganizationWizardPage)page).getFileStore().getContent();
userPage.setOrganization(activeOrganization) ;
return userPage ;
}else{
......@@ -88,28 +93,19 @@ public class SynchronizeOrganizationWizard extends Wizard {
*/
@Override
public boolean performFinish() {
final IPreferenceStore prefStore = updateDefaultUserPreference();
final OrganizationFileStore artifact = getFileStore();
try {
getContainer().run(true, false, new IRunnableWithProgress() {
@Override
public void run(final IProgressMonitor maonitor) throws InvocationTargetException,InterruptedException {
maonitor.beginTask(Messages.synchronizingOrganization, IProgressMonitor.UNKNOWN) ;
final IPreferenceStore prefStore = BonitaStudioPreferencesPlugin.getDefault().getPreferenceStore() ;
final String userName = userPage.getUser();
String password = null;
if (activeOrganization!=null){
for (final User user:activeOrganization.getUsers().getUser()){
if (user.getUserName().equals(userPage.getUser())){
password = user.getPassword().getValue();
}
}
public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
monitor.beginTask(Messages.validatingOrganizationContent, IProgressMonitor.UNKNOWN);
final IStatus status = validator.validate(artifact.getContent());
if (!status.isOK()) {
throw new InvocationTargetException(new OrganizationValidationException(status));
}
prefStore.setValue(BonitaPreferenceConstants.USER_NAME,userName);
prefStore.setValue(BonitaPreferenceConstants.USER_PASSWORD,password);
final IRepositoryFileStore artifact = getFileStore() ;
monitor.beginTask(Messages.synchronizingOrganization, IProgressMonitor.UNKNOWN);
final ICommandService service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class) ;
final IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class) ;
final Command cmd = service.getCommand("org.bonitasoft.studio.engine.installOrganization") ;
......@@ -120,25 +116,40 @@ public class SynchronizeOrganizationWizard extends Wizard {
} catch (final Exception e) {
throw new InvocationTargetException(e);
}
final String organizationName = artifact.getDisplayName();
Display.getDefault().syncExec( new Runnable() {
@Override
public void run() {
MessageDialog.openInformation(Display.getDefault().getActiveShell(), Messages.synchronizeInformationTitle,Messages.bind(Messages.synchronizeOrganizationSuccessMsg, organizationName));
}
});
}
}) ;
} catch (final Exception e) {
BonitaStudioLog.error(e) ;
} catch (final InvocationTargetException e) {
if (e.getCause() instanceof OrganizationValidationException) {
MessageDialog.openError(Display.getDefault().getActiveShell(), Messages.organizationValidationFailed, e.getCause().getMessage());
}
return false ;
} catch (final InterruptedException e) {
BonitaStudioLog.error(e);
return false;
}
final String organizationName = artifact.getDisplayName();
MessageDialog.openInformation(Display.getDefault().getActiveShell(), Messages.synchronizeInformationTitle,
Messages.bind(Messages.synchronizeOrganizationSuccessMsg, organizationName));
return true;
}
public IRepositoryFileStore getFileStore() {
protected IPreferenceStore updateDefaultUserPreference() {
final IPreferenceStore prefStore = BonitaStudioPreferencesPlugin.getDefault().getPreferenceStore();
final String userName = userPage.getUser();
String password = null;
if (activeOrganization != null) {
for (final User user : activeOrganization.getUsers().getUser()) {
if (user.getUserName().equals(userPage.getUser())) {
password = user.getPassword().getValue();
}
}
}
prefStore.setValue(BonitaPreferenceConstants.USER_NAME, userName);
prefStore.setValue(BonitaPreferenceConstants.USER_PASSWORD, password);
return prefStore;
}
public OrganizationFileStore getFileStore() {
return page.getFileStore();
}
......
......@@ -36,39 +36,31 @@ import org.eclipse.core.runtime.Status;
* @author Romain Bioteau
*
*/
public class OrganizationUserValidator implements IValidator {
public class OrganizationValidator implements IValidator {
/* (non-Javadoc)
* @see org.eclipse.core.databinding.validation.IValidator#validate(java.lang.Object)
*/
@Override
public IStatus validate(Object input) {
public IStatus validate(final Object input) {
final Organization organization = (Organization) input;
for(User u : organization.getUsers().getUser()){
for(final User u : organization.getUsers().getUser()){
if(u.getUserName() == null || u.getUserName().isEmpty()){
return ValidationStatus.error(Messages.userNameMissing);
}
if(u.getPassword() == null || u.getPassword().getValue() == null || u.getPassword().getValue().isEmpty()){
return ValidationStatus.error(Messages.bind(Messages.userPasswordMissing,u.getUserName()));
}
// if(u.getFirstName() == null || u.getFirstName().isEmpty()){
// return ValidationStatus.error(Messages.bind(Messages.userFirstNameMissing,u.getUserName()));
// }
// if(u.getLastName() == null || u.getLastName().isEmpty()){
// return ValidationStatus.error(Messages.bind(Messages.userLastNameMissing,u.getUserName()));
// }
if(u.getManager() != null && !u.getManager().isEmpty()){
IStatus status = checkManagerCycles(organization,u);
final IStatus status = checkManagerCycles(organization,u);
if(!status.isOK()){
return status;
}
}
boolean membershipFound = false;
for(Membership membership : organization.getMemberships().getMembership()){
for(final Membership membership : organization.getMemberships().getMembership()){
final String userName = membership.getUserName() ;
if(userName != null){
if(userName.equals(u.getUserName())){
......@@ -84,7 +76,7 @@ public class OrganizationUserValidator implements IValidator {
}else{
groupPath = parentPath + GroupContentProvider.GROUP_SEPARATOR + groupName ;
}
IStatus groupStatus = validateGroupExists(organization,groupPath,membership) ;
final IStatus groupStatus = validateGroupExists(organization,groupPath,membership) ;
if(groupStatus.getSeverity() != IStatus.OK){
return groupStatus ;
}
......@@ -93,7 +85,7 @@ public class OrganizationUserValidator implements IValidator {
if(roleName == null){
return ValidationStatus.error(Messages.bind(Messages.missingRole,u.getUserName()));
}
IStatus roleStatus = validateRoleExists(organization,roleName,membership) ;
final IStatus roleStatus = validateRoleExists(organization,roleName,membership) ;
if(roleStatus.getSeverity() != IStatus.OK){
return roleStatus ;
}
......@@ -104,12 +96,17 @@ public class OrganizationUserValidator implements IValidator {
return ValidationStatus.error(Messages.bind(Messages.missingMembershipForUser,u.getUserName()));
}
}
for (final Group group : organization.getGroups().getGroup()) {
if (!group.getDisplayName().isEmpty() && group.getDisplayName().length() > 75) {
return ValidationStatus.error(Messages.bind(Messages.groupDisplayLengthTooLong, group.getDisplayName()));
}
}
return ValidationStatus.ok() ;
}
private IStatus checkManagerCycles(Organization organization,User u) {
private IStatus checkManagerCycles(final Organization organization,final User u) {