diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ServiceForDataStoreServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ServiceForDataStoreServer.java index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..2b06d92ab776b4594eb6c997047975febfee4373 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ServiceForDataStoreServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ServiceForDataStoreServer.java @@ -0,0 +1,3387 @@ +/* + * Copyright 2009 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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 ch.systemsx.cisd.openbis.generic.server; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Stack; +import java.util.UUID; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.commons.collections.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; + +import ch.ethz.sis.openbis.generic.asapi.v3.dto.dataset.Complete; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.dataset.create.DataSetCreation; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.dataset.create.LinkedDataCreation; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.dataset.create.PhysicalDataCreation; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.dataset.id.DataSetPermId; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.dataset.id.FileFormatTypePermId; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.dataset.id.IDataSetId; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.dataset.id.LocatorTypePermId; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.dataset.id.StorageFormatPermId; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.datastore.id.DataStorePermId; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.entitytype.id.EntityTypePermId; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.externaldms.id.ExternalDmsPermId; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.sample.id.ISampleId; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.sample.id.SamplePermId; +import ch.ethz.sis.openbis.generic.server.asapi.v3.context.IProgress; +import ch.ethz.sis.openbis.generic.server.asapi.v3.context.IProgressListener; +import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.IOperationContext; +import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.OperationContext; +import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.dataset.ICreateDataSetExecutor; +import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.sample.ListSampleTechIdByIdentifier; +import ch.rinn.restrictions.Private; +import ch.systemsx.cisd.authentication.DefaultSessionManager; +import ch.systemsx.cisd.authentication.DummyAuthenticationService; +import ch.systemsx.cisd.authentication.IAuthenticationService; +import ch.systemsx.cisd.authentication.ISessionManager; +import ch.systemsx.cisd.common.exceptions.ConfigurationFailureException; +import ch.systemsx.cisd.common.exceptions.UserFailureException; +import ch.systemsx.cisd.common.servlet.IRequestContextProvider; +import ch.systemsx.cisd.common.servlet.RequestContextProviderAdapter; +import ch.systemsx.cisd.openbis.common.conversation.context.ServiceConversationsThreadContext; +import ch.systemsx.cisd.openbis.common.conversation.progress.IServiceConversationProgressListener; +import ch.systemsx.cisd.openbis.common.spring.IInvocationLoggerContext; +import ch.systemsx.cisd.openbis.generic.server.api.v1.SearchCriteriaToDetailedSearchCriteriaTranslator; +import ch.systemsx.cisd.openbis.generic.server.authorization.AuthorizationServiceUtils; +import ch.systemsx.cisd.openbis.generic.server.authorization.annotation.AuthorizationGuard; +import ch.systemsx.cisd.openbis.generic.server.authorization.annotation.ReturnValueFilter; +import ch.systemsx.cisd.openbis.generic.server.authorization.annotation.RolesAllowed; +import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.AbstractTechIdPredicate.ExperimentTechIdPredicate; +import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.AtomicOperationsPredicate; +import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.DataSetCodeCollectionPredicate; +import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.DataSetCodePredicate; +import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.DataSetUpdatesPredicate; +import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.ExistingSampleOwnerIdentifierPredicate; +import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.ExistingSpaceIdentifierPredicate; +import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.ExperimentPermIdPredicate; +import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.ListSampleCriteriaPredicate; +import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.ListSamplesByPropertyPredicate; +import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.NewExperimentPredicate; +import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.NewSamplePredicate; +import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.NewSamplesWithTypePredicate; +import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.ProjectPermIdPredicate; +import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.SampleOwnerIdentifierPredicate; +import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.SamplePermIdPredicate; +import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.SampleTechIdPredicate; +import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.SampleUpdatesPredicate; +import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.SpaceIdentifierPredicate; +import ch.systemsx.cisd.openbis.generic.server.authorization.validator.ProjectValidator; +import ch.systemsx.cisd.openbis.generic.server.authorization.validator.SampleValidator; +import ch.systemsx.cisd.openbis.generic.server.batch.BatchOperationExecutor; +import ch.systemsx.cisd.openbis.generic.server.batch.DataSetBatchUpdate; +import ch.systemsx.cisd.openbis.generic.server.batch.DataSetCheckBeforeBatchUpdate; +import ch.systemsx.cisd.openbis.generic.server.batch.SampleBatchRegistration; +import ch.systemsx.cisd.openbis.generic.server.batch.SampleCheckBeforeUpdate; +import ch.systemsx.cisd.openbis.generic.server.batch.SampleUpdate; +import ch.systemsx.cisd.openbis.generic.server.business.IDataStoreServiceFactory; +import ch.systemsx.cisd.openbis.generic.server.business.IPropertiesBatchManager; +import ch.systemsx.cisd.openbis.generic.server.business.IServiceConversationClientManagerLocal; +import ch.systemsx.cisd.openbis.generic.server.business.IServiceConversationServerManagerLocal; +import ch.systemsx.cisd.openbis.generic.server.business.bo.EntityCodeGenerator; +import ch.systemsx.cisd.openbis.generic.server.business.bo.EntityObjectIdHelper; +import ch.systemsx.cisd.openbis.generic.server.business.bo.IAuthorizationGroupBO; +import ch.systemsx.cisd.openbis.generic.server.business.bo.ICommonBusinessObjectFactory; +import ch.systemsx.cisd.openbis.generic.server.business.bo.IDataBO; +import ch.systemsx.cisd.openbis.generic.server.business.bo.IDataSetTable; +import ch.systemsx.cisd.openbis.generic.server.business.bo.IExperimentBO; +import ch.systemsx.cisd.openbis.generic.server.business.bo.IExperimentTable; +import ch.systemsx.cisd.openbis.generic.server.business.bo.IMaterialBO; +import ch.systemsx.cisd.openbis.generic.server.business.bo.IMetaprojectBO; +import ch.systemsx.cisd.openbis.generic.server.business.bo.IProjectBO; +import ch.systemsx.cisd.openbis.generic.server.business.bo.IRoleAssignmentTable; +import ch.systemsx.cisd.openbis.generic.server.business.bo.ISampleBO; +import ch.systemsx.cisd.openbis.generic.server.business.bo.ISampleTable; +import ch.systemsx.cisd.openbis.generic.server.business.bo.ISpaceBO; +import ch.systemsx.cisd.openbis.generic.server.business.bo.IVocabularyBO; +import ch.systemsx.cisd.openbis.generic.server.business.bo.datasetlister.IDatasetLister; +import ch.systemsx.cisd.openbis.generic.server.business.bo.fetchoptions.experimentlister.ExperimentLister; +import ch.systemsx.cisd.openbis.generic.server.business.bo.materiallister.IMaterialLister; +import ch.systemsx.cisd.openbis.generic.server.business.bo.samplelister.ISampleLister; +import ch.systemsx.cisd.openbis.generic.server.business.bo.util.DataSetRegistrationCache; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDAOFactory; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDataDAO; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDataSetTypeDAO; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDataStoreDAO; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDataStoreDataSourceManager; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IEntityPropertyTypeDAO; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IEntityTypeDAO; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IMetaprojectDAO; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.IPersonDAO; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.ISampleTypeDAO; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.db.search.IFullTextIndexUpdateScheduler; +import ch.systemsx.cisd.openbis.generic.server.dataaccess.db.search.IndexUpdateOperation; +import ch.systemsx.cisd.openbis.generic.shared.IDataStoreService; +import ch.systemsx.cisd.openbis.generic.shared.IOpenBisSessionManager; +import ch.systemsx.cisd.openbis.generic.shared.IServer; +import ch.systemsx.cisd.openbis.generic.shared.IServiceForDataStoreServer; +import ch.systemsx.cisd.openbis.generic.shared.LogMessagePrefixGenerator; +import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.DataSetFetchOption; +import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchCriteria; +import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchableEntityKind; +import ch.systemsx.cisd.openbis.generic.shared.basic.EntityOperationsState; +import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AbstractExternalData; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ArchiverDataSetCriteria; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Attachment; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AttachmentHolderKind; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AttachmentWithContent; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AuthorizationGroup; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetArchivingStatus; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetTypePropertyType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetTypeWithVocabularyTerms; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseInstance; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DeletedDataSet; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DetailedSearchCriteria; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityTypePropertyType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExperimentFetchOption; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExperimentFetchOptions; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExperimentType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExperimentTypePropertyType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalDataManagementSystem; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Grantee; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IDatasetLocationNode; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityProperty; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ListMaterialCriteria; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ListOrSearchSampleCriteria; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ListSampleCriteria; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Material; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialIdentifier; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialTypePropertyType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Metaproject; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MetaprojectAssignments; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MetaprojectAssignmentsFetchOption; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewExperiment; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewMaterial; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewMaterialWithType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewMetaproject; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewProject; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewSample; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewSamplesWithTypes; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewSpace; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Person; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Project; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.PropertyType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.PropertyTypeWithVocabulary; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.RoleAssignment; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.RoleWithHierarchy; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.RoleWithHierarchy.RoleCode; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleTypePropertyType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SourceType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Space; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TrackingDataSetCriteria; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Vocabulary; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.VocabularyTerm; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.id.IObjectId; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.id.experiment.ExperimentPermIdId; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.id.metaproject.IMetaprojectId; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.id.metaproject.MetaprojectIdentifierId; +import ch.systemsx.cisd.openbis.generic.shared.dto.AtomicEntityOperationDetails; +import ch.systemsx.cisd.openbis.generic.shared.dto.AtomicEntityOperationResult; +import ch.systemsx.cisd.openbis.generic.shared.dto.AttachmentHolderPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.AttachmentPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.AuthorizationGroupPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.DataPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.DataSetBatchUpdatesDTO; +import ch.systemsx.cisd.openbis.generic.shared.dto.DataSetShareId; +import ch.systemsx.cisd.openbis.generic.shared.dto.DataSetTypePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.DataSetTypePropertyTypePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.DataSetUpdatesDTO; +import ch.systemsx.cisd.openbis.generic.shared.dto.DataStorePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.DataStoreServerInfo; +import ch.systemsx.cisd.openbis.generic.shared.dto.DataStoreServicePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.EntityCollectionForCreationOrUpdate; +import ch.systemsx.cisd.openbis.generic.shared.dto.EntityOperationsLogEntryPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.EntityTypePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.EntityTypePropertyTypePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentTypePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentUpdatesDTO; +import ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataManagementSystemPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.IEntityInformationHolderDTO; +import ch.systemsx.cisd.openbis.generic.shared.dto.ListSamplesByPropertyCriteria; +import ch.systemsx.cisd.openbis.generic.shared.dto.MaterialPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.MaterialUpdateDTO; +import ch.systemsx.cisd.openbis.generic.shared.dto.MetaprojectAssignmentPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.MetaprojectPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.MetaprojectUpdatesDTO; +import ch.systemsx.cisd.openbis.generic.shared.dto.NewContainerDataSet; +import ch.systemsx.cisd.openbis.generic.shared.dto.NewExternalData; +import ch.systemsx.cisd.openbis.generic.shared.dto.NewLinkDataSet; +import ch.systemsx.cisd.openbis.generic.shared.dto.NewProperty; +import ch.systemsx.cisd.openbis.generic.shared.dto.NewRoleAssignment; +import ch.systemsx.cisd.openbis.generic.shared.dto.PermId; +import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.ProjectPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.ProjectUpdatesDTO; +import ch.systemsx.cisd.openbis.generic.shared.dto.PropertyTypePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.RoleAssignmentPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePropertyPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.SampleTypePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.SampleUpdatesDTO; +import ch.systemsx.cisd.openbis.generic.shared.dto.Session; +import ch.systemsx.cisd.openbis.generic.shared.dto.SimpleDataSetInformationDTO; +import ch.systemsx.cisd.openbis.generic.shared.dto.SpacePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.SpaceRoleAssignment; +import ch.systemsx.cisd.openbis.generic.shared.dto.VocabularyPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.VocabularyTermPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.VocabularyUpdatesDTO; +import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.ExperimentIdentifier; +import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.ProjectIdentifier; +import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.ProjectIdentifierFactory; +import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifier; +import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifierFactory; +import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SpaceIdentifier; +import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind; +import ch.systemsx.cisd.openbis.generic.shared.managed_property.IManagedPropertyEvaluatorFactory; +import ch.systemsx.cisd.openbis.generic.shared.translator.AttachmentTranslator; +import ch.systemsx.cisd.openbis.generic.shared.translator.AuthorizationGroupTranslator; +import ch.systemsx.cisd.openbis.generic.shared.translator.DataSetTranslator; +import ch.systemsx.cisd.openbis.generic.shared.translator.DataSetTypePropertyTypeTranslator; +import ch.systemsx.cisd.openbis.generic.shared.translator.DataSetTypeTranslator; +import ch.systemsx.cisd.openbis.generic.shared.translator.EntityPropertyTranslator; +import ch.systemsx.cisd.openbis.generic.shared.translator.ExperimentTranslator; +import ch.systemsx.cisd.openbis.generic.shared.translator.ExperimentTranslator.LoadableFields; +import ch.systemsx.cisd.openbis.generic.shared.translator.ExperimentTypePropertyTypeTranslator; +import ch.systemsx.cisd.openbis.generic.shared.translator.ExperimentTypeTranslator; +import ch.systemsx.cisd.openbis.generic.shared.translator.ExternalDataManagementSystemTranslator; +import ch.systemsx.cisd.openbis.generic.shared.translator.MaterialTranslator; +import ch.systemsx.cisd.openbis.generic.shared.translator.MaterialTypePropertyTypeTranslator; +import ch.systemsx.cisd.openbis.generic.shared.translator.MetaprojectTranslator; +import ch.systemsx.cisd.openbis.generic.shared.translator.PersonTranslator; +import ch.systemsx.cisd.openbis.generic.shared.translator.ProjectTranslator; +import ch.systemsx.cisd.openbis.generic.shared.translator.RoleAssignmentTranslator; +import ch.systemsx.cisd.openbis.generic.shared.translator.SampleTranslator; +import ch.systemsx.cisd.openbis.generic.shared.translator.SampleTypePropertyTypeTranslator; +import ch.systemsx.cisd.openbis.generic.shared.translator.SampleTypeTranslator; +import ch.systemsx.cisd.openbis.generic.shared.translator.SimpleDataSetHelper; +import ch.systemsx.cisd.openbis.generic.shared.translator.SpaceTranslator; +import ch.systemsx.cisd.openbis.generic.shared.translator.VocabularyTermTranslator; +import ch.systemsx.cisd.openbis.generic.shared.translator.VocabularyTranslator; +import ch.systemsx.cisd.openbis.generic.shared.util.HibernateUtils; + +/** + * @author Franz-Josef Elmer + */ +public class ServiceForDataStoreServer extends AbstractCommonServer<IServiceForDataStoreServer> + implements IServiceForDataStoreServer +{ + + @Private + static final EnumSet<DataSetFetchOption> DATASET_FETCH_OPTIONS_FILE_DATASETS = EnumSet.of( + DataSetFetchOption.BASIC, DataSetFetchOption.EXPERIMENT, DataSetFetchOption.SAMPLE); + + private final IDAOFactory daoFactory; + + private final IDataStoreServiceFactory dssFactory; + + private final TrustedCrossOriginDomainsProvider trustedOriginDomainProvider; + + private final IETLEntityOperationChecker entityOperationChecker; + + private final ISessionManager<Session> sessionManagerForEntityOperation; + + private final IDataStoreServiceRegistrator dataStoreServiceRegistrator; + + private final IDataStoreDataSourceManager dataSourceManager; + + private IServiceConversationClientManagerLocal conversationClient; + + private IServiceConversationServerManagerLocal conversationServer; + + private IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory; + + @Autowired + private ICreateDataSetExecutor createDataSetExecutor; + + private long timeout = 5; // minutes + + public ServiceForDataStoreServer(IAuthenticationService authenticationService, + IOpenBisSessionManager sessionManager, IDAOFactory daoFactory, + ICommonBusinessObjectFactory boFactory, IDataStoreServiceFactory dssFactory, + TrustedCrossOriginDomainsProvider trustedOriginDomainProvider, + IETLEntityOperationChecker entityOperationChecker, + IDataStoreServiceRegistrator dataStoreServiceRegistrator, + IDataStoreDataSourceManager dataSourceManager, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory) + { + this(authenticationService, sessionManager, daoFactory, null, boFactory, dssFactory, + trustedOriginDomainProvider, entityOperationChecker, dataStoreServiceRegistrator, + dataSourceManager, new DefaultSessionManager<Session>(new SessionFactory(), + new LogMessagePrefixGenerator(), new DummyAuthenticationService(), + new RequestContextProviderAdapter(new IRequestContextProvider() + { + @Override + public HttpServletRequest getHttpServletRequest() + { + return null; + } + }), + 30), + managedPropertyEvaluatorFactory, null); + } + + ServiceForDataStoreServer(IAuthenticationService authenticationService, + IOpenBisSessionManager sessionManager, IDAOFactory daoFactory, + IPropertiesBatchManager propertiesBatchManager, ICommonBusinessObjectFactory boFactory, + IDataStoreServiceFactory dssFactory, + TrustedCrossOriginDomainsProvider trustedOriginDomainProvider, + IETLEntityOperationChecker entityOperationChecker, + IDataStoreServiceRegistrator dataStoreServiceRegistrator, + IDataStoreDataSourceManager dataSourceManager, + ISessionManager<Session> sessionManagerForEntityOperation, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, ICreateDataSetExecutor createDataSetExecutor) + { + super(authenticationService, sessionManager, daoFactory, propertiesBatchManager, boFactory); + this.daoFactory = daoFactory; + this.dssFactory = dssFactory; + this.trustedOriginDomainProvider = trustedOriginDomainProvider; + this.entityOperationChecker = entityOperationChecker; + this.dataStoreServiceRegistrator = dataStoreServiceRegistrator; + this.dataSourceManager = dataSourceManager; + this.sessionManagerForEntityOperation = sessionManagerForEntityOperation; + this.managedPropertyEvaluatorFactory = managedPropertyEvaluatorFactory; + this.createDataSetExecutor = createDataSetExecutor; + } + + @Override + public IServiceForDataStoreServer createLogger(IInvocationLoggerContext context) + { + return new ServiceForDataStoreServerLogger(getSessionManager(), context); + } + + @Override + public int getVersion() + { + return IServer.VERSION; + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public DatabaseInstance getHomeDatabaseInstance(final String sessionToken) + { + final DatabaseInstance result = new DatabaseInstance(); + result.setCode("CISD"); + result.setHomeDatabase(true); + result.setId(1L); + String uuid = getDatabaseInstanceUUID(); + result.setIdentifier(uuid); + result.setUuid(uuid); + return result; + } + + private String getDatabaseInstanceUUID() + { + List<DataStorePE> stores = daoFactory.getDataStoreDAO().listDataStores(); + if (stores.size() == 0) + { + return UUID.randomUUID().toString().toUpperCase(); + } else + { + return stores.get(0).getDatabaseInstanceUUID(); + } + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public void registerDataStoreServer(String sessionToken, DataStoreServerInfo info) + { + Session session = getSession(sessionToken); + + String dssSessionToken = info.getSessionToken(); + String dssURL = checkVersion(info, session, dssSessionToken); + IDataStoreDAO dataStoreDAO = daoFactory.getDataStoreDAO(); + DataStorePE dataStore = dataStoreDAO.tryToFindDataStoreByCode(info.getDataStoreCode()); + if (dataStore == null) + { + dataStore = new DataStorePE(); + dataStore.setDatabaseInstanceUUID(getDatabaseInstanceUUID()); + } + dataStore.setCode(info.getDataStoreCode()); + dataStore.setDownloadUrl(info.getDownloadUrl()); + dataStore.setRemoteUrl(dssURL); + dataStore.setSessionToken(dssSessionToken); + dataStore.setArchiverConfigured(info.isArchiverConfigured()); + dataStore.setServices(new HashSet<DataStoreServicePE>()); // services will be set by the + // dataStoreServiceRegistrator + // setServices(dataStore, info.getServicesDescriptions(), dataStoreDAO); + dataStoreDAO.createOrUpdateDataStore(dataStore); + dataStoreServiceRegistrator.setServiceDescriptions(dataStore, + info.getServicesDescriptions()); + dataSourceManager.handle(info.getDataStoreCode(), info.getDataSourceDefinitions()); + + conversationClient.setDataStoreInformation(dssURL, info.getTimeoutInMinutes()); + conversationServer.setDataStoreInformation(info.getDataStoreCode(), dssURL, + info.getTimeoutInMinutes()); + } + + private String checkVersion(DataStoreServerInfo info, Session session, String dssSessionToken) + { + int port = info.getPort(); + String remoteHost = session.getRemoteHost() + ":" + port; + String dssURL = (info.isUseSSL() ? "https://" : "http://") + remoteHost; + checkVersion(dssSessionToken, dssURL); + return dssURL; + } + + private void checkVersion(String dssSessionToken, final String dssURL) + { + final IDataStoreService service = dssFactory.create(dssURL, timeout * 60 * 1000); + if (operationLog.isInfoEnabled()) + { + operationLog.info("Obtain version of Data Store Server at " + dssURL); + } + int dssVersion = service.getVersion(dssSessionToken); + if (IDataStoreService.VERSION != dssVersion) + { + String msg = + "Data Store Server version is " + dssVersion + " instead of " + + IDataStoreService.VERSION; + notificationLog.error(msg); + throw new ConfigurationFailureException(msg); + } + if (operationLog.isInfoEnabled()) + { + operationLog.info("Data Store Server (version " + dssVersion + ") registered for " + + dssURL); + } + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public String createPermId(final String sessionToken) throws UserFailureException + { + checkSession(sessionToken); // throws exception if invalid sessionToken + return daoFactory.getPermIdDAO().createPermId(); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<String> createPermIds(String sessionToken, int n) throws UserFailureException + { + checkSession(sessionToken); + return daoFactory.getPermIdDAO().createPermIds(n); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public long drawANewUniqueID(String sessionToken) throws UserFailureException + { + checkSession(sessionToken); + return daoFactory.getCodeSequenceDAO().getNextCodeSequenceId(); + } + + @Override + @RolesAllowed({ RoleWithHierarchy.SPACE_OBSERVER, RoleWithHierarchy.SPACE_ETL_SERVER }) + public List<Experiment> listExperiments(String sessionToken, + @AuthorizationGuard(guardClass = SpaceIdentifierPredicate.class) List<ExperimentIdentifier> experimentIdentifiers, + ExperimentFetchOptions experimentFetchOptions) + { + if (sessionToken == null) + { + throw new IllegalArgumentException("SessionToken was null"); + } + if (experimentIdentifiers == null) + { + throw new IllegalArgumentException("ExperimentIdentifiers were null"); + } + if (experimentFetchOptions == null) + { + throw new IllegalArgumentException("ExperimentFetchOptions were null"); + } + + checkSession(sessionToken); + + if (experimentFetchOptions.isSubsetOf(ExperimentFetchOption.BASIC, + ExperimentFetchOption.METAPROJECTS)) + { + ExperimentLister lister = + new ExperimentLister(getDAOFactory(), getSession(sessionToken) + .getBaseIndexURL()); + return lister.listExperiments(experimentIdentifiers, experimentFetchOptions); + } else + { + List<Experiment> experiments = new ArrayList<Experiment>(); + for (ExperimentIdentifier experimentIdentifier : experimentIdentifiers) + { + Experiment experiment = tryGetExperiment(sessionToken, experimentIdentifier); + if (experiment != null) + { + experiment.setFetchOptions(new ExperimentFetchOptions(ExperimentFetchOption + .values())); + experiments.add(experiment); + } + } + return experiments; + } + } + + @Override + @RolesAllowed({ RoleWithHierarchy.SPACE_OBSERVER, RoleWithHierarchy.SPACE_ETL_SERVER }) + public List<Experiment> listExperimentsForProjects(String sessionToken, + @AuthorizationGuard(guardClass = SpaceIdentifierPredicate.class) List<ProjectIdentifier> projectIdentifiers, + ExperimentFetchOptions experimentFetchOptions) + { + if (sessionToken == null) + { + throw new IllegalArgumentException("SessionToken was null"); + } + if (projectIdentifiers == null) + { + throw new IllegalArgumentException("ProjectIdentifiers were null"); + } + if (experimentFetchOptions == null) + { + throw new IllegalArgumentException("ExperimentFetchOptions were null"); + } + + checkSession(sessionToken); + + if (experimentFetchOptions.isSubsetOf(ExperimentFetchOption.BASIC, + ExperimentFetchOption.METAPROJECTS)) + { + ExperimentLister lister = + new ExperimentLister(daoFactory, getSession(sessionToken).getBaseIndexURL()); + return lister.listExperimentsForProjects(projectIdentifiers, experimentFetchOptions); + } else + { + List<Experiment> experiments = new ArrayList<Experiment>(); + for (ProjectIdentifier projectIdentifier : projectIdentifiers) + { + List<Experiment> projectExperiments = + listExperiments(sessionToken, projectIdentifier); + if (projectExperiments != null) + { + for (Experiment projectExperiment : projectExperiments) + { + if (projectExperiment != null) + { + projectExperiment.setFetchOptions(new ExperimentFetchOptions( + ExperimentFetchOption.values())); + experiments.add(projectExperiment); + } + } + + } + } + return experiments; + } + } + + @Override + @RolesAllowed({ RoleWithHierarchy.SPACE_OBSERVER, RoleWithHierarchy.SPACE_ETL_SERVER }) + public Experiment tryGetExperiment(String sessionToken, + @AuthorizationGuard(guardClass = ExistingSpaceIdentifierPredicate.class) ExperimentIdentifier experimentIdentifier) + throws UserFailureException + { + assert sessionToken != null : "Unspecified session token."; + assert experimentIdentifier != null : "Unspecified experiment identifier."; + + final Session session = getSession(sessionToken); + ExperimentPE experiment = tryLoadExperimentByIdentifier(session, experimentIdentifier); + return translateExperimentWithMetaprojects(session, experiment); + } + + @Override + @RolesAllowed({ RoleWithHierarchy.SPACE_OBSERVER, RoleWithHierarchy.SPACE_ETL_SERVER }) + public Experiment tryGetExperimentByPermId(String sessionToken, @AuthorizationGuard(guardClass = ExperimentPermIdPredicate.class) PermId permId) + throws UserFailureException + { + assert sessionToken != null : "Unspecified session token."; + assert permId != null : "Unspecified experiment perm id."; + + final Session session = getSession(sessionToken); + ExperimentPE experiment = tryLoadExperimentByPermId(session, permId.getId()); + return translateExperimentWithMetaprojects(session, experiment); + } + + private Experiment translateExperimentWithMetaprojects(final Session session, ExperimentPE experiment) + { + if (experiment == null) + { + return null; + } + enrichWithProperties(experiment); + + Collection<MetaprojectPE> metaprojectPEs = + getDAOFactory().getMetaprojectDAO().listMetaprojectsForEntity( + session.tryGetPerson(), experiment); + + return ExperimentTranslator.translate(experiment, session.getBaseIndexURL(), + MetaprojectTranslator.translate(metaprojectPEs), managedPropertyEvaluatorFactory, + LoadableFields.PROPERTIES); + } + + @Override + @RolesAllowed({ RoleWithHierarchy.SPACE_OBSERVER, RoleWithHierarchy.SPACE_ETL_SERVER }) + @ReturnValueFilter(validatorClass = SampleValidator.class) + public List<Sample> listSamples(final String sessionToken, + @AuthorizationGuard(guardClass = ListSampleCriteriaPredicate.class) + final ListSampleCriteria criteria) + { + final Session session = getSession(sessionToken); + final ISampleLister sampleLister = businessObjectFactory.createSampleLister(session); + return sampleLister.list(new ListOrSearchSampleCriteria(criteria)); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public Sample tryGetSampleWithExperiment(final String sessionToken, + @AuthorizationGuard(guardClass = ExistingSampleOwnerIdentifierPredicate.class) + final SampleIdentifier sampleIdentifier) throws UserFailureException + { + assert sessionToken != null : "Unspecified session token."; + assert sampleIdentifier != null : "Unspecified sample identifier."; + + final Session session = getSession(sessionToken); + SamplePE sample = tryLoadSample(session, sampleIdentifier); + return translateSampleWithMetaProjects(session, sample); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public Sample tryGetSampleByPermId(String sessionToken, @AuthorizationGuard(guardClass = SamplePermIdPredicate.class) PermId permId) + throws UserFailureException + { + assert sessionToken != null : "Unspecified session token."; + assert permId != null : "Unspecified sample perm id."; + + final Session session = getSession(sessionToken); + SamplePE sample = tryLoadSample(session, permId.getId()); + return translateSampleWithMetaProjects(session, sample); + } + + private Sample translateSampleWithMetaProjects(final Session session, SamplePE sample) + { + Collection<MetaprojectPE> metaprojects = Collections.emptySet(); + if (sample != null) + { + HibernateUtils.initialize(sample.getProperties()); + enrichWithProperties(sample.getExperiment()); + metaprojects = + getDAOFactory().getMetaprojectDAO().listMetaprojectsForEntity( + session.tryGetPerson(), sample); + } + return SampleTranslator.translate(sample, session.getBaseIndexURL(), true, true, + MetaprojectTranslator.translate(metaprojects), managedPropertyEvaluatorFactory); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public SampleIdentifier tryGetSampleIdentifier(String sessionToken, String samplePermID) + throws UserFailureException + { + assert sessionToken != null : "Unspecified session token."; + assert samplePermID != null : "Unspecified sample perm ID."; + + final SamplePE sample = daoFactory.getSampleDAO().tryToFindByPermID(samplePermID); + return (sample == null) ? null : sample.getSampleIdentifier(); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public Map<String, SampleIdentifier> listSamplesByPermId(final String sessionToken, + List<String> samplePermIds) + { + List<SamplePE> samples = + daoFactory.getSampleDAO().listByPermID(new HashSet<String>(samplePermIds)); + + Map<String, SampleIdentifier> map = new HashMap<String, SampleIdentifier>(); + + for (SamplePE sample : samples) + { + map.put(sample.getPermId(), sample.getSampleIdentifier()); + } + + return map; + } + + private ExperimentPE tryLoadExperimentByIdentifier(final Session session, + ExperimentIdentifier experimentIdentifier) + { + final IExperimentBO experimentBO = businessObjectFactory.createExperimentBO(session); + return experimentBO.tryFindByExperimentIdentifier(experimentIdentifier); + } + + private ExperimentPE tryLoadExperimentByPermId(final Session session, + String permId) + { + final IExperimentBO experimentBO = businessObjectFactory.createExperimentBO(session); + return experimentBO.tryFindByExperimentId(new ExperimentPermIdId(permId)); + } + + private SamplePE tryLoadSample(final Session session, SampleIdentifier sampleIdentifier) + { + SamplePE result = null; + final ISampleBO sampleBO = businessObjectFactory.createSampleBO(session); + try + { + sampleBO.tryToLoadBySampleIdentifier(sampleIdentifier); + result = sampleBO.tryToGetSample(); + } catch (UserFailureException ufe) + { + // sample does not exist + } + return result; + } + + private SamplePE tryLoadSample(final Session session, String permId) + { + SamplePE result = null; + final ISampleBO sampleBO = businessObjectFactory.createSampleBO(session); + try + { + sampleBO.tryToLoadBySamplePermId(permId); + result = sampleBO.tryToGetSample(); + } catch (UserFailureException ufe) + { + // sample does not exist + } + return result; + } + + private void enrichWithProperties(ExperimentPE experiment) + { + if (experiment == null) + { + return; + } + HibernateUtils.initialize(experiment.getProperties()); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public ExperimentType getExperimentType(String sessionToken, String experimentTypeCode) + throws UserFailureException + { + checkSession(sessionToken); + + IEntityTypeDAO entityTypeDAO = getDAOFactory().getEntityTypeDAO(EntityKind.EXPERIMENT); + EntityTypePE entityType = entityTypeDAO.tryToFindEntityTypeByCode(experimentTypeCode); + if (entityType == null) + { + throw new UserFailureException("No Experiment type found with code '" + + experimentTypeCode + "'."); + } + assert entityType instanceof ExperimentTypePE : "Not an ExperimentTypePE: " + entityType; + ExperimentTypePE experimentType = (ExperimentTypePE) entityType; + HibernateUtils.initialize(experimentType.getExperimentTypePropertyTypes()); + return ExperimentTypeTranslator.translate(experimentType, null); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public SampleType getSampleType(String sessionToken, String sampleTypeCode) + throws UserFailureException + { + checkSession(sessionToken); + + ISampleTypeDAO sampleTypeDAO = getDAOFactory().getSampleTypeDAO(); + SampleTypePE sampleType = sampleTypeDAO.tryFindSampleTypeByCode(sampleTypeCode); + if (sampleType == null) + { + throw new UserFailureException("No sample type found with code '" + sampleTypeCode + + "'."); + } + HibernateUtils.initialize(sampleType.getSampleTypePropertyTypes()); + return SampleTypeTranslator.translate(sampleType, null); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public DataSetTypeWithVocabularyTerms getDataSetType(String sessionToken, String dataSetTypeCode) + throws UserFailureException + { + checkSession(sessionToken); + + IDataSetTypeDAO dataSetTypeDAO = getDAOFactory().getDataSetTypeDAO(); + DataSetTypePE dataSetType = dataSetTypeDAO.tryToFindDataSetTypeByCode(dataSetTypeCode); + if (dataSetType == null) + { + throw new UserFailureException("No data set type found with code '" + dataSetTypeCode + + "'."); + } + Set<DataSetTypePropertyTypePE> dataSetTypePropertyTypes = + dataSetType.getDataSetTypePropertyTypes(); + HibernateUtils.initialize(dataSetTypePropertyTypes); + DataSetTypeWithVocabularyTerms result = new DataSetTypeWithVocabularyTerms(); + result.setDataSetType(DataSetTypeTranslator.translate(dataSetType, null)); + for (DataSetTypePropertyTypePE dataSetTypePropertyTypePE : dataSetTypePropertyTypes) + { + PropertyTypePE propertyTypePE = dataSetTypePropertyTypePE.getPropertyType(); + PropertyTypeWithVocabulary propertyType = new PropertyTypeWithVocabulary(); + propertyType.setCode(propertyTypePE.getCode()); + VocabularyPE vocabulary = propertyTypePE.getVocabulary(); + if (vocabulary != null) + { + Set<VocabularyTermPE> terms = vocabulary.getTerms(); + HibernateUtils.initialize(terms); + propertyType.setTerms(VocabularyTermTranslator.translateTerms(terms)); + } + result.addPropertyType(propertyType); + } + return result; + } + + @Override + @RolesAllowed({ RoleWithHierarchy.SPACE_OBSERVER, RoleWithHierarchy.SPACE_ETL_SERVER }) + public List<AbstractExternalData> listDataSetsByExperimentID(final String sessionToken, + @AuthorizationGuard(guardClass = ExperimentTechIdPredicate.class) + final TechId experimentID) throws UserFailureException + { + Session session = getSession(sessionToken); + IDatasetLister datasetLister = createDatasetLister(session); + List<AbstractExternalData> datasets = + datasetLister.listByExperimentTechId(experimentID, true); + Collections.sort(datasets); + return datasets; + } + + @Override + @RolesAllowed({ RoleWithHierarchy.SPACE_OBSERVER, RoleWithHierarchy.SPACE_ETL_SERVER }) + public List<AbstractExternalData> listDataSetsBySampleID(final String sessionToken, + @AuthorizationGuard(guardClass = SampleTechIdPredicate.class) + final TechId sampleId, final boolean showOnlyDirectlyConnected) + throws UserFailureException + { + final Session session = getSession(sessionToken); + final IDatasetLister datasetLister = createDatasetLister(session); + final List<AbstractExternalData> datasets = + datasetLister.listBySampleTechId(sampleId, showOnlyDirectlyConnected); + Collections.sort(datasets); + return datasets; + } + + @Override + @RolesAllowed({ RoleWithHierarchy.SPACE_OBSERVER, RoleWithHierarchy.SPACE_ETL_SERVER }) + public List<AbstractExternalData> listDataSetsByCode(String sessionToken, + @AuthorizationGuard(guardClass = DataSetCodeCollectionPredicate.class) List<String> dataSetCodes) throws UserFailureException + { + final Session session = getSession(sessionToken); + final IDatasetLister datasetLister = createDatasetLister(session); + return datasetLister.listByDatasetCode(dataSetCodes); + } + + @Override + @RolesAllowed(value = { RoleWithHierarchy.SPACE_OBSERVER, RoleWithHierarchy.SPACE_ETL_SERVER }) + @ReturnValueFilter(validatorClass = ProjectValidator.class) + public List<Project> listProjects(String sessionToken) + { + checkSession(sessionToken); + final List<ProjectPE> projects = getDAOFactory().getProjectDAO().listProjects(); + Collections.sort(projects); + return ProjectTranslator.translate(projects); + } + + @Override + @RolesAllowed(value = { RoleWithHierarchy.SPACE_OBSERVER, RoleWithHierarchy.SPACE_ETL_SERVER }) + public List<Experiment> listExperiments(String sessionToken, + @AuthorizationGuard(guardClass = SpaceIdentifierPredicate.class) ProjectIdentifier projectIdentifier) + { + final Session session = getSession(sessionToken); + final IExperimentTable experimentTable = + businessObjectFactory.createExperimentTable(session); + experimentTable.load(EntityType.ALL_TYPES_CODE, projectIdentifier); + final List<ExperimentPE> experiments = experimentTable.getExperiments(); + return translateExperimentsWithMetaprojectAssignments(session, experiments); + } + + private List<Experiment> translateExperimentsWithMetaprojectAssignments(final Session session, final List<ExperimentPE> experiments) + { + final Collection<MetaprojectAssignmentPE> assignmentPEs = + getDAOFactory().getMetaprojectDAO().listMetaprojectAssignmentsForEntities( + session.tryGetPerson(), experiments, EntityKind.EXPERIMENT); + Map<Long, Set<Metaproject>> assignments = + MetaprojectTranslator.translateMetaprojectAssignments(assignmentPEs); + Collections.sort(experiments); + return ExperimentTranslator.translate(experiments, session.getBaseIndexURL(), assignments, + managedPropertyEvaluatorFactory); + } + + @Override + @RolesAllowed({ RoleWithHierarchy.SPACE_OBSERVER, RoleWithHierarchy.SPACE_ETL_SERVER }) + public IEntityProperty[] tryGetPropertiesOfTopSample(final String sessionToken, + @AuthorizationGuard(guardClass = SampleOwnerIdentifierPredicate.class) + final SampleIdentifier sampleIdentifier) throws UserFailureException + { + assert sessionToken != null : "Unspecified session token."; + assert sampleIdentifier != null : "Unspecified sample identifier."; + + final Session session = getSession(sessionToken); + final ISampleBO sampleBO = businessObjectFactory.createSampleBO(session); + sampleBO.loadBySampleIdentifier(sampleIdentifier); + SamplePE sample = sampleBO.getSample(); + if (sample == null) + { + return null; + } + SamplePE top = sample.getTop(); + Set<SamplePropertyPE> properties = top.getProperties(); + HibernateUtils.initialize(properties); + return EntityPropertyTranslator.translate(properties.toArray(new SamplePropertyPE[0]), + new HashMap<PropertyTypePE, PropertyType>(), managedPropertyEvaluatorFactory); + } + + @Override + @RolesAllowed({ RoleWithHierarchy.SPACE_OBSERVER, RoleWithHierarchy.SPACE_ETL_SERVER }) + public IEntityProperty[] tryGetPropertiesOfSample(String sessionToken, + @AuthorizationGuard(guardClass = SampleOwnerIdentifierPredicate.class) SampleIdentifier sampleIdentifier) throws UserFailureException + { + assert sessionToken != null : "Unspecified session token."; + assert sampleIdentifier != null : "Unspecified sample identifier."; + + final Session session = getSession(sessionToken); + final ISampleBO sampleBO = businessObjectFactory.createSampleBO(session); + sampleBO.loadBySampleIdentifier(sampleIdentifier); + SamplePE sample = sampleBO.getSample(); + if (sample == null) + { + return null; + } + Set<SamplePropertyPE> properties = sample.getProperties(); + HibernateUtils.initialize(properties); + return EntityPropertyTranslator.translate(properties.toArray(new SamplePropertyPE[0]), + new HashMap<PropertyTypePE, PropertyType>(), managedPropertyEvaluatorFactory); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public void registerEntities(String sessionToken, EntityCollectionForCreationOrUpdate collection) + throws UserFailureException + { + Session session = getSession(sessionToken); + + for (NewExperiment experiment : collection.getNewExperiments()) + { + registerExperiment(session, experiment); + } + + DataSetRegistrationCache cache = new DataSetRegistrationCache(); + for (NewExternalData dataSet : collection.getNewDataSets()) + { + registerDataSetInternal(session, dataSet, cache); + } + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public long registerExperiment(String sessionToken, + @AuthorizationGuard(guardClass = NewExperimentPredicate.class) NewExperiment experiment) throws UserFailureException + { + assert sessionToken != null : "Unspecified session token."; + assert experiment != null : "Unspecified new example."; + + final Session session = getSession(sessionToken); + return registerExperiment(session, experiment); + } + + private long registerExperiment(final Session session, NewExperiment experiment) + { + IExperimentBO experimentBO = businessObjectFactory.createExperimentBO(session); + experimentBO.define(experiment); + experimentBO.save(); + return experimentBO.getExperiment().getId(); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public void registerSamples(final String sessionToken, + @AuthorizationGuard(guardClass = NewSamplesWithTypePredicate.class) + final List<NewSamplesWithTypes> newSamplesWithType, String userIDOrNull) + throws UserFailureException + { + assert sessionToken != null : "Unspecified session token."; + final Session session = getSession(sessionToken); + PersonPE registratorOrNull = + userIDOrNull != null ? getOrCreatePerson(sessionToken, userIDOrNull) : null; + for (NewSamplesWithTypes samples : newSamplesWithType) + { + registerSamples(session, samples, registratorOrNull); + } + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public long registerSample(final String sessionToken, + @AuthorizationGuard(guardClass = NewSamplePredicate.class) + final NewSample newSample, String userIDOrNull) throws UserFailureException + { + assert sessionToken != null : "Unspecified session token."; + assert newSample != null : "Unspecified new sample."; + + final Session session = getSession(sessionToken); + SamplePE samplePE = registerSampleInternal(session, newSample, userIDOrNull); + return samplePE.getId(); + } + + private PersonPE getOrCreatePerson(String sessionToken, String userID) + { + PersonPE person = getDAOFactory().getPersonDAO().tryFindPersonByUserId(userID); + if (person != null) + { + return person; + } + List<PersonPE> persons = registerPersons(sessionToken, Collections.singletonList(userID)); + return persons.get(0); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public void updateSample(String sessionToken, + @AuthorizationGuard(guardClass = SampleUpdatesPredicate.class) SampleUpdatesDTO updates) + { + final Session session = getSession(sessionToken); + updateSampleInternal(updates, session); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public void registerDataSet(final String sessionToken, + @AuthorizationGuard(guardClass = SampleOwnerIdentifierPredicate.class) + final SampleIdentifier sampleIdentifier, final NewExternalData externalData) + throws UserFailureException + { + assert sessionToken != null : "Unspecified session token."; + assert sampleIdentifier != null : "Unspecified sample identifier."; + + final Session session = getSession(sessionToken); + registerDataSetInternal(session, sampleIdentifier, externalData, new DataSetRegistrationCache()); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public void registerDataSet(final String sessionToken, + @AuthorizationGuard(guardClass = SpaceIdentifierPredicate.class) + final ExperimentIdentifier experimentIdentifier, final NewExternalData externalData) + throws UserFailureException + { + assert sessionToken != null : "Unspecified session token."; + assert experimentIdentifier != null : "Unspecified experiment identifier."; + + final Session session = getSession(sessionToken); + registerDataSetInternal(session, experimentIdentifier, externalData, new DataSetRegistrationCache()); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public void addPropertiesToDataSet(String sessionToken, List<NewProperty> properties, + String dataSetCode, @AuthorizationGuard(guardClass = SpaceIdentifierPredicate.class) + final SpaceIdentifier identifier) throws UserFailureException + { + assert sessionToken != null : "Unspecified session token."; + final Session session = getSession(sessionToken); + final IDataBO dataBO = businessObjectFactory.createDataBO(session); + dataBO.addPropertiesToDataSet(dataSetCode, properties); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public boolean isDataSetOnTrashCanOrDeleted(String sessionToken, + @AuthorizationGuard(guardClass = DataSetCodePredicate.class) String dataSetCode) + { + // Check if dataset is available for retrieval + DataPE dataSet = getDAOFactory().getDataDAO().tryToFindFullDataSetByCode(dataSetCode, false, false); + boolean isDataSetAvailable = dataSet != null; + // Check if the dataset is on the table, since can't be retrieved is on the trashcan + boolean isDataSetOnTrashCan = getDAOFactory().getDataDAO().exists(dataSetCode); + // Check if the dataset is finally deleted + boolean isDataSetDeleted = getDAOFactory().getEventDAO().tryFind( + dataSetCode, + ch.systemsx.cisd.openbis.generic.shared.dto.EventPE.EntityType.DATASET, + ch.systemsx.cisd.openbis.generic.shared.dto.EventType.DELETION) != null; + + return !isDataSetAvailable && (isDataSetOnTrashCan || isDataSetDeleted); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public void updateShareIdAndSize(String sessionToken, + @AuthorizationGuard(guardClass = DataSetCodePredicate.class) String dataSetCode, String shareId, long size) throws UserFailureException + { + final Session session = getSession(sessionToken); + IDataDAO dataSetDAO = getDAOFactory().getDataDAO(); + + DataPE dataSet = dataSetDAO.tryToFindFullDataSetByCode(dataSetCode, false, false); + if (dataSet == null) // Dataset is not available for retrieval + { + // Check if the dataset is on the table, since can't be retrieved is on the trashcan + boolean isDataSetOnTrashCan = getDAOFactory().getDataDAO().exists(dataSetCode); + // Check if the dataset is finally deleted + boolean isDataSetDeleted = getDAOFactory().getEventDAO().tryFind( + dataSetCode, + ch.systemsx.cisd.openbis.generic.shared.dto.EventPE.EntityType.DATASET, + ch.systemsx.cisd.openbis.generic.shared.dto.EventType.DELETION) != null; + + if (isDataSetOnTrashCan) + { + operationLog.info("The data set has been moved to the trashcan and the share will not be updated: " + dataSetCode); + return; + } else if (isDataSetDeleted) + { + operationLog.info("The data set has been deleted and the share will not be updated: " + dataSetCode); + return; + } else + { + throw new UserFailureException("Unknown data set, that has not been deleted, check for storage errors: " + dataSetCode); + } + } + ExternalDataPE externalData = dataSet.tryAsExternalData(); + if (externalData == null) + { + throw new UserFailureException("Can't update share id and size of a virtual data set: " + + dataSetCode); + } + // data sets consisting out of empty folders have a size of 0, + // but we want the size of a data set to be strictly positive + long positiveSize = Math.max(1, size); + externalData.setShareId(shareId); + externalData.setSize(positiveSize); + dataSetDAO.updateDataSet(dataSet, session.tryGetPerson()); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public void updateDataSetStatuses(String sessionToken, + @AuthorizationGuard(guardClass = DataSetCodeCollectionPredicate.class) List<String> dataSetCodes, final DataSetArchivingStatus newStatus, + boolean presentInArchive) throws UserFailureException + { + assert sessionToken != null : "Unspecified session token."; + final Session session = getSession(sessionToken); + final IDataBO dataBO = businessObjectFactory.createDataBO(session); + dataBO.updateStatuses(dataSetCodes, newStatus, presentInArchive); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public boolean compareAndSetDataSetStatus(String sessionToken, String dataSetCode, + DataSetArchivingStatus oldStatus, DataSetArchivingStatus newStatus, + boolean newPresentInArchive) throws UserFailureException + { + assert sessionToken != null : "Unspecified session token."; + final Session session = getSession(sessionToken); + final IDataBO dataBO = businessObjectFactory.createDataBO(session); + dataBO.loadByCode(dataSetCode); + return dataBO.compareAndSetDataSetStatus(oldStatus, newStatus, newPresentInArchive); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public int archiveDatasets(String sessionToken, + @AuthorizationGuard(guardClass = DataSetCodeCollectionPredicate.class) List<String> datasetCodes, boolean removeFromDataStore) + { + return super.archiveDatasets(sessionToken, datasetCodes, removeFromDataStore); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public int unarchiveDatasets(String sessionToken, + @AuthorizationGuard(guardClass = DataSetCodeCollectionPredicate.class) List<String> datasetCodes) + { + return super.unarchiveDatasets(sessionToken, datasetCodes); + } + + @Override + @RolesAllowed(value = { RoleWithHierarchy.SPACE_OBSERVER, RoleWithHierarchy.SPACE_ETL_SERVER }) + public IDatasetLocationNode tryGetDataSetLocation(String sessionToken, + @AuthorizationGuard(guardClass = DataSetCodePredicate.class) String dataSetCode) throws UserFailureException + { + assert sessionToken != null : "Unspecified session token."; + assert dataSetCode != null : "Unspecified data set code."; + + Session session = getSession(sessionToken); + IDatasetLister lister = businessObjectFactory.createDatasetLister(session); + return lister.listLocationsByDatasetCode(dataSetCode); + } + + @Override + @RolesAllowed(value = { RoleWithHierarchy.SPACE_OBSERVER, RoleWithHierarchy.SPACE_ETL_SERVER }) + public AbstractExternalData tryGetLocalDataSet(String sessionToken, String dataSetCode, + String dataStore) throws UserFailureException + { + AbstractExternalData dataSet = tryGetDataSet(sessionToken, dataSetCode); + if (dataSet != null && dataSet.getDataStore().getCode().equals(dataStore)) + { + return dataSet; + } + return null; + } + + @Override + @RolesAllowed(value = { RoleWithHierarchy.SPACE_OBSERVER, RoleWithHierarchy.SPACE_ETL_SERVER }) + public AbstractExternalData tryGetDataSet(String sessionToken, + @AuthorizationGuard(guardClass = DataSetCodePredicate.class) String dataSetCode) throws UserFailureException + { + assert sessionToken != null : "Unspecified session token."; + assert dataSetCode != null : "Unspecified data set code."; + + Session session = getSession(sessionToken); // assert authenticated + + IDataBO dataBO = businessObjectFactory.createDataBO(session); + dataBO.loadByCode(dataSetCode); + dataBO.enrichWithParentsAndExperiment(); + dataBO.enrichWithChildren(); + dataBO.enrichWithProperties(); + dataBO.enrichWithContainedDataSets(); + DataPE dataPE = dataBO.tryGetData(); + if (null == dataPE) + { + return null; + } + Collection<MetaprojectPE> metaprojects = + getDAOFactory().getMetaprojectDAO().listMetaprojectsForEntity( + session.tryGetPerson(), dataPE); + return DataSetTranslator.translate(dataPE, session.getBaseIndexURL(), + MetaprojectTranslator.translate(metaprojects), managedPropertyEvaluatorFactory); + } + + @Override + @RolesAllowed(value = { RoleWithHierarchy.SPACE_OBSERVER, RoleWithHierarchy.SPACE_ETL_SERVER }) + public AbstractExternalData tryGetThinDataSet(String sessionToken, String dataSetCode) throws UserFailureException + { + assert sessionToken != null : "Unspecified session token."; + assert dataSetCode != null : "Unspecified data set code."; + + Session session = getSession(sessionToken); // assert authenticated + + IDataBO dataBO = businessObjectFactory.createDataBO(session); + dataBO.loadByCode(dataSetCode); + DataPE dataPE = dataBO.tryGetData(); + if (null == dataPE) + { + return null; + } + return DataSetTranslator.translate(dataPE, session.getBaseIndexURL(), + Collections.<Metaproject> emptyList(), managedPropertyEvaluatorFactory); + } + + @Override + @RolesAllowed(RoleWithHierarchy.INSTANCE_ADMIN) + public void checkInstanceAdminAuthorization(String sessionToken) throws UserFailureException + { + checkSession(sessionToken); + // do nothing, the access rights specified in method annotations are checked by a proxy + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_POWER_USER) + public void checkSpacePowerUserAuthorization(String sessionToken) throws UserFailureException + { + checkSession(sessionToken); + // do nothing, the access rights specified in method annotations are checked by a proxy + } + + @Override + @RolesAllowed({ RoleWithHierarchy.SPACE_OBSERVER, RoleWithHierarchy.SPACE_ETL_SERVER }) + public void checkDataSetAccess(String sessionToken, + @AuthorizationGuard(guardClass = DataSetCodePredicate.class) String dataSetCode) throws UserFailureException + { + checkSession(sessionToken); + // do nothing, the access rights specified in method annotations are checked by a proxy + } + + @Override + @RolesAllowed({ RoleWithHierarchy.SPACE_OBSERVER, RoleWithHierarchy.SPACE_ETL_SERVER }) + public void checkDataSetCollectionAccess(String sessionToken, + @AuthorizationGuard(guardClass = DataSetCodeCollectionPredicate.class) List<String> dataSetCodes) + { + checkSession(sessionToken); + // do nothing, the access rights specified in method annotations are checked by a proxy + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_USER) + public void checkSpaceAccess(String sessionToken, + @AuthorizationGuard(guardClass = SpaceIdentifierPredicate.class) SpaceIdentifier spaceId) + { + checkSession(sessionToken); + // do nothing, the access rights specified in method annotations are checked by a proxy + } + + @Override + @RolesAllowed({ RoleWithHierarchy.SPACE_OBSERVER, RoleWithHierarchy.SPACE_ETL_SERVER }) + public List<Sample> listSamplesByCriteria(final String sessionToken, + @AuthorizationGuard(guardClass = ListSamplesByPropertyPredicate.class) + final ListSamplesByPropertyCriteria criteria) throws UserFailureException + { + assert sessionToken != null : "Unspecified session token."; + assert criteria != null : "Unspecified criteria."; + + Session session = getSession(sessionToken); + ISampleTable sampleTable = businessObjectFactory.createSampleTable(session); + sampleTable.loadSamplesByCriteria(criteria); + List<SamplePE> samples = sampleTable.getSamples(); + + final Collection<MetaprojectAssignmentPE> assignmentPEs = + getDAOFactory().getMetaprojectDAO().listMetaprojectAssignmentsForEntities( + session.tryGetPerson(), samples, EntityKind.SAMPLE); + Map<Long, Set<Metaproject>> assignments = + MetaprojectTranslator.translateMetaprojectAssignments(assignmentPEs); + + return SampleTranslator + .translate(samples, "", assignments, managedPropertyEvaluatorFactory); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<DataSetShareId> listShareIds(final String sessionToken, String dataStoreCode) + throws UserFailureException + { + Session session = getSession(sessionToken); + IDatasetLister datasetLister = businessObjectFactory.createDatasetLister(session); + DataStorePE dataStore = loadDataStore(session, dataStoreCode); + return datasetLister.listAllDataSetShareIdsByDataStore(dataStore.getId()); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<SimpleDataSetInformationDTO> listPhysicalDataSets(final String sessionToken, + String dataStoreCode) throws UserFailureException + { + final Session session = getSession(sessionToken); + final DataStorePE dataStore = loadDataStore(session, dataStoreCode); + final IDatasetLister datasetLister = businessObjectFactory.createDatasetLister(session); + final List<AbstractExternalData> dataSets = + datasetLister.listByDataStore(dataStore.getId(), + DATASET_FETCH_OPTIONS_FILE_DATASETS); + return SimpleDataSetHelper.filterAndTranslate(dataSets); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<SimpleDataSetInformationDTO> listOldestPhysicalDataSets(String sessionToken, + String dataStoreCode, int limit) throws UserFailureException + { + final Session session = getSession(sessionToken); + final DataStorePE dataStore = loadDataStore(session, dataStoreCode); + final IDatasetLister datasetLister = businessObjectFactory.createDatasetLister(session); + final List<AbstractExternalData> dataSets = + datasetLister.listByDataStore(dataStore.getId(), limit, + DATASET_FETCH_OPTIONS_FILE_DATASETS); + return SimpleDataSetHelper.filterAndTranslate(dataSets); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<SimpleDataSetInformationDTO> listOldestPhysicalDataSets(String sessionToken, + String dataStoreCode, Date youngerThan, int limit) throws UserFailureException + { + final Session session = getSession(sessionToken); + final DataStorePE dataStore = loadDataStore(session, dataStoreCode); + final IDatasetLister datasetLister = businessObjectFactory.createDatasetLister(session); + final List<AbstractExternalData> dataSets = + datasetLister.listByDataStore(dataStore.getId(), youngerThan, limit, + DATASET_FETCH_OPTIONS_FILE_DATASETS); + return SimpleDataSetHelper.filterAndTranslate(dataSets); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<SimpleDataSetInformationDTO> listPhysicalDataSetsWithUnknownSize(String sessionToken, String dataStoreCode, int chunkSize, + String dataSetCodeLowerLimit) + { + final Session session = getSession(sessionToken); + final DataStorePE dataStore = loadDataStore(session, dataStoreCode); + final IDatasetLister datasetLister = businessObjectFactory.createDatasetLister(session); + final List<AbstractExternalData> dataSets = + datasetLister.listByDataStoreWithUnknownSize(dataStore.getId(), chunkSize, dataSetCodeLowerLimit, + DATASET_FETCH_OPTIONS_FILE_DATASETS); + return SimpleDataSetHelper.filterAndTranslate(dataSets); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public void updatePhysicalDataSetsSize(String sessionToken, Map<String, Long> sizeMap) + { + assert sessionToken != null : "Unspecified session token."; + final Session session = getSession(sessionToken); + final IDataBO dataBO = businessObjectFactory.createDataBO(session); + dataBO.updateSizes(sizeMap); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<AbstractExternalData> listAvailableDataSets(String sessionToken, + String dataStoreCode, ArchiverDataSetCriteria criteria) + { + Session session = getSession(sessionToken); + final IDatasetLister datasetLister = createDatasetLister(session); + return datasetLister.listByArchiverCriteria(dataStoreCode, criteria); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<AbstractExternalData> listDataSets(String sessionToken, String dataStoreCode, + TrackingDataSetCriteria criteria) + { + Session session = getSession(sessionToken); + DataStorePE dataStore = + getDAOFactory().getDataStoreDAO().tryToFindDataStoreByCode(dataStoreCode); + if (dataStore == null) + { + throw new UserFailureException("Unknown data store: " + dataStoreCode); + } + final IDatasetLister datasetLister = createDatasetLister(session); + List<AbstractExternalData> allDataSets = datasetLister.listByTrackingCriteria(criteria); + List<AbstractExternalData> result = new ArrayList<AbstractExternalData>(); + for (AbstractExternalData externalData : allDataSets) + { + if (dataStoreCode.equals(externalData.getDataStore().getCode())) + { + result.add(externalData); + } + } + return result; + } + + private DataStorePE loadDataStore(Session session, String dataStoreCode) + { + DataStorePE dataStore = + getDAOFactory().getDataStoreDAO().tryToFindDataStoreByCode(dataStoreCode); + if (dataStore == null) + { + throw new UserFailureException(String.format("Unknown data store '%s'", dataStoreCode)); + } + return dataStore; + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<DeletedDataSet> listDeletedDataSets(String sessionToken, + Long lastSeenDeletionEventIdOrNull, Date maxDeletionDataOrNull) + { + checkSession(sessionToken); + return getDAOFactory().getEventDAO().listDeletedDataSets(lastSeenDeletionEventIdOrNull, + maxDeletionDataOrNull); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public Collection<VocabularyTerm> listVocabularyTerms(String sessionToken, String vocabularyCode) + throws UserFailureException + { + checkSession(sessionToken); + VocabularyPE vocabularyOrNull = + getDAOFactory().getVocabularyDAO().tryFindVocabularyByCode(vocabularyCode); + if (vocabularyOrNull == null) + { + throw new UserFailureException(String.format("Vocabulary '%s' not found", + vocabularyCode)); + } + return VocabularyTermTranslator.translateTerms(vocabularyOrNull.getTerms()); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public Vocabulary tryGetVocabulary(String sessionToken, String vocabularyCode) + { + checkSession(sessionToken); + VocabularyPE vocabularyOrNull = + getDAOFactory().getVocabularyDAO().tryFindVocabularyByCode(vocabularyCode); + + if (vocabularyOrNull == null) + { + return null; + } else + { + return VocabularyTranslator.translate(vocabularyOrNull, true); + } + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<String> generateCodes(String sessionToken, String prefix, + ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind entityKind, int number) + { + checkSession(sessionToken); + return new EntityCodeGenerator(daoFactory).generateCodes(prefix, entityKind, number); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<Person> listAdministrators(String sessionToken) + { + checkSession(sessionToken); + // Get all Persons in the DB + final List<PersonPE> persons = getDAOFactory().getPersonDAO().listPersons(); + + // Filter down to the admins + ArrayList<PersonPE> admins = new ArrayList<PersonPE>(); + for (PersonPE person : persons) + { + for (final RoleAssignmentPE roleAssigment : person.getRoleAssignments()) + { + if (roleAssigment.getSpace() == null + && roleAssigment.getRole().equals(RoleCode.ADMIN)) + { + admins.add(person); + } + } + } + Collections.sort(admins); + return PersonTranslator.translate(admins); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public Person tryPersonWithUserIdOrEmail(String sessionToken, String useridOrEmail) + { + checkSession(sessionToken); + + PersonPE personPE = tryFindPersonForUserIdOrEmail(useridOrEmail); + return (null != personPE) ? PersonTranslator.translate(personPE) : null; + } + + private PersonPE tryFindPersonForUserIdOrEmail(String userIdOrEmail) + { + if (userIdOrEmail == null) + { + return null; + } + + // First search for a userId match + IPersonDAO personDao = getDAOFactory().getPersonDAO(); + PersonPE person = personDao.tryFindPersonByUserId(userIdOrEmail); + if (null != person) + { + return person; + } + // Didn't find one -- try email + return personDao.tryFindPersonByEmail(userIdOrEmail); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public Sample registerSampleAndDataSet(final String sessionToken, + @AuthorizationGuard(guardClass = NewSamplePredicate.class) + final NewSample newSample, final NewExternalData externalData, String userIdOrNull) + throws UserFailureException + { + assert sessionToken != null : "Unspecified session token."; + assert newSample != null : "Unspecified new sample."; + + // Register the Sample + final Session session = getSession(sessionToken); + SamplePE samplePE = registerSampleInternal(session, newSample, userIdOrNull); + + // Register the data set + registerDataSetInternal(getSession(sessionToken), samplePE, externalData, new DataSetRegistrationCache()); + Sample result = + SampleTranslator.translate(samplePE, session.getBaseIndexURL(), null, + managedPropertyEvaluatorFactory); + return result; + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public Sample updateSampleAndRegisterDataSet(String sessionToken, + @AuthorizationGuard(guardClass = SampleUpdatesPredicate.class) SampleUpdatesDTO updates, NewExternalData externalData) + { + final Session session = getSession(sessionToken); + + // Update the sample + final ISampleBO sampleBO = updateSampleInternal(updates, session); + + // Register the data set + final SamplePE samplePE = sampleBO.getSample(); + registerDataSetInternal(getSession(sessionToken), samplePE, externalData, new DataSetRegistrationCache()); + + Collection<MetaprojectPE> metaprojectPEs = + getDAOFactory().getMetaprojectDAO().listMetaprojectsForEntity( + session.tryGetPerson(), samplePE); + + Sample result = + SampleTranslator.translate(samplePE, session.getBaseIndexURL(), + MetaprojectTranslator.translate(metaprojectPEs), + managedPropertyEvaluatorFactory); + return result; + } + + private ISampleBO updateSampleInternal(SampleUpdatesDTO updates, final Session session) + { + final ISampleBO sampleBO = businessObjectFactory.createSampleBO(session); + sampleBO.update(updates); + sampleBO.save(); + + return sampleBO; + } + + private SamplePE registerSampleInternal(Session session, NewSample newSample, + String userIdOrNull) + { + final ISampleBO sampleBO = businessObjectFactory.createSampleBO(session); + sampleBO.define(newSample); + if (userIdOrNull != null) + { + sampleBO.getSample().setRegistrator( + getOrCreatePerson(session.getSessionToken(), userIdOrNull)); + } + sampleBO.save(); + SamplePE samplePE = sampleBO.getSample(); + return samplePE; + } + + @Override + @RolesAllowed(value = { RoleWithHierarchy.SPACE_ETL_SERVER }) + public Space tryGetSpace(String sessionToken, + @AuthorizationGuard(guardClass = ExistingSpaceIdentifierPredicate.class) SpaceIdentifier spaceIdentifier) + { + + Session session = getSession(sessionToken); + ISpaceBO spaceBO = businessObjectFactory.createSpaceBO(session); + SpaceIdentifier identifier = + new SpaceIdentifier(spaceIdentifier.getSpaceCode()); + try + { + spaceBO.load(identifier); + return SpaceTranslator.translate(spaceBO.getSpace()); + } catch (UserFailureException ufe) + { + // space does not exist + return null; + } + } + + @Override + @RolesAllowed(value = { RoleWithHierarchy.SPACE_ETL_SERVER }) + public Project tryGetProject(String sessionToken, + @AuthorizationGuard(guardClass = ExistingSpaceIdentifierPredicate.class) ProjectIdentifier projectIdentifier) + { + final Session session = getSession(sessionToken); + final IProjectBO bo = businessObjectFactory.createProjectBO(session); + try + { + bo.loadByProjectIdentifier(projectIdentifier); + final ProjectPE project = bo.getProject(); + return ProjectTranslator.translate(project); + } catch (UserFailureException ufe) + { + // project does not exist + return null; + } + } + + @Override + @RolesAllowed(value = { RoleWithHierarchy.SPACE_ETL_SERVER }) + public Project tryGetProjectByPermId(String sessionToken, @AuthorizationGuard(guardClass = ProjectPermIdPredicate.class) PermId permId) + throws UserFailureException + { + final Session session = getSession(sessionToken); + final IProjectBO bo = businessObjectFactory.createProjectBO(session); + try + { + bo.loadByPermId(permId.getId()); + final ProjectPE project = bo.getProject(); + return ProjectTranslator.translate(project); + } catch (UserFailureException ufe) + { + // project does not exist + return null; + } + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public Material tryGetMaterial(String sessionToken, MaterialIdentifier materialIdentifier) + { + final Session session = getSession(sessionToken); + final IMaterialBO bo = businessObjectFactory.createMaterialBO(session); + try + { + bo.loadByMaterialIdentifier(materialIdentifier); + bo.enrichWithProperties(); + MaterialPE materialPE = bo.getMaterial(); + Collection<MetaprojectPE> metaprojectPEs = Collections.emptySet(); + if (materialPE != null) + { + metaprojectPEs = + getDAOFactory().getMetaprojectDAO().listMetaprojectsForEntity( + session.tryGetPerson(), materialPE); + } + return MaterialTranslator.translate(materialPE, + MetaprojectTranslator.translate(metaprojectPEs), + managedPropertyEvaluatorFactory); + } catch (UserFailureException ufe) + { + // material does not exist + return null; + } + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public Metaproject tryGetMetaproject(String sessionToken, String name, String ownerId) + { + final Session session = getSession(sessionToken); + final IMetaprojectBO bo = businessObjectFactory.createMetaprojectBO(session); + + MetaprojectPE pe = bo.tryFindByMetaprojectId(new MetaprojectIdentifierId(ownerId, name)); + + if (pe == null) + { + return null; + } else + { + return MetaprojectTranslator.translate(pe); + } + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public AtomicEntityOperationResult performEntityOperations(String sessionToken, + @AuthorizationGuard(guardClass = AtomicOperationsPredicate.class) AtomicEntityOperationDetails operationDetails) + { + IServiceConversationProgressListener progressListener = + ServiceConversationsThreadContext.getProgressListener(); + + TechId registrationId = operationDetails.getRegistrationIdOrNull(); + + EntityOperationsInProgress.getInstance().addRegistrationPending(registrationId); + + String sessionTokenForEntityOperation = null; + try + { + final Session session = getSession(sessionToken); + final String userId = operationDetails.tryUserIdOrNull(); + boolean authorize = (userId != null); + Session sessionForEntityOperation = session; + if (authorize) + { + sessionTokenForEntityOperation = + sessionManagerForEntityOperation.tryToOpenSession(userId, "dummy password"); + sessionForEntityOperation = + sessionManagerForEntityOperation.getSession(sessionTokenForEntityOperation); + injectPerson(sessionForEntityOperation, userId); + } + + long spacesCreated = + createSpaces(sessionForEntityOperation, operationDetails, progressListener, + authorize); + + long materialsCreated = + createMaterials(sessionForEntityOperation, operationDetails, progressListener, + authorize); + + long projectsCreated = + createProjects(sessionForEntityOperation, operationDetails, progressListener, + authorize); + + long projectsUpdated = + updateProjects(sessionForEntityOperation, operationDetails, progressListener, + authorize); + + long vocabulariesUpdated = + updateVocabularies(sessionForEntityOperation, operationDetails, + progressListener, authorize); + + long experimentsCreated = + createExperiments(sessionForEntityOperation, operationDetails, + progressListener, authorize); + + long experimentsUpdates = + updateExperiments(sessionForEntityOperation, operationDetails, + progressListener, authorize); + + long samplesCreated = + createSamples(sessionForEntityOperation, operationDetails, progressListener, + authorize); + + long samplesUpdated = + updateSamples(sessionForEntityOperation, operationDetails, progressListener, + authorize); + + long dataSetsCreated = createDataSetsV3(sessionForEntityOperation, operationDetails, progressListener, authorize); + + long dataSetsUpdated = + updateDataSets(sessionForEntityOperation, operationDetails, progressListener, + authorize); + + long materialsUpdates = + updateMaterials(sessionForEntityOperation, operationDetails, progressListener, + authorize); + + long metaprojectsCreated = + createMetaprojects(sessionForEntityOperation, operationDetails, + progressListener, authorize); + + long metaprojectsUpdates = + updateMetaprojects(sessionForEntityOperation, operationDetails, + progressListener, authorize); + + long spaceRolesAssigned = assignSpaceRoles(sessionForEntityOperation, operationDetails, progressListener, authorize); + + long spaceRolesRevoked = revokeSpaceRoles(sessionForEntityOperation, operationDetails, progressListener, authorize); + + // If the id is not null, the caller wants to persist the fact that the operation was + // invoked and completed; + // if the id is null, the caller does not care. + if (null != registrationId) + { + daoFactory.getEntityOperationsLogDAO().addLogEntry(registrationId.getId()); + } + + return new AtomicEntityOperationResult(spacesCreated, projectsCreated, projectsUpdated, + materialsCreated, materialsUpdates, experimentsCreated, experimentsUpdates, + samplesCreated, samplesUpdated, dataSetsCreated, dataSetsUpdated, + metaprojectsCreated, metaprojectsUpdates, vocabulariesUpdated, spaceRolesAssigned, spaceRolesRevoked); + } catch (org.hibernate.StaleObjectStateException e) + { + throw new UserFailureException("The operation has failed due to conflict with simultanous operations."); + } finally + { + EntityOperationsInProgress.getInstance().removeRegistrationPending(registrationId); + if (sessionTokenForEntityOperation != null) + { + sessionManagerForEntityOperation.closeSession(sessionTokenForEntityOperation); + } + try + { + daoFactory.getSessionFactory().getCurrentSession().flush(); + } catch (Exception e) + { + } + } + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public EntityOperationsState didEntityOperationsSucceed(String token, TechId registrationId) + { + if (registrationId == null) + { + return EntityOperationsState.NO_OPERATION; + } + + if (EntityOperationsInProgress.getInstance().isRegistrationPending(registrationId)) + { + return EntityOperationsState.IN_PROGRESS; + } + + EntityOperationsLogEntryPE logEntry = + daoFactory.getEntityOperationsLogDAO().tryFindLogEntry(registrationId.getId()); + + if (logEntry != null) + { + return EntityOperationsState.OPERATION_SUCCEEDED; + } else + { + return EntityOperationsState.NO_OPERATION; + } + } + + private long createSpaces(Session session, AtomicEntityOperationDetails operationDetails, + IServiceConversationProgressListener progress, boolean authorize) + { + ArrayList<SpacePE> spacePEsCreated = new ArrayList<SpacePE>(); + List<NewSpace> newSpaces = operationDetails.getSpaceRegistrations(); + if (authorize) + { + checkSpaceCreationAllowed(session, newSpaces); + } + + int index = 0; + for (NewSpace newSpace : newSpaces) + { + SpacePE spacePE = + registerSpaceInternal(session, newSpace, operationDetails.tryUserIdOrNull()); + spacePEsCreated.add(spacePE); + progress.update("createSpaces", newSpaces.size(), ++index); + } + return index; + } + + protected void checkSpaceCreationAllowed(Session session, List<NewSpace> newSpaces) + { + if (newSpaces != null && newSpaces.isEmpty() == false) + { + entityOperationChecker.assertSpaceCreationAllowed(session, newSpaces); + } + } + + protected void checkSpaceRoleAssignmentAllowed(Session session, SpaceIdentifier space) + { + entityOperationChecker.assertSpaceRoleAssignmentAllowed(session, space); + } + + private long updateVocabularies(Session session, AtomicEntityOperationDetails operationDetails, + IServiceConversationProgressListener progress, boolean authorize) + { + + List<VocabularyUpdatesDTO> updates = operationDetails.getVocabularyUpdates(); + + for (VocabularyUpdatesDTO update : updates) + { + updateVocabulary(session, update); + } + + return updates.size(); + } + + private void updateVocabulary(Session session, VocabularyUpdatesDTO updates) + { + final IVocabularyBO vocabularyBO = businessObjectFactory.createVocabularyBO(session); + vocabularyBO.update(updates); + } + + private long createMaterials(Session session, AtomicEntityOperationDetails operationDetails, + IServiceConversationProgressListener progress, boolean authorize) + { + MaterialHelper materialHelper = + new MaterialHelper(session, businessObjectFactory, getDAOFactory(), + getPropertiesBatchManager(), managedPropertyEvaluatorFactory); + Map<String, List<NewMaterial>> materialRegs = operationDetails.getMaterialRegistrations(); + if (authorize) + { + checkMaterialCreationAllowed(session, materialRegs); + } + + List<NewMaterialWithType> materials = materialHelper.convertMaterialRegistrationIntoMaterialsWithType(materialRegs); + + Map<String, Set<String>> materialTypesWithMateiralProperties = materialHelper.getPropertyTypesOfMaterialType(materialRegs.keySet()); + + List<List<NewMaterialWithType>> materialGroups = MaterialGroupingDAG.groupByDepencies(materials, materialTypesWithMateiralProperties); + int index = 0; + + for (List<NewMaterialWithType> materialsGroup : materialGroups) + { + materialHelper.registerMaterials(materialsGroup); + progress.update("createMaterials", materialRegs.size(), ++index); + } + return index; + } + + private long updateMaterials(Session session, AtomicEntityOperationDetails operationDetails, + IServiceConversationProgressListener progress, boolean authorize) + { + MaterialHelper materialHelper = + new MaterialHelper(session, businessObjectFactory, getDAOFactory(), + getPropertiesBatchManager(), managedPropertyEvaluatorFactory); + + List<MaterialUpdateDTO> allMaterialUpdates = operationDetails.getMaterialUpdates(); + + if (authorize) + { + checkMaterialUpdateAllowed(session, allMaterialUpdates); + } + + materialHelper.updateMaterials(allMaterialUpdates); + + // in material helper call the update of materials - but this has to wait fo change of the + // material updates to a map + return allMaterialUpdates.size(); + } + + protected void checkMaterialCreationAllowed(Session session, + Map<String, List<NewMaterial>> materials) + { + if (materials != null && materials.isEmpty() == false) + { + entityOperationChecker.assertMaterialCreationAllowed(session, materials); + } + } + + protected void checkMaterialUpdateAllowed(Session session, + List<MaterialUpdateDTO> materialUpdates) + { + if (materialUpdates != null && materialUpdates.isEmpty() == false) + { + entityOperationChecker.assertMaterialUpdateAllowed(session, materialUpdates); + } + } + + private long updateMetaprojects(Session session, AtomicEntityOperationDetails operationDetails, + IServiceConversationProgressListener progress, boolean authorize) + { + List<MetaprojectUpdatesDTO> updates = operationDetails.getMetaprojectUpdates(); + + for (MetaprojectUpdatesDTO update : updates) + { + updateMetaprojects(session, update); + } + + return updates.size(); + } + + private void updateMetaprojects(Session session, MetaprojectUpdatesDTO update) + { + IMetaprojectBO metaprojectBO = businessObjectFactory.createMetaprojectBO(session); + metaprojectBO.loadDataByTechId(update.getMetaprojectId()); + + Metaproject updates = new Metaproject(); + updates.setName(metaprojectBO.getMetaproject().getName()); + updates.setDescription(update.getDescription()); + metaprojectBO.update(updates); + + metaprojectBO.addSamples(update.getAddedSamples()); + metaprojectBO.removeSamples(update.getRemovedSamples()); + metaprojectBO.addDataSets(update.getAddedDataSets()); + metaprojectBO.removeDataSets(update.getRemovedDataSets()); + metaprojectBO.addExperiments(update.getAddedExperiments()); + metaprojectBO.removeExperiments(update.getRemovedExperiments()); + metaprojectBO.addMaterials(update.getAddedMaterials()); + metaprojectBO.removeMaterials(update.getRemovedMaterials()); + + metaprojectBO.save(); + } + + private long assignSpaceRoles(Session session, AtomicEntityOperationDetails operationDetails, + IServiceConversationProgressListener progressListener, boolean authorize) + { + // see also ch.systemsx.cisd.openbis.generic.server.CommonServer.registerSpaceRole(String, RoleCode, SpaceIdentifier, Grantee) + List<SpaceRoleAssignment> spaceRoleAssignments = operationDetails.getSpaceRoleAssignments(); + int index = 0; + int assignmentCount = 0; + for (SpaceRoleAssignment assignment : spaceRoleAssignments) + { + assignmentCount += assignment.getGrantees().size(); + } + + if (assignmentCount < 1) + { + return assignmentCount; + } + + final IRoleAssignmentTable table = businessObjectFactory.createRoleAssignmentTable(session); + + for (SpaceRoleAssignment assignment : spaceRoleAssignments) + { + RoleCode roleCode = assignment.getRoleCode(); + SpaceIdentifier space = assignment.getSpaceIdentifier(); + if (authorize) + { + checkSpaceRoleAssignmentAllowed(session, space); + } + for (Grantee grantee : assignment.getGrantees()) + { + final NewRoleAssignment newRoleAssignment = new NewRoleAssignment(); + newRoleAssignment.setGrantee(grantee); + newRoleAssignment.setSpaceIdentifier(space); + newRoleAssignment.setRole(roleCode); + + table.add(newRoleAssignment); + progressListener.update("assignSpaceRole", assignmentCount, ++index); + } + } + + table.save(); + return index; + } + + private long revokeSpaceRoles(Session session, AtomicEntityOperationDetails operationDetails, + IServiceConversationProgressListener progressListener, boolean authorize) + { + // see also ch.systemsx.cisd.openbis.generic.server.CommonServer.deleteSpaceRole(String, RoleCode, SpaceIdentifier, Grantee) + // Did not refactor the above method to share code for fear of making merges to the release branch difficult + List<SpaceRoleAssignment> spaceRoleRevocations = operationDetails.getSpaceRoleRevocations(); + int index = 0; + int assignmentCount = 0; + for (SpaceRoleAssignment assignment : spaceRoleRevocations) + { + assignmentCount += assignment.getGrantees().size(); + } + + if (assignmentCount < 1) + { + return assignmentCount; + } + + for (SpaceRoleAssignment assignment : spaceRoleRevocations) + { + RoleCode roleCode = assignment.getRoleCode(); + SpaceIdentifier space = assignment.getSpaceIdentifier(); + for (Grantee grantee : assignment.getGrantees()) + { + final RoleAssignmentPE roleAssignment = + getDAOFactory().getRoleAssignmentDAO().tryFindSpaceRoleAssignment(roleCode, + space.getSpaceCode(), grantee); + if (roleAssignment == null) + { + throw new UserFailureException("Given space role does not exist."); + } + final PersonPE personPE = session.tryGetPerson(); + if (roleAssignment.getPerson() != null && roleAssignment.getPerson().equals(personPE) + && roleAssignment.getRole().equals(RoleCode.ADMIN)) + { + boolean isInstanceAdmin = false; + for (final RoleAssignmentPE roleAssigment : personPE.getRoleAssignments()) + { + if (roleAssigment.getSpace() == null + && roleAssigment.getRole().equals(RoleCode.ADMIN)) + { + isInstanceAdmin = true; + } + } + if (isInstanceAdmin == false) + { + throw new UserFailureException( + "For safety reason you cannot give away your own space admin power. " + + "Ask instance admin to do that for you."); + } + } + getDAOFactory().getRoleAssignmentDAO().deleteRoleAssignment(roleAssignment); + progressListener.update("revokeSpaceRole", assignmentCount, ++index); + } + } + + return index; + } + + private long createMetaprojects(Session session, AtomicEntityOperationDetails operationDetails, + IServiceConversationProgressListener progress, boolean authorize) + { + final List<NewMetaproject> metaprojectRegistrations = + operationDetails.getMetaprojectRegistrations(); + int index = 0; + for (NewMetaproject metaproject : metaprojectRegistrations) + { + registerMetaproject(session, metaproject); + progress.update("createMetaProjects", metaprojectRegistrations.size(), ++index); + } + return index; + } + + private MetaprojectPE registerMetaproject(final Session session, NewMetaproject metaproject) + { + IMetaprojectBO metaprojectBO = businessObjectFactory.createMetaprojectBO(session); + + Metaproject registration = new Metaproject(); + registration.setName(metaproject.getName()); + registration.setDescription(metaproject.getDescription()); + metaprojectBO.define(metaproject.getOwnerId(), registration); + + metaprojectBO.addSamples(metaproject.getSamples()); + metaprojectBO.addExperiments(metaproject.getExperiments()); + metaprojectBO.addMaterials(metaproject.getMaterials()); + metaprojectBO.addDataSets(metaproject.getDatasets()); + metaprojectBO.save(); + return metaprojectBO.getMetaproject(); + } + + private SpacePE registerSpaceInternal(Session session, NewSpace newSpace, + String registratorUserIdOrNull) + { + // create space + ISpaceBO groupBO = businessObjectFactory.createSpaceBO(session); + groupBO.define(newSpace.getCode(), newSpace.getDescription()); + SpacePE space = groupBO.getSpace(); + + if (registratorUserIdOrNull != null) + { + space.setRegistrator( + getOrCreatePerson(session.getSessionToken(), registratorUserIdOrNull)); + } + groupBO.save(); + + // create ADMIN role assignemnt + if (newSpace.getSpaceAdminUserId() != null) + { + IRoleAssignmentTable roleTable = + businessObjectFactory.createRoleAssignmentTable(session); + NewRoleAssignment assignment = new NewRoleAssignment(); + SpaceIdentifier spaceIdentifier = new SpaceIdentifier(space.getCode()); + assignment.setSpaceIdentifier(spaceIdentifier); + assignment.setRole(RoleCode.ADMIN); + Grantee grantee = Grantee.createPerson(newSpace.getSpaceAdminUserId()); + assignment.setGrantee(grantee); + roleTable.add(assignment); + roleTable.save(); + } + return space; + + } + + private long createProjects(Session session, AtomicEntityOperationDetails operationDetails, + IServiceConversationProgressListener progress, boolean authorize) + { + ArrayList<ProjectPE> projectPEsCreated = new ArrayList<ProjectPE>(); + List<NewProject> newProjects = operationDetails.getProjectRegistrations(); + if (authorize) + { + checkProjectCreationAllowed(session, newProjects); + } + int index = 0; + for (NewProject newProject : newProjects) + { + ProjectPE projectPE = + registerProjectInternal(session, newProject, operationDetails.tryUserIdOrNull()); + projectPEsCreated.add(projectPE); + progress.update("createProjects", newProjects.size(), ++index); + } + return index; + } + + protected void checkProjectCreationAllowed(Session session, List<NewProject> newProjects) + { + if (newProjects != null && newProjects.isEmpty() == false) + { + entityOperationChecker.assertProjectCreationAllowed(session, newProjects); + } + } + + private ProjectPE registerProjectInternal(Session session, NewProject newProject, + String registratorUserIdOrNull) + { + IProjectBO projectBO = businessObjectFactory.createProjectBO(session); + ProjectIdentifier identifier = + new ProjectIdentifierFactory(newProject.getIdentifier()).createIdentifier(); + projectBO + .define(identifier, newProject.getDescription(), newProject.getAttachments(), null); + if (registratorUserIdOrNull != null) + { + projectBO.getProject().setRegistrator( + getOrCreatePerson(session.getSessionToken(), registratorUserIdOrNull)); + } + projectBO.save(); + + return projectBO.getProject(); + } + + private long updateProjects(Session session, AtomicEntityOperationDetails operationDetails, + IServiceConversationProgressListener progress, boolean authorize) + { + ArrayList<ProjectPE> projectPEsUpdated = new ArrayList<ProjectPE>(); + List<ProjectUpdatesDTO> projectsToUpdate = operationDetails.getProjectUpdates(); + if (authorize) + { + checkProjectUpdateAllowed(session, projectsToUpdate); + } + int index = 0; + for (ProjectUpdatesDTO project : projectsToUpdate) + { + ProjectPE projectPE = + updateProjectInternal(session, project, operationDetails.tryUserIdOrNull()); + projectPEsUpdated.add(projectPE); + progress.update("updateProjects", projectsToUpdate.size(), ++index); + } + return index; + } + + protected void checkProjectUpdateAllowed(Session session, + List<ProjectUpdatesDTO> projectsToUpdate) + { + if (projectsToUpdate != null && projectsToUpdate.isEmpty() == false) + { + entityOperationChecker.assertProjectUpdateAllowed(session, projectsToUpdate); + } + } + + private ProjectPE updateProjectInternal(Session session, ProjectUpdatesDTO projectToUpdate, + String registratorUserIdOrNull) + { + IProjectBO projectBO = businessObjectFactory.createProjectBO(session); + if (projectToUpdate.getTechId() != null) + { + projectBO.loadDataByTechId(projectToUpdate.getTechId()); + } else if (projectToUpdate.getPermId() != null) + { + projectBO.loadByPermId(projectToUpdate.getPermId()); + } else + { + ProjectIdentifier identifier = + new ProjectIdentifierFactory(projectToUpdate.getIdentifier()).createIdentifier(); + projectBO.loadByProjectIdentifier(identifier); + } + projectBO.update(projectToUpdate); + if (registratorUserIdOrNull != null) + { + projectBO.getProject().setModifier( + getOrCreatePerson(session.getSessionToken(), registratorUserIdOrNull)); + } + projectBO.save(); + + return projectBO.getProject(); + } + + private long createSamples(Session session, AtomicEntityOperationDetails operationDetails, + IServiceConversationProgressListener progress, boolean authorize) + { + List<NewSample> newSamples = operationDetails.getSampleRegistrations(); + + if (authorize) + { + authorizeSampleCreation(session, newSamples); + } + String userIdOrNull = operationDetails.tryUserIdOrNull(); + PersonPE registratorOrNull = tryFindPersonForUserIdOrEmail(userIdOrNull); + final ISampleTable sampleTable = businessObjectFactory.createSampleTable(session); + + List<List<NewSample>> sampleGroups = splitIntoDependencyGroups(newSamples); + + for (List<NewSample> groupOfSamples : sampleGroups) + { + BatchOperationExecutor.executeInBatches(new SampleBatchRegistration(sampleTable, + groupOfSamples, registratorOrNull), getBatchSize(operationDetails), progress, + "createContainerSamples"); + } + return newSamples.size(); + } + + /** + * Splits the samples using the grouping dag into groups, that can be executed in batches one after another, that samples in later batches depend + * only on the samples from earlier batches + */ + private List<List<NewSample>> splitIntoDependencyGroups(List<NewSample> newSamples) + { + return SampleGroupingDAG.groupByDepencies(newSamples); + } + + private void authorizeSampleCreation(Session session, List<NewSample> newSamples) + { + List<NewSample> instanceSamples = new ArrayList<NewSample>(); + List<NewSample> spaceSamples = new ArrayList<NewSample>(); + + for (NewSample newSample : newSamples) + { + SampleIdentifier sampleIdentifier = SampleIdentifierFactory.parse(newSample); + if (sampleIdentifier.isDatabaseInstanceLevel()) + { + instanceSamples.add(newSample); + } else + { + spaceSamples.add(newSample); + } + } + + checkInstanceSampleCreationAllowed(session, instanceSamples); + checkSpaceSampleCreationAllowed(session, spaceSamples); + } + + private void checkInstanceSampleCreationAllowed(Session session, List<NewSample> instanceSamples) + { + if (instanceSamples.isEmpty() == false) + { + entityOperationChecker.assertInstanceSampleCreationAllowed(session, instanceSamples); + } + } + + private void checkSpaceSampleCreationAllowed(Session session, List<NewSample> spaceSamples) + { + if (spaceSamples.isEmpty() == false) + { + entityOperationChecker.assertSpaceSampleCreationAllowed(session, spaceSamples); + } + } + + private long updateSamples(final Session session, + AtomicEntityOperationDetails operationDetails, + IServiceConversationProgressListener progress, boolean authorize) + { + List<SampleUpdatesDTO> sampleUpdates = operationDetails.getSampleUpdates(); + int sampleUpdateCount = sampleUpdates.size(); + if (sampleUpdateCount < 1) + { + return 0; + } + progress.update("authorizingSampleUpdates", sampleUpdateCount, 0); + if (authorize) + { + checkSampleUpdatesAllowed(session, sampleUpdates); + } + progress.update("authorizingSampleUpdates", sampleUpdateCount, sampleUpdateCount); + final ISampleTable sampleTable = businessObjectFactory.createSampleTable(session); + + BatchOperationExecutor.executeInBatches(new SampleCheckBeforeUpdate(sampleTable, + sampleUpdates), getBatchSize(operationDetails), progress, + "checkSamplesBeforeUpdate"); + + BatchOperationExecutor.executeInBatches(new SampleUpdate(sampleTable, sampleUpdates), + getBatchSize(operationDetails), progress, "updateSamples"); + + return sampleUpdateCount; + } + + private void checkSampleUpdatesAllowed(final Session session, + List<SampleUpdatesDTO> sampleUpdates) + { + List<SampleUpdatesDTO> instanceSamples = new ArrayList<SampleUpdatesDTO>(); + List<SampleUpdatesDTO> spaceSamples = new ArrayList<SampleUpdatesDTO>(); + for (SampleUpdatesDTO sampleUpdate : sampleUpdates) + { + SampleIdentifier sampleIdentifier = sampleUpdate.getSampleIdentifier(); + if (sampleIdentifier.isDatabaseInstanceLevel()) + { + instanceSamples.add(sampleUpdate); + } else + { + spaceSamples.add(sampleUpdate); + } + } + checkInstanceSampleUpdateAllowed(session, instanceSamples); + checkSpaceSampleUpdateAllowed(session, spaceSamples); + } + + private void checkInstanceSampleUpdateAllowed(Session session, + List<SampleUpdatesDTO> instanceSamples) + { + if (instanceSamples.isEmpty() == false) + { + entityOperationChecker.assertInstanceSampleUpdateAllowed(session, instanceSamples); + } + } + + private void checkSpaceSampleUpdateAllowed(Session session, List<SampleUpdatesDTO> spaceSamples) + { + if (spaceSamples.isEmpty() == false) + { + entityOperationChecker.assertSpaceSampleUpdateAllowed(session, spaceSamples); + } + } + + private long createDataSetsV3(Session session, AtomicEntityOperationDetails operationDetails, + final IServiceConversationProgressListener conversationProgress, boolean authorize) + { + if (operationDetails.getDataSetRegistrations() == null) + { + return 0; + } + + if (authorize) + { + checkDataSetCreationAllowed(session, operationDetails.getDataSetRegistrations()); + } + + IOperationContext context = new OperationContext(session); + context.setAttribute(ListSampleTechIdByIdentifier.CONTAINER_SHORTCUT_ALLOWED_ATTRIBUTE, true); + context.addProgressListener(new IProgressListener() + { + @Override + public void onProgress(Stack<IProgress> progressStack) + { + if (progressStack.isEmpty() == false) + { + IProgress progress = progressStack.peek(); + int totalItemsToProcess = progress.getTotalItemsToProcess() != null ? progress.getTotalItemsToProcess() : 0; + int numItemsProcessed = progress.getNumItemsProcessed() != null ? progress.getNumItemsProcessed() : 0; + conversationProgress.update(progress.getLabel(), totalItemsToProcess, numItemsProcessed); + } + } + }); + + List<DataSetCreation> creations = new LinkedList<DataSetCreation>(); + + for (NewExternalData newData : operationDetails.getDataSetRegistrations()) + { + // Fields that were in V2 but are intentionally ignored in V3: + // - newData.getUserId() and newData.getUserEMail() fields were used in V2 to find a registrator (see in DataBO.tryToGetRegistrator()), + // but found registrator was anyway overwritten by RelationshipUtils.setExperimentForDataSet() call at the end of DataBO.define() method + // (a user from the session was used as registrator and modifier) + // - newData.getAssociatedSampleCode() field was never used in V2 + // - newData.getRegistrationDate() field was never used in V2 + + DataSetCreation creation = new DataSetCreation(); + creation.setCode(newData.getCode()); + creation.setMeasured(newData.isMeasured()); + creation.setDataProducer(newData.getDataProducerCode()); + creation.setDataProductionDate(newData.getProductionDate()); + + // type + if (newData.getDataSetType() != null) + { + creation.setTypeId(new EntityTypePermId(newData.getDataSetType().getCode())); + } + + // experiment + if (newData.getExperimentIdentifierOrNull() != null) + { + creation.setExperimentId(new ch.ethz.sis.openbis.generic.asapi.v3.dto.experiment.id.ExperimentIdentifier(newData + .getExperimentIdentifierOrNull().toString())); + } + + // sample + injectSampleId(creation, newData); + + // data store + if (newData.getDataStoreCode() != null) + { + creation.setDataStoreId(new DataStorePermId(newData.getDataStoreCode())); + } + + // properties + if (newData.getDataSetProperties() != null) + { + for (NewProperty property : newData.getDataSetProperties()) + { + creation.setProperty(property.getPropertyCode(), property.getValue()); + } + } + + // parents + if (newData.getParentDataSetCodes() != null) + { + List<IDataSetId> parentIds = new LinkedList<IDataSetId>(); + for (String parentCode : newData.getParentDataSetCodes()) + { + parentIds.add(new DataSetPermId(parentCode)); + } + creation.setParentIds(parentIds); + } + + if (newData instanceof NewContainerDataSet) + { + NewContainerDataSet newContainerData = (NewContainerDataSet) newData; + + if (newContainerData.getContainedDataSetCodes() != null) + { + List<IDataSetId> componentIds = new LinkedList<IDataSetId>(); + for (String componentCode : newContainerData.getContainedDataSetCodes()) + { + componentIds.add(new DataSetPermId(componentCode)); + } + creation.setComponentIds(componentIds); + } + } else if (newData instanceof NewLinkDataSet) + { + NewLinkDataSet newLinkData = (NewLinkDataSet) newData; + + LinkedDataCreation linkCreation = new LinkedDataCreation(); + linkCreation.setExternalCode(newLinkData.getExternalCode()); + linkCreation.setExternalDmsId(new ExternalDmsPermId(newLinkData.getExternalDataManagementSystemCode())); + + creation.setLinkedData(linkCreation); + } else + { + // newData is instance of NewExternalData or NewDataSet + + PhysicalDataCreation physicalCreation = new PhysicalDataCreation(); + physicalCreation.setLocation(newData.getLocation()); + physicalCreation.setShareId(newData.getShareId()); + physicalCreation.setSize(newData.getSize()); + physicalCreation.setSpeedHint(newData.getSpeedHint()); + + // complete + if (newData.getComplete() != null) + { + Complete complete = null; + switch (newData.getComplete()) + { + case T: + complete = Complete.YES; + break; + case F: + complete = Complete.NO; + break; + case U: + complete = Complete.UNKNOWN; + break; + default: + throw new IllegalArgumentException("Unsupported complete value: " + newData.getComplete()); + } + physicalCreation.setComplete(complete); + } + + // file format type + if (newData.getFileFormatType() != null) + { + physicalCreation.setFileFormatTypeId(new FileFormatTypePermId(newData.getFileFormatType().getCode())); + } + + // locator type + if (newData.getLocatorType() != null) + { + physicalCreation.setLocatorTypeId(new LocatorTypePermId(newData.getLocatorType().getCode())); + } + + // storage format + if (newData.getStorageFormat() != null) + { + physicalCreation.setStorageFormatId(new StorageFormatPermId(newData.getStorageFormat().getCode())); + } + + creation.setPhysicalData(physicalCreation); + } + + creations.add(creation); + } + + List<DataSetPermId> ids = createDataSetExecutor.create(context, creations); + return ids.size(); + } + + private void injectSampleId(DataSetCreation creation, NewExternalData newData) + { + SampleIdentifier sampleIdentifier = newData.getSampleIdentifierOrNull(); + String permId = newData.getSamplePermIdOrNull(); + if (sampleIdentifier != null) + { + ISampleId sampleId; + if (permId != null) + { + sampleId = new SamplePermId(permId); + } else + { + sampleId = new ch.ethz.sis.openbis.generic.asapi.v3.dto.sample.id.SampleIdentifier( + sampleIdentifier.toString()); + } + creation.setSampleId(sampleId); + } + } + + private void checkDataSetCreationAllowed(Session session, + List<? extends NewExternalData> dataSets) + { + if (dataSets != null && dataSets.isEmpty() == false) + { + entityOperationChecker.assertDataSetCreationAllowed(session, dataSets); + } + } + + private long updateDataSets(final Session session, + AtomicEntityOperationDetails operationDetails, + IServiceConversationProgressListener progress, boolean authorize) + { + final List<DataSetBatchUpdatesDTO> dataSetUpdates = operationDetails.getDataSetUpdates(); + final int dataSetUpdatesCount = dataSetUpdates.size(); + if (dataSetUpdatesCount < 1) + { + return 0; + } + + progress.update("authorizingDataSetUpdates", dataSetUpdatesCount, 0); + if (authorize) + { + checkDataSetUpdateAllowed(session, dataSetUpdates); + } + progress.update("authorizingDataSetUpdates", dataSetUpdatesCount, dataSetUpdatesCount); + final IDataSetTable dataSetTable = businessObjectFactory.createDataSetTable(session); + + BatchOperationExecutor.executeInBatches(new DataSetCheckBeforeBatchUpdate(dataSetTable, + dataSetUpdates), getBatchSize(operationDetails), progress, + "checkDataSetsBeforeUpdate"); + + BatchOperationExecutor.executeInBatches( + new DataSetBatchUpdate(dataSetTable, dataSetUpdates), + getBatchSize(operationDetails), progress, "updateDataSets"); + + return dataSetUpdatesCount; + } + + private void checkDataSetUpdateAllowed(Session session, List<DataSetBatchUpdatesDTO> dataSets) + { + if (dataSets != null && dataSets.isEmpty() == false) + { + entityOperationChecker.assertDataSetUpdateAllowed(session, dataSets); + } + } + + private IDataBO registerDataSetInternal(final Session session, NewExternalData dataSet, DataSetRegistrationCache cache) + { + SampleIdentifier sampleIdentifier = dataSet.getSampleIdentifierOrNull(); + if (sampleIdentifier != null) + { + return registerDataSetInternal(session, sampleIdentifier, dataSet, cache); + } else + { + ExperimentIdentifier experimentIdentifier = dataSet.getExperimentIdentifierOrNull(); + return registerDataSetInternal(session, experimentIdentifier, dataSet, cache); + } + } + + private long createExperiments(Session session, AtomicEntityOperationDetails operationDetails, + IServiceConversationProgressListener progress, boolean authorize) + { + final List<NewExperiment> experimentRegistrations = + operationDetails.getExperimentRegistrations(); + if (authorize) + { + checkExperimentCreationAllowed(session, experimentRegistrations); + } + int index = 0; + for (NewExperiment experiment : experimentRegistrations) + { + registerExperiment(session, experiment); + progress.update("createExperiments", experimentRegistrations.size(), ++index); + } + return index; + } + + protected void checkExperimentCreationAllowed(Session session, + List<NewExperiment> newExperiments) + { + if (newExperiments != null && newExperiments.isEmpty() == false) + { + entityOperationChecker.assertExperimentCreationAllowed(session, newExperiments); + } + } + + private void updateExperiment(Session session, ExperimentUpdatesDTO updates) + { + final IExperimentBO experimentBO = businessObjectFactory.createExperimentBO(session); + experimentBO.update(updates); + experimentBO.save(); + } + + private long updateExperiments(Session session, AtomicEntityOperationDetails operationDetails, + IServiceConversationProgressListener progress, boolean authorize) + { + List<ExperimentUpdatesDTO> updates = operationDetails.getExperimentUpdates(); + + if (authorize) + { + checkExperimentUpdateAllowed(session, updates); + } + + for (ExperimentUpdatesDTO update : updates) + { + updateExperiment(session, update); + } + + return updates.size(); + } + + protected void checkExperimentUpdateAllowed(Session session, + List<ExperimentUpdatesDTO> experimentUpdates) + { + if (experimentUpdates != null && experimentUpdates.isEmpty() == false) + { + entityOperationChecker.assertExperimentUpdateAllowed(session, experimentUpdates); + } + } + + private IDataBO registerDataSetInternal(final Session session, + SampleIdentifier sampleIdentifier, NewExternalData externalData, DataSetRegistrationCache cache) + { + SamplePE sample = cache.getSamples().get(sampleIdentifier); + + if (sample == null) + { + final ISampleBO sampleBO = businessObjectFactory.createSampleBO(session); + sampleBO.loadBySampleIdentifier(sampleIdentifier); + sample = sampleBO.getSample(); + cache.getSamples().put(sampleIdentifier, sample); + } + + return registerDataSetInternal(session, sample, externalData, cache); + } + + private IDataBO registerDataSetInternal(final Session session, SamplePE sample, + NewExternalData externalData, DataSetRegistrationCache cache) + { + final IDataBO dataBO = cache.getDataBO() != null ? cache.getDataBO() : businessObjectFactory.createDataBO(session); + cache.setDataBO(dataBO); + + SourceType sourceType = + externalData.isMeasured() ? SourceType.MEASUREMENT : SourceType.DERIVED; + dataBO.setCache(cache); + dataBO.define(externalData, sample, sourceType); + dataBO.save(); + + boolean isContainer = externalData instanceof NewContainerDataSet; + if (isContainer) + { + dataBO.setContainedDataSets(sample.getExperiment(), sample, (NewContainerDataSet) externalData); + } + + final String dataSetCode = dataBO.getData().getCode(); + assert dataSetCode != null : "Data set code not specified."; + + return dataBO; + } + + private IDataBO registerDataSetInternal(final Session session, + ExperimentIdentifier experimentIdentifier, NewExternalData externalData, DataSetRegistrationCache cache) + { + if (false == cache.getExperiments().containsKey(experimentIdentifier)) + { + cache.getExperiments().put(experimentIdentifier, tryLoadExperimentByIdentifier(session, experimentIdentifier)); + } + ExperimentPE experiment = cache.getExperiments().get(experimentIdentifier); + + if (experiment == null) + { + throw new UserFailureException("Unknown experiment '" + experimentIdentifier + "'."); + } + if (experiment.getDeletion() != null) + { + throw new UserFailureException("Data set can not be registered because experiment '" + + experiment.getIdentifier() + "' is in trash."); + } + final IDataBO externalDataBO = cache.getDataBO() != null ? cache.getDataBO() : businessObjectFactory.createDataBO(session); + cache.setDataBO(externalDataBO); + + SourceType sourceType = + externalData.isMeasured() ? SourceType.MEASUREMENT : SourceType.DERIVED; + externalDataBO.setCache(cache); + externalDataBO.define(externalData, experiment, sourceType); + externalDataBO.save(); + + boolean isContainer = externalData instanceof NewContainerDataSet; + if (isContainer) + { + externalDataBO.setContainedDataSets(experiment, null, (NewContainerDataSet) externalData); + } + + final String dataSetCode = externalDataBO.getData().getCode(); + assert dataSetCode != null : "Data set code not specified."; + + return externalDataBO; + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<Sample> searchForSamples(String sessionToken, SearchCriteria searchCriteria) + { + Session session = getSession(sessionToken); + DetailedSearchCriteria detailedSearchCriteria = + SearchCriteriaToDetailedSearchCriteriaTranslator.convert(getDAOFactory(), + SearchableEntityKind.SAMPLE, searchCriteria); + SearchHelper searchHelper = + new SearchHelper(session, businessObjectFactory, getDAOFactory()); + return searchHelper.searchForSamples(session.getUserName(), detailedSearchCriteria); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<AbstractExternalData> searchForDataSets(String sessionToken, + SearchCriteria searchCriteria) + { + Session session = getSession(sessionToken); + DetailedSearchCriteria detailedSearchCriteria = + SearchCriteriaToDetailedSearchCriteriaTranslator.convert(getDAOFactory(), + SearchableEntityKind.DATA_SET, searchCriteria); + SearchHelper searchHelper = + new SearchHelper(session, businessObjectFactory, getDAOFactory()); + return searchHelper.searchForDataSets(session.getUserName(), detailedSearchCriteria); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<Experiment> searchForExperiments(String sessionToken, SearchCriteria searchCriteria) + { + Session session = getSession(sessionToken); + DetailedSearchCriteria detailedSearchCriteria = + SearchCriteriaToDetailedSearchCriteriaTranslator.convert(getDAOFactory(), SearchableEntityKind.EXPERIMENT, searchCriteria); + SearchHelper searchHelper = new SearchHelper(session, businessObjectFactory, getDAOFactory()); + List<ExperimentPE> experiments = searchHelper.searchForExperiments(sessionToken, detailedSearchCriteria); + return translateExperimentsWithMetaprojectAssignments(session, experiments); + } + + @Override + @RolesAllowed(value = + { RoleWithHierarchy.SPACE_OBSERVER, RoleWithHierarchy.SPACE_ETL_SERVER }) + public List<Material> listMaterials(String sessionToken, ListMaterialCriteria criteria, + boolean withProperties) + { + Session session = getSession(sessionToken); + IMaterialLister lister = businessObjectFactory.createMaterialLister(session); + ListMaterialCriteria criteriaWithIds = populateMissingTypeId(criteria); + return lister.list(criteriaWithIds, withProperties); + } + + private ListMaterialCriteria populateMissingTypeId(ListMaterialCriteria criteria) + { + MaterialType materialTypeOrNull = criteria.tryGetMaterialType(); + if (materialTypeOrNull != null && materialTypeOrNull.getId() == null) + { + String materialTypeCode = materialTypeOrNull.getCode(); + EntityTypePE typeWithId = + daoFactory.getEntityTypeDAO(EntityKind.MATERIAL).tryToFindEntityTypeByCode( + materialTypeCode); + if (typeWithId == null) + { + throw UserFailureException.fromTemplate("Invalid material type '%s'", + materialTypeCode); + } else + { + MaterialType materialTypeWithId = new MaterialType(); + materialTypeWithId.setId(typeWithId.getId()); + materialTypeWithId.setCode(materialTypeCode); + return ListMaterialCriteria.createFromMaterialType(materialTypeWithId); + } + } + + return criteria; + + } + + @Override + @SuppressWarnings("deprecation") + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public void removeDataSetsPermanently(String sessionToken, + @AuthorizationGuard(guardClass = DataSetCodeCollectionPredicate.class) List<String> dataSetCodes, String reason) + { + Session session = getSession(sessionToken); + IDataSetTable dataSetTable = businessObjectFactory.createDataSetTable(session); + permanentlyDeleteDataSets(session, dataSetTable, dataSetCodes, reason, false); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public void updateDataSet(String sessionToken, + @AuthorizationGuard(guardClass = DataSetUpdatesPredicate.class) DataSetUpdatesDTO dataSetUpdates) + { + final Session session = getSession(sessionToken); + final IDataBO dataSetBO = businessObjectFactory.createDataBO(session); + dataSetBO.update(dataSetUpdates); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<String> getTrustedCrossOriginDomains(String sessionToken) + { + return trustedOriginDomainProvider.getTrustedDomains(); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public void setStorageConfirmed(String sessionToken, List<String> dataSetCodes) + { + checkSession(sessionToken); + + List<Long> dataSetIds = new LinkedList<Long>(); + for (String dataSetCode : dataSetCodes) + { + + if (daoFactory.getDataDAO().confirmStorage(dataSetCode)) + { + daoFactory.getPostRegistrationDAO().addDataSet(dataSetCode); + } else if (daoFactory.getDataDAO().exists(dataSetCode) == false) + { + throw new UserFailureException("Storage confirmation for a dataset: " + dataSetCode + + " failed because the data set has been already deleted."); + } + + Long id = daoFactory.getDataDAO().tryToFindDataSetIdByCode(dataSetCode).getId(); + dataSetIds.add(id); + } + IFullTextIndexUpdateScheduler indexUpdater = + daoFactory.getPersistencyResources().getIndexUpdateScheduler(); + indexUpdater.scheduleUpdate(IndexUpdateOperation.reindex(DataPE.class, + dataSetIds)); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public void markSuccessfulPostRegistration(String sessionToken, String dataSetCode) + { + checkSession(sessionToken); + + daoFactory.getPostRegistrationDAO().removeDataSet(dataSetCode); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public void notifyDatasetAccess(String sessionToken, String dataSetCode) + { + checkSession(sessionToken); + + daoFactory.getDataDAO().updateAccessTimestamp(dataSetCode); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<AbstractExternalData> listDataSetsForPostRegistration(String sessionToken, + String dataStoreCode) + { + Session session = getSession(sessionToken); + + // find all datasets for registration + final IDatasetLister datasetLister = createDatasetLister(session); + Collection<Long> allDataSetIds = + daoFactory.getPostRegistrationDAO().listDataSetsForPostRegistration(); + List<AbstractExternalData> allDataSets = datasetLister.listByDatasetIds(allDataSetIds); + + // find datastore + DataStorePE dataStore = + getDAOFactory().getDataStoreDAO().tryToFindDataStoreByCode(dataStoreCode); + if (dataStore == null) + { + throw new UserFailureException("Unknown data store: " + dataStoreCode); + } + + // filter datasets by datastore + List<AbstractExternalData> result = new ArrayList<AbstractExternalData>(); + for (AbstractExternalData externalData : allDataSets) + { + if (dataStoreCode.equals(externalData.getDataStore().getCode())) + { + result.add(externalData); + } + } + return result; + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public void heartbeat(String token) + { + // do nothing + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public boolean doesUserHaveRole(String token, String user, String roleCode, String spaceOrNull) + { + return new AuthorizationServiceUtils(daoFactory, user).doesUserHaveRole(roleCode, + spaceOrNull); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<String> filterToVisibleDataSets(String token, String user, List<String> dataSetCodes) + { + return new AuthorizationServiceUtils(daoFactory, user).filterDataSetCodes(dataSetCodes); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<String> filterToVisibleExperiments(String token, String user, + List<String> experimentIds) + { + return new AuthorizationServiceUtils(daoFactory, user).filterExperimentIds(experimentIds); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<String> filterToVisibleSamples(String token, String user, List<String> sampleIds) + { + return new AuthorizationServiceUtils(daoFactory, user).filterSampleIds(sampleIds); + } + + @Override + @RolesAllowed( + { RoleWithHierarchy.SPACE_OBSERVER, RoleWithHierarchy.SPACE_ETL_SERVER }) + public List<? extends EntityTypePropertyType<?>> listPropertyDefinitionsForType( + String sessionToken, String code, EntityKind entityKind) + { + IEntityTypeDAO edao = daoFactory.getEntityTypeDAO(entityKind); + IEntityPropertyTypeDAO dao = daoFactory.getEntityPropertyTypeDAO(entityKind); + + EntityTypePE type = edao.tryToFindEntityTypeByCode(code); + List<EntityTypePropertyTypePE> propertiesPE = dao.listEntityPropertyTypes(type); + + if (entityKind == EntityKind.DATA_SET) + { + Collection<DataSetTypePropertyType> collection = + CollectionUtils.collect(propertiesPE, + DataSetTypePropertyTypeTranslator.TRANSFORMER); + return new LinkedList<DataSetTypePropertyType>(collection); + } else if (entityKind == EntityKind.SAMPLE) + { + Collection<SampleTypePropertyType> collection = + CollectionUtils.collect(propertiesPE, + SampleTypePropertyTypeTranslator.TRANSFORMER); + return new LinkedList<SampleTypePropertyType>(collection); + } else if (entityKind == EntityKind.EXPERIMENT) + { + Collection<ExperimentTypePropertyType> collection = + CollectionUtils.collect(propertiesPE, + ExperimentTypePropertyTypeTranslator.TRANSFORMER); + return new LinkedList<ExperimentTypePropertyType>(collection); + } else if (entityKind == EntityKind.MATERIAL) + { + Collection<MaterialTypePropertyType> collection = + CollectionUtils.collect(propertiesPE, + MaterialTypePropertyTypeTranslator.TRANSFORMER); + return new LinkedList<MaterialTypePropertyType>(collection); + } else + { + throw new IllegalArgumentException("Unsupported entity kind " + entityKind); + } + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public ExternalDataManagementSystem tryGetExternalDataManagementSystem(String token, + String externalDataManagementSystemCode) + { + checkSession(token); + + ExternalDataManagementSystemPE externalSystem = + getDAOFactory().getExternalDataManagementSystemDAO() + .tryToFindExternalDataManagementSystemByCode( + externalDataManagementSystemCode); + + if (externalSystem != null) + { + return ExternalDataManagementSystemTranslator.translate(externalSystem); + } else + { + return null; + } + } + + private int getBatchSize(AtomicEntityOperationDetails details) + { + return details == null || details.getBatchSizeOrNull() == null ? BatchOperationExecutor + .getDefaultBatchSize() : details.getBatchSizeOrNull(); + } + + public void setConversationClient(IServiceConversationClientManagerLocal conversationClient) + { + this.conversationClient = conversationClient; + } + + public void setConversationServer(IServiceConversationServerManagerLocal conversationServer) + { + this.conversationServer = conversationServer; + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<Metaproject> listMetaprojects(String sessionToken, String userId) + { + IMetaprojectDAO metaprojectDAO = daoFactory.getMetaprojectDAO(); + PersonPE owner = daoFactory.getPersonDAO().tryFindPersonByUserId(userId); + + if (owner == null) + { + throw new IllegalArgumentException("User with id " + userId + " doesn't exist."); + } + + List<MetaprojectPE> metaprojectPEs = metaprojectDAO.listMetaprojects(owner); + + return MetaprojectTranslator.translate(metaprojectPEs); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public MetaprojectAssignments getMetaprojectAssignments(String systemSessionToken, String name, + String userName, EnumSet<MetaprojectAssignmentsFetchOption> fetchOptions) + { + Metaproject metaproject = tryGetMetaproject(systemSessionToken, name, userName); + + if (metaproject == null) + { + throw UserFailureException.fromTemplate("Can't find metaproject '%s/%s'", userName, + name); + } + + MetaprojectAssignmentsHelper helper = + new MetaprojectAssignmentsHelper(daoFactory, managedPropertyEvaluatorFactory); + return helper.getMetaprojectAssignments(getSession(systemSessionToken), metaproject, + userName, fetchOptions); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<Metaproject> listMetaprojectsForEntity(String systemSessionToken, String userId, + IObjectId entityId) + { + Map<IObjectId, List<Metaproject>> map = listMetaprojectsForEntities(systemSessionToken, userId, Collections.singletonList(entityId)); + return map.get(entityId); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public Map<IObjectId, List<Metaproject>> listMetaprojectsForEntities(String systemSessionToken, String userId, + Collection<? extends IObjectId> entityIds) + { + IMetaprojectDAO metaprojectDAO = daoFactory.getMetaprojectDAO(); + PersonPE owner = daoFactory.getPersonDAO().tryFindPersonByUserId(userId); + + EntityObjectIdHelper helper = new EntityObjectIdHelper(businessObjectFactory); + Map<IObjectId, List<Metaproject>> map = new HashMap<IObjectId, List<Metaproject>>(); + + if (entityIds != null) + { + for (IObjectId entityId : entityIds) + { + if (entityId != null) + { + IEntityInformationHolderDTO entity = + helper.getEntityById(getSession(systemSessionToken), entityId); + + Collection<MetaprojectPE> metaprojectPEs = + metaprojectDAO.listMetaprojectsForEntity(owner, entity); + + map.put(entityId, MetaprojectTranslator.translate(metaprojectPEs)); + } + } + } + + return map; + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<AuthorizationGroup> listAuthorizationGroups(String sessionToken) + { + // see ch.systemsx.cisd.openbis.generic.server.CommonServer.listAuthorizationGroups(String) + checkSession(sessionToken); + final List<AuthorizationGroupPE> authorizationGroups = + getDAOFactory().getAuthorizationGroupDAO().list(); + Collections.sort(authorizationGroups); + return AuthorizationGroupTranslator.translate(authorizationGroups); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<AuthorizationGroup> listAuthorizationGroupsForUser(String sessionToken, String userId) + { + checkSession(sessionToken); + final List<AuthorizationGroupPE> allAuthorizationGroups = + getDAOFactory().getAuthorizationGroupDAO().list(); + ArrayList<AuthorizationGroupPE> authorizationGroups = new ArrayList<AuthorizationGroupPE>(); + for (AuthorizationGroupPE authorizationGroup : allAuthorizationGroups) + { + Set<PersonPE> persons = authorizationGroup.getPersons(); + for (PersonPE person : persons) + { + if (userId.equals(person.getUserId())) + { + authorizationGroups.add(authorizationGroup); + } + } + } + + Collections.sort(authorizationGroups); + return AuthorizationGroupTranslator.translate(authorizationGroups); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<Person> listUsersForAuthorizationGroup(String sessionToken, TechId authorizationGroupId) + { + final Session session = getSession(sessionToken); + IAuthorizationGroupBO bo = businessObjectFactory.createAuthorizationGroupBO(session); + bo.loadByTechId(authorizationGroupId); + return PersonTranslator.translate(bo.getAuthorizationGroup().getPersons()); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<RoleAssignment> listRoleAssignments(String sessionToken) + { + checkSession(sessionToken); + final List<RoleAssignmentPE> roles = + getDAOFactory().getRoleAssignmentDAO().listRoleAssignments(); + return RoleAssignmentTranslator.translate(roles); + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<Attachment> listAttachments(String sessionToken, AttachmentHolderKind attachmentHolderKind, Long attachmentHolderId) + { + Session session = getSession(sessionToken); + + AttachmentHolderPE attachmentHolder = null; + + switch (attachmentHolderKind) + { + case PROJECT: + { + IProjectBO projectBO = businessObjectFactory.createProjectBO(session); + projectBO.loadDataByTechId(new TechId(attachmentHolderId)); + attachmentHolder = projectBO.getProject(); + break; + } + case EXPERIMENT: + { + IExperimentBO experimentBO = businessObjectFactory.createExperimentBO(session); + experimentBO.loadDataByTechId(new TechId(attachmentHolderId)); + attachmentHolder = experimentBO.getExperiment(); + break; + } + case SAMPLE: + { + ISampleBO sampleBO = businessObjectFactory.createSampleBO(session); + sampleBO.loadDataByTechId(new TechId(attachmentHolderId)); + attachmentHolder = sampleBO.getSample(); + break; + } + } + + if (attachmentHolder != null) + { + List<AttachmentPE> attachments = getDAOFactory().getAttachmentDAO().listAttachments(attachmentHolder); + return AttachmentTranslator.translate(attachments, session.getBaseIndexURL()); + } else + { + return null; + } + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public AttachmentWithContent getAttachment(String sessionToken, AttachmentHolderKind attachmentHolderKind, Long attachmentHolderId, + String fileName, Integer versionOrNull) + { + Session session = getSession(sessionToken); + + AttachmentPE attachment = null; + + switch (attachmentHolderKind) + { + case PROJECT: + { + IProjectBO bo = businessObjectFactory.createProjectBO(session); + bo.loadDataByTechId(new TechId(attachmentHolderId)); + attachment = bo.tryGetProjectFileAttachment(fileName, versionOrNull); + break; + } + case EXPERIMENT: + { + IExperimentBO bo = businessObjectFactory.createExperimentBO(session); + bo.loadDataByTechId(new TechId(attachmentHolderId)); + attachment = bo.tryGetExperimentFileAttachment(fileName, versionOrNull); + break; + } + case SAMPLE: + { + ISampleBO bo = businessObjectFactory.createSampleBO(session); + bo.loadDataByTechId(new TechId(attachmentHolderId)); + attachment = bo.tryGetSampleFileAttachment(fileName, versionOrNull); + break; + } + } + + if (attachment != null) + { + return AttachmentTranslator.translateWithContent(attachment); + } else + { + return null; + } + } + + public void setTimeout(String timeout) + { + try + { + this.timeout = Long.parseLong(timeout); + } catch (Exception e) + { + } + } + + @Override + @RolesAllowed(RoleWithHierarchy.SPACE_ETL_SERVER) + public List<AbstractExternalData> listNotArchivedDatasetsWithMetaproject(String sessionToken, final IMetaprojectId metaprojectId) + { + final Session session = getSession(sessionToken); + final IDatasetLister datasetLister = createDatasetLister(session); + final Metaproject metaproject = CommonServiceProvider.getCommonServer().getMetaprojectWithoutOwnershipChecks(sessionToken, metaprojectId); + return datasetLister.listByMetaprojectIdAndArchivalState(metaproject.getId(), false); + } +} diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ServiceForDataStoreServerLogger.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ServiceForDataStoreServerLogger.java index 19166b05b0b16e8dbacb7b69e0867fa353ed3002..9417ead519459667c4c700b6036774c266e2f2d3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ServiceForDataStoreServerLogger.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ServiceForDataStoreServerLogger.java @@ -487,7 +487,7 @@ public class ServiceForDataStoreServerLogger extends AbstractServerLogger implem logAccess(Level.DEBUG, sessionToken, "isDataSetOnTrashCanOrDeleted", "DATA_SET_CODE(%s)", dataSetCode); return false; } - + @Override public void updateShareIdAndSize(String sessionToken, String dataSetCode, String shareId, long size) throws UserFailureException diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/TrackingServerLogger.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/TrackingServerLogger.java index c8581b2dfc8d4504d6e39d13a8e08a2f683000b5..999259c5f83e9de72d05e8e504b7f939480933cb 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/TrackingServerLogger.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/TrackingServerLogger.java @@ -36,9 +36,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.Session; final class TrackingServerLogger extends AbstractServerLogger implements ITrackingServer { /** - * Creates an instance for the specified session manager, invocation status and elapsed time. - * The session manager is used to retrieve user information which will be a part of the log - * message. + * Creates an instance for the specified session manager, invocation status and elapsed time. The session manager is used to retrieve user + * information which will be a part of the log message. */ TrackingServerLogger(final ISessionManager<Session> sessionManager, IInvocationLoggerContext context) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/TrackingServiceServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/TrackingServiceServer.java index 67f76a4c7e3481572d4773ff3af1c8b4a6fcd6c5..f54dd4874cd65e4e9566de3f4e83358d35dc915d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/TrackingServiceServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/TrackingServiceServer.java @@ -48,10 +48,11 @@ public class TrackingServiceServer extends WhiteAndBlackListHttpInvokerServiceEx } @RequestMapping( - { "/rmi-tracking", "/openbis/rmi-tracking" }) + { "/rmi-tracking", "/openbis/rmi-tracking" }) @Override public void handleRequest(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { + throws ServletException, IOException + { super.handleRequest(request, response); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/TrustedCrossOriginDomainsProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/TrustedCrossOriginDomainsProvider.java index 8ea9c44a8e99fe52e35fdebb58f2f71156730b76..ba08f173212ed0d179510120c4bf2db1d231665d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/TrustedCrossOriginDomainsProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/TrustedCrossOriginDomainsProvider.java @@ -43,8 +43,8 @@ public class TrustedCrossOriginDomainsProvider } /** - * Returns a list of configured trusted domains which can host external shared web resources. - * Typically these are lightweight webapps that integrate with openBIS via JSON-RPC services. + * Returns a list of configured trusted domains which can host external shared web resources. Typically these are lightweight webapps that + * integrate with openBIS via JSON-RPC services. * <p> * Can return empty list. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/WhiteListBasedRemoteHostValidator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/WhiteListBasedRemoteHostValidator.java index 5944f9a6ba7aaea35e27517d421aa913cbe0b5bb..cd9c18e04bae4cc5fd8a7dcaace8dc2fa8ef744a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/WhiteListBasedRemoteHostValidator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/WhiteListBasedRemoteHostValidator.java @@ -28,8 +28,8 @@ import ch.systemsx.cisd.openbis.generic.shared.IRemoteHostValidator; */ public class WhiteListBasedRemoteHostValidator implements IRemoteHostValidator { - - private final Set<String> allowedRemoteHosts; + + private final Set<String> allowedRemoteHosts; public WhiteListBasedRemoteHostValidator(String commaSeparatedListOfAllowedRemoteHosts) { @@ -43,12 +43,12 @@ public class WhiteListBasedRemoteHostValidator implements IRemoteHostValidator } } } - + public void removeRemoteHost(String remoteHost) { allowedRemoteHosts.remove(remoteHost); } - + public void addRemoteHost(String remoteHost) { allowedRemoteHosts.add(remoteHost); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/ExperimentToDataSetRelatedEntitiesTranslator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/ExperimentToDataSetRelatedEntitiesTranslator.java index dfd2066877cbf394a73d8d22847c559b989481a8..00034fae63a5bbf2fc303d4ef913b483daaa80b9 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/ExperimentToDataSetRelatedEntitiesTranslator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/ExperimentToDataSetRelatedEntitiesTranslator.java @@ -26,11 +26,9 @@ class ExperimentToDataSetRelatedEntitiesTranslator private final ArrayList<BasicEntityInformationHolder> entityInformationHolders; /** - * Creates a translator from public {@Experiment} objects to the internal - * {@link DataSetRelatedEntities} objects. + * Creates a translator from public {@Experiment} objects to the internal {@link DataSetRelatedEntities} objects. * <p> - * A list of experiment types known to the DB must be provided because Experiment knows only the - * code of the ExperimentType. + * A list of experiment types known to the DB must be provided because Experiment knows only the code of the ExperimentType. * * @param experimentTypes A list of ExperimentTypes known to the DB. * @param experiments The experiments to convert. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationChangingService.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationChangingService.java index 424db69d2df24c0107657bdb987649f348a24bae..36aee99039c82c0d53dcca1bced7ef317171a2be 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationChangingService.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationChangingService.java @@ -332,18 +332,19 @@ public class GeneralInformationChangingService extends { server.deletePermanentlyForced(sessionToken, TechId.createList(deletionIds)); } - + @Override public void registerPerson(String sessionToken, String userID) { server.registerPerson(sessionToken, userID); } - + @Override - public void registerSpace(String sessionToken, String spaceCode, String spaceDescription) { - server.registerSpace(sessionToken,spaceCode, spaceDescription); + public void registerSpace(String sessionToken, String spaceCode, String spaceDescription) + { + server.registerSpace(sessionToken, spaceCode, spaceDescription); } - + @Override public void registerPersonSpaceRole(String sessionToken, String spaceCode, String userID, String roleCode) { @@ -351,5 +352,5 @@ public class GeneralInformationChangingService extends SpaceIdentifier spaceIdentifier = new SpaceIdentifier(spaceCode); server.registerSpaceRole(sessionToken, RoleCode.valueOf(roleCode), spaceIdentifier, grantee); } - + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationChangingServiceJsonServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationChangingServiceJsonServer.java index b9ed6c36059bd28f32ff7adc1b3381da7f2cc5f5..14800f19a87ee2bf8e076ae64afd6e97dfc8eb28 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationChangingServiceJsonServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationChangingServiceJsonServer.java @@ -57,14 +57,14 @@ public class GeneralInformationChangingServiceJsonServer extends AbstractApiJson } @RequestMapping( - { IGeneralInformationChangingService.JSON_SERVICE_URL, - "/openbis" + IGeneralInformationChangingService.JSON_SERVICE_URL }) + { IGeneralInformationChangingService.JSON_SERVICE_URL, + "/openbis" + IGeneralInformationChangingService.JSON_SERVICE_URL }) @Override public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, - IOException { + IOException + { super.handleRequest(request, response); } - } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationChangingServiceLogger.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationChangingServiceLogger.java index 1bf5d91e8bd3851b1b3d08734872cd6c331be543..7ab105f0323a77b7020606c2372ddf957fffc1fc 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationChangingServiceLogger.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationChangingServiceLogger.java @@ -248,5 +248,5 @@ class GeneralInformationChangingServiceLogger extends AbstractServerLogger imple { logAccess(sessionToken, "registerPersonSpaceRole", "spaceCode(%s), userID(%s), roleCode(%s)", spaceCode, userID, roleCode); } - + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationService.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationService.java index ee64f5a89de31a5d7795243fac897493f8ab55ad..b9a4da48b8610ba0eb9964d8d7060a8ef474011f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationService.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationService.java @@ -407,8 +407,7 @@ public class GeneralInformationService extends AbstractServer<IGeneralInformatio @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) @ReturnValueFilter(validatorClass = SampleByIdentiferValidator.class) public List<Sample> listSamplesForExperiment(String sessionToken, - @AuthorizationGuard(guardClass = ExperimentAugmentedCodePredicate.class) - String experimentIdentifierString) + @AuthorizationGuard(guardClass = ExperimentAugmentedCodePredicate.class) String experimentIdentifierString) { checkSession(sessionToken); ExperimentIdentifier experimentId = @@ -429,8 +428,7 @@ public class GeneralInformationService extends AbstractServer<IGeneralInformatio @RolesAllowed(RoleWithHierarchy.INSTANCE_OBSERVER) @Capability("SEARCH_ON_BEHALF_OF_USER") public List<Sample> listSamplesForExperimentOnBehalfOfUser(String sessionToken, - @AuthorizationGuard(guardClass = ExperimentAugmentedCodePredicate.class) - String experimentIdentifierString, String userId) + @AuthorizationGuard(guardClass = ExperimentAugmentedCodePredicate.class) String experimentIdentifierString, String userId) { checkSession(sessionToken); ExperimentIdentifier experimentId = @@ -464,8 +462,7 @@ public class GeneralInformationService extends AbstractServer<IGeneralInformatio @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) @ReturnValueFilter(validatorClass = DataSetByExperimentOrSampleIdentifierValidator.class) public List<DataSet> listDataSets(String sessionToken, - @AuthorizationGuard(guardClass = SampleListPredicate.class) - List<Sample> samples) + @AuthorizationGuard(guardClass = SampleListPredicate.class) List<Sample> samples) { return listDataSets(sessionToken, samples, EnumSet.noneOf(Connections.class)); } @@ -475,8 +472,7 @@ public class GeneralInformationService extends AbstractServer<IGeneralInformatio @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) @ReturnValueFilter(validatorClass = ExperimentByIdentiferValidator.class) public List<Experiment> listExperiments(String sessionToken, - @AuthorizationGuard(guardClass = ProjectPredicate.class) - List<Project> projects, String experimentTypeString) + @AuthorizationGuard(guardClass = ProjectPredicate.class) List<Project> projects, String experimentTypeString) { return listExperiments(sessionToken, projects, experimentTypeString, false, false); } @@ -486,8 +482,7 @@ public class GeneralInformationService extends AbstractServer<IGeneralInformatio @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) @ReturnValueFilter(validatorClass = ExperimentByIdentiferValidator.class) public List<Experiment> listExperimentsHavingDataSets(String sessionToken, - @AuthorizationGuard(guardClass = ProjectPredicate.class) - List<Project> projects, String experimentTypeString) + @AuthorizationGuard(guardClass = ProjectPredicate.class) List<Project> projects, String experimentTypeString) { return listExperiments(sessionToken, projects, experimentTypeString, false, true); } @@ -497,8 +492,7 @@ public class GeneralInformationService extends AbstractServer<IGeneralInformatio @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) @ReturnValueFilter(validatorClass = ExperimentByIdentiferValidator.class) public List<Experiment> listExperimentsHavingSamples(String sessionToken, - @AuthorizationGuard(guardClass = ProjectPredicate.class) - List<Project> projects, String experimentTypeString) + @AuthorizationGuard(guardClass = ProjectPredicate.class) List<Project> projects, String experimentTypeString) { return listExperiments(sessionToken, projects, experimentTypeString, true, false); } @@ -602,8 +596,7 @@ public class GeneralInformationService extends AbstractServer<IGeneralInformatio @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) @ReturnValueFilter(validatorClass = DataSetByExperimentOrSampleIdentifierValidator.class) public List<DataSet> listDataSetsForSample(String sessionToken, - @AuthorizationGuard(guardClass = SamplePredicate.class) - Sample sample, boolean areOnlyDirectlyConnectedIncluded) + @AuthorizationGuard(guardClass = SamplePredicate.class) Sample sample, boolean areOnlyDirectlyConnectedIncluded) { checkSession(sessionToken); List<AbstractExternalData> externalData = @@ -751,8 +744,7 @@ public class GeneralInformationService extends AbstractServer<IGeneralInformatio @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) @ReturnValueFilter(validatorClass = DataSetByExperimentOrSampleIdentifierValidator.class) public List<DataSet> listDataSets(String sessionToken, - @AuthorizationGuard(guardClass = SampleListPredicate.class) - List<Sample> samples, EnumSet<Connections> connections) + @AuthorizationGuard(guardClass = SampleListPredicate.class) List<Sample> samples, EnumSet<Connections> connections) { checkSession(sessionToken); EnumSet<Connections> connectionsToGet = @@ -810,8 +802,7 @@ public class GeneralInformationService extends AbstractServer<IGeneralInformatio @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) @ReturnValueFilter(validatorClass = DataSetByExperimentOrSampleIdentifierValidator.class) public List<DataSet> listDataSetsForExperiments(String sessionToken, - @AuthorizationGuard(guardClass = ExperimentListPredicate.class) - List<Experiment> experiments, EnumSet<Connections> connections) + @AuthorizationGuard(guardClass = ExperimentListPredicate.class) List<Experiment> experiments, EnumSet<Connections> connections) { checkSession(sessionToken); EnumSet<Connections> connectionsToGet = @@ -1049,8 +1040,7 @@ public class GeneralInformationService extends AbstractServer<IGeneralInformatio @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) @ReturnValueFilter(validatorClass = ExperimentByIdentiferValidator.class) public List<Experiment> listExperiments(String sessionToken, - @AuthorizationGuard(guardClass = ExperimentAugmentedCodePredicate.class) - List<String> experimentIdentifiers) + @AuthorizationGuard(guardClass = ExperimentAugmentedCodePredicate.class) List<String> experimentIdentifiers) { checkSession(sessionToken); @@ -1213,8 +1203,7 @@ public class GeneralInformationService extends AbstractServer<IGeneralInformatio @Transactional(readOnly = true) @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) public List<Attachment> listAttachmentsForProject(String sessionToken, - @AuthorizationGuard(guardClass = ProjectIdPredicate.class) - IProjectId projectId, boolean allVersions) + @AuthorizationGuard(guardClass = ProjectIdPredicate.class) IProjectId projectId, boolean allVersions) { Session session = getSession(sessionToken); @@ -1231,8 +1220,7 @@ public class GeneralInformationService extends AbstractServer<IGeneralInformatio @Transactional(readOnly = true) @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) public List<Attachment> listAttachmentsForExperiment(String sessionToken, - @AuthorizationGuard(guardClass = ExperimentIdPredicate.class) - IExperimentId experimentId, boolean allVersions) + @AuthorizationGuard(guardClass = ExperimentIdPredicate.class) IExperimentId experimentId, boolean allVersions) { Session session = getSession(sessionToken); @@ -1249,8 +1237,7 @@ public class GeneralInformationService extends AbstractServer<IGeneralInformatio @Transactional(readOnly = true) @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) public List<Attachment> listAttachmentsForSample(String sessionToken, - @AuthorizationGuard(guardClass = SampleIdPredicate.class) - ISampleId sampleId, boolean allVersions) + @AuthorizationGuard(guardClass = SampleIdPredicate.class) ISampleId sampleId, boolean allVersions) { Session session = getSession(sessionToken); @@ -1358,7 +1345,7 @@ public class GeneralInformationService extends AbstractServer<IGeneralInformatio { return commonServer.listPersons(sessionToken); } - + @Override @Transactional(readOnly = true) @RolesAllowed(RoleWithHierarchy.SPACE_USER) @@ -1368,11 +1355,11 @@ public class GeneralInformationService extends AbstractServer<IGeneralInformatio SQLQuery querySampleTypeId = currentSession.createSQLQuery("SELECT id from sample_types WHERE code = :sampleTypeCode"); querySampleTypeId.setParameter("sampleTypeCode", sampleTypeCode); int sampleTypeId = ((Number) querySampleTypeId.uniqueResult()).intValue(); - + SQLQuery querySampleCount = currentSession.createSQLQuery("SELECT COUNT(*) FROM samples_all WHERE saty_id = :sampleTypeId"); querySampleCount.setParameter("sampleTypeId", sampleTypeId); long sampleCount = ((Number) querySampleCount.uniqueResult()).longValue(); - + return sampleCount; } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationServiceJsonServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationServiceJsonServer.java index f80f5428440b26f5f8531b8420afd22725111985..d3fa439179632ee337bfdbc16ea4a3c18e17b834 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationServiceJsonServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationServiceJsonServer.java @@ -56,11 +56,12 @@ public class GeneralInformationServiceJsonServer extends AbstractApiJsonServiceE } @RequestMapping( - { IGeneralInformationService.JSON_SERVICE_URL, - "/openbis" + IGeneralInformationService.JSON_SERVICE_URL }) + { IGeneralInformationService.JSON_SERVICE_URL, + "/openbis" + IGeneralInformationService.JSON_SERVICE_URL }) public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, - IOException { + IOException + { super.handleRequest(request, response); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationServiceServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationServiceServer.java index 7d1d59f5272069a1e712f8cb43fabd05587e096a..6afab5e88bfcd32877f98bdc9e58de53bfc616f2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationServiceServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/GeneralInformationServiceServer.java @@ -30,8 +30,6 @@ import ch.systemsx.cisd.openbis.common.api.server.AbstractApiServiceExporter; import ch.systemsx.cisd.openbis.generic.shared.api.v1.IGeneralInformationService; /** - * - * * @author Franz-Josef Elmer */ @Controller @@ -47,14 +45,15 @@ public class GeneralInformationServiceServer extends AbstractApiServiceExporter IGeneralInformationService.SERVICE_NAME, IGeneralInformationService.SERVICE_URL); super.afterPropertiesSet(); } - @RequestMapping( - { IGeneralInformationService.SERVICE_URL, "/openbis" + IGeneralInformationService.SERVICE_URL, "/openbis/openbis" + IGeneralInformationService.SERVICE_URL }) + { IGeneralInformationService.SERVICE_URL, "/openbis" + IGeneralInformationService.SERVICE_URL, + "/openbis/openbis" + IGeneralInformationService.SERVICE_URL }) @Override public void handleRequest(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { + throws ServletException, IOException + { super.handleRequest(request, response); } - + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/SampleToDataSetRelatedEntitiesTranslator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/SampleToDataSetRelatedEntitiesTranslator.java index 3a480ed5eb8d666dddc0ffa7444cfafcea1ffe82..382e8ac8b8bd61534f78e69a431b34494a1ac363 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/SampleToDataSetRelatedEntitiesTranslator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/SampleToDataSetRelatedEntitiesTranslator.java @@ -42,11 +42,9 @@ class SampleToDataSetRelatedEntitiesTranslator private final ArrayList<BasicEntityInformationHolder> entityInformationHolders; /** - * Creates a translator from public {@Sample} objects to the internal - * {@link DataSetRelatedEntities} objects. + * Creates a translator from public {@Sample} objects to the internal {@link DataSetRelatedEntities} objects. * <p> - * A list of sample types known to the DB must be provided because Sample knows only the code of - * the SampleType. + * A list of sample types known to the DB must be provided because Sample knows only the code of the SampleType. * * @param sampleTypes A list of SampleTypes known to the DB. * @param samples The samples to convert. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/WebInformationServiceJsonServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/WebInformationServiceJsonServer.java index 736de594016367cdffce10838b978081db6d1298..e2f5dff6987cf47ad812efa6d3b290e74a44e3c8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/WebInformationServiceJsonServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/WebInformationServiceJsonServer.java @@ -55,11 +55,12 @@ public class WebInformationServiceJsonServer extends AbstractApiJsonServiceExpor } @RequestMapping( - { IWebInformationService.JSON_SERVICE_URL, "/openbis" + IWebInformationService.JSON_SERVICE_URL }) + { IWebInformationService.JSON_SERVICE_URL, "/openbis" + IWebInformationService.JSON_SERVICE_URL }) @Override public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, - IOException { + IOException + { super.handleRequest(request, response); - } + } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/ActiveAuthorization.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/ActiveAuthorization.java index 2f53ebe55e143f43d1e400da84b19a8adf568cbf..e326c588bee7fe8ebefa1c112ccd7ca3a8acabb5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/ActiveAuthorization.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/ActiveAuthorization.java @@ -19,8 +19,7 @@ package ch.systemsx.cisd.openbis.generic.server.authorization; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IAuthorizationDAOFactory; /** - * A {@link IAuthorizationComponentFactory} implementation which provides components for an active - * authorization. + * A {@link IAuthorizationComponentFactory} implementation which provides components for an active authorization. * * @author Christian Ribeaud */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/Argument.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/Argument.java index 9f78a080076e1cf344ba351f6700db6b56a6608c..f7dabde51a767d7ae6142229fa11a272f1bf1c34 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/Argument.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/Argument.java @@ -6,8 +6,7 @@ import ch.systemsx.cisd.common.reflection.ModifiedShortPrefixToStringStyle; import ch.systemsx.cisd.openbis.generic.server.authorization.annotation.AuthorizationGuard; /** - * Small class encapsulating a method argument which could have been annotated with - * {@link AuthorizationGuard}. + * Small class encapsulating a method argument which could have been annotated with {@link AuthorizationGuard}. * * @author Christian Ribeaud */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/CapabilityMap.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/CapabilityMap.java index e6a29a98fb9a1ecd139bb119dd0f8652b815e523..952c2cfa85e5748d66d6b913791ce49ce166fd09 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/CapabilityMap.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/CapabilityMap.java @@ -89,7 +89,7 @@ class CapabilityMap } String[] terms = StringUtils.split(trimmed, ';'); String firstTerm = terms[0].trim(); - + final String[] firstTermSplitted = StringUtils.split(firstTerm, " \t:", 2); if (firstTermSplitted.length != 2) { @@ -111,7 +111,7 @@ class CapabilityMap } } } - + private void addRolesForParameter(String capabilityName, String parameterTerm, String line, String filePath) { int indexOfEqual = parameterTerm.indexOf('='); @@ -129,7 +129,7 @@ class CapabilityMap String roleNames = parameterTerm.substring(indexOfEqual + 1).trim(); addRoles(capabilityName + ":" + parameterName, roleNames, line, filePath); } - + private void addRoles(String capabilityName, String roleNames, String line, String filePath) { Collection<RoleWithHierarchy> roles = capMap.get(capabilityName); @@ -157,7 +157,7 @@ class CapabilityMap } } } - + private void logWarning(String line, String filePath, String messageOrNull) { String msg = String.format( diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/DefaultAccessController.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/DefaultAccessController.java index 7c513392552124f59a748c174e1189eb6239b1b5..18224192b48a4c5aeb17a1b3b97c9e5d484206bb 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/DefaultAccessController.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/DefaultAccessController.java @@ -76,7 +76,7 @@ public final class DefaultAccessController implements IAccessController new HashMap<Method, Set<RoleWithHierarchy>>(); private final Map<Method, Map<String, Set<RoleWithHierarchy>>> argumentRolesCache = new HashMap<>(); - + private final CapabilityMap capabilities = new CapabilityMap(new File("etc/capabilities")); private PredicateExecutor predicateExecutor; @@ -203,7 +203,7 @@ public final class DefaultAccessController implements IAccessController return rootRoles; } - private Set<RoleWithHierarchy> getArgumentRoles(Method method, Argument<?> argument, + private Set<RoleWithHierarchy> getArgumentRoles(Method method, Argument<?> argument, Set<RoleWithHierarchy> defaultRoles) { synchronized (argumentRolesCache) @@ -233,8 +233,8 @@ public final class DefaultAccessController implements IAccessController return roles; } } - - private Collection<RoleWithHierarchy> getRootRoles(Method method, AuthorizationGuard predicateCandidate, + + private Collection<RoleWithHierarchy> getRootRoles(Method method, AuthorizationGuard predicateCandidate, Set<RoleWithHierarchy> defaultRoles) { Collection<RoleWithHierarchy> roles = capabilities.tryGetRoles(method, predicateCandidate.name()); @@ -252,8 +252,7 @@ public final class DefaultAccessController implements IAccessController return roles; } - - private Status checkNotEmpty(List<RoleWithIdentifier> relevantRoles, Set<RoleWithHierarchy> argumentRoles, + private Status checkNotEmpty(List<RoleWithIdentifier> relevantRoles, Set<RoleWithHierarchy> argumentRoles, IAuthSession session) { if (relevantRoles.isEmpty() == false) @@ -263,7 +262,7 @@ public final class DefaultAccessController implements IAccessController final String msg = String.format(MATCHING_ROLE_NOT_FOUND_TEMPLATE, argumentRoles, session.getUserName()); return Status.createError(msg); } - + private List<RoleWithIdentifier> getRelevantRoles( final List<RoleWithIdentifier> userRoles, final Set<RoleWithHierarchy> methodOrParameterRoles) { @@ -279,8 +278,7 @@ public final class DefaultAccessController implements IAccessController } /** - * Retains {@link RoleWithIdentifier}s with {@link RoleWithIdentifier#getRole()} included in the - * set of {@link RoleWithHierarchy}s. + * Retains {@link RoleWithIdentifier}s with {@link RoleWithIdentifier#getRole()} included in the set of {@link RoleWithHierarchy}s. * * @return retained user roles */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/IAccessController.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/IAccessController.java index c80d6f60e8d2425f0d035863b8b7c3491801e60e..8357bb153cb64d6237989cde98f84545f13f3ef5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/IAccessController.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/IAccessController.java @@ -33,15 +33,12 @@ public interface IAccessController /** * Whether given <code>Session</code> has enough rights to access the calling <var>method</var>. * - * @param arguments the method arguments (minus the first one which is expected to be a - * {@link IAuthSession} object). + * @param arguments the method arguments (minus the first one which is expected to be a {@link IAuthSession} object). * @throws UserFailureException if the authorization could not be checked for some reason. - * @return a {@link Status} with {@link StatusFlag#OK} if given <var>session</var> is - * authorized to access the given <code>Method</code>. In case of - * {@link StatusFlag#ERROR} you might find more information by calling - * {@link Status#tryGetErrorMessage()}. + * @return a {@link Status} with {@link StatusFlag#OK} if given <var>session</var> is authorized to access the given <code>Method</code>. In case + * of {@link StatusFlag#ERROR} you might find more information by calling {@link Status#tryGetErrorMessage()}. */ public Status isAuthorized(final IAuthSession session, final Method method, final Argument<?>[] arguments) throws UserFailureException; - + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/IReturnValueFilter.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/IReturnValueFilter.java index 4e756475c421e17c64877291bbabec434a45328c..2d32763c39af38241d874f420d4727d68d1f601e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/IReturnValueFilter.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/IReturnValueFilter.java @@ -23,8 +23,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.IAuthSession; /** * A return value filter. * <p> - * A <code>IReturnValueFilter</code> should never throw an exception but should only take care of - * filtering. + * A <code>IReturnValueFilter</code> should never throw an exception but should only take care of filtering. * </p> * * @author Christian Ribeaud @@ -35,8 +34,8 @@ public interface IReturnValueFilter /** * Applies filtering on given <var>returnValue</var>. * - * @param returnValueOrNull the return value that should be filtered. If the method has a return - * value of type <code>void</code>, this would be <code>null</code>. + * @param returnValueOrNull the return value that should be filtered. If the method has a return value of type <code>void</code>, this would be + * <code>null</code>. */ public Object applyFilter(final IAuthSession session, final Method method, final Object returnValueOrNull); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/NoAuthorization.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/NoAuthorization.java index 14da5d050234b08712dd32abf8878326ef594994..4d1c40286ce89075584039b7fbef3d8b15b98855 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/NoAuthorization.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/NoAuthorization.java @@ -17,8 +17,7 @@ package ch.systemsx.cisd.openbis.generic.server.authorization; /** - * A {@link IAuthorizationComponentFactory} implementation which provides components in case we do - * not want any authorization. + * A {@link IAuthorizationComponentFactory} implementation which provides components in case we do not want any authorization. * * @author Christian Ribeaud */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/NoReturnValueFilter.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/NoReturnValueFilter.java index 6281b6e44155eb5cc5bb99bb5d028eb62b8dcb32..d7eeb2b4f063444d93de509914a0258e4fd6cc58 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/NoReturnValueFilter.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/NoReturnValueFilter.java @@ -21,8 +21,7 @@ import java.lang.reflect.Method; import ch.systemsx.cisd.openbis.generic.shared.dto.IAuthSession; /** - * A dummy <code>IReturnValueFilter</code> implementation which does not apply any filter to given - * return value. + * A dummy <code>IReturnValueFilter</code> implementation which does not apply any filter to given return value. * * @author Christian Ribeaud */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/SpaceOwnerKind.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/SpaceOwnerKind.java index d58b6935374a11f054cb4efc4b97e8f1b0dec298..cb1dc6176a2c6d767853e9497446a9beeabd9659 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/SpaceOwnerKind.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/SpaceOwnerKind.java @@ -19,8 +19,7 @@ package ch.systemsx.cisd.openbis.generic.server.authorization; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; /** - * Enumeration of the various ways to get the space of an entity knowing its - * {@link TechId}. + * Enumeration of the various ways to get the space of an entity knowing its {@link TechId}. * * @author Piotr Buczek * @author Franz-Josef Elmer diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/annotation/AuthorizationGuard.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/annotation/AuthorizationGuard.java index cd6da3a93b98a783171d4315b892056fe9cbd5d2..ee80ff3a663fb5182c7fbd915880d1ed0c61b70f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/annotation/AuthorizationGuard.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/annotation/AuthorizationGuard.java @@ -39,12 +39,12 @@ public @interface AuthorizationGuard * Class responsible for evaluating the method parameter. */ Class<? extends IPredicate<?>> guardClass(); - + /** * List of roles replacing corresponding list of @RolesAllowed annotation. */ RoleWithHierarchy[] rolesAllowed() default {}; - + /** * Name of the guard. Needed for the capabilities file to override allowed roles list. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/annotation/RolesAllowed.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/annotation/RolesAllowed.java index dd4efbec566d80fc95e4d4be84f669566c4c98c4..788bfc0dab5df4366132f079ba8871bd657b1c5c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/annotation/RolesAllowed.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/annotation/RolesAllowed.java @@ -35,8 +35,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.RoleWithHierarchy; public @interface RolesAllowed { /** - * The set of roles that are allowed to execute a method. The method will be accessible by all - * users with a role defined in any of {@link RoleWithHierarchy#getRoles()}. + * The set of roles that are allowed to execute a method. The method will be accessible by all users with a role defined in any of + * {@link RoleWithHierarchy#getRoles()}. */ RoleWithHierarchy[] value() default {}; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/AbstractPredicate.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/AbstractPredicate.java index cbe5a4651b7194a0bb40380df6185cc7f4e41a56..d177444f587d776d443bfeb6ac49551e2913ff97 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/AbstractPredicate.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/AbstractPredicate.java @@ -28,8 +28,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.RoleWithHierarchy.RoleL import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; /** - * An <i>abstract</i> <code>IPredicate</code> implementation which mainly checks method parameters - * before doing the real work. + * An <i>abstract</i> <code>IPredicate</code> implementation which mainly checks method parameters before doing the real work. * * @author Christian Ribeaud */ @@ -50,8 +49,7 @@ public abstract class AbstractPredicate<T> implements IPredicate<T> final List<RoleWithIdentifier> allowedRoles, final T value); /** - * Is the checked value allowed to be <code>null</code>, <code>false</code> by default. - * Can be overridden in sub-classes. + * Is the checked value allowed to be <code>null</code>, <code>false</code> by default. Can be overridden in sub-classes. */ protected boolean isNullValueAllowed() { @@ -59,8 +57,7 @@ public abstract class AbstractPredicate<T> implements IPredicate<T> } /** - * Returns <code>true</code> if <var>allowedRoles</var> contains a role that allows writing to - * all entities. + * Returns <code>true</code> if <var>allowedRoles</var> contains a role that allows writing to all entities. */ public static Status hasInstanceWritePermissions(PersonPE aPerson, List<RoleWithIdentifier> allowedRoles) @@ -82,8 +79,7 @@ public abstract class AbstractPredicate<T> implements IPredicate<T> } /** - * Returns <code>true</code> if <var>allowedRoles</var> contains a role that allows reading all - * entities. + * Returns <code>true</code> if <var>allowedRoles</var> contains a role that allows reading all entities. */ public static Status hasInstanceReadPermissions(PersonPE aPerson, List<RoleWithIdentifier> allowedRoles) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/AbstractProjectPredicate.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/AbstractProjectPredicate.java index b26d73e529565ae3c94868e73a5e8a9001c8d7a9..555184f42156c4533c3b681008ab321799eaee82 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/AbstractProjectPredicate.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/AbstractProjectPredicate.java @@ -20,8 +20,7 @@ import ch.systemsx.cisd.openbis.generic.server.authorization.IAuthorizationDataP import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.AbstractTechIdPredicate.ProjectTechIdPredicate; /** - * An <code>IPredicate</code> implementation that has the tools for authenticating projects based on - * any kind of identifier. + * An <code>IPredicate</code> implementation that has the tools for authenticating projects based on any kind of identifier. * * @author Bernd Rinn */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/AbstractTechIdPredicate.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/AbstractTechIdPredicate.java index 859ad685800628410e9ad7fc06f34846d67e737f..7dfd3dc746a405644feec04d76dc129b35190489 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/AbstractTechIdPredicate.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/AbstractTechIdPredicate.java @@ -26,8 +26,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; import ch.systemsx.cisd.openbis.generic.shared.dto.SpacePE; /** - * An <code>IPredicate</code> abstract implementation based on {@link TechId} and - * {@link SpaceOwnerKind} + * An <code>IPredicate</code> abstract implementation based on {@link TechId} and {@link SpaceOwnerKind} * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/AtomicOperationsPredicate.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/AtomicOperationsPredicate.java index e49b7ff570927663fbee84781a39c1e186f9275e..9e84daed0eab94cda606f16ce99a89469c029893 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/AtomicOperationsPredicate.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/AtomicOperationsPredicate.java @@ -35,8 +35,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.ExperimentIdentifi import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifier; /** - * The predicate for the {@link AtomicEntityOperationDetails}. This check is always being performed - * as the user + * The predicate for the {@link AtomicEntityOperationDetails}. This check is always being performed as the user * * @author Chandrasekhar Ramakrishnan */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/DataSetUpdatesCollectionPredicate.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/DataSetUpdatesCollectionPredicate.java index 30e12af3dbf0ff8ec90032259604d6ab2dca6fde..64358a73edc86e2ac2c0bbb584c23e120594d8fa 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/DataSetUpdatesCollectionPredicate.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/DataSetUpdatesCollectionPredicate.java @@ -34,9 +34,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifier; import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleOwnerIdentifier; /** - * Predicate for lists of {@link DataSetUpdatesDTO} instances. Checks that the user has update - * rights for all data sets. In addition for all data sets with changed samples or experiments it is - * check that the user has access rights for those samples and experiments. + * Predicate for lists of {@link DataSetUpdatesDTO} instances. Checks that the user has update rights for all data sets. In addition for all data sets + * with changed samples or experiments it is check that the user has access rights for those samples and experiments. * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/DataSetUpdatesPredicate.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/DataSetUpdatesPredicate.java index 52832ad7cb5b159be5c7ad3176209d10c2fbceaa..e9d087536197442d50666f9b59f8ffd7d209b22c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/DataSetUpdatesPredicate.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/DataSetUpdatesPredicate.java @@ -27,9 +27,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifier; /** - * An <code>IPredicate</code> implementation based on {@link DataSetUpdatesDTO}. Checks that: 1) the - * user has rights to update the data set 2) if data set is moved to a different sample the user has - * access to this sample. + * An <code>IPredicate</code> implementation based on {@link DataSetUpdatesDTO}. Checks that: 1) the user has rights to update the data set 2) if data + * set is moved to a different sample the user has access to this sample. * * @author Piotr Buczek */ @@ -59,8 +58,7 @@ public class DataSetUpdatesPredicate extends AbstractPredicate<DataSetUpdatesDTO } @Override - protected - Status doEvaluation(final PersonPE person, final List<RoleWithIdentifier> allowedRoles, + protected Status doEvaluation(final PersonPE person, final List<RoleWithIdentifier> allowedRoles, final DataSetUpdatesDTO updates) { assert dataSetTechIdPredicate.initialized : "Predicate has not been initialized"; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/DelegatedNullableAbstractPredicate.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/DelegatedNullableAbstractPredicate.java index 45440e112d294dbe28ad99735e19d76baf80d6e1..e9b417336d7ef04113786df2800e35c9a0cd13ee 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/DelegatedNullableAbstractPredicate.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/DelegatedNullableAbstractPredicate.java @@ -24,8 +24,8 @@ import ch.systemsx.cisd.openbis.generic.server.authorization.RoleWithIdentifier; import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; /** - * An <code>AbstractPredicate</code> extension which delegates its method calls to the encapsulated - * {@link AbstractPredicate} allowing the value to be null. + * An <code>AbstractPredicate</code> extension which delegates its method calls to the encapsulated {@link AbstractPredicate} allowing the value to be + * null. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/DelegatedPredicate.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/DelegatedPredicate.java index 58d795dfee19b44456fe98b1c11ad8f3eb25705a..8ad534db890395519d93af3906a6706795caf95e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/DelegatedPredicate.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/DelegatedPredicate.java @@ -24,12 +24,10 @@ import ch.systemsx.cisd.openbis.generic.server.authorization.RoleWithIdentifier; import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; /** - * An <code>AbstractPredicate</code> extension which delegates its method calls to the encapsulated - * {@link IPredicate}. + * An <code>AbstractPredicate</code> extension which delegates its method calls to the encapsulated {@link IPredicate}. * <p> - * Each implementation should know how to convert <code>T</code> to <code>P</code> by implementing - * {@link #tryConvert(Object)} method. Note that {@link #doEvaluation(PersonPE, List, Object)} - * delegates its call to {@link IPredicate#evaluate(PersonPE, List, Object)} of the specified + * Each implementation should know how to convert <code>T</code> to <code>P</code> by implementing {@link #tryConvert(Object)} method. Note that + * {@link #doEvaluation(PersonPE, List, Object)} delegates its call to {@link IPredicate#evaluate(PersonPE, List, Object)} of the specified * <code>delegate</code>. * </p> * diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/ExistingSpaceIdentifierPredicate.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/ExistingSpaceIdentifierPredicate.java index ccdc0e4ddf379332b1025921e6ea9c023f2ff497..f65d7158210472617a7f44b75150a878360d8b05 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/ExistingSpaceIdentifierPredicate.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/ExistingSpaceIdentifierPredicate.java @@ -16,7 +16,6 @@ package ch.systemsx.cisd.openbis.generic.server.authorization.predicate; - /** * A {@link SpaceIdentifierPredicate} which evaluates to OK if the space does not exist. * diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/ExperimentUpdatesPredicate.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/ExperimentUpdatesPredicate.java index 7d1cf715f163858504f709e16b2cb259b8d81a95..8572f787536bffa2e0176097cbb386189fd879e2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/ExperimentUpdatesPredicate.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/ExperimentUpdatesPredicate.java @@ -24,9 +24,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentUpdatesDTO; import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; /** - * An <code>IPredicate</code> implementation based on {@link ExperimentUpdatesDTO}. Checks that: 1) - * the user has rights to update the experiment 2) if experiment is moved to a different projects - * the user has access to this project. + * An <code>IPredicate</code> implementation based on {@link ExperimentUpdatesDTO}. Checks that: 1) the user has rights to update the experiment 2) if + * experiment is moved to a different projects the user has access to this project. * * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/IPredicate.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/IPredicate.java index 62851ab331f53bc439ae4742bd4d5c296445fd4f..af22024b16a96566bea7c6f1d608da2b3f83aa4d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/IPredicate.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/IPredicate.java @@ -28,8 +28,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; /** * Performs some predicate which returns a {@link Status} based on the input objects. * <p> - * Each implementation is expected to have an empty <code>public</code> constructor and might be - * statefull. So do not try to reuse it. Use a {@link IPredicateFactory} to get an implementation. + * Each implementation is expected to have an empty <code>public</code> constructor and might be statefull. So do not try to reuse it. Use a + * {@link IPredicateFactory} to get an implementation. * </p> * * @author Christian Ribeaud diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/ListSamplesByPropertyPredicate.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/ListSamplesByPropertyPredicate.java index fab5175ce71f04541d3fa9cd484674fafc7405a3..a2218b2ea61f3a32b771f7042d01df1675a989b1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/ListSamplesByPropertyPredicate.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/ListSamplesByPropertyPredicate.java @@ -25,9 +25,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.ListSamplesByPropertyCriteria import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; /** - * An <code>IPredicate</code> implementation based on {@link ListSamplesByPropertyCriteria}. Checks - * that the user has the right to access the group from which samples are referenced. Note that we - * can ignore the experiment, since it belongs to the same group. + * An <code>IPredicate</code> implementation based on {@link ListSamplesByPropertyCriteria}. Checks that the user has the right to access the group + * from which samples are referenced. Note that we can ignore the experiment, since it belongs to the same group. * * @author Tomasz Pylak */ @@ -54,8 +53,7 @@ public class ListSamplesByPropertyPredicate extends } @Override - protected - Status doEvaluation(final PersonPE person, final List<RoleWithIdentifier> allowedRoles, + protected Status doEvaluation(final PersonPE person, final List<RoleWithIdentifier> allowedRoles, final ListSamplesByPropertyCriteria criteria) { assert spacePredicate.initialized : "Predicate has not been initialized"; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/NewDataSetsWithTypePredicate.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/NewDataSetsWithTypePredicate.java index 9dd927ac5c784b9122a9a89b12540583363e3c49..eb605b83c80d7825339b482dd7840299bd1cf5f8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/NewDataSetsWithTypePredicate.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/NewDataSetsWithTypePredicate.java @@ -49,8 +49,7 @@ public class NewDataSetsWithTypePredicate extends AbstractPredicate<NewDataSetsW } @Override - protected - Status doEvaluation(PersonPE person, List<RoleWithIdentifier> allowedRoles, + protected Status doEvaluation(PersonPE person, List<RoleWithIdentifier> allowedRoles, NewDataSetsWithTypes dataSets) { List<String> codes = new ArrayList<String>(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/NullableGroupIdentifierPredicate.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/NullableGroupIdentifierPredicate.java index 8fd15faff82d85dc0ae5dbc8c321fcb82e2b8452..ff4de6715c50d43f85973870334ff3da7d5a6259 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/NullableGroupIdentifierPredicate.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/NullableGroupIdentifierPredicate.java @@ -19,8 +19,7 @@ package ch.systemsx.cisd.openbis.generic.server.authorization.predicate; import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SpaceIdentifier; /** - * An <code>IPredicate</code> implementation based on {@link SpaceIdentifierPredicate} which allows - * the identifier to be null. + * An <code>IPredicate</code> implementation based on {@link SpaceIdentifierPredicate} which allows the identifier to be null. * * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/RevertDeletionPredicate.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/RevertDeletionPredicate.java index 006d3f2bb22b8d82b106cebbb6142b99ac81099f..5cb787fea8091565bec0fc3799185ad11851c208 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/RevertDeletionPredicate.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/RevertDeletionPredicate.java @@ -46,8 +46,7 @@ public class RevertDeletionPredicate extends AbstractPredicate<List<TechId>> } @Override - public void init(@SuppressWarnings("hiding") - IAuthorizationDataProvider provider) + public void init(@SuppressWarnings("hiding") IAuthorizationDataProvider provider) { this.provider = provider; deletionTechIdCollectionPredicate.init(provider); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SamplePredicate.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SamplePredicate.java index 088c03afd8a4429966ce6b8a24269a75af710644..222bbaf2b58a5e0cf7fb1ba2c10deb6b58a52e41 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SamplePredicate.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SamplePredicate.java @@ -22,9 +22,8 @@ import java.util.List; import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.Sample; /** - * Predicate based on {@link ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.Sample}. This - * predicate authorizes for read-only access, i.e. it will allow access to shared samples for all - * users. + * Predicate based on {@link ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.Sample}. This predicate authorizes for read-only access, i.e. it will + * allow access to shared samples for all users. * * @author Bernd Rinn */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SampleTechIdPredicate.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SampleTechIdPredicate.java index d961fb398411a734b3395117c2a14a8826b5bd53..6c42f2a30f89cc78fd2412656971afffdcb8b84e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SampleTechIdPredicate.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SampleTechIdPredicate.java @@ -63,8 +63,7 @@ public class SampleTechIdPredicate extends AbstractDatabaseInstancePredicate<Tec } @Override - protected - final Status doEvaluation(final PersonPE person, final List<RoleWithIdentifier> allowedRoles, + protected final Status doEvaluation(final PersonPE person, final List<RoleWithIdentifier> allowedRoles, final TechId techId) { SamplePE sample = authorizationDataProvider.getSample(techId); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SampleUpdatesCollectionPredicate.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SampleUpdatesCollectionPredicate.java index ddfc654ce3a8010d1d6812d53ce1ef640a0c8b49..9a79f31e0fe34a43c471963fb4d5c7387d22109b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SampleUpdatesCollectionPredicate.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SampleUpdatesCollectionPredicate.java @@ -33,8 +33,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifier; import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleOwnerIdentifier; /** - * Predicate for a list of {@link SampleUpdatesDTO} instances. The logical is similar to - * {@link SampleUpdatesPredicate}. + * Predicate for a list of {@link SampleUpdatesDTO} instances. The logical is similar to {@link SampleUpdatesPredicate}. * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SampleUpdatesPredicate.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SampleUpdatesPredicate.java index 3f73b47f44434289746417bd03c5d7516600a451..861696a6d2ecc837adf86c46e642fced454a835f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SampleUpdatesPredicate.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SampleUpdatesPredicate.java @@ -24,9 +24,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; import ch.systemsx.cisd.openbis.generic.shared.dto.SampleUpdatesDTO; /** - * An <code>IPredicate</code> implementation based on {@link SampleUpdatesDTO}. Checks that: 1) the - * user has rights to update the sample 2) if sample is moved to a different group the user has - * access to this group 3) if sample is attached to experiment, user has access to this experiment. + * An <code>IPredicate</code> implementation based on {@link SampleUpdatesDTO}. Checks that: 1) the user has rights to update the sample 2) if sample + * is moved to a different group the user has access to this group 3) if sample is attached to experiment, user has access to this experiment. * * @author Izabela Adamczyk */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/AbstractValidator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/AbstractValidator.java index 3819e810b54dd6d4b51d45b9990266beb7cda83f..5c5ee7a10a12f399e74146b62ad8ba1ec13cbb91 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/AbstractValidator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/AbstractValidator.java @@ -20,8 +20,7 @@ import ch.systemsx.cisd.openbis.generic.server.authorization.IAuthorizationDataP import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; /** - * An <i>abstract</i> <code>IValidator</code> implementation which mainly checks method parameters - * before doing the real work. + * An <i>abstract</i> <code>IValidator</code> implementation which mainly checks method parameters before doing the real work. * * @author Christian Ribeaud */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/IValidator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/IValidator.java index 0730e1f5df3791ea729e572a22b45d4e8bb35124..1929e02d3d6626e3ee4f4d68f3d0f723187c2cc6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/IValidator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/IValidator.java @@ -21,11 +21,10 @@ import ch.systemsx.cisd.openbis.generic.server.authorization.ValidatorStore; import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; /** - * Performs some validation which returns <code>true</code> or <code>false</code> based on the input - * objects. + * Performs some validation which returns <code>true</code> or <code>false</code> based on the input objects. * <p> - * Each implementation is expected to have an empty <code>public</code> constructor and is expected - * to be stateless. Use {@link ValidatorStore} to get an implementation. + * Each implementation is expected to have an empty <code>public</code> constructor and is expected to be stateless. Use {@link ValidatorStore} to get + * an implementation. * </p> * * @author Christian Ribeaud diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/ProjectValidator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/ProjectValidator.java index 0cb71cba4b159a2ff45bdbed9a0e95a03ba7cb96..7ba9a737a590c8fb04705e72339f9b998528c21a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/ProjectValidator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/ProjectValidator.java @@ -44,5 +44,5 @@ public final class ProjectValidator extends AbstractValidator<Project> final Space space = value.getSpace(); return groupValidator.isValid(person, space); } - + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/SearchDomainSearchResultValidator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/SearchDomainSearchResultValidator.java index 9e35e7c1eb910458ebcc398c2859e1598807dcdc..b5ef1159b91f225a88e8d32b8f36e001c5b3db19 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/SearchDomainSearchResultValidator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/SearchDomainSearchResultValidator.java @@ -31,7 +31,9 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; public class SearchDomainSearchResultValidator extends AbstractValidator<SearchDomainSearchResultWithFullEntity> { private final ExternalDataValidator dataSetValidator = new ExternalDataValidator(); + private final SampleValidator sampleValidator = new SampleValidator(); + private final ExperimentValidator experimentValidator = new ExperimentValidator(); @Override diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/batch/AbstractBatchOperationDelegate.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/batch/AbstractBatchOperationDelegate.java index 0f5f0193f8ed8e7436fd0adbb5df32446767154b..f6c18553887d52a5ad392471447dad066167a38e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/batch/AbstractBatchOperationDelegate.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/batch/AbstractBatchOperationDelegate.java @@ -17,8 +17,7 @@ package ch.systemsx.cisd.openbis.generic.server.batch; /** - * A shell superclass for batch operation delegates. Subclasses only need to override those methods - * they actually use. + * A shell superclass for batch operation delegates. Subclasses only need to override those methods they actually use. * * @author Chandrasekhar Ramakrishnan */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/batch/BatchOperationExecutor.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/batch/BatchOperationExecutor.java index 21e370481355b27206003b368b2c1c7decd8867e..7bc393f25ea3a85669604bcedce8af60a51c1fbc 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/batch/BatchOperationExecutor.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/batch/BatchOperationExecutor.java @@ -29,10 +29,9 @@ public class BatchOperationExecutor * Executes an operation in batches using the default batch size. * * @param strategy The operation to execute - * @param progressListenerOrNull The progress listener to notify of progress. If this is - * non-null, the progressPhaseOrNull must be non-null as well. - * @param progressPhaseOrNull The phase used in updating the progressListenerOrNull. Must be - * non-null if the progressListenerOrNull is + * @param progressListenerOrNull The progress listener to notify of progress. If this is non-null, the progressPhaseOrNull must be non-null as + * well. + * @param progressPhaseOrNull The phase used in updating the progressListenerOrNull. Must be non-null if the progressListenerOrNull is */ public static <S> void executeInBatches(IBatchOperation<S> strategy, IServiceConversationProgressListener progressListenerOrNull, String progressPhaseOrNull) @@ -50,10 +49,9 @@ public class BatchOperationExecutor * * @param strategy The operation to execute * @param batchSize The size of the batches - * @param progressListenerOrNull The progress listener to notify of progress. If this is - * non-null, the progressPhaseOrNull must be non-null as well. - * @param progressPhaseOrNull The phase used in updating the progressListenerOrNull. Must be - * non-null if the progressListenerOrNull is + * @param progressListenerOrNull The progress listener to notify of progress. If this is non-null, the progressPhaseOrNull must be non-null as + * well. + * @param progressPhaseOrNull The phase used in updating the progressListenerOrNull. Must be non-null if the progressListenerOrNull is */ public static <S> void executeInBatches(IBatchOperation<S> strategy, int batchSize, IServiceConversationProgressListener progressListenerOrNull, String progressPhaseOrNull) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/batch/SampleUpdate.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/batch/SampleUpdate.java index eba771887b26d291aaf76effc05cc0cbc0fe7b82..a17a9b15bc72025945fcfe43da571261c5cdf434 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/batch/SampleUpdate.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/batch/SampleUpdate.java @@ -22,12 +22,11 @@ import ch.systemsx.cisd.openbis.generic.server.business.bo.ISampleTable; import ch.systemsx.cisd.openbis.generic.shared.dto.SampleUpdatesDTO; /** - * {@link IBatchOperation} updating samples. It is like {@link SampleBatchUpdate}, but uses - * {@link SampleUpdatesDTO} to specify the updates instead of {@link SampleBatchUpdate} and thus has - * slightly different semantics. + * {@link IBatchOperation} updating samples. It is like {@link SampleBatchUpdate}, but uses {@link SampleUpdatesDTO} to specify the updates instead of + * {@link SampleBatchUpdate} and thus has slightly different semantics. * <p> - * Whereas SampleBatchUpdate only makes changes to the sample that are explicitly specified in it - * the details object of its DTO, SampleUpdate changes the sample to match the DTO. + * Whereas SampleBatchUpdate only makes changes to the sample that are explicitly specified in it the details object of its DTO, SampleUpdate changes + * the sample to match the DTO. * * @author Chandrasekhar Ramakrishnan */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/DataStoreServiceFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/DataStoreServiceFactory.java index 704445259ee33f06f732f1209813442836cf977a..4e3d2f2136bde9d9282d4f58bccc0352e788d046 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/DataStoreServiceFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/DataStoreServiceFactory.java @@ -56,10 +56,11 @@ public class DataStoreServiceFactory implements IDataStoreServiceFactory "Monitoring Proxy").corePoolSize(NUMBER_OF_CORE_THREADS).daemonize(); @Override - public IDataStoreService create(String serverURL) { + public IDataStoreService create(String serverURL) + { return create(serverURL, 5 * DateUtils.MILLIS_PER_MINUTE); } - + @Override public IDataStoreService create(String serverURL, long timeout) { @@ -89,7 +90,7 @@ public class DataStoreServiceFactory implements IDataStoreServiceFactory .executorService(executorService) .callAsynchronously( IDataStoreService.class.getMethod("cleanupSession", new Class<?>[] - { String.class })).get(); + { String.class })).get(); } catch (SecurityException ex) { throw CheckedExceptionTunnel.wrapIfNecessary(ex); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/IDataStoreServiceFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/IDataStoreServiceFactory.java index ef9cf77610da509cffd431dbba6c5f3de7cd9775..900d8cfcadde3b3708d20215b8cda8217a15f418 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/IDataStoreServiceFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/IDataStoreServiceFactory.java @@ -27,10 +27,9 @@ public interface IDataStoreServiceFactory public IDataStoreService create(String serverURL); public IDataStoreService create(String serverURL, long timeout); - + /** - * Creates a monitored version of the service where - * {@link IDataStoreService#cleanupSession(String)} is run asynchronously. + * Creates a monitored version of the service where {@link IDataStoreService#cleanupSession(String)} is run asynchronously. */ public IDataStoreService createMonitored(String serverURL, LogLevel logLevelForNotSuccessfulCalls); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/IEntityOperationChecker.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/IEntityOperationChecker.java index 0b0f75063c9d7e133d7d95d8bd3fb78454fc879b..85c0fc2d75e0c66911a48c578647381f4fabfcb7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/IEntityOperationChecker.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/IEntityOperationChecker.java @@ -34,15 +34,13 @@ public interface IEntityOperationChecker { @RolesAllowed( - { RoleWithHierarchy.INSTANCE_ADMIN, RoleWithHierarchy.INSTANCE_ETL_SERVER }) + { RoleWithHierarchy.INSTANCE_ADMIN, RoleWithHierarchy.INSTANCE_ETL_SERVER }) public void assertInstanceSampleCreationAllowed(IAuthSession session, - @AuthorizationGuard(guardClass = NewSamplePredicate.class) - List<? extends NewSample> instanceSamples); + @AuthorizationGuard(guardClass = NewSamplePredicate.class) List<? extends NewSample> instanceSamples); @RolesAllowed( - { RoleWithHierarchy.INSTANCE_ADMIN, RoleWithHierarchy.INSTANCE_ETL_SERVER }) + { RoleWithHierarchy.INSTANCE_ADMIN, RoleWithHierarchy.INSTANCE_ETL_SERVER }) public void assertInstanceSampleUpdateAllowed(IAuthSession session, - @AuthorizationGuard(guardClass = SampleOwnerIdentifierPredicate.class) - List<? extends SampleOwnerIdentifier> instanceSamples); + @AuthorizationGuard(guardClass = SampleOwnerIdentifierPredicate.class) List<? extends SampleOwnerIdentifier> instanceSamples); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/IRelationshipService.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/IRelationshipService.java index cc028262fc7a2db6cc133e9687363b653a20358b..00af457ed6518956fc2b1658509854ec93984b4f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/IRelationshipService.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/IRelationshipService.java @@ -50,27 +50,24 @@ public interface IRelationshipService { RoleWithHierarchy.SPACE_ETL_SERVER, RoleWithHierarchy.SPACE_POWER_USER }) @Capability("ASSIGN_EXPERIMENT_TO_PROJECT") public void assignExperimentToProject(IAuthSession session, - @AuthorizationGuard(guardClass = ExperimentPEPredicate.class) - ExperimentPE experiment, @AuthorizationGuard(guardClass = ProjectPEPredicate.class) - ProjectPE project); + @AuthorizationGuard(guardClass = ExperimentPEPredicate.class) ExperimentPE experiment, + @AuthorizationGuard(guardClass = ProjectPEPredicate.class) ProjectPE project); @Transactional(propagation = Propagation.MANDATORY) @RolesAllowed(value = { RoleWithHierarchy.SPACE_ETL_SERVER, RoleWithHierarchy.SPACE_POWER_USER }) @Capability("ASSIGN_SAMPLE_TO_PROJECT") public void assignSampleToProject(IAuthSession session, - @AuthorizationGuard(guardClass = SamplePEPredicate.class) - SamplePE sample, @AuthorizationGuard(guardClass = ProjectPEPredicate.class) - ProjectPE project); + @AuthorizationGuard(guardClass = SamplePEPredicate.class) SamplePE sample, + @AuthorizationGuard(guardClass = ProjectPEPredicate.class) ProjectPE project); @Transactional(propagation = Propagation.MANDATORY) @RolesAllowed(value = { RoleWithHierarchy.SPACE_ETL_SERVER, RoleWithHierarchy.SPACE_POWER_USER }) @Capability("ASSIGN_PROJECT_TO_SPACE") public void assignProjectToSpace(IAuthSession session, - @AuthorizationGuard(guardClass = ProjectPEPredicate.class) - ProjectPE project, @AuthorizationGuard(guardClass = SpacePEPredicate.class) - SpacePE space); + @AuthorizationGuard(guardClass = ProjectPEPredicate.class) ProjectPE project, + @AuthorizationGuard(guardClass = SpacePEPredicate.class) SpacePE space); @Transactional(propagation = Propagation.MANDATORY) @RolesAllowed(value = @@ -78,149 +75,130 @@ public interface IRelationshipService RoleWithHierarchy.SPACE_USER }) @Capability("ASSIGN_SAMPLE_TO_EXPERIMENT") public void assignSampleToExperiment(IAuthSession session, - @AuthorizationGuard(guardClass = SamplePEPredicate.class) - SamplePE sample, @AuthorizationGuard(guardClass = ExperimentPEPredicate.class) - ExperimentPE experiment); + @AuthorizationGuard(guardClass = SamplePEPredicate.class) SamplePE sample, + @AuthorizationGuard(guardClass = ExperimentPEPredicate.class) ExperimentPE experiment); @Transactional(propagation = Propagation.MANDATORY) @RolesAllowed(value = { RoleWithHierarchy.SPACE_ETL_SERVER, RoleWithHierarchy.SPACE_POWER_USER }) @Capability("UNASSIGN_SAMPLE_FROM_EXPERIMENT") public void checkCanUnassignSampleFromExperiment(IAuthSession session, - @AuthorizationGuard(guardClass = SamplePEPredicate.class) - SamplePE sample); + @AuthorizationGuard(guardClass = SamplePEPredicate.class) SamplePE sample); @Transactional(propagation = Propagation.MANDATORY) @RolesAllowed(value = { RoleWithHierarchy.SPACE_ETL_SERVER, RoleWithHierarchy.SPACE_POWER_USER }) @Capability("UNASSIGN_SAMPLE_FROM_EXPERIMENT") public void unassignSampleFromExperiment(IAuthSession session, - @AuthorizationGuard(guardClass = SamplePEPredicate.class) - SamplePE sample); + @AuthorizationGuard(guardClass = SamplePEPredicate.class) SamplePE sample); @Transactional(propagation = Propagation.MANDATORY) @RolesAllowed(value = { RoleWithHierarchy.SPACE_ETL_SERVER, RoleWithHierarchy.SPACE_POWER_USER }) @Capability("UNASSIGN_SAMPLE_FROM_PROJECT") public void unassignSampleFromProject(IAuthSession session, - @AuthorizationGuard(guardClass = SamplePEPredicate.class) - SamplePE sample); + @AuthorizationGuard(guardClass = SamplePEPredicate.class) SamplePE sample); @Transactional(propagation = Propagation.MANDATORY) @RolesAllowed(value = { RoleWithHierarchy.INSTANCE_ETL_SERVER, RoleWithHierarchy.INSTANCE_ADMIN }) @Capability("UNSHARE_SAMPLE") public void unshareSample(IAuthSession session, - @AuthorizationGuard(guardClass = SamplePEPredicate.class) - SamplePE sample, @AuthorizationGuard(guardClass = SpacePEPredicate.class) - SpacePE space); + @AuthorizationGuard(guardClass = SamplePEPredicate.class) SamplePE sample, + @AuthorizationGuard(guardClass = SpacePEPredicate.class) SpacePE space); @Transactional(propagation = Propagation.MANDATORY) @RolesAllowed(value = { RoleWithHierarchy.SPACE_ETL_SERVER, RoleWithHierarchy.SPACE_POWER_USER }) @Capability("ASSIGN_SAMPLE_TO_SPACE") public void assignSampleToSpace(IAuthSession session, - @AuthorizationGuard(guardClass = SamplePEPredicate.class) - SamplePE sample, @AuthorizationGuard(guardClass = SpacePEPredicate.class) - SpacePE space); + @AuthorizationGuard(guardClass = SamplePEPredicate.class) SamplePE sample, + @AuthorizationGuard(guardClass = SpacePEPredicate.class) SpacePE space); @Transactional(propagation = Propagation.MANDATORY) @RolesAllowed(value = { RoleWithHierarchy.INSTANCE_ETL_SERVER, RoleWithHierarchy.INSTANCE_ADMIN }) @Capability("SHARE_SAMPLE") public void shareSample(IAuthSession session, - @AuthorizationGuard(guardClass = SamplePEPredicate.class) - SamplePE sample); + @AuthorizationGuard(guardClass = SamplePEPredicate.class) SamplePE sample); @Transactional(propagation = Propagation.MANDATORY) @RolesAllowed(value = { RoleWithHierarchy.SPACE_ETL_SERVER, RoleWithHierarchy.SPACE_POWER_USER }) @Capability("ASSIGN_DATASET_TO_EXPERIMENT") public void assignDataSetToExperiment(IAuthSession session, - @AuthorizationGuard(guardClass = DataPEPredicate.class) - DataPE dataSet, @AuthorizationGuard(guardClass = ExperimentPEOrNullPredicate.class) - ExperimentPE experimentOrNull); + @AuthorizationGuard(guardClass = DataPEPredicate.class) DataPE dataSet, + @AuthorizationGuard(guardClass = ExperimentPEOrNullPredicate.class) ExperimentPE experimentOrNull); @Transactional(propagation = Propagation.MANDATORY) @RolesAllowed(value = { RoleWithHierarchy.SPACE_ETL_SERVER, RoleWithHierarchy.SPACE_POWER_USER }) @Capability("ASSIGN_DATASET_TO_SAMPLE") public void assignDataSetToSample(IAuthSession session, - @AuthorizationGuard(guardClass = DataPEPredicate.class) - DataPE dataSet, @AuthorizationGuard(guardClass = SamplePEOrNullPredicate.class) - SamplePE sampleOrNull); + @AuthorizationGuard(guardClass = DataPEPredicate.class) DataPE dataSet, + @AuthorizationGuard(guardClass = SamplePEOrNullPredicate.class) SamplePE sampleOrNull); @Transactional(propagation = Propagation.MANDATORY) @RolesAllowed(value = { RoleWithHierarchy.SPACE_ETL_SERVER, RoleWithHierarchy.SPACE_USER }) @Capability("ADD_PARENT_TO_SAMPLE") public void addParentToSample(IAuthSession session, - @AuthorizationGuard(name = "SAMPLE", guardClass = SamplePEPredicate.class) - SamplePE sample, @AuthorizationGuard(name = "PARENT", guardClass = SamplePEPredicate.class, - rolesAllowed = { RoleWithHierarchy.SPACE_ETL_SERVER, RoleWithHierarchy.SPACE_USER }) - SamplePE parent); + @AuthorizationGuard(name = "SAMPLE", guardClass = SamplePEPredicate.class) SamplePE sample, + @AuthorizationGuard(name = "PARENT", guardClass = SamplePEPredicate.class, + rolesAllowed = { RoleWithHierarchy.SPACE_ETL_SERVER, RoleWithHierarchy.SPACE_USER }) SamplePE parent); @Transactional(propagation = Propagation.MANDATORY) @RolesAllowed(value = { RoleWithHierarchy.SPACE_ETL_SERVER, RoleWithHierarchy.SPACE_POWER_USER }) @Capability("REMOVE_PARENT_FROM_SAMPLE") public void removeParentFromSample(IAuthSession session, - @AuthorizationGuard(name = "SAMPLE", guardClass = SamplePEPredicate.class) - SamplePE sample, @AuthorizationGuard(name = "PARENT", guardClass = SamplePEPredicate.class, - rolesAllowed = { RoleWithHierarchy.SPACE_ETL_SERVER, RoleWithHierarchy.SPACE_USER }) - SamplePE parent); + @AuthorizationGuard(name = "SAMPLE", guardClass = SamplePEPredicate.class) SamplePE sample, + @AuthorizationGuard(name = "PARENT", guardClass = SamplePEPredicate.class, + rolesAllowed = { RoleWithHierarchy.SPACE_ETL_SERVER, RoleWithHierarchy.SPACE_USER }) SamplePE parent); @Transactional(propagation = Propagation.MANDATORY) @RolesAllowed(value = { RoleWithHierarchy.SPACE_ETL_SERVER, RoleWithHierarchy.SPACE_POWER_USER }) @Capability("ADD_CONTAINER_TO_SAMPLE") public void assignSampleToContainer(IAuthSession session, - @AuthorizationGuard(guardClass = SamplePEPredicate.class) - SamplePE sample, @AuthorizationGuard(guardClass = SamplePEPredicate.class) - SamplePE container); + @AuthorizationGuard(guardClass = SamplePEPredicate.class) SamplePE sample, + @AuthorizationGuard(guardClass = SamplePEPredicate.class) SamplePE container); @Transactional(propagation = Propagation.MANDATORY) @RolesAllowed(value = { RoleWithHierarchy.SPACE_ETL_SERVER, RoleWithHierarchy.SPACE_POWER_USER }) @Capability("REMOVE_CONTAINER_FROM_SAMPLE") public void removeSampleFromContainer(IAuthSession session, - @AuthorizationGuard(guardClass = SamplePEPredicate.class) - SamplePE sample); + @AuthorizationGuard(guardClass = SamplePEPredicate.class) SamplePE sample); @Transactional(propagation = Propagation.MANDATORY) @RolesAllowed(value = { RoleWithHierarchy.SPACE_ETL_SERVER, RoleWithHierarchy.SPACE_POWER_USER }) @Capability("ADD_PARENT_TO_DATASET") public void addParentToDataSet(IAuthSession session, - @AuthorizationGuard(guardClass = DataPEPredicate.class) - DataPE data, @AuthorizationGuard(guardClass = DataPEPredicate.class) - DataPE parent); + @AuthorizationGuard(guardClass = DataPEPredicate.class) DataPE data, @AuthorizationGuard(guardClass = DataPEPredicate.class) DataPE parent); @Transactional(propagation = Propagation.MANDATORY) @RolesAllowed(value = { RoleWithHierarchy.SPACE_ETL_SERVER, RoleWithHierarchy.SPACE_POWER_USER }) @Capability("REMOVE_PARENT_FROM_DATASET") public void removeParentFromDataSet(IAuthSession session, - @AuthorizationGuard(guardClass = DataPEPredicate.class) - DataPE data, @AuthorizationGuard(guardClass = DataPEPredicate.class) - DataPE parent); + @AuthorizationGuard(guardClass = DataPEPredicate.class) DataPE data, @AuthorizationGuard(guardClass = DataPEPredicate.class) DataPE parent); @Transactional(propagation = Propagation.MANDATORY) @RolesAllowed(value = { RoleWithHierarchy.SPACE_ETL_SERVER, RoleWithHierarchy.SPACE_POWER_USER }) @Capability("ADD_CONTAINER_TO_DATASET") public void assignDataSetToContainer(IAuthSession session, - @AuthorizationGuard(guardClass = DataPEPredicate.class) - DataPE data, @AuthorizationGuard(guardClass = DataPEPredicate.class) - DataPE container); + @AuthorizationGuard(guardClass = DataPEPredicate.class) DataPE data, + @AuthorizationGuard(guardClass = DataPEPredicate.class) DataPE container); @Transactional(propagation = Propagation.MANDATORY) @RolesAllowed(value = { RoleWithHierarchy.SPACE_ETL_SERVER, RoleWithHierarchy.SPACE_POWER_USER }) @Capability("REMOVE_CONTAINER_FROM_DATASET") public void removeDataSetFromContainer(IAuthSession session, - @AuthorizationGuard(guardClass = DataPEPredicate.class) - DataPE data, @AuthorizationGuard(guardClass = DataPEPredicate.class) - DataPE container); + @AuthorizationGuard(guardClass = DataPEPredicate.class) DataPE data, + @AuthorizationGuard(guardClass = DataPEPredicate.class) DataPE container); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/PropertiesBatchEvaluationErrors.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/PropertiesBatchEvaluationErrors.java index 750ab4ead3c4e05ec019cd42d6f8e48fff4ec653..817cb261ba7634da01753a22cbfb4933bf93aae3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/PropertiesBatchEvaluationErrors.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/PropertiesBatchEvaluationErrors.java @@ -35,8 +35,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.ScriptPE; class PropertiesBatchEvaluationErrors { /** - * limitation on the number of ErrorDetails objects kept in memory. This guards us from scripts - * generating unique error messages for excessively large batches. + * limitation on the number of ErrorDetails objects kept in memory. This guards us from scripts generating unique error messages for excessively + * large batches. */ static final int MAX_ERROR_DETAILS_KEPT = 10; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AbstractMaterialBusinessObject.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AbstractMaterialBusinessObject.java index 0279bbee17f6e11fb5f552843bdf69425916dacd..3a088d4a2282febcc61c663ebd3d3e3eec519e80 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AbstractMaterialBusinessObject.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AbstractMaterialBusinessObject.java @@ -35,8 +35,8 @@ import ch.systemsx.cisd.openbis.generic.shared.managed_property.IManagedProperty public class AbstractMaterialBusinessObject extends AbstractBusinessObject { protected AbstractMaterialBusinessObject(final IDAOFactory daoFactory, final Session session, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService) { super(daoFactory, session, EntityKind.MATERIAL, managedPropertyEvaluatorFactory, dataSetTypeChecker, @@ -45,11 +45,11 @@ public class AbstractMaterialBusinessObject extends AbstractBusinessObject protected AbstractMaterialBusinessObject(final IDAOFactory daoFactory, final Session session, final IEntityPropertiesConverter entityPropertiesConverter, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService) { - super(daoFactory, session, entityPropertiesConverter, managedPropertyEvaluatorFactory, + super(daoFactory, session, entityPropertiesConverter, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); } @@ -59,7 +59,7 @@ public class AbstractMaterialBusinessObject extends AbstractBusinessObject { assert materialId != null : "Material technical id unspecified."; String[] connections = - { PROPERTY_TYPES }; + { PROPERTY_TYPES }; final MaterialPE result = getMaterialDAO().tryGetByTechId(materialId, connections); if (result == null) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AbstractSampleBusinessObject.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AbstractSampleBusinessObject.java index 23379bfe8b5d4041b925d7ac9c9e7d84014bb016..ec1bec1093966e13ffebc1ca7ef2b9ac76b9b2f2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AbstractSampleBusinessObject.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AbstractSampleBusinessObject.java @@ -80,7 +80,7 @@ abstract class AbstractSampleBusinessObject extends AbstractSampleIdentifierBusi AbstractSampleBusinessObject(final IDAOFactory daoFactory, final Session session, IRelationshipService relationshipService, IEntityOperationChecker entityOperationChecker, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, DataSetTypeWithoutExperimentChecker dataSetTypeChecker) { super(daoFactory, session, EntityKind.SAMPLE, managedPropertyEvaluatorFactory, dataSetTypeChecker, @@ -92,10 +92,10 @@ abstract class AbstractSampleBusinessObject extends AbstractSampleIdentifierBusi final IEntityPropertiesConverter entityPropertiesConverter, IRelationshipService relationshipService, IEntityOperationChecker entityOperationChecker, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, DataSetTypeWithoutExperimentChecker dataSetTypeChecker) { - super(daoFactory, session, entityPropertiesConverter, managedPropertyEvaluatorFactory, + super(daoFactory, session, entityPropertiesConverter, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); this.entityOperationChecker = entityOperationChecker; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AbstractSampleIdentifierBusinessObject.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AbstractSampleIdentifierBusinessObject.java index d44a978c18122325120316d4fd604f2bc04b0425..9b9b7183fc489944c2b4566147bb380e396d0eb8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AbstractSampleIdentifierBusinessObject.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AbstractSampleIdentifierBusinessObject.java @@ -48,8 +48,8 @@ abstract class AbstractSampleIdentifierBusinessObject extends AbstractBusinessOb private final SampleOwnerFinder sampleOwnerFinder; AbstractSampleIdentifierBusinessObject(final IDAOFactory daoFactory, final Session session, - EntityKind entityKind, IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + EntityKind entityKind, IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService) { super(daoFactory, session, entityKind, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); @@ -58,8 +58,8 @@ abstract class AbstractSampleIdentifierBusinessObject extends AbstractBusinessOb public AbstractSampleIdentifierBusinessObject(IDAOFactory daoFactory, Session session, IEntityPropertiesConverter converter, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService) { super(daoFactory, session, converter, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AttachmentBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AttachmentBO.java index 47f309101ddd3e7236f0860a001253ea02d16b4b..b945eb5bc08afede0f755940911f81654d9c7b0e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AttachmentBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AttachmentBO.java @@ -43,8 +43,8 @@ public final class AttachmentBO extends AbstractBusinessObject implements IAttac private boolean dataChanged; public AttachmentBO(final IDAOFactory daoFactory, final Session session, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService) { super(daoFactory, session, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AuthorizationGroupBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AuthorizationGroupBO.java index d4b506f2c7209f3b5fa2e913f8771e4055c3fd0f..c4619477454fe41cb2aafd4a1adee897e362359d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AuthorizationGroupBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/AuthorizationGroupBO.java @@ -57,8 +57,8 @@ public class AuthorizationGroupBO extends AbstractBusinessObject implements IAut @Private AuthorizationGroupBO(IDAOFactory daoFactory, Session session, IAuthorizationGroupFactory factory, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService) { super(daoFactory, session, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); @@ -66,11 +66,11 @@ public class AuthorizationGroupBO extends AbstractBusinessObject implements IAut } public AuthorizationGroupBO(IDAOFactory daoFactory, Session session, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService) { - this(daoFactory, session, new AuthorizationGroupFactory(), managedPropertyEvaluatorFactory, + this(daoFactory, session, new AuthorizationGroupFactory(), managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/CorePluginTable.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/CorePluginTable.java index ac1ef379b560a25e90c0b54afd2033fd3c7f5b6f..90f98997e63d5e579f691e45d0be1d01244f4b85 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/CorePluginTable.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/CorePluginTable.java @@ -52,8 +52,8 @@ public final class CorePluginTable extends AbstractBusinessObject implements ICo public CorePluginTable(IDAOFactory daoFactory, Session session, IMasterDataScriptRegistrationRunner masterDataScriptRunner, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService) { super(daoFactory, session, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataAccessExceptionTranslator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataAccessExceptionTranslator.java index 035eff2b4e8a1de2c1ad97c22ea9eaa602911e8a..09190c75d142810ab74e428fad17a8330630d685 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataAccessExceptionTranslator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataAccessExceptionTranslator.java @@ -26,16 +26,14 @@ import ch.systemsx.cisd.common.exceptions.UserFailureException; import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind; /** - * This class converts the low-level {@link DataAccessException} into a high-level exception - * {@link UserFailureException}. + * This class converts the low-level {@link DataAccessException} into a high-level exception {@link UserFailureException}. * <p> - * This class can only be used on the business layer side as, only there, we dispose of enough - * information to decide whether or not a <code>DataAccessException</code> should be translated into - * an high-level exception. + * This class can only be used on the business layer side as, only there, we dispose of enough information to decide whether or not a + * <code>DataAccessException</code> should be translated into an high-level exception. * </p> * <p> - * Do not try to put this logic on the <i>DAO</i> level or do not try to automate this conversion as - * we want full control on this translation and we prefer to call it manually. + * Do not try to put this logic on the <i>DAO</i> level or do not try to automate this conversion as we want full control on this translation and we + * prefer to call it manually. * </p> * * @author Tomasz Pylak @@ -61,17 +59,14 @@ public final class DataAccessExceptionTranslator } /** - * Analyzes given <code>DataAccessException</code> and converts it into a - * <code>UserFailureException</code>. + * Analyzes given <code>DataAccessException</code> and converts it into a <code>UserFailureException</code>. * <p> - * This method is typically used by <i>creator</i> methods (methods which inserts a new object - * into the database) and <i>deletion</i> methods. + * This method is typically used by <i>creator</i> methods (methods which inserts a new object into the database) and <i>deletion</i> methods. * </p> * - * @param subject short description of the object that got blessed by the unique/foreign key - * violation constraint. - * @param entityKindOrNull entity kind of the subject object (if specified can make the error - * message more detailed especially for foreign key violation upon deletion) + * @param subject short description of the object that got blessed by the unique/foreign key violation constraint. + * @param entityKindOrNull entity kind of the subject object (if specified can make the error message more detailed especially for foreign key + * violation upon deletion) */ public final static void throwException(final DataAccessException exception, final String subject, final EntityKind entityKindOrNull) throws UserFailureException diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataSetTable.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataSetTable.java index d7a8f5569a025eebcf5f6d756c4f29d923ac2d05..ee90b77299d22450239763056f80aba43c6dcf01 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataSetTable.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataSetTable.java @@ -1128,11 +1128,11 @@ public final class DataSetTable extends AbstractDataSetBusinessObject implements updateSample(dataSet, sampleIdentifierOrNull); } else { - updateExperiment(dataSet,dataSetUpdates.getExperimentIdentifierOrNull()); + updateExperiment(dataSet, dataSetUpdates.getExperimentIdentifierOrNull()); } } else if (details.isExperimentUpdateRequested() && dataSetUpdates.getExperimentIdentifierOrNull() != null) { - updateExperiment(dataSet,dataSetUpdates.getExperimentIdentifierOrNull()); + updateExperiment(dataSet, dataSetUpdates.getExperimentIdentifierOrNull()); } if (details.isContainerUpdateRequested()) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DeletionTable.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DeletionTable.java index 21241e86d28d86e488dd14d00ea0833033f30830..1ec091f47f2e4587e8505e5aeb4ec3ac31ee40a1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DeletionTable.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DeletionTable.java @@ -44,8 +44,8 @@ public class DeletionTable extends AbstractBusinessObject implements IDeletionTa private List<Deletion> deletions; public DeletionTable(IDAOFactory daoFactory, Session session, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService) { super(daoFactory, session, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/EntityCodeGenerator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/EntityCodeGenerator.java index a1922fffe93807db3c09b32dc2478c0c04d9cb4d..9a206c8ad572ae20386e62afb7941e94b6353e55 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/EntityCodeGenerator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/EntityCodeGenerator.java @@ -27,11 +27,9 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.dto.TableNames; /** - * Generates unique codes for openBIS entities. It uses database sequences as a base for the code - * generation. Moreover it verifies that the generated codes are in fact unique (i.e. entities with - * such codes do not exist yet). If it finds that the new generated code is already used by an - * existing entity (e.g. the entity code was manually entered by a user) then it regenerates the - * code until it is unique. + * Generates unique codes for openBIS entities. It uses database sequences as a base for the code generation. Moreover it verifies that the generated + * codes are in fact unique (i.e. entities with such codes do not exist yet). If it finds that the new generated code is already used by an existing + * entity (e.g. the entity code was manually entered by a user) then it regenerates the code until it is unique. * * @author pkupczyk */ @@ -74,10 +72,8 @@ public class EntityCodeGenerator /** * Generate unique codes for openBIS entities. * - * @param codePrefix Prefix for the generated codes (e.g. when "ABC-" then codes will be - * "ABC-1", "ABC-2", ...) - * @param entityKind Kind of an entity the codes should be generated for (different kinds of - * entities use different database sequences). + * @param codePrefix Prefix for the generated codes (e.g. when "ABC-" then codes will be "ABC-1", "ABC-2", ...) + * @param entityKind Kind of an entity the codes should be generated for (different kinds of entities use different database sequences). * @param numberOfCodes Number of codes to be generated. */ public List<String> generateCodes(String codePrefix, EntityKind entityKind, int numberOfCodes) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/EntityTypeBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/EntityTypeBO.java index 46f6920bb1fba3d99677394e95198d67845bd35a..8cf51ac30e132f9fa31d82b6328680bf821ae30b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/EntityTypeBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/EntityTypeBO.java @@ -69,8 +69,8 @@ public final class EntityTypeBO extends AbstractBusinessObject implements IEntit private EntityKind entityKind; public EntityTypeBO(final IDAOFactory daoFactory, final Session session, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService) { super(daoFactory, session, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/EntityTypePropertyTypeBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/EntityTypePropertyTypeBO.java index f7f6c9b826d4e3f22fa3eec24ccfa4078950121c..bf9d8b1c03d767f03854d53e773d4a3911dec317 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/EntityTypePropertyTypeBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/EntityTypePropertyTypeBO.java @@ -65,8 +65,8 @@ public class EntityTypePropertyTypeBO extends AbstractBusinessObject implements @Private EntityTypePropertyTypeBO(IDAOFactory daoFactory, Session session, EntityKind entityKind, IEntityPropertiesConverter converter, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService) { super(daoFactory, session, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); @@ -75,8 +75,8 @@ public class EntityTypePropertyTypeBO extends AbstractBusinessObject implements } public EntityTypePropertyTypeBO(IDAOFactory daoFactory, Session session, EntityKind entityKind, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService) { super(daoFactory, session, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ExperimentBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ExperimentBO.java index fdf638d1d3d0285768eba06f2d766a02dd03f57d..1b2e59b213be2abf23f15ad8c83499900a4b64b5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ExperimentBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ExperimentBO.java @@ -89,20 +89,20 @@ public final class ExperimentBO extends AbstractBusinessObject implements IExper public ExperimentBO(final IDAOFactory daoFactory, final Session session, IRelationshipService relationshipService, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, DataSetTypeWithoutExperimentChecker dataSetTypeChecker) { - super(daoFactory, session, EntityKind.EXPERIMENT, managedPropertyEvaluatorFactory, + super(daoFactory, session, EntityKind.EXPERIMENT, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); } ExperimentBO(final IDAOFactory daoFactory, final Session session, final IEntityPropertiesConverter entityPropertiesConverter, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService) { - super(daoFactory, session, entityPropertiesConverter, managedPropertyEvaluatorFactory, + super(daoFactory, session, entityPropertiesConverter, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ExperimentTable.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ExperimentTable.java index c279e73cb21c3ef131a436f25efc479124fb07bb..2b13d09a881cf0f70a12f680398fb0d623516cb5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ExperimentTable.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ExperimentTable.java @@ -70,8 +70,8 @@ public final class ExperimentTable extends AbstractBusinessObject implements IEx ExperimentTable(final IDAOFactory daoFactory, final Session session, IEntityPropertiesConverter converter, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService) { super(daoFactory, session, converter, managedPropertyEvaluatorFactory, dataSetTypeChecker, @@ -80,10 +80,10 @@ public final class ExperimentTable extends AbstractBusinessObject implements IEx public ExperimentTable(final IDAOFactory daoFactory, final Session session, IRelationshipService relationshipService, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, DataSetTypeWithoutExperimentChecker dataSetTypeChecker) { - super(daoFactory, session, EntityKind.EXPERIMENT, managedPropertyEvaluatorFactory, + super(daoFactory, session, EntityKind.EXPERIMENT, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/GridCustomColumnBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/GridCustomColumnBO.java index 6a6a7fff63a6fb93a26796ed685219da95e7ee56..efb3b99650afd64fd3c41a7fd459325aecca5e2f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/GridCustomColumnBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/GridCustomColumnBO.java @@ -47,8 +47,8 @@ public class GridCustomColumnBO extends AbstractBusinessObject implements private GridCustomColumnPE column; public GridCustomColumnBO(IDAOFactory daoFactory, Session session, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService) { super(daoFactory, session, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/GridCustomFilterBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/GridCustomFilterBO.java index c33dc966d9bea7692c3ef909f7ee93ad73abf10f..9198cd8b55c38460639d16554c3d132c7acc6949 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/GridCustomFilterBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/GridCustomFilterBO.java @@ -41,8 +41,8 @@ public class GridCustomFilterBO extends AbstractBusinessObject implements private GridCustomFilterPE filter; public GridCustomFilterBO(IDAOFactory daoFactory, Session session, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService) { super(daoFactory, session, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IAttachmentBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IAttachmentBO.java index bd076e0d6248c2c3025d359261fe65a5bd27c176..a9e3fd0c8dddccd8bfb633c654e7c705499095b8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IAttachmentBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IAttachmentBO.java @@ -30,11 +30,10 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.AttachmentHolderPE; public interface IAttachmentBO { /** - * Deletes specified {@link AttachmentHolderPE} attachments (all versions with given file names) - * for specified reason. + * Deletes specified {@link AttachmentHolderPE} attachments (all versions with given file names) for specified reason. * - * @param fileNames list of file names of attachments to be deleted (there will be no error if - * there are no attachments with these file names attached to specified holder) + * @param fileNames list of file names of attachments to be deleted (there will be no error if there are no attachments with these file names + * attached to specified holder) * @throws UserFailureException if holder with given technical identifier is not found. */ void deleteHolderAttachments(final AttachmentHolderPE holder, final List<String> fileNames, diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IAuthorizationGroupBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IAuthorizationGroupBO.java index 1a857e8b31927d36f20bf432a95f5d1e1e5f4019..a36e6818820e0cdfd6f9720f507248e3fd64039f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IAuthorizationGroupBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IAuthorizationGroupBO.java @@ -32,17 +32,15 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.AuthorizationGroupPE; public interface IAuthorizationGroupBO extends IBusinessObject { /** - * Defines a authorization group. After invocation of this method - * {@link IAuthorizationGroupBO#save()} should be invoked to store the new authorization group - * in the Data Access Layer. + * Defines a authorization group. After invocation of this method {@link IAuthorizationGroupBO#save()} should be invoked to store the new + * authorization group in the Data Access Layer. */ void define(final NewAuthorizationGroup newAuthorizationGroup) throws UserFailureException; /** * Deletes the authorization group. * - * @throws UserFailureException if authorization group with given technical identifier is not - * found. + * @throws UserFailureException if authorization group with given technical identifier is not found. */ public void deleteByTechId(TechId authGroupId, String reason); @@ -57,14 +55,12 @@ public interface IAuthorizationGroupBO extends IBusinessObject public AuthorizationGroupPE getAuthorizationGroup(); /** - * Loads authorization group with given technical id or throws exception if no such group - * exists. + * Loads authorization group with given technical id or throws exception if no such group exists. */ public void loadByTechId(TechId authorizatonGroupId); /** - * Adds persons with given codes to the loaded authorization group. Returns a list of users - * codes not registered in the system. + * Adds persons with given codes to the loaded authorization group. Returns a list of users codes not registered in the system. */ public List<String> addPersons(List<String> personsCodes); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IBusinessObject.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IBusinessObject.java index 4f891dd32eabfe34a1eb0e16d71d2948882b2f53..d5978062ffad9bddfa4691ff7ecf22aa13556ae4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IBusinessObject.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IBusinessObject.java @@ -21,15 +21,14 @@ import ch.systemsx.cisd.common.exceptions.UserFailureException; /** * Common method(s) all Business Objects and Tables have to implement. * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ public interface IBusinessObject { /** * Writes changed or added data to the Data Access Layers. * - * @throws UnsupportedOperationException if saving isn't supported because it is a read-only - * object. + * @throws UnsupportedOperationException if saving isn't supported because it is a read-only object. */ public void save() throws UserFailureException; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ICommonBusinessObjectFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ICommonBusinessObjectFactory.java index 5d15adaa6fa19543ae18eb7591cec0c0f81d6124..d092f65a723003248e00d0bc9d49ab1ee248e1ae 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ICommonBusinessObjectFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ICommonBusinessObjectFactory.java @@ -24,8 +24,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.Session; import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind; /** - * The <i>generic</i> specific <i>Business Object</i> factory. Each method creates one kind of a - * business object. + * The <i>generic</i> specific <i>Business Object</i> factory. Each method creates one kind of a business object. * * @author Tomasz Pylak */ @@ -46,7 +45,7 @@ public interface ICommonBusinessObjectFactory extends IAbstractBussinessObjectFa public IDataBO createDataBO(Session session); public IDataSetTable createDataSetTable(final Session session); - + public ISearchDomainSearcher createSearchDomainSearcher(Session session); public IDeletedDataSetTable createDeletedDataSetTable(final Session session); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ICorePluginTable.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ICorePluginTable.java index 7f617539d4d7afb36b03137ecca03b10ffff139d..311e72eb78d1a8e7f0bcb1719f04b601e5723cd3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ICorePluginTable.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ICorePluginTable.java @@ -32,8 +32,7 @@ public interface ICorePluginTable List<CorePlugin> listCorePluginsByName(String name); /** - * Registers a core plugin. The operation has no effect if the plugin has already been deployed - * on the openBIS AS. + * Registers a core plugin. The operation has no effect if the plugin has already been deployed on the openBIS AS. */ public void registerPlugin(CorePlugin plugin, ICorePluginResourceLoader resourceLoader); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IEntityTypeBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IEntityTypeBO.java index 4d3896e8da55dfb52f01d0d60d1d181b600f3176..3830cd1740401c68476aa086bb847866e79f2d55 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IEntityTypeBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IEntityTypeBO.java @@ -24,8 +24,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.EntityTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind; /** - * Operations on {@link EntityTypePE} extensions. Note that you can use only one <em>define</em> - * method at a time. + * Operations on {@link EntityTypePE} extensions. Note that you can use only one <em>define</em> method at a time. * * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IEntityTypePropertyTypeBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IEntityTypePropertyTypeBO.java index 4be23daee68f65b54164742a0ff36226780c7cfa..2628662fbbcc1fe6779a0fb4c7deca9a318341aa 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IEntityTypePropertyTypeBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IEntityTypePropertyTypeBO.java @@ -38,8 +38,7 @@ public interface IEntityTypePropertyTypeBO void loadAssignment(String propertyTypeCode, String entityTypeCode); /** - * Returns number of property values used by entities for assignment between specified property - * type and entity type. + * Returns number of property values used by entities for assignment between specified property type and entity type. */ int countAssignmentValues(String propertyTypeCode, String entityTypeCode); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IExternalDataTable.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IExternalDataTable.java index 75f948aa917f563c3b78e68ff586d3ace9cd0af2..9b6884a60625ea19b7847784833b304678711743 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IExternalDataTable.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IExternalDataTable.java @@ -36,11 +36,9 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE; public interface IExternalDataTable { /** - * Loads data sets specified by their codes. Data set codes will be ignored if no - * {@link ExternalDataPE} could be found. Properties will be loaded too depending on - * <var>withProperties</var> value. Optionally if <var>lockForUpdate</var> is <var>true</var> - * all updates to loaded data sets from other transactions will be blocked until current - * transaction is finished. + * Loads data sets specified by their codes. Data set codes will be ignored if no {@link ExternalDataPE} could be found. Properties will be loaded + * too depending on <var>withProperties</var> value. Optionally if <var>lockForUpdate</var> is <var>true</var> all updates to loaded data sets + * from other transactions will be blocked until current transaction is finished. */ void loadByDataSetCodes(List<String> dataSetCodes, boolean withProperties, boolean lockForUpdate); @@ -77,11 +75,10 @@ public interface IExternalDataTable String uploadLoadedDataSetsToCIFEX(DataSetUploadContext uploadContext); /** - * Schedules archiving of loaded data sets. Only available data sets that are not locked will be - * archived. + * Schedules archiving of loaded data sets. Only available data sets that are not locked will be archived. * - * @param removeFromDataStore when set to <code>true</code> the data sets will be removed from - * the data store after a successful archiving operation. + * @param removeFromDataStore when set to <code>true</code> the data sets will be removed from the data store after a successful archiving + * operation. * @return number of data sets scheduled for archiving. */ int archiveDatasets(boolean removeFromDataStore); @@ -112,8 +109,7 @@ public interface IExternalDataTable List<String> datasetCodes); /** - * Schedules processing of specified datasets with specified parameter bindings using the - * specified datastore service. + * Schedules processing of specified datasets with specified parameter bindings using the specified datastore service. * * @param parameterBindings Should be a map where additional entries can be added. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IGridCustomFilterOrColumnBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IGridCustomFilterOrColumnBO.java index e88c28b9a5c66bb0cc70af78dcb753a1db4af38f..e1be193dd8e3f51add7e55811bd69f1cc69e3690 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IGridCustomFilterOrColumnBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IGridCustomFilterOrColumnBO.java @@ -31,9 +31,8 @@ public interface IGridCustomFilterOrColumnBO extends IEntityBusinessObject { /** - * Defines a new grid custom filter or column. After invocation of this method - * {@link IBusinessObject#save()} should be invoked to store the new group in the <i>Data Access - * Layer</i>. + * Defines a new grid custom filter or column. After invocation of this method {@link IBusinessObject#save()} should be invoked to store the new + * group in the <i>Data Access Layer</i>. */ public void define(NewColumnOrFilter filterOrColumn) throws UserFailureException; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IPropertyTypeBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IPropertyTypeBO.java index 70459793e518d55ba4078f10da3957a9bf3ff9aa..702b19069290d90530c2ade83332fc2d23066634 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IPropertyTypeBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IPropertyTypeBO.java @@ -33,8 +33,8 @@ public interface IPropertyTypeBO extends IBusinessObject /** * Defines a new property type. * <p> - * After invocation of this method {@link IBusinessObject#save()} should be invoked to store the - * new property type in the <i>Data Access Layer</i>. + * After invocation of this method {@link IBusinessObject#save()} should be invoked to store the new property type in the <i>Data Access + * Layer</i>. * </p> * * @throws UserFailureException if <var>propertyType</var> does already exist. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ISampleTable.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ISampleTable.java index dc09b130df053306c5c2b134eb60dbcd36f14d93..b3ca6abbebe01d5bf4c8c31e071a2e497a6f49e9 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ISampleTable.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ISampleTable.java @@ -36,8 +36,7 @@ public interface ISampleTable { /** - * Lists samples filtered by specified criteria, see {@link ListSamplesByPropertyCriteria} to - * see the details. + * Lists samples filtered by specified criteria, see {@link ListSamplesByPropertyCriteria} to see the details. */ void loadSamplesByCriteria(final ListSamplesByPropertyCriteria criteria); @@ -53,9 +52,8 @@ public interface ISampleTable throws UserFailureException; /** - * This method should be invoked before a series of prepareForUpdateXXX() method calls. It - * checks the data before the update can be started. For instance, it verifies versions of - * objects for Optimistic Locking. + * This method should be invoked before a series of prepareForUpdateXXX() method calls. It checks the data before the update can be started. For + * instance, it verifies versions of objects for Optimistic Locking. */ public void checkBeforeUpdate(List<SampleUpdatesDTO> updates) throws UserFailureException; @@ -67,10 +65,9 @@ public interface ISampleTable public void prepareForUpdate(List<SampleBatchUpdatesDTO> updates) throws UserFailureException; /** - * Comparable to {@link #prepareForUpdate(List)} but takes a {@link SampleUpdatesDTO} object - * instead of a {@link SampleBatchUpdatesDTO} object. Whereas prepareForUpdate only changes the - * fields requested in the updates' details object, this method changes the samples to match the - * updates object. + * Comparable to {@link #prepareForUpdate(List)} but takes a {@link SampleUpdatesDTO} object instead of a {@link SampleBatchUpdatesDTO} object. + * Whereas prepareForUpdate only changes the fields requested in the updates' details object, this method changes the samples to match the updates + * object. */ void prepareForUpdateWithSampleUpdates(List<SampleUpdatesDTO> updates) throws UserFailureException; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ISearchDomainSearcher.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ISearchDomainSearcher.java index d880533b630c72803529af0335700ae814289fa9..fd43a14b9a52352f8556e73d51286a3ca8ce786e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ISearchDomainSearcher.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ISearchDomainSearcher.java @@ -39,6 +39,5 @@ public interface ISearchDomainSearcher */ List<SearchDomainSearchResultWithFullEntity> searchForEntitiesWithSequences(String preferredSearchDomainOrNull, String sequenceSnippet, Map<String, String> optionalParametersOrNull); - } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ISpaceBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ISpaceBO.java index e7c3957fe0da5cfa082a7d8a217fa0684d14199d..a39a49748049435477125e496165336bb28c2aa3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ISpaceBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ISpaceBO.java @@ -31,9 +31,8 @@ public interface ISpaceBO extends IEntityBusinessObject { /** - * Defines a new space of specified code for the home database instance. After invocation of - * this method {@link IBusinessObject#save()} should be invoked to store the new group in the - * <i>Data Access Layer</i>. + * Defines a new space of specified code for the home database instance. After invocation of this method {@link IBusinessObject#save()} should be + * invoked to store the new group in the <i>Data Access Layer</i>. * * @throws UserFailureException if <code>group</code> does already exist. */ @@ -42,8 +41,7 @@ public interface ISpaceBO extends IEntityBusinessObject /** * Loads a space described by identifier from Database Layer. * - * @throws UserFailureException if <code>groupIdentifier</code> does not describe existing - * group. + * @throws UserFailureException if <code>groupIdentifier</code> does not describe existing group. */ public void load(SpaceIdentifier spaceIdentifier) throws UserFailureException; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/MaterialBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/MaterialBO.java index d36803d002b8d8269824cedee75fa1a08b6c2ddf..a08e55b94ab67f1071f0eee7a1235f812f716575 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/MaterialBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/MaterialBO.java @@ -178,8 +178,8 @@ public final class MaterialBO extends AbstractMaterialBusinessObject implements { List<Long> idsToDelete = Collections.singletonList(material.getId()); String content = historyCreator.apply(getSessionFactory().getCurrentSession(), idsToDelete, - MaterialDAO.sqlPropertyHistory, null, MaterialDAO.sqlAttributesHistory, null, - null, session.tryGetPerson()); + MaterialDAO.sqlPropertyHistory, null, MaterialDAO.sqlAttributesHistory, null, + null, session.tryGetPerson()); getMaterialDAO().delete(material); getEventDAO().persist(createDeletionEvent(material, session.tryGetPerson(), reason, content)); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/MaterialTable.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/MaterialTable.java index 4dd9f49fd23bf7601481a3fc518ac4a2e89688dd..966616efb50444b715e029c5a7060ab2cdcf0e6f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/MaterialTable.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/MaterialTable.java @@ -59,8 +59,8 @@ public final class MaterialTable extends AbstractMaterialBusinessObject implemen private boolean dataChanged; public MaterialTable(final IDAOFactory daoFactory, final Session session, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService) { super(daoFactory, session, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); @@ -70,11 +70,11 @@ public final class MaterialTable extends AbstractMaterialBusinessObject implemen // for tests only MaterialTable(final IDAOFactory daoFactory, final Session session, final IEntityPropertiesConverter entityPropertiesConverter, List<MaterialPE> materials, - boolean dataChanged, IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + boolean dataChanged, IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService) { - super(daoFactory, session, entityPropertiesConverter, managedPropertyEvaluatorFactory, + super(daoFactory, session, entityPropertiesConverter, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); this.materials = materials; this.dataChanged = dataChanged; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/MetaprojectBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/MetaprojectBO.java index a7da2747e5ec373b77d5ca3d33aeb2644c010406..24ef0a5e1068d1ae1f53519115ffdd60bf3c62b2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/MetaprojectBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/MetaprojectBO.java @@ -83,8 +83,8 @@ public class MetaprojectBO extends AbstractBusinessObject implements IMetaprojec public MetaprojectBO(final IDAOFactory daoFactory, IExperimentBO experimentBO, ISampleBO sampleBO, IDataBO dataBO, IMaterialBO materialBO, final Session session, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService) { super(daoFactory, session, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/NextExceptionFallbackExceptionTranslator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/NextExceptionFallbackExceptionTranslator.java index 55cad85849fec631ae866255e0a4f8aa0be5c496..e4eff0faedf374afada2c09a7cde1baf8da2d79f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/NextExceptionFallbackExceptionTranslator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/NextExceptionFallbackExceptionTranslator.java @@ -21,8 +21,7 @@ import java.sql.SQLException; import org.springframework.jdbc.support.SQLStateSQLExceptionTranslator; /** - * A translator that takes into includes the message from the next exception in the chain as this - * often has the real cause. + * A translator that takes into includes the message from the next exception in the chain as this often has the real cause. * * @author Bernd Rinn */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ProjectBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ProjectBO.java index d8cb2b41e91456b3b956a12cd96a69adaa9bebd8..183c65a95c9028bf5e31ae947184241fee7dc383 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ProjectBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ProjectBO.java @@ -350,7 +350,7 @@ public final class ProjectBO extends AbstractBusinessObject implements IProjectB private static final String propertyHistoryQuery = "SELECT 1 as a, 1 as b, 1 as c, 1 as d, 1 as e, 1 as f, 1 as g, 1 as h, 1 as i FROM materials WHERE id = -1 and id IN (:entityIds)"; - + private static final String ENTITY_TYPE = "case " + "when h.space_id is not null then 'SPACE' " + "when h.expe_id is not null then 'EXPERIMENT' " @@ -408,8 +408,8 @@ public final class ProjectBO extends AbstractBusinessObject implements IProjectB { List<Long> idsToDelete = Collections.singletonList(projectId.getId()); String content = historyCreator.apply(getSessionFactory().getCurrentSession(), idsToDelete, - propertyHistoryQuery, relationshipHistoryQuery, sqlAttributesHistory, - Arrays.asList(project), null, session.tryGetPerson()); + propertyHistoryQuery, relationshipHistoryQuery, sqlAttributesHistory, + Arrays.asList(project), null, session.tryGetPerson()); getProjectDAO().delete(project); getEventDAO().persist(createDeletionEvent(project, session.tryGetPerson(), reason, content)); } else diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/PropertyTypeBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/PropertyTypeBO.java index 3ff528e66d8e16f2e8387acb81fbd178df570a12..2aa6d30377cab3286ae8d39ec81dd193a4630511 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/PropertyTypeBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/PropertyTypeBO.java @@ -63,8 +63,8 @@ public final class PropertyTypeBO extends VocabularyBO implements IPropertyTypeB private PropertyTypePE propertyTypePE; public PropertyTypeBO(final IDAOFactory daoFactory, final Session session, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService) { super(daoFactory, session, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/PropertyTypeTable.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/PropertyTypeTable.java index 09116c3ead3f784f5819be3eb0bedb80adc9cd7f..1626d9d4369d014e813693e2b0478a489d8fe682 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/PropertyTypeTable.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/PropertyTypeTable.java @@ -36,8 +36,8 @@ public final class PropertyTypeTable extends AbstractBusinessObject implements I private List<PropertyTypePE> propertyTypes; public PropertyTypeTable(final IDAOFactory daoFactory, final Session session, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService) { super(daoFactory, session, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/RootEntitiesFinder.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/RootEntitiesFinder.java index 3ca8ace59cffcdced3b701987a5499ed6732a537..cd14721dc500ce2b7455912424862d08eaa5c2df 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/RootEntitiesFinder.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/RootEntitiesFinder.java @@ -32,8 +32,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.IDeletablePE; import ch.systemsx.cisd.openbis.generic.shared.translator.DeletedEntityTranslator; /** - * Helper class for finding the root entities of entities belonging to the same deletion event. It - * is assumed that experiments are added before samples which are added before data sets. + * Helper class for finding the root entities of entities belonging to the same deletion event. It is assumed that experiments are added before + * samples which are added before data sets. * * @author Franz-Josef Elmer * @author Kaloyan Enimanev diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleBO.java index 812c5889ec28c6ad815f8ac3cc33a89b7a05602e..c008c9b0a644a3bc8910acd7e88836da45097e00 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleBO.java @@ -69,7 +69,7 @@ public final class SampleBO extends AbstractSampleBusinessObject implements ISam public SampleBO(final IDAOFactory daoFactory, final Session session, final IRelationshipService relationshipService, final IEntityOperationChecker entityOperationChecker, - final IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + final IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, DataSetTypeWithoutExperimentChecker dataSetTypeChecker) { super(daoFactory, session, relationshipService, entityOperationChecker, @@ -80,7 +80,7 @@ public final class SampleBO extends AbstractSampleBusinessObject implements ISam final IEntityPropertiesConverter entityPropertiesConverter, IRelationshipService relationshipService, final IEntityOperationChecker entityOperationChecker, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, DataSetTypeWithoutExperimentChecker dataSetTypeChecker) { super(daoFactory, session, entityPropertiesConverter, relationshipService, diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleCodeGeneratorByType.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleCodeGeneratorByType.java index 5e4b2333b99a5069906b639bce78e0bccdd53a54..405afeae6277253a838b63c8e5dbce31ea820cdd 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleCodeGeneratorByType.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleCodeGeneratorByType.java @@ -42,7 +42,7 @@ public class SampleCodeGeneratorByType extends EntityCodeGenerator super(daoFactory); this.maxQuery = QueryTool.getManagedQuery(MaxQuery.class); } - + @Override public List<String> generateCodes(String codePrefix, EntityKind entityKind, int numberOfCodes) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ScriptBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ScriptBO.java index 673240c8689f98110d5851134572e5ca592ca9be..dc638865bf85cbf3170f35cb543d846560c42998 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ScriptBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ScriptBO.java @@ -55,8 +55,8 @@ public final class ScriptBO extends AbstractBusinessObject implements IScriptBO private final IJythonEvaluatorPool jythonEvaluatorPool; public ScriptBO(final IDAOFactory daoFactory, final Session session, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService, IJythonEvaluatorPool jythonEvaluationPool) { @@ -67,8 +67,8 @@ public final class ScriptBO extends AbstractBusinessObject implements IScriptBO @Private // for testing ScriptBO(final IDAOFactory daoFactory, final Session session, IScriptFactory scriptFactory, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService, IJythonEvaluatorPool jythonEvaluationPool) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SearchDomainSearcher.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SearchDomainSearcher.java index 407d048098e658ef858d6928a24b7b7d1176ae1e..a3713888f06f8b6bf89c361a8922f60d58f7e4bc 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SearchDomainSearcher.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SearchDomainSearcher.java @@ -52,13 +52,11 @@ import ch.systemsx.cisd.openbis.generic.shared.translator.ExperimentTranslator; import ch.systemsx.cisd.openbis.generic.shared.translator.SampleTranslator; /** - * - * * @author Franz-Josef Elmer */ public class SearchDomainSearcher extends AbstractBusinessObject implements ISearchDomainSearcher { - private static final Map<Long, Set<Metaproject>> EMPTY_METAPROJECTS = Collections.<Long, Set<Metaproject>>emptyMap(); + private static final Map<Long, Set<Metaproject>> EMPTY_METAPROJECTS = Collections.<Long, Set<Metaproject>> emptyMap(); private static final IKeyExtractor<String, IEntityInformationHolderWithPermId> PERM_ID_EXTRACTOR = new IKeyExtractor<String, IEntityInformationHolderWithPermId>() @@ -72,9 +70,9 @@ public class SearchDomainSearcher extends AbstractBusinessObject implements ISea private final IDataStoreServiceFactory dssFactory; - public SearchDomainSearcher(IDAOFactory daoFactory, Session session, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService, + public SearchDomainSearcher(IDAOFactory daoFactory, Session session, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService, IDataStoreServiceFactory dssFactory) { super(daoFactory, session, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); @@ -98,11 +96,10 @@ public class SearchDomainSearcher extends AbstractBusinessObject implements ISea } @Override - public List<SearchDomainSearchResultWithFullEntity> searchForEntitiesWithSequences(String preferredSearchDomainOrNull, + public List<SearchDomainSearchResultWithFullEntity> searchForEntitiesWithSequences(String preferredSearchDomainOrNull, String sequenceSnippet, Map<String, String> optionalParametersOrNull) { - List<SearchDomainSearchResult> searchResults - = askAllDataStoreServers(preferredSearchDomainOrNull, sequenceSnippet, optionalParametersOrNull); + List<SearchDomainSearchResult> searchResults = askAllDataStoreServers(preferredSearchDomainOrNull, sequenceSnippet, optionalParametersOrNull); return enrichWithEntities(searchResults); } @@ -179,8 +176,7 @@ public class SearchDomainSearcher extends AbstractBusinessObject implements ISea { EntityLoader loader = entry.getKey(); List<String> permIds = entry.getValue(); - List<IEntityInformationHolderWithPermId> entities - = loader.loadEntities(this, managedPropertyEvaluatorFactory, permIds); + List<IEntityInformationHolderWithPermId> entities = loader.loadEntities(this, managedPropertyEvaluatorFactory, permIds); result.put(loader, new TableMap<String, IEntityInformationHolderWithPermId>(entities, PERM_ID_EXTRACTOR)); } return result; @@ -273,7 +269,7 @@ public class SearchDomainSearcher extends AbstractBusinessObject implements ISea { return permId; } - + } - + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/TrashBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/TrashBO.java index fd7ee1c61e956b23dc3b812523f76b3837226858..7e3a0d357d836fa6b24aa31ebe3e0ced5af4f194 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/TrashBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/TrashBO.java @@ -79,8 +79,7 @@ import ch.systemsx.cisd.openbis.generic.shared.util.RelationshipUtils; */ public class TrashBO extends AbstractBusinessObject implements ITrashBO { - static final EnumSet<DataSetFetchOption> DATA_SET_FETCH_OPTIONS - = EnumSet.of(DataSetFetchOption.EXPERIMENT, DataSetFetchOption.SAMPLE); + static final EnumSet<DataSetFetchOption> DATA_SET_FETCH_OPTIONS = EnumSet.of(DataSetFetchOption.EXPERIMENT, DataSetFetchOption.SAMPLE); private enum CascadeSampleDependentComponents { @@ -92,8 +91,8 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO private DeletionPE deletion; public TrashBO(IDAOFactory daoFactory, ICommonBusinessObjectFactory boFactory, Session session, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService) { super(daoFactory, session, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); @@ -125,7 +124,7 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO public void trashDataSets(List<TechId> dataSetIds) { assert deletion != null; - + IDatasetLister datasetLister = boFactory.createDatasetLister(session); final Set<TechId> experimentIds = new HashSet<TechId>(); final Set<TechId> sampleIds = new HashSet<TechId>(); @@ -135,7 +134,7 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO if (sample != null) { sampleIds.add(new TechId(sample)); - } + } if (dataSet.getExperiment() != null) { experimentIds.add(new TechId(dataSet.getExperiment())); @@ -160,7 +159,7 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO } return filtered; } - + private boolean contains(Set<TechId> ids, IIdAndCodeHolder entity) { return entity != null && ids.contains(new TechId(HibernateUtils.getId(entity))); @@ -187,8 +186,7 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO assert deletion != null; TrashOperationsManager trashManager = new TrashOperationsManager(session, deletion, this, getTransactionTimeStamp()); - Set<TechId> allSampleIds - = trashSamples(trashManager, sampleIds, CascadeSampleDependentComponents.TRUE, true); + Set<TechId> allSampleIds = trashSamples(trashManager, sampleIds, CascadeSampleDependentComponents.TRUE, true); Set<TechId> experimentsOfSamples = getExperimentsOfSamples(sampleIds); trashSampleDependentDataSets(trashManager, experimentsOfSamples, allSampleIds); trashManager.trash(); @@ -209,8 +207,8 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO } return experimentIds; } - - private Set<TechId> trashSamples(TrashOperationsManager trashManager, + + private Set<TechId> trashSamples(TrashOperationsManager trashManager, final List<TechId> sampleIds, final CascadeSampleDependentComponents cascadeType, boolean isOriginalDeletion) { assert deletion != null; @@ -229,22 +227,25 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO { public List<TechId> filter(List<AbstractExternalData> dataSets); } - + private static interface IIdHolderProvider { public IIdHolder getIdHolder(AbstractExternalData dataSet); } - + private static final class DataSetFilter implements IDataSetFilter { private Set<Long> ids; + private IIdHolderProvider idHolderProvider; + DataSetFilter(Collection<TechId> ids, IIdHolderProvider idHolderProvider) { this.ids = new LinkedHashSet<Long>(TechId.asLongs(ids)); this.idHolderProvider = idHolderProvider; - + } + @Override public List<TechId> filter(List<AbstractExternalData> dataSets) { @@ -261,7 +262,7 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO } } - private void trashDataSets(TrashOperationsManager trashManager, final List<TechId> dataSetIds, + private void trashDataSets(TrashOperationsManager trashManager, final List<TechId> dataSetIds, boolean isOriginalDeletion, IDataSetFilter filterOrNull) { assert deletion != null; @@ -328,7 +329,7 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO } } - private Set<TechId> trashSampleDependentComponents(TrashOperationsManager trashManager, + private Set<TechId> trashSampleDependentComponents(TrashOperationsManager trashManager, List<TechId> sampleIds) { final ISampleDAO sampleDAO = getSampleDAO(); @@ -349,7 +350,7 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO return trashSamples(trashManager, batchOperation.getResults(), CascadeSampleDependentComponents.FALSE, false); } - private void trashSampleDependentDataSets(TrashOperationsManager trashManager, + private void trashSampleDependentDataSets(TrashOperationsManager trashManager, Set<TechId> experimentsOfSamples, Set<TechId> sampleIds) { AbstractQueryBatchOperation batchOperation = @@ -367,14 +368,14 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO List<TechId> dataSetIds = batchOperation.getResults(); assertDataSetDeletionBusinessRules(experimentsOfSamples, sampleIds, dataSetIds); trashDataSets(trashManager, dataSetIds, false, new DataSetFilter(sampleIds, - new IIdHolderProvider() - { - @Override - public IIdHolder getIdHolder(AbstractExternalData dataSet) - { - return dataSet.getSample(); - } - })); + new IIdHolderProvider() + { + @Override + public IIdHolder getIdHolder(AbstractExternalData dataSet) + { + return dataSet.getSample(); + } + })); } private Set<TechId> trashExperimentDependentSamples(TrashOperationsManager trashManager, Set<TechId> experimentIds) @@ -394,7 +395,7 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO return trashSamples(trashManager, sampleIds, CascadeSampleDependentComponents.TRUE, false); } - private void trashExperimentDependentDataSets(TrashOperationsManager trashManager, Set<TechId> experimentIds, + private void trashExperimentDependentDataSets(TrashOperationsManager trashManager, Set<TechId> experimentIds, Set<TechId> dependentSampleIds) { AbstractQueryBatchOperation batchOperation = @@ -411,17 +412,17 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO List<TechId> dataSetIds = batchOperation.getResults(); assertDataSetDeletionBusinessRules(experimentIds, dependentSampleIds, dataSetIds); trashDataSets(trashManager, dataSetIds, false, new DataSetFilter(experimentIds, - new IIdHolderProvider() - { - @Override - public IIdHolder getIdHolder(AbstractExternalData dataSet) - { - return dataSet.getExperiment(); - } - })); + new IIdHolderProvider() + { + @Override + public IIdHolder getIdHolder(AbstractExternalData dataSet) + { + return dataSet.getExperiment(); + } + })); } - - private void assertDataSetDeletionBusinessRules(Set<TechId> experimentIds, Set<TechId> sampleIdes, + + private void assertDataSetDeletionBusinessRules(Set<TechId> experimentIds, Set<TechId> sampleIdes, List<TechId> dataSetIds) { IDatasetLister datasetLister = boFactory.createDatasetLister(session); @@ -469,15 +470,15 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO throw new UserFailureException(builder.toString().trim()); } } - - private void addTo(StringBuilder builder, String entityDescription, AbstractExternalData dataSet, + + private void addTo(StringBuilder builder, String entityDescription, AbstractExternalData dataSet, Map<Long, Set<Long>> containerIds) { String findOriginalDataSet = findOriginalDataSet(containerIds, dataSet); - builder.append("The data set " + findOriginalDataSet + " is a component of the data set " + builder.append("The data set " + findOriginalDataSet + " is a component of the data set " + dataSet.getCode() + " which belongs to the " + entityDescription + " which is outside the deletion set.\n"); } - + private String findOriginalDataSet(Map<Long, Set<Long>> relations, AbstractExternalData dataSet) { Set<Entry<Long, Set<Long>>> entrySet = relations.entrySet(); @@ -503,7 +504,7 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO { return datasetLister.listByDatasetIds(TechId.asLongs(dataSetIds), DATA_SET_FETCH_OPTIONS); } - + @Override public void revertDeletion(TechId deletionId) { @@ -516,22 +517,31 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO throwException(ex, "Deletion"); } } - + private static final class TrashOperationsManager { private final Session session; + private final DeletionPE deletion; + private final IDAOFactory daoFactory; - + private final Map<EntityKind, Set<TechId>> entityIdsByKind = new HashMap<EntityKind, Set<TechId>>(); + private final List<TrashBatchOperation> operations = new ArrayList<TrashBatchOperation>(); + private final PersonPE person; + private final List<RoleWithIdentifier> allowedRoles; + private final ExperimentPEPredicate experimentPredicate; + private final SamplePEPredicate samplesPredicate; + private final DataPEPredicate dataSetPredicate; + private final Date modificationTimestamp; - + TrashOperationsManager(Session session, DeletionPE deletion, IDAOFactory daoFactory, Date modificationTimestamp) { this.session = session; @@ -549,7 +559,7 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO samplesPredicate = new SamplePEPredicate(); dataSetPredicate = new DataPEPredicate(); } - + void addTrashOperation(EntityKind entityKind, List<TechId> entityIds, boolean isOriginalDeletion) { if (entityIds.isEmpty() == false) @@ -575,7 +585,7 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO } @SuppressWarnings({ "unchecked", "rawtypes" }) - private void assertAuthorization(PersistentEntityPredicate entityPredicate, + private void assertAuthorization(PersistentEntityPredicate entityPredicate, List<? extends IIdentifierHolder> entities, String entityKindName) { List<String> identifiers = new ArrayList<String>(); @@ -591,12 +601,12 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO } if (identifiers.isEmpty() == false) { - throw new AuthorizationFailureException("Can not delete " + entityKindName + " " - + CollectionUtils.abbreviate(identifiers, 10) + " because user " + throw new AuthorizationFailureException("Can not delete " + entityKindName + " " + + CollectionUtils.abbreviate(identifiers, 10) + " because user " + errorMessage); } } - + void trash() { updateModificationDateAndModifierOfRelatedProjectsOfExperiments(); @@ -607,7 +617,7 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO BatchOperationExecutor.executeInBatches(operation); } } - + private void updateModificationDateAndModifierOfRelatedProjectsOfExperiments() { List<Long> ids = TechId.asLongs(entityIdsByKind.get(EntityKind.EXPERIMENT)); @@ -618,7 +628,7 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO experiments, session, modificationTimestamp); } } - + private void updateModificationDateAndModifierOfRelatedEntitiesOfSamples() { List<Long> ids = TechId.asLongs(entityIdsByKind.get(EntityKind.SAMPLE)); @@ -629,7 +639,7 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO samples, session, modificationTimestamp); } } - + private void updateModificationDateAndModifierOfRelatedEntitiesOfDataSets() { List<Long> ids = TechId.asLongs(entityIdsByKind.get(EntityKind.DATA_SET)); @@ -640,7 +650,7 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO dataSets, session, modificationTimestamp); } } - + } private static class TrashBatchOperation implements IBatchOperation<TechId> @@ -692,10 +702,10 @@ public class TrashBO extends AbstractBusinessObject implements ITrashBO @Override public String toString() { - return getOperationName() + (isOriginalDeletion ? " original " : " dependent ") + entityKind + return getOperationName() + (isOriginalDeletion ? " original " : " dependent ") + entityKind + " " + getEntityName() + " " + entityIds; } - + } private abstract static class AbstractQueryBatchOperation implements IBatchOperation<TechId> diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/VocabularyTermBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/VocabularyTermBO.java index 99ad08e2eadec00a49d61db2c0e78fc308f3b537..d09f673d3b60be092d61685354cff0c464b0e6c4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/VocabularyTermBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/VocabularyTermBO.java @@ -41,8 +41,8 @@ public final class VocabularyTermBO extends AbstractBusinessObject implements IV private VocabularyTermPE vocabularyTermPE; public VocabularyTermBO(final IDAOFactory daoFactory, final Session session, - IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, - DataSetTypeWithoutExperimentChecker dataSetTypeChecker, + IManagedPropertyEvaluatorFactory managedPropertyEvaluatorFactory, + DataSetTypeWithoutExperimentChecker dataSetTypeChecker, IRelationshipService relationshipService) { super(daoFactory, session, managedPropertyEvaluatorFactory, dataSetTypeChecker, relationshipService); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/AbstractBatchIterator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/AbstractBatchIterator.java index 0bbcb4a45f00788a92a9011c2cd65c7184e7912c..f90e99a58637b1f59b2f7aba05f512437e98861a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/AbstractBatchIterator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/AbstractBatchIterator.java @@ -24,18 +24,16 @@ import java.util.Iterator; import ch.systemsx.cisd.common.exceptions.NotImplementedException; /** - * Allows to convert an memory-inefficient iterator into a one which has lower memory consumption. - * Divides the items used to produce iterated elements into batches and calls the original iterator - * on each batch. The outside interface make the division into batches invisible, but the - * inefficient iterator is never used with a big number of items. + * Allows to convert an memory-inefficient iterator into a one which has lower memory consumption. Divides the items used to produce iterated elements + * into batches and calls the original iterator on each batch. The outside interface make the division into batches invisible, but the inefficient + * iterator is never used with a big number of items. * * @author Tomasz Pylak */ abstract public class AbstractBatchIterator<T> implements Iterable<T> { /** - * Creates an iterator which is not very memory efficient and should not be called with too many - * items at the same time. + * Creates an iterator which is not very memory efficient and should not be called with too many items at the same time. */ abstract protected Iterable<T> createUnefficientIterator(LongSet itemsBatch); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/CodeRecord.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/CodeRecord.java index 59925bc47aaef538678a3588c0d6b5c9e1098693..5bf540328bc1bc80fdff43fc0fca8482d1f65e9e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/CodeRecord.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/CodeRecord.java @@ -1,6 +1,5 @@ package ch.systemsx.cisd.openbis.generic.server.business.bo.common; - /** * A record object for id and code. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/EntityPropertiesEnricher.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/EntityPropertiesEnricher.java index 9c5fada9dda44f94f3fe6cc8072018dc8f806b4d..6fd38ebfd6e8a177a4b29c30740a3444c1885051 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/EntityPropertiesEnricher.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/EntityPropertiesEnricher.java @@ -109,8 +109,8 @@ public final class EntityPropertiesEnricher implements IEntityPropertiesEnricher } /** - * Enriches the entities with given <var>entityIDs</var> with its properties. The entities will - * be resolved by the {@link IEntityPropertiesHolderResolver} and will be enriched in place. + * Enriches the entities with given <var>entityIDs</var> with its properties. The entities will be resolved by the + * {@link IEntityPropertiesHolderResolver} and will be enriched in place. */ @Override public void enrich(final LongSet entityIDs, final IEntityPropertiesHolderResolver entities) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/GenericEntityPropertyRecord.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/GenericEntityPropertyRecord.java index d1c843d931bc88f589cb6592710a9df73ed58f1f..9a0f6973442b2f900c1ea68f714c669c479a1671 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/GenericEntityPropertyRecord.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/GenericEntityPropertyRecord.java @@ -1,6 +1,5 @@ package ch.systemsx.cisd.openbis.generic.server.business.bo.common; - /** * A record object for a generic entity property. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/IEntityPropertiesEnricher.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/IEntityPropertiesEnricher.java index d8870fbee1e4a98849676203f5dcf7294d157165..cd17994c5d6cacd8ef7edc7a62d1d2d6ef9dfce1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/IEntityPropertiesEnricher.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/IEntityPropertiesEnricher.java @@ -26,8 +26,8 @@ import it.unimi.dsi.fastutil.longs.LongSet; public interface IEntityPropertiesEnricher { /** - * Enriches the entities specified by its IDs its properties. The entities will be retrieved - * by the {@link IEntityPropertiesHolderResolver} and will be enriched "in place". + * Enriches the entities specified by its IDs its properties. The entities will be retrieved by the {@link IEntityPropertiesHolderResolver} and + * will be enriched "in place". */ public void enrich(final LongSet entityIDs, final IEntityPropertiesHolderResolver entities); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/IEntityPropertiesHolderResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/IEntityPropertiesHolderResolver.java index 19697c0f2aeb9a4b3313341c0620b7f00ac32325..8938e5559068f6be1c03b59e62c7fd0eb5ade657 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/IEntityPropertiesHolderResolver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/IEntityPropertiesHolderResolver.java @@ -21,7 +21,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityPropertiesHolder /** * Resolver of objects holding entity properties. * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ public interface IEntityPropertiesHolderResolver { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/IPropertyListingQuery.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/IPropertyListingQuery.java index caaf001e6e20eca2a82f7c832e4f90546595663a..cfbb66435860ee0cd8cf1a98ed7bb5802e88875b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/IPropertyListingQuery.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/IPropertyListingQuery.java @@ -28,9 +28,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.PropertyType; public interface IPropertyListingQuery { /** - * Returns all property types. Fills only <code>id</code>, <code>code</code>, - * <code>label</var> and <code>DataType</code>. Note that code and label are already HTML - * escaped. + * Returns all property types. Fills only <code>id</code>, <code>code</code>, <code>label</var> and <code>DataType</code>. Note that code and + * label are already HTML escaped. */ @Select(sql = "select pt.id as pt_id, pt.code as pt_code, dt.code as dt_code," + " pt.label as pt_label, pt.is_internal_namespace, pt.schema, pt.transformation" diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/MaterialEntityPropertyRecord.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/MaterialEntityPropertyRecord.java index 76b8e94e339f0e799b907c6b6f0f0d850158f5be..cdc45e5ae3ab3de9026bf9ed0f204b5c690f76c5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/MaterialEntityPropertyRecord.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/MaterialEntityPropertyRecord.java @@ -1,6 +1,5 @@ package ch.systemsx.cisd.openbis.generic.server.business.bo.common; - /** * A record object for an entity property of type MATERIAL. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/ExperimentProjectSpaceCodeRecord.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/ExperimentProjectSpaceCodeRecord.java index 581f0c90f6909eb02cdc24e5135d8bb2f27d172b..1a71d998fc56d3152458cad8d701e4d875438e30 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/ExperimentProjectSpaceCodeRecord.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/ExperimentProjectSpaceCodeRecord.java @@ -3,14 +3,13 @@ package ch.systemsx.cisd.openbis.generic.server.business.bo.common.entity; import ch.rinn.restrictions.Private; /** - * A class representing an experiment, project and space code. It contains also deletion id, code of - * experiment type and database instance id. + * A class representing an experiment, project and space code. It contains also deletion id, code of experiment type and database instance id. */ @Private public class ExperimentProjectSpaceCodeRecord { public long id; - + public String e_code; public String e_permid; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/ISecondaryEntityListingQuery.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/ISecondaryEntityListingQuery.java index 79bd2678f48846a89b4015c5e12946d9553b9f15..42a7e398cc5f2024b27a635e31750b9776a7313f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/ISecondaryEntityListingQuery.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/ISecondaryEntityListingQuery.java @@ -37,12 +37,12 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Space; { SampleReferenceRecord.class }) public interface ISecondaryEntityListingQuery extends BaseQuery { - public static final String SELECT_FROM_EXPERIMENTS - = "select e.id as id, e.code as e_code, e.perm_id as e_permid, e.del_id as del_id, et.code as et_code, " - + "p.code as p_code, p.id as p_id, p.perm_id as p_perm_id, g.code as spc_code from experiments e " - + "join experiment_types et on e.exty_id=et.id join projects p on e.proj_id=p.id " - + "join spaces g on p.space_id=g.id"; - + public static final String SELECT_FROM_EXPERIMENTS = + "select e.id as id, e.code as e_code, e.perm_id as e_permid, e.del_id as del_id, et.code as et_code, " + + "p.code as p_code, p.id as p_id, p.perm_id as p_perm_id, g.code as spc_code from experiments e " + + "join experiment_types et on e.exty_id=et.id join projects p on e.proj_id=p.id " + + "join spaces g on p.space_id=g.id"; + public static final int FETCH_SIZE = 1000; // @@ -57,9 +57,9 @@ public interface ISecondaryEntityListingQuery extends BaseQuery @Select(SELECT_FROM_EXPERIMENTS + " where e.id=?{1}") public ExperimentProjectSpaceCodeRecord getExperimentAndProjectAndGroupCodeForId( long experimentId); - + @Select(sql = SELECT_FROM_EXPERIMENTS + " where e.id = any(?{1})", parameterBindings = - { LongSetMapper.class }, fetchSize = FETCH_SIZE) + { LongSetMapper.class }, fetchSize = FETCH_SIZE) public DataIterator<ExperimentProjectSpaceCodeRecord> getExperiments(LongSet experimentIds); // diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/SecondaryEntityDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/SecondaryEntityDAO.java index 944c8d443f89f3001f616d00c93036fe039cd0d7..a6969d3d4a9ba1a40479f2d51cf402777aba5bf0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/SecondaryEntityDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/SecondaryEntityDAO.java @@ -164,7 +164,7 @@ public class SecondaryEntityDAO } return result; } - + public Long2ObjectMap<Experiment> getExperiments(LongSet experimentIds) { Iterable<ExperimentProjectSpaceCodeRecord> experimentRecords = query.getExperiments(experimentIds); @@ -175,7 +175,7 @@ public class SecondaryEntityDAO } return result; } - + public LongSet getSampleDescendantIdsAndSelf(Long sampleId) { LongSet results = new LongOpenHashSet(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/DatasetLister.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/DatasetLister.java index cda4425eff61b4ef5059ba57fbe8a243f93028d2..1e7aecf647bc17fffccb45bf687f010810e14335 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/DatasetLister.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/DatasetLister.java @@ -839,7 +839,7 @@ public class DatasetLister extends AbstractLister implements IDatasetLister } return ids; } - + // assumes that the connection to experiment has been already established and experiment has the // id set. private void enrichWithExperiments(Long2ObjectMap<AbstractExternalData> datasetMap) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/IDatasetListingQuery.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/IDatasetListingQuery.java index a8d95d7e2686263b76835ba3256c58d229a8c926..a79251823a98e70c1f51056a60c8b7268650568d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/IDatasetListingQuery.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/IDatasetListingQuery.java @@ -54,16 +54,16 @@ public interface IDatasetListingQuery extends BaseQuery, IPropertyListingQuery public final static String SELECT_ALL = "select data.*, external_data.*, link_data.*, " - + "prdq.id IS NULL as is_post_registered " - + "from data left outer join external_data on data.id = external_data.data_id " - + "left outer join link_data on data.id = link_data.data_id " - + "left outer join post_registration_dataset_queue prdq on data.id = prdq.ds_id "; + + "prdq.id IS NULL as is_post_registered " + + "from data left outer join external_data on data.id = external_data.data_id " + + "left outer join link_data on data.id = link_data.data_id " + + "left outer join post_registration_dataset_queue prdq on data.id = prdq.ds_id "; public final static String SELECT_ALL_EXTERNAL_DATAS = "select data.*, external_data.*, prdq.id IS NULL as is_post_registered " - + "from data " - + "join external_data on data.id = external_data.data_id " - + "left outer join post_registration_dataset_queue prdq on data.id = prdq.ds_id "; + + "from data " + + "join external_data on data.id = external_data.data_id " + + "left outer join post_registration_dataset_queue prdq on data.id = prdq.ds_id "; /** * Returns the datasets for the given experiment id. @@ -91,7 +91,7 @@ public interface IDatasetListingQuery extends BaseQuery, IPropertyListingQuery + "left outer join external_data as ed on d.id = ed.data_id " + "left outer join link_data as ld on d.id = ld.data_id " + "left outer join post_registration_dataset_queue prdq on d.id = prdq.ds_id " - + "where expe_id = ?{1} " + + "where expe_id = ?{1} " + " or samp_id in (with recursive connected_samples as " + " (select id from samples where expe_id = ?{1} " + " union select s.id from connected_samples as cs " diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/fetchoptions/datasetlister/IDataSetLister.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/fetchoptions/datasetlister/IDataSetLister.java index 9857dd37a771da4511badaf329bc7b1d4d918191..cab3dc4d91a19497d11eb4ef2ef3821c92b9b5eb 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/fetchoptions/datasetlister/IDataSetLister.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/fetchoptions/datasetlister/IDataSetLister.java @@ -29,8 +29,7 @@ public interface IDataSetLister { /** - * Returns the data set meta data for the given <var>dataSetCodes</var> with the given - * <var>dataSetFetchOptions</var>. + * Returns the data set meta data for the given <var>dataSetCodes</var> with the given <var>dataSetFetchOptions</var>. * * @return One data set meta data object for each entry in <var>dataSetCodes</var>. */ @@ -40,16 +39,14 @@ public interface IDataSetLister /** * Returns the download URLs for a set of <var>dataSetCodes</var>. * - * @return The list of data store download URLs, each with the list of data set codes it has - * stored. + * @return The list of data store download URLs, each with the list of data set codes it has stored. */ public List<DataStoreURLForDataSets> getDataStoreDownloadURLs(List<String> dataSetCodes); /** * Returns the remote URLs for a set of <var>dataSetCodes</var>. * - * @return The list of data store remote URLs, each with the list of data set codes it has - * stored. + * @return The list of data store remote URLs, each with the list of data set codes it has stored. */ public List<DataStoreURLForDataSets> getDataStoreRemoteURLs(List<String> dataSetCodes); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/fetchoptions/samplelister/ISampleLister.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/fetchoptions/samplelister/ISampleLister.java index d0fa0d3d445aeb9b40f155c9c2a99007b51274c9..50bd4a8ca360d914db22f2751358aa9dcbcb6347 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/fetchoptions/samplelister/ISampleLister.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/fetchoptions/samplelister/ISampleLister.java @@ -33,8 +33,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.IIdentifierHolder; public interface ISampleLister { /** - * Returns all samples of specified technical ids. Properties and related samples are added in - * accordance to the fetch options. + * Returns all samples of specified technical ids. Properties and related samples are added in accordance to the fetch options. * * @param filter A filter which returns only samples and related samples which pass the filter. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/fetchoptions/samplelister/ISampleListingQuery.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/fetchoptions/samplelister/ISampleListingQuery.java index fe0d1b14bafcdfea3e73e683da8e562d9d8790a0..9e2631aa756607e65756c0d6b992f26317cb2584 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/fetchoptions/samplelister/ISampleListingQuery.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/fetchoptions/samplelister/ISampleListingQuery.java @@ -55,17 +55,17 @@ public interface ISampleListingQuery extends BaseQuery + "left join spaces as ps on p.space_id = ps.id " + "left join persons as mod on s.pers_id_modifier = mod.id " + "join persons as pe on s.pers_id_registerer = pe.id where s.id = any(?{1}) ", parameterBindings = - { LongSetMapper.class }, fetchSize = FETCH_SIZE) + { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<SampleRecord> listSamplesByIds(LongSet sampleIDs); @Select(sql = "Select * from sample_relationships " + "where relationship_id = ?{1} and sample_id_parent = any(?{2})", parameterBindings = - { TypeMapper.class/* default */, LongSetMapper.class }, fetchSize = FETCH_SIZE) + { TypeMapper.class/* default */, LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<SampleRelationshipRecord> getChildren(Long relationshipID, LongSet sampleIDs); @Select(sql = "Select * from sample_relationships " + "where relationship_id = ?{1} and sample_id_child = any(?{2})", parameterBindings = - { TypeMapper.class/* default */, LongSetMapper.class }, fetchSize = FETCH_SIZE) + { TypeMapper.class/* default */, LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<SampleRelationshipRecord> getParents(Long relationshipID, LongSet sampleIDs); @Select(sql = "with recursive connected_relationships as (select * from sample_relationships " @@ -73,7 +73,7 @@ public interface ISampleListingQuery extends BaseQuery + "union select sr.* from connected_relationships as cr " + "join sample_relationships as sr on cr.sample_id_child = sr.sample_id_parent) " + "select * from connected_relationships", parameterBindings = - { TypeMapper.class/* default */, LongSetMapper.class }, fetchSize = FETCH_SIZE) + { TypeMapper.class/* default */, LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<SampleRelationshipRecord> getDescendants(Long relationshipID, LongSet sampleIDs); @Select(sql = "with recursive connected_relationships as (select * from sample_relationships " @@ -81,7 +81,7 @@ public interface ISampleListingQuery extends BaseQuery + "union select sr.* from connected_relationships as cr " + "join sample_relationships as sr on cr.sample_id_parent = sr.sample_id_child) " + "select * from connected_relationships", parameterBindings = - { TypeMapper.class/* default */, LongSetMapper.class }, fetchSize = FETCH_SIZE) + { TypeMapper.class/* default */, LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<SampleRelationshipRecord> getAncestors(Long relationshipID, LongSet sampleIDs); @Select(sql = "select p.samp_id as entity_id, pt.code as code, dt.code as data_type, p.value, " @@ -94,20 +94,20 @@ public interface ISampleListingQuery extends BaseQuery + "left join material_types as mt on m.maty_id = mt.id " + "left join controlled_vocabulary_terms as vt on p.cvte_id = vt.id " + "where p.samp_id = any(?{1})", parameterBindings = - { LongSetMapper.class }, fetchSize = FETCH_SIZE) + { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<PropertyRecord> getProperties(LongSet entityIDs); @Select(sql = "select ma.mepr_id as metaproject_id, ma.samp_id as entity_id " + " from metaproject_assignments as ma " + " join metaprojects as m on ma.mepr_id = m.id " + "where ma.samp_id = any(?{1}) and m.owner = ?{2}", parameterBindings = - { LongSetMapper.class }, fetchSize = FETCH_SIZE) + { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<EntityMetaprojectRelationRecord> getMetaprojectAssignments(LongSet sampleIDs, Long ownerId); @Select(sql = "select id as id, name as name, description as description, " + " private as is_private, creation_date as creation_date " + " from metaprojects" + " where id = any(?{1})", parameterBindings = - { LongSetMapper.class }, fetchSize = FETCH_SIZE) + { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<MetaprojectRecord> getMetaprojects(LongSet metaprojectIDs); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/util/DataSetTypeWithoutExperimentChecker.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/util/DataSetTypeWithoutExperimentChecker.java index a104cd35731f06e6b3f8d2e59d133909c5afd033..301b888b5288cc662750fd610dda40ed82289a8a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/util/DataSetTypeWithoutExperimentChecker.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/util/DataSetTypeWithoutExperimentChecker.java @@ -34,9 +34,9 @@ import ch.systemsx.cisd.common.exceptions.ConfigurationFailureException; public class DataSetTypeWithoutExperimentChecker { public static final String PROPERTY_KEY = "data-set-types-with-no-experiment-needed"; - + private final String regularExpressions; - + private List<Pattern> patternsForDataSetTypesWithoutExperiment = new ArrayList<Pattern>(); public DataSetTypeWithoutExperimentChecker(Properties properties) @@ -63,7 +63,7 @@ public class DataSetTypeWithoutExperimentChecker } } } - + public String getRegularExpressions() { return regularExpressions; @@ -81,5 +81,4 @@ public class DataSetTypeWithoutExperimentChecker return false; } - } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/importer/DatabaseInstance.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/importer/DatabaseInstance.java index 5ff095ca9800266434e29b33de45da8e9f164c79..120bee3bddc59c9d12a79d4be9ecb9009673809b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/importer/DatabaseInstance.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/importer/DatabaseInstance.java @@ -16,7 +16,6 @@ package ch.systemsx.cisd.openbis.generic.server.business.importer; - /** * The database instance for the importer. * diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/importer/DatabaseInstanceImporter.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/importer/DatabaseInstanceImporter.java index a63f0d063ca9c752ef1996c5be0292b7841a9161..070f276f9e8a3f24b05a39a9a8717d776e991524 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/importer/DatabaseInstanceImporter.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/importer/DatabaseInstanceImporter.java @@ -54,7 +54,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.TableNames; /** * Class which allows to import another database instance. * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ public class DatabaseInstanceImporter { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/coreplugin/JettyWebAppPluginInjector.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/coreplugin/JettyWebAppPluginInjector.java index bfcb2220b5d8d3b9c69940f2f12fa38cfd9145b5..a1a9a26c2ef20d75bf87f13fb419d2bc38ce2f84 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/coreplugin/JettyWebAppPluginInjector.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/coreplugin/JettyWebAppPluginInjector.java @@ -48,7 +48,7 @@ import ch.systemsx.cisd.openbis.generic.shared.coreplugin.CorePluginsUtils; public class JettyWebAppPluginInjector { private static final String WEBAPP_FOLDER = "webapp"; - + private static final String START_PAGE = "start-page"; private static final Logger operationLog = LogFactory.getLogger(LogCategory.OPERATION, @@ -112,7 +112,7 @@ public class JettyWebAppPluginInjector } } } - + public void injectWebApps() { List<String> remainingWebapps = replaceDefaultStartPageByWebApp(); @@ -140,7 +140,7 @@ public class JettyWebAppPluginInjector { try { - if (!folder.getCanonicalPath().equals(link.getCanonicalPath())) //Verifies they are pointing to the same version + if (!folder.getCanonicalPath().equals(link.getCanonicalPath())) // Verifies they are pointing to the same version { link.delete(); } @@ -159,7 +159,7 @@ public class JettyWebAppPluginInjector } return; } - + private List<String> replaceDefaultStartPageByWebApp() { List<String> remainingWebApps = new ArrayList<String>(webapps); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IAttachmentDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IAttachmentDAO.java index d6d5d7593b347ee029cd54502f2036a66668fb94..89e0e20f331174d6e9ff649de83c6b4a195e78be 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IAttachmentDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IAttachmentDAO.java @@ -87,7 +87,7 @@ public interface IAttachmentDAO extends IGenericDAO<AttachmentPE> */ public int deleteByOwnerAndFileName(final AttachmentHolderPE owner, final String fileName) throws DataAccessException; - + public Map<String, AttachmentEntry> deleteAttachments(final AttachmentHolderPE holder, final String reason, final List<String> fileNames, PersonPE registrator); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IAuthorizationGroupDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IAuthorizationGroupDAO.java index 5ed7880d66ddd17e20cdec956f0f0013a650611d..c60437b8fe5ae25c16147914d5090677b5eefed5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IAuthorizationGroupDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IAuthorizationGroupDAO.java @@ -38,8 +38,7 @@ public interface IAuthorizationGroupDAO extends IGenericDAO<AuthorizationGroupPE public void create(AuthorizationGroupPE authorizationGroup); /** - * Returns the authorization group with given code located in home database or null if no such - * group exists. + * Returns the authorization group with given code located in home database or null if no such group exists. */ public AuthorizationGroupPE tryFindByCode(String code); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDataSourceProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDataSourceProvider.java index 3113ab225ba6f18a0cc4fee04b1cdb07fade23a2..c0ce9d888a1da277ea75b5c01a60d470bacb2b25 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDataSourceProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDataSourceProvider.java @@ -21,8 +21,7 @@ import javax.sql.DataSource; import ch.systemsx.cisd.common.exceptions.UserFailureException; /** - * Interface for providing a {@link DataSource} for a technology specific database based on data set - * code or data store server code + * Interface for providing a {@link DataSource} for a technology specific database based on data set code or data store server code * * @author Franz-Josef Elmer */ @@ -31,8 +30,7 @@ public interface IDataSourceProvider /** * Returns an appropriated data source for specified data store server code and technology. * - * @throws IllegalArgumentException if getting data source by data store server code isn't - * supported for the specified technology. + * @throws IllegalArgumentException if getting data source by data store server code isn't supported for the specified technology. * @throws UserFailureException if the specified data store server doesn't exist. */ public DataSource getDataSourceByDataStoreServerCode(String dssCode, String technology); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDataStoreDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDataStoreDAO.java index a64072db9e1041f4eb3457eabddfc04e4073da90..69ef07c787d63239181b6a3cc6530e38c82d2de8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDataStoreDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDataStoreDAO.java @@ -23,7 +23,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.DataStorePE; /** * <i>Data Access Object</i> for {@link DataStorePE}. * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ public interface IDataStoreDAO { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDeletionDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDeletionDAO.java index 0f9e65818bc1d330312fb50dd3b528d340646b5b..d6c364291a677abf5129e00ebcd4e2ad5228e34d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDeletionDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDeletionDAO.java @@ -37,19 +37,16 @@ public interface IDeletionDAO extends IGenericDAO<DeletionPE> void create(final DeletionPE deletion) throws DataAccessException; /** - * Moves entities with given ids to trash using specified deletion. Ignores ids of entities that - * don't exist or are already in the trash. + * Moves entities with given ids to trash using specified deletion. Ignores ids of entities that don't exist or are already in the trash. * - * @param isOriginalDeletion if true than the specified entities are considered originally - * deleted entities + * @param isOriginalDeletion if true than the specified entities are considered originally deleted entities * @return number of trashed entities */ int trash(EntityKind entityKind, List<TechId> entityIds, DeletionPE deletion, boolean isOriginalDeletion) throws DataAccessException; /** - * Moves entities with given ids to trash using specified deletion. Ignores ids of entities that - * don't exist or are already in the trash. + * Moves entities with given ids to trash using specified deletion. Ignores ids of entities that don't exist or are already in the trash. * <p> * The entites are considered to be originally deleted * @@ -70,14 +67,12 @@ public interface IDeletionDAO extends IGenericDAO<DeletionPE> List<TechId> findTrashedSampleIds(List<TechId> deletionIds); /** - * Returns list of ids of non-comonent samples (having no container) moved to trash in specified - * deletions. + * Returns list of ids of non-comonent samples (having no container) moved to trash in specified deletions. */ List<TechId> findTrashedNonComponentSampleIds(List<TechId> deletionIds); /** - * Returns list of ids of component samples (samples with container) moved to trash in specified - * deletions. + * Returns list of ids of component samples (samples with container) moved to trash in specified deletions. */ List<TechId> findTrashedComponentSampleIds(List<TechId> deletionIds); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDynamicPropertyEvaluationScheduler.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDynamicPropertyEvaluationScheduler.java index eb7bcdfb3869162e4ad53139238c7e8dc8702fdf..48908b2e7f5e839c844332c22cf5da0c9fcc0c74 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDynamicPropertyEvaluationScheduler.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDynamicPropertyEvaluationScheduler.java @@ -16,7 +16,6 @@ package ch.systemsx.cisd.openbis.generic.server.dataaccess; - /** * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDynamicPropertyEvaluationSchedulerWithQueue.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDynamicPropertyEvaluationSchedulerWithQueue.java index 013b9ae184663d6a424548eb989521bc097020d7..567c2c328578800005b423b16bfcb7441c11d740 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDynamicPropertyEvaluationSchedulerWithQueue.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IDynamicPropertyEvaluationSchedulerWithQueue.java @@ -17,8 +17,7 @@ package ch.systemsx.cisd.openbis.generic.server.dataaccess; /** - * {@link IDynamicPropertyEvaluationScheduler} extension with methods for dealing with persistent - * blocking queue. + * {@link IDynamicPropertyEvaluationScheduler} extension with methods for dealing with persistent blocking queue. * * @author Piotr Buczek */ @@ -26,8 +25,7 @@ public interface IDynamicPropertyEvaluationSchedulerWithQueue extends IDynamicPropertyEvaluationScheduler { /** - * Retrieves, but does not remove, an operation from the head of this queue, waiting if no - * elements are present on this queue. + * Retrieves, but does not remove, an operation from the head of this queue, waiting if no elements are present on this queue. * * @return an operation from the head of this queue * @throws InterruptedException if interrupted while waiting. @@ -35,8 +33,7 @@ public interface IDynamicPropertyEvaluationSchedulerWithQueue extends DynamicPropertyEvaluationOperation peekWait() throws InterruptedException; /** - * Retrieves and removes an operation from the head of this queue, waiting if no elements are - * present on this queue. + * Retrieves and removes an operation from the head of this queue, waiting if no elements are present on this queue. * * @return an operation from the head of this queue * @throws InterruptedException if interrupted while waiting. @@ -44,15 +41,13 @@ public interface IDynamicPropertyEvaluationSchedulerWithQueue extends DynamicPropertyEvaluationOperation take() throws InterruptedException; /** - * Synchronizes all operations scheduled in a transaction handled by current thread with this - * queue. Should be called after transaction is successfuly commited (otherwise evaluator can - * work on stale data). + * Synchronizes all operations scheduled in a transaction handled by current thread with this queue. Should be called after transaction is + * successfuly commited (otherwise evaluator can work on stale data). */ void synchronizeThreadQueue(); /** - * Remove all operations scheduled in a transaction handled by current thread with this queue. - * Should be called after transaction is rolled back. + * Remove all operations scheduled in a transaction handled by current thread with this queue. Should be called after transaction is rolled back. */ void clearThreadQueue(); } \ No newline at end of file diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IEntityPropertiesConverter.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IEntityPropertiesConverter.java index 1e10d96b5a1e197a3ccdcd7cfc9a21ac6aa8239c..dcb2c5f7f0d189c1fca7e11e48f8aebb51e23a41 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IEntityPropertiesConverter.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IEntityPropertiesConverter.java @@ -38,8 +38,7 @@ public interface IEntityPropertiesConverter { /** - * Converts the set of {@link IEntityProperty} objects obtained from the specified entity to an - * array of {@link EntityPropertyPE} objects. + * Converts the set of {@link IEntityProperty} objects obtained from the specified entity to an array of {@link EntityPropertyPE} objects. * * @param registrator Will appear in the objects of the output. */ @@ -48,8 +47,7 @@ public interface IEntityPropertiesConverter final PersonPE registrator); /** - * Returns given value validated and converted for given property type and entity type. Result - * may be null if given value is null. + * Returns given value validated and converted for given property type and entity type. Result may be null if given value is null. */ public String tryCreateValidatedPropertyValue(PropertyTypePE propertyType, EntityTypePropertyTypePE entityTypPropertyType, String value); @@ -72,8 +70,7 @@ public interface IEntityPropertiesConverter EntityTypePE entityType, List<IEntityProperty> newProperties, PersonPE author); /** - * Updates Set<T> of properties but preserve those old properties which codes are not among - * <var>propertiesToUpdate</var>. + * Updates Set<T> of properties but preserve those old properties which codes are not among <var>propertiesToUpdate</var>. */ public <T extends EntityPropertyPE> Set<T> updateProperties(Collection<T> oldProperties, EntityTypePE entityType, List<IEntityProperty> newProperties, PersonPE author, @@ -86,15 +83,14 @@ public interface IEntityPropertiesConverter EntityTypePE entityTypePE); /** - * Checks whether all mandatory properties are provided. It uses (and fills) the - * <var>cache</var> in order to avoid looking up the assigned properties time and again. + * Checks whether all mandatory properties are provided. It uses (and fills) the <var>cache</var> in order to avoid looking up the assigned + * properties time and again. */ public <T extends EntityPropertyPE> void checkMandatoryProperties(Collection<T> properties, EntityTypePE entityTypePE, Map<EntityTypePE, List<EntityTypePropertyTypePE>> cache); /** - * Update the value of a managed property, assuming the managedProperty already has the updated - * value. + * Update the value of a managed property, assuming the managedProperty already has the updated value. */ public <T extends EntityPropertyPE> Set<T> updateManagedProperty(Collection<T> oldProperties, EntityTypePE entityType, IManagedProperty managedProperty, PersonPE author); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IEntityPropertyTypeDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IEntityPropertyTypeDAO.java index 416f614581fef328f14ca32e2c78ad9d156a96c8..76e9fdb9b5ef623fb774f77da507bbb2e81af8e8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IEntityPropertyTypeDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IEntityPropertyTypeDAO.java @@ -38,8 +38,7 @@ public interface IEntityPropertyTypeDAO { /** - * Returns a list of all entity type - property type assignments connected to given - * {@link EntityTypePE}. + * Returns a list of all entity type - property type assignments connected to given {@link EntityTypePE}. */ public List<EntityTypePropertyTypePE> listEntityPropertyTypes(final EntityTypePE entityType) throws DataAccessException; @@ -50,8 +49,8 @@ public interface IEntityPropertyTypeDAO public List<String> listPropertyTypeCodes() throws DataAccessException; /** - * Returns {@link EntityTypePropertyTypePE} assignment connecting given {@link EntityTypePE} and - * {@link PropertyTypePE} if it exists and null otherwise. + * Returns {@link EntityTypePropertyTypePE} assignment connecting given {@link EntityTypePE} and {@link PropertyTypePE} if it exists and null + * otherwise. */ public EntityTypePropertyTypePE tryFindAssignment(EntityTypePE entityType, PropertyTypePE propertyType); @@ -71,8 +70,8 @@ public interface IEntityPropertyTypeDAO public List<Long> listEntityIds(final EntityTypePE entityType) throws DataAccessException; /** - * Returns a list of ids of all entities of type from specified assignment with that don't have - * any value for property assigned with the assignment. + * Returns a list of ids of all entities of type from specified assignment with that don't have any value for property assigned with the + * assignment. */ public List<Long> listIdsOfEntitiesWithoutPropertyValue( final EntityTypePropertyTypePE assignment) throws DataAccessException; @@ -102,8 +101,7 @@ public interface IEntityPropertyTypeDAO /** * Updates given persistent (already saved) <var>entity</var> after successful validation.<br> * <br> - * Useful especially instead of a save() method (used for making entity persistent) after BO - * update that does not flush. + * Useful especially instead of a save() method (used for making entity persistent) after BO update that does not flush. * * @param entity the entity to be validated and updated */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IEventDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IEventDAO.java index 8b46374ab616724af9bc10f67160e52e128d380e..1d55cce7532a4ce5ce3e026bb7b4ba72b08683e8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IEventDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IEventDAO.java @@ -33,8 +33,7 @@ public interface IEventDAO extends IGenericDAO<EventPE> { /** - * Tries to find <var>eventType</var> event concerning an object of given <var>entityType</var> - * and <code>identifier</code>. + * Tries to find <var>eventType</var> event concerning an object of given <var>entityType</var> and <code>identifier</code>. */ public EventPE tryFind(final String identifier, final EntityType entityType, final EventType eventType); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IFileFormatTypeDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IFileFormatTypeDAO.java index 6a57c93aaef9187bc58b57e83e9bce41f4059c79..fe48f2f0e3361e2e793a9b53cb7e552ffbe773ef 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IFileFormatTypeDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IFileFormatTypeDAO.java @@ -23,7 +23,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.FileFormatTypePE; /** * Interface to the data access layer for retrieving instances of {@link FileFormatTypePE}. * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ public interface IFileFormatTypeDAO extends IGenericDAO<FileFormatTypePE> { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/ILocatorTypeDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/ILocatorTypeDAO.java index 31109e6abef642c9f4e1e6407b1c6b851af60c07..badd415758f82d47222da7f02ec0ebd01247611a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/ILocatorTypeDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/ILocatorTypeDAO.java @@ -21,7 +21,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.LocatorTypePE; /** * Interface to the data access layer for retrieving instances of {@link LocatorTypePE}. * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ public interface ILocatorTypeDAO extends IGenericDAO<LocatorTypePE> { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IMetaprojectDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IMetaprojectDAO.java index b7cb69c6d77ff5d12f20b451f58e797959c337d8..40eb1c4f6e13ded5e833e8b0b4e7e4d8a2cffb25 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IMetaprojectDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IMetaprojectDAO.java @@ -32,8 +32,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind; public interface IMetaprojectDAO extends IGenericDAO<MetaprojectPE> { /** - * Finds a metaproject by the specified owner id and metaproject name. Returns null if no - * metaproject is found. + * Finds a metaproject by the specified owner id and metaproject name. Returns null if no metaproject is found. */ public MetaprojectPE tryFindByOwnerAndName(String ownerId, String metaprojectName); @@ -72,8 +71,7 @@ public interface IMetaprojectDAO extends IGenericDAO<MetaprojectPE> EntityKind entityKind); /** - * Returns a map with counts of assignments for different entity kinds for the given - * metaproject. + * Returns a map with counts of assignments for different entity kinds for the given metaproject. */ public int getMetaprojectAssignmentsCount(Long metaprojectId, EntityKind entityKind); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IPropertyTypeDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IPropertyTypeDAO.java index 2b04dc33e90b02d155895a84235e346d2253790c..02f562aa6387b2d72be0082e68940ea19facd663 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IPropertyTypeDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IPropertyTypeDAO.java @@ -58,8 +58,7 @@ public interface IPropertyTypeDAO extends IGenericDAO<PropertyTypePE> public List<DataTypePE> listDataTypes() throws DataAccessException; /** - * Returns the {@link DataTypePE} for specified <var>code</var> or <code>null</code> if none - * could be found. + * Returns the {@link DataTypePE} for specified <var>code</var> or <code>null</code> if none could be found. */ public DataTypePE getDataTypeByCode(final DataTypeCode code) throws DataAccessException; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IPropertyValueValidator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IPropertyValueValidator.java index d1161f6c26806d59848102b04ea85861443db214..81fba56ee8658e4b9b48ad813042f70016ea8d5c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IPropertyValueValidator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IPropertyValueValidator.java @@ -27,8 +27,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.PropertyTypePE; public interface IPropertyValueValidator { /** - * Validates given <var>value</var> against given {@link PropertyTypePE} and returns the - * validated value as <code>String</code>. + * Validates given <var>value</var> against given {@link PropertyTypePE} and returns the validated value as <code>String</code>. * * @return the validated value. It does not implicitly equal given <var>value</var> */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/ISampleTypeDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/ISampleTypeDAO.java index 082719dee439e8e2d6c580b3c20d8c9372faa61f..af51e5e125f0d7a772c95ba0562808293920662f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/ISampleTypeDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/ISampleTypeDAO.java @@ -30,9 +30,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.SampleTypePE; public interface ISampleTypeDAO extends IGenericDAO<SampleTypePE> { /** - * Returns a list of {@link SampleTypePE} which have their property types and corresponding - * vocabulary terms eagerly fetched (overriding default behavior which lazily loads the property - * types). + * Returns a list of {@link SampleTypePE} which have their property types and corresponding vocabulary terms eagerly fetched (overriding default + * behavior which lazily loads the property types). * * @return The list of {@link SampleTypePE}s registered in the database. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IVocabularyDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IVocabularyDAO.java index 73a04854311bd98fe71b296b0620a4ff555262f2..0e580887d17521d7efa931ca9a9b0f4cca5297bf 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IVocabularyDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IVocabularyDAO.java @@ -22,8 +22,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.VocabularyPE; import ch.systemsx.cisd.openbis.generic.shared.dto.VocabularyTermPE; /** - * An interface that contains all data access operations on {@link VocabularyTermPE} and - * {@link VocabularyPE}. + * An interface that contains all data access operations on {@link VocabularyTermPE} and {@link VocabularyPE}. * * @author Christian Ribeaud */ @@ -36,11 +35,9 @@ public interface IVocabularyDAO extends IGenericDAO<VocabularyPE> void createOrUpdateVocabulary(final VocabularyPE vocabularyPE); /** - * Returns the {@link VocabularyPE} object for the given <var>vocabularyCode</var>, or - * <code>null</code>, if it doesn't exist.<br> + * Returns the {@link VocabularyPE} object for the given <var>vocabularyCode</var>, or <code>null</code>, if it doesn't exist.<br> * <br> - * NOTE: Only internally managed vocabularies have codes that can be used as business - * identifiers (cannot be edited). + * NOTE: Only internally managed vocabularies have codes that can be used as business identifiers (cannot be edited). */ VocabularyPE tryFindVocabularyByCode(final String vocabularyCode); @@ -50,8 +47,7 @@ public interface IVocabularyDAO extends IGenericDAO<VocabularyPE> List<VocabularyPE> listVocabularies(boolean excludeInternal); /** - * @return {@link VocabularyTermPE} with given <var>code</var> for given {@link VocabularyPE} or - * null if it does not exist. + * @return {@link VocabularyTermPE} with given <var>code</var> for given {@link VocabularyPE} or null if it does not exist. */ VocabularyTermPE tryFindVocabularyTermByCode(VocabularyPE vocabulary, String code); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IVocabularyTermDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IVocabularyTermDAO.java index 33ca358f6b7a0451469e10f47c799f637ceb8512..f516bacfc6be34bcdac62229d17dd44e2e16c5a5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IVocabularyTermDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/IVocabularyTermDAO.java @@ -31,12 +31,10 @@ public interface IVocabularyTermDAO extends IGenericDAO<VocabularyTermPE> void validate(final VocabularyTermPE term); /** - * All terms in specified vocabulary starting from specified ordinal will have the ordinal - * increased by specified increment. + * All terms in specified vocabulary starting from specified ordinal will have the ordinal increased by specified increment. * <p> - * After this change a collection of terms with size equal to <var>increment</var> can be put - * consecutively starting from <var>fromOrdinal</var> and ordinals in the vocabulary will stay - * unique. + * After this change a collection of terms with size equal to <var>increment</var> can be put consecutively starting from <var>fromOrdinal</var> + * and ordinals in the vocabulary will stay unique. */ void increaseVocabularyTermOrdinals(final VocabularyPE vocabulary, final Long fromOrdinal, final int increment); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/PlaceholderPropertyCreator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/PlaceholderPropertyCreator.java index 36b8cc668050ff856c366758b74625d981caf09b..b17997ff1f894bf3140a5d92185871ef08cd4bfe 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/PlaceholderPropertyCreator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/PlaceholderPropertyCreator.java @@ -26,8 +26,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.PropertyType; class PlaceholderPropertyCreator implements IPropertyPlaceholderCreator { /** - * Adds placeholders for <var>dynamicProperties</var> to <var>definedProperties</var> if they - * don't exist yet. + * Adds placeholders for <var>dynamicProperties</var> to <var>definedProperties</var> if they don't exist yet. */ @Override public void addDynamicPropertiesPlaceholders(Set<IEntityProperty> definedProperties, @@ -38,8 +37,7 @@ class PlaceholderPropertyCreator implements IPropertyPlaceholderCreator } /** - * Adds placeholders for <var>managedProperties</var> to <var>definedProperties</var> if they - * don't exist yet. + * Adds placeholders for <var>managedProperties</var> to <var>definedProperties</var> if they don't exist yet. */ @Override public void addManagedPropertiesPlaceholders(Set<IEntityProperty> definedProperties, @@ -50,8 +48,7 @@ class PlaceholderPropertyCreator implements IPropertyPlaceholderCreator } /** - * Adds <var>placeholderProperties</var> with specified <var>placeholderValue</var>to - * <var>definedProperties</var> if they don't exist yet. + * Adds <var>placeholderProperties</var> with specified <var>placeholderValue</var>to <var>definedProperties</var> if they don't exist yet. */ private void addPlaceholders(Set<IEntityProperty> definedProperties, Set<String> placeholderProperties, String placeholderValue) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/PropertyValidator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/PropertyValidator.java index 32808f02ce8b73b11c56e8526b05508513b092bc..5355dfa64e7cdf3459a026bba436fb55d177deec 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/PropertyValidator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/PropertyValidator.java @@ -144,8 +144,7 @@ public final class PropertyValidator implements IPropertyValueValidator } /** - * @return Details about vocabulary dependent on {@link VocabularyPE#isChosenFromList()} - * value: + * @return Details about vocabulary dependent on {@link VocabularyPE#isChosenFromList()} value: * <ul> * <li>for <var>true</var> - returns a list of first few vocabulary terms from it. * <li>for <var>false</var> - returns a vocabulary description diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/AbstractDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/AbstractDAO.java index 7e0d324cb15b2dcc79e17a52589882baab93a7b2..160f1d82904d5c6c451542d3711b3b4ab972faa3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/AbstractDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/AbstractDAO.java @@ -70,8 +70,9 @@ public abstract class AbstractDAO extends HibernateDaoSupport { private static ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); + private static final int MAX_STRING_ERROR_LENGTH = 500; - + protected AbstractDAO(final SessionFactory sessionFactory) { assert sessionFactory != null : "Unspecified session factory"; @@ -99,8 +100,11 @@ public abstract class AbstractDAO extends HibernateDaoSupport for (ConstraintViolation v : violations) { Object invalidValue = v.getInvalidValue(); - if(invalidValue instanceof String && (((String) invalidValue).length() > MAX_STRING_ERROR_LENGTH)) { - invalidValue = String.format("%s... (complete value was %d characters)", ((String) invalidValue).substring(0, MAX_STRING_ERROR_LENGTH), ((String) invalidValue).length()); + if (invalidValue instanceof String && (((String) invalidValue).length() > MAX_STRING_ERROR_LENGTH)) + { + invalidValue = + String.format("%s... (complete value was %d characters)", ((String) invalidValue).substring(0, MAX_STRING_ERROR_LENGTH), + ((String) invalidValue).length()); } msg += ", " + String.format(v.getMessage(), invalidValue); } @@ -179,7 +183,7 @@ public abstract class AbstractDAO extends HibernateDaoSupport size); } } - + protected Date getTransactionTimeStamp() { return UpdateUtils.getTransactionTimeStamp(getSessionFactory()); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/AbstractGenericEntityWithPropertiesDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/AbstractGenericEntityWithPropertiesDAO.java index b713d4d02dba9c32db86abf65b4c4d2a5e44f072..2278e300d46fdec14b81d55b1f258cfad606c870 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/AbstractGenericEntityWithPropertiesDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/AbstractGenericEntityWithPropertiesDAO.java @@ -125,7 +125,7 @@ public abstract class AbstractGenericEntityWithPropertiesDAO<T extends IEntityIn final List<TechId> entityTechIds, final PersonPE registrator, final String reason, final String sqlSelectPermIds, final String sqlDeleteProperties, final String sqlDeleteAttachments, final String sqlDeleteEntities, - final String sqlInsertEvent, final String sqlSelectPropertyHistory, + final String sqlInsertEvent, final String sqlSelectPropertyHistory, final String sqlSelectRelationshipHistory, final String sqlSelectAttributes, List<? extends AttachmentHolderPE> attachmentHolders, AttachmentHolderKind attachmentHolderKind) @@ -133,7 +133,7 @@ public abstract class AbstractGenericEntityWithPropertiesDAO<T extends IEntityIn List<Long> entityIds = TechId.asLongs(entityTechIds); DeletePermanentlyBatchOperation deleteOperation = new DeletePermanentlyBatchOperation(entityType, entityIds, registrator, reason, - sqlSelectPermIds, sqlDeleteProperties, + sqlSelectPermIds, sqlDeleteProperties, sqlDeleteAttachments, sqlDeleteEntities, sqlInsertEvent, sqlSelectPropertyHistory, sqlSelectRelationshipHistory, sqlSelectAttributes, attachmentHolders, attachmentHolderKind); @@ -179,7 +179,7 @@ public abstract class AbstractGenericEntityWithPropertiesDAO<T extends IEntityIn DeletePermanentlyBatchOperation(EntityType entityType, List<Long> allEntityIds, PersonPE registrator, String reason, String sqlSelectPermIds, String sqlDeleteProperties, String sqlDeleteAttachments, - String sqlDeleteEntities, String sqlInsertEvent, String selectPropertyHistory, + String sqlDeleteEntities, String sqlInsertEvent, String selectPropertyHistory, String selectRelationshipHistory, String sqlSelectAttributes, List<? extends AttachmentHolderPE> attachmentHolders, AttachmentHolderKind attachmentHolderKind) @@ -257,8 +257,8 @@ public abstract class AbstractGenericEntityWithPropertiesDAO<T extends IEntityIn return null; } - String content = historyCreator.apply(session, entityIdsToDelete, sqlSelectPropertyHistory, - sqlSelectRelationshipHistory, sqlSelectAttributes, attachmentHolders, + String content = historyCreator.apply(session, entityIdsToDelete, sqlSelectPropertyHistory, + sqlSelectRelationshipHistory, sqlSelectAttributes, attachmentHolders, attachmentHolderKind, registrator); deleteProperties(sqlQueryDeleteProperties, entityIdsToDelete); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/AttachmentDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/AttachmentDAO.java index 03133291f2cbab13a3cd23235f9e0c54952eac8f..ea4027fcda57fb71c6e00faa6146e45a6ff798e0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/AttachmentDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/AttachmentDAO.java @@ -67,10 +67,9 @@ final class AttachmentDAO extends AbstractGenericEntityDAO<AttachmentPE> impleme private static final Logger operationLog = LogFactory.getLogger(LogCategory.OPERATION, AttachmentDAO.class); - private final IEventDAO eventDAO; - AttachmentDAO(final PersistencyResources persistencyResources, + AttachmentDAO(final PersistencyResources persistencyResources, IEventDAO eventDAO, EntityHistoryCreator historyCreator) { super(persistencyResources.getSessionFactory(), ATTACHMENT_CLASS, historyCreator); @@ -101,7 +100,7 @@ final class AttachmentDAO extends AbstractGenericEntityDAO<AttachmentPE> impleme // @Override - public Map<String, AttachmentEntry> deleteAttachments(final AttachmentHolderPE holder, final String reason, + public Map<String, AttachmentEntry> deleteAttachments(final AttachmentHolderPE holder, final String reason, final List<String> fileNames, PersonPE registrator) { Map<String, AttachmentEntry> attachmentEntries = new TreeMap<>(); @@ -121,7 +120,7 @@ final class AttachmentDAO extends AbstractGenericEntityDAO<AttachmentPE> impleme return attachmentEntries; } - private Map<String, AttachmentEntry> createDeletionEvents(List<AttachmentPE> attachmentsToBeDeleted, + private Map<String, AttachmentEntry> createDeletionEvents(List<AttachmentPE> attachmentsToBeDeleted, PersonPE registrator, String reason) { Map<String, AttachmentEntry> attachmentEntries = new TreeMap<>(); @@ -141,8 +140,7 @@ final class AttachmentDAO extends AbstractGenericEntityDAO<AttachmentPE> impleme event.setReason(reason); event.setRegistrator(registrator); event.setAttachmentContent(attachmentToBeDeleted.getAttachmentContent()); - Map<String, List<? extends EntityModification>> modifications - = new HashMap<String, List<? extends EntityModification>>(); + Map<String, List<? extends EntityModification>> modifications = new HashMap<String, List<? extends EntityModification>>(); AttachmentEntry attachmentEntry = new AttachmentEntry(); attachmentEntry.fileName = fileName; attachmentEntry.version = version; @@ -167,7 +165,7 @@ final class AttachmentDAO extends AbstractGenericEntityDAO<AttachmentPE> impleme { AttachmentHolderPE result = internalCreateAttachment(attachment, ownerParam); getHibernateTemplate().flush(); - + scheduleDynamicPropertiesEvaluation(ownerParam); return result; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DAOFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DAOFactory.java index caa3ae78c842db0c3984250f83dbe2a114024f32..2988dc0cc231f15360bf0a7419998e6b1f43fc52 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DAOFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DAOFactory.java @@ -355,8 +355,8 @@ public final class DAOFactory extends AuthorizationDAOFactory implements IDAOFac public void afterPropertiesSet() throws Exception { // TODO: project samples -// Properties serviceProperties = configurer.getResolvedProps(); -// boolean projectSamplesEnabled = PropertyUtils.getBoolean(serviceProperties, Constants.PROJECT_SAMPLES_ENABLED_KEY, false); + // Properties serviceProperties = configurer.getResolvedProps(); + // boolean projectSamplesEnabled = PropertyUtils.getBoolean(serviceProperties, Constants.PROJECT_SAMPLES_ENABLED_KEY, false); boolean projectSamplesEnabled = false; Connection connection = null; try diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DataDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DataDAO.java index 71cf453699113ee1b5ba64a748b34941abb6723b..a041cb66d4e00809463b297ddace2ce7bc1ca584 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DataDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DataDAO.java @@ -937,12 +937,12 @@ final class DataDAO extends AbstractGenericEntityWithPropertiesDAO<DataPE> imple private static String createQueryRelationshipHistorySQL() { - return " SELECT d.code, relation_type,entity_perm_id, " + ENTITY_TYPE + ", " + return " SELECT d.code, relation_type,entity_perm_id, " + ENTITY_TYPE + ", " + "p.user_id, valid_from_timestamp, valid_until_timestamp " + "FROM " + TableNames.DATA_ALL_TABLE + " d, " + TableNames.DATA_SET_RELATIONSHIPS_HISTORY_TABLE + " h, " + TableNames.PERSONS_TABLE + " p " - + "WHERE d.id = main_data_id and main_data_id " + SQLBuilder.inEntityIds() - + " and h.pers_id_author = p.id" + + "WHERE d.id = main_data_id and main_data_id " + SQLBuilder.inEntityIds() + + " and h.pers_id_author = p.id" + " order by 1, valid_from_timestamp"; } @@ -1058,7 +1058,7 @@ final class DataDAO extends AbstractGenericEntityWithPropertiesDAO<DataPE> imple final List<DeletedDataSetLocation> locations = selectLocations(selectLocations, entityIdsToDelete); - String content = historyCreator.apply(session, entityIdsToDelete, sqls.selectPropertyHistory, + String content = historyCreator.apply(session, entityIdsToDelete, sqls.selectPropertyHistory, sqls.selectRelationshipHistory, sqls.selectAttributes, null, null, registrator); executeUpdate(deleteProperties, entityIdsToDelete); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DatabaseAndIndexReplacer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DatabaseAndIndexReplacer.java index 3994a56fc4f188fb9406e7b5ea2f892a60b4fc48..6c2ae1fbb830d351da71e8891fbf4f03fc8ac060 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DatabaseAndIndexReplacer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DatabaseAndIndexReplacer.java @@ -28,16 +28,14 @@ import ch.systemsx.cisd.common.logging.LogFactory; import ch.systemsx.cisd.common.logging.LogInitializer; /** - * Helper application which replaces a database and its Lucene index by another existing database and - * its index. + * Helper application which replaces a database and its Lucene index by another existing database and its index. * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ public class DatabaseAndIndexReplacer { private static final Logger operationLog = - LogFactory.getLogger(LogCategory.OPERATION, DatabaseAndIndexReplacer.class); - + LogFactory.getLogger(LogCategory.OPERATION, DatabaseAndIndexReplacer.class); public static void main(String[] args) { @@ -53,7 +51,7 @@ public class DatabaseAndIndexReplacer File destinationFolder = new File(args[1]); String sourceDatabase = IndexCreationUtil.DATABASE_NAME_PREFIX + args[2]; File sourceFolder = new File(args[3]); - + boolean ok = IndexCreationUtil.duplicateDatabase(destinationDatabase, sourceDatabase); if (ok == false) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DynamicPropertiesInterceptor.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DynamicPropertiesInterceptor.java index 313ab2d36878c9dbd620bc837984f99ac84f0904..cff239c2791d79ce113ba6434731e6da54a4902c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DynamicPropertiesInterceptor.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DynamicPropertiesInterceptor.java @@ -23,8 +23,7 @@ import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDynamicPropertyEvalua import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ServiceVersionHolder; /** - * Synchronizes all dynamic property evaluations scheduled in a transaction with persistent queue - * after transaction is successfully committed. + * Synchronizes all dynamic property evaluations scheduled in a transaction with persistent queue after transaction is successfully committed. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ExperimentDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ExperimentDAO.java index 91e84c5d734119db3bc22282e525ec8eca67ac4d..ad10c25309cd2afb997707703d639f23999098a6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ExperimentDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ExperimentDAO.java @@ -492,7 +492,7 @@ public class ExperimentDAO extends AbstractGenericEntityWithPropertiesDAO<Experi executePermanentDeleteAction(EntityType.EXPERIMENT, experimentIds, registrator, reason, sqlSelectPermIds, sqlDeleteProperties, sqlDeleteAttachments, sqlDeleteExperiments, - sqlInsertEvent, sqlSelectPropertyHistory, sqlSelectRelationshipHistory, sqlSelectAttributes, + sqlInsertEvent, sqlSelectPropertyHistory, sqlSelectRelationshipHistory, sqlSelectAttributes, null, AttachmentHolderKind.EXPERIMENT); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/IPermIdDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/IPermIdDAO.java index ee9fc3900695cdacd9b26796db2888c438947c1b..96363f25a79fde85adabdb1a743708b2f182a365 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/IPermIdDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/IPermIdDAO.java @@ -39,8 +39,7 @@ public interface IPermIdDAO public List<String> createPermIds(int n); /** - * Returns {@link IEntityInformationHolderDTO} for given permId and entityKind or null if - * nothing found; + * Returns {@link IEntityInformationHolderDTO} for given permId and entityKind or null if nothing found; */ public IEntityInformationHolderDTO tryToFindByPermId(String permId, EntityKind entityKind); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/IndexCreationUtil.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/IndexCreationUtil.java index 588f5f4a8a84060e78e886392d7dda35c57a51c0..134b443194d2139d3c54dcf5cde3cac1b5cb23a5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/IndexCreationUtil.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/IndexCreationUtil.java @@ -73,7 +73,7 @@ public final class IndexCreationUtil if (applicationContext == null) { final AbstractApplicationContext appC = new ClassPathXmlApplicationContext(new String[] - { "applicationContext.xml" }, true); + { "applicationContext.xml" }, true); IndexCreationUtil.applicationContext = appC; } return applicationContext; @@ -119,8 +119,7 @@ public final class IndexCreationUtil } /** - * Creates a freshly new {@link HibernateSearchContext} overriding the one loaded by - * <i>Spring</i>. + * Creates a freshly new {@link HibernateSearchContext} overriding the one loaded by <i>Spring</i>. */ private final static HibernateSearchContext createHibernateSearchContext(String indexFolder) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/MaterialDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/MaterialDAO.java index f60d67499abdbb6f11ab9aa1406cf924c0316119..65014315e160b832869b682b1a1300deec63f623 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/MaterialDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/MaterialDAO.java @@ -308,7 +308,7 @@ public class MaterialDAO extends AbstractGenericEntityWithPropertiesDAO<Material String materialTypeCode = (String) codeAndType[1]; String permId = MaterialPE.createPermId(materialCode, materialTypeCode); - String content = historyCreator.apply(session, Collections.singletonList(techId.getId()), + String content = historyCreator.apply(session, Collections.singletonList(techId.getId()), sqlPropertyHistory, null, sqlAttributesHistory, null, null, registrator); try diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SampleDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SampleDAO.java index 437c006d62ed996004213f1fb6ba64145ad93b3b..172437d7cc18c3e872c1ae06b4ff921fd9d9dbf2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SampleDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SampleDAO.java @@ -72,8 +72,7 @@ public class SampleDAO extends AbstractGenericEntityWithPropertiesDAO<SamplePE> /** * This logger does not output any SQL statement. If you want to do so, you had better set an appropriate debugging level for class - * {@link JdbcAccessor}. - * </p> + * {@link JdbcAccessor}. </p> */ private static final Logger operationLog = LogFactory.getLogger(LogCategory.OPERATION, SampleDAO.class); @@ -353,7 +352,7 @@ public class SampleDAO extends AbstractGenericEntityWithPropertiesDAO<SamplePE> @Override public final void createOrUpdateSamples(final List<SamplePE> samples, final PersonPE modifier, boolean clearCache) - throws DataAccessException + throws DataAccessException { assert samples != null && samples.size() > 0 : "Unspecified or empty samples."; @@ -457,7 +456,7 @@ public class SampleDAO extends AbstractGenericEntityWithPropertiesDAO<SamplePE> final String sqlSelectAttributes = createQueryAttributesSQL(); executePermanentDeleteAction(EntityType.SAMPLE, sampleIds, registrator, reason, - sqlSelectPermIds, sqlDeleteProperties, + sqlSelectPermIds, sqlDeleteProperties, sqlDeleteAttachments, sqlDeleteSamples, sqlInsertEvent, sqlSelectPropertyHistory, sqlSelectRelationshipHistory, sqlSelectAttributes, null, AttachmentHolderKind.SAMPLE); } @@ -491,7 +490,7 @@ public class SampleDAO extends AbstractGenericEntityWithPropertiesDAO<SamplePE> + ") " + " ORDER BY 1, valid_from_timestamp"; } - + private static String createQueryRelationshipHistorySQL() { return "SELECT s.perm_id, h.relation_type, h.entity_perm_id, " + ENTITY_TYPE + ", " @@ -570,7 +569,7 @@ public class SampleDAO extends AbstractGenericEntityWithPropertiesDAO<SamplePE> String permIds = permIdList.substring(2); String content = historyCreator.apply(session, entityIdsToDelete, createQueryPropertyHistorySQL(), - createQueryRelationshipHistorySQL(), createQueryAttributesSQL(), null, + createQueryRelationshipHistorySQL(), createQueryAttributesSQL(), null, AttachmentHolderKind.SAMPLE, registrator); SQLQuery deleteProperties = session.createSQLQuery(properties); @@ -586,14 +585,14 @@ public class SampleDAO extends AbstractGenericEntityWithPropertiesDAO<SamplePE> deleteAttachments.setParameter("id", deletion.getId()); deleteAttachments.executeUpdate(); -// if (attachmentContentIdList.size() > 0) -// { -// SQLQuery deleteAttachmentContents = -// session.createSQLQuery(attachmentContents); -// deleteAttachmentContents.setParameterList("ids", attachmentContentIdList); -// deleteAttachmentContents.executeUpdate(); -// } -// + // if (attachmentContentIdList.size() > 0) + // { + // SQLQuery deleteAttachmentContents = + // session.createSQLQuery(attachmentContents); + // deleteAttachmentContents.setParameterList("ids", attachmentContentIdList); + // deleteAttachmentContents.executeUpdate(); + // } + // SQLQuery deleteSamples = session.createSQLQuery(samples); deleteSamples.setParameter("id", deletion.getId()); deleteSamples.executeUpdate(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/AttachmentEntry.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/AttachmentEntry.java index fae3b3275580b46595cff0a1577034720a6f7455..4b76b8cc8faf58807e24ce4537b1f6db110ecdcf 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/AttachmentEntry.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/AttachmentEntry.java @@ -21,8 +21,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonInclude.Include; /** - * - * * @author Franz-Josef Elmer */ public class AttachmentEntry extends EntityModification @@ -30,22 +28,22 @@ public class AttachmentEntry extends EntityModification public static final String ATTACHMENT = "ATTACHMENT"; public final String type = ATTACHMENT; - + @JsonProperty("key") public String relationType; - + @JsonProperty("value") public String relatedEntity; public String entityType; - + public String fileName; - + public int version; - + @JsonInclude(Include.NON_EMPTY) public String description; - + @JsonInclude(Include.NON_EMPTY) public String title; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/AttributeEntry.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/AttributeEntry.java index 7d425b617453cb489c2f314e21b3d4cf98513cdd..3d65dc7272212a83e1998a76019f0934f130e8d7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/AttributeEntry.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/AttributeEntry.java @@ -19,8 +19,6 @@ package ch.systemsx.cisd.openbis.generic.server.dataaccess.db.deletion; import com.fasterxml.jackson.annotation.JsonProperty; /** - * - * * @author Franz-Josef Elmer */ public class AttributeEntry extends EntityModification @@ -33,7 +31,7 @@ public class AttributeEntry extends EntityModification public String attributeName; public String value; - + @Override public String toString() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/EntityHistoryCreator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/EntityHistoryCreator.java index 5118e9ebae27ef9697aeff0ce4a3bed1c7ae8bab..d63f9f002a1f7a85bfa8b05c595f08d5f9f3b37f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/EntityHistoryCreator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/EntityHistoryCreator.java @@ -57,7 +57,7 @@ public class EntityHistoryCreator } public String apply(SharedSessionContract session, List<Long> entityIdsToDelete, - String propertyHistoryQuery, String relationshipHistoryQuery, String attributesQuery, + String propertyHistoryQuery, String relationshipHistoryQuery, String attributesQuery, List<? extends AttachmentHolderPE> attachmentHolders, AttachmentHolderKind attachmentHolderKind, PersonPE registrator) { @@ -73,7 +73,7 @@ public class EntityHistoryCreator selectAttributeEntries(session.createSQLQuery(attributesQuery), entityIdsToDelete); addToHistories(histories, attributeEntries); } - + List<PropertyHistoryEntry> propertyHistory = selectHistoryPropertyEntries(session.createSQLQuery(propertyHistoryQuery), entityIdsToDelete); addToHistories(histories, propertyHistory); @@ -85,17 +85,15 @@ public class EntityHistoryCreator entityIdsToDelete); addToHistories(histories, relationshipHistory); } - + if (attachmentHolders != null) { - List<RelationshipHistoryEntry> deletedAttachments - = deleteAttachments(session, registrator, attachmentHolders); + List<RelationshipHistoryEntry> deletedAttachments = deleteAttachments(session, registrator, attachmentHolders); addToHistories(histories, deletedAttachments); } if (attachmentHolderKind != null) { - List<RelationshipHistoryEntry> deletedAttachments - = deleteAttachments(session, registrator, attachmentHolderKind, entityIdsToDelete); + List<RelationshipHistoryEntry> deletedAttachments = deleteAttachments(session, registrator, attachmentHolderKind, entityIdsToDelete); addToHistories(histories, deletedAttachments); } @@ -116,7 +114,7 @@ public class EntityHistoryCreator } return content; } - + private List<RelationshipHistoryEntry> deleteAttachments(SharedSessionContract session, PersonPE registrator, AttachmentHolderKind attachmentHolderKind, List<Long> holderIds) { @@ -150,8 +148,7 @@ public class EntityHistoryCreator insertQuery.setParameter("registerer", registrator.getId()); insertQuery.setParameter("identifiers", identifier); insertQuery.setParameter("attachment", ((Number) row.get("EXAC_ID")).longValue()); - Map<String, List<? extends EntityModification>> modifications - = new HashMap<String, List<? extends EntityModification>>(); + Map<String, List<? extends EntityModification>> modifications = new HashMap<String, List<? extends EntityModification>>(); AttachmentEntry attachmentEntry = new AttachmentEntry(); attachmentEntry.fileName = fileName; attachmentEntry.version = version; @@ -183,35 +180,47 @@ public class EntityHistoryCreator } return result; } - + private String createSelectHolderStatement(AttachmentHolderKind holderKind) { String tableName = ""; switch (holderKind) { - case PROJECT: tableName = "projects"; break; - case EXPERIMENT: tableName = "experiments_all"; break; - case SAMPLE: tableName = "samples_all"; break; + case PROJECT: + tableName = "projects"; + break; + case EXPERIMENT: + tableName = "experiments_all"; + break; + case SAMPLE: + tableName = "samples_all"; + break; } return "SELECT id, perm_id from " + tableName + " WHERE id in (:" + ENTITY_IDS + ")"; } - + private String createSelectAttachmentsStatement(AttachmentHolderKind attachmentHolderKind) { String holderColumn = ""; switch (attachmentHolderKind) { - case PROJECT: holderColumn = "proj_id"; break; - case EXPERIMENT: holderColumn = "expe_id"; break; - case SAMPLE: holderColumn = "samp_id"; break; + case PROJECT: + holderColumn = "proj_id"; + break; + case EXPERIMENT: + holderColumn = "expe_id"; + break; + case SAMPLE: + holderColumn = "samp_id"; + break; } return "SELECT " + holderColumn + " as holder_id, file_name, " + "version, title, description, a.registration_timestamp, r.user_id, exac_id " + "FROM attachments a join persons r on a.pers_id_registerer = r.id " + "WHERE " + holderColumn + " in (:" + ENTITY_IDS + ")"; } - - private List<RelationshipHistoryEntry> deleteAttachments(SharedSessionContract session, + + private List<RelationshipHistoryEntry> deleteAttachments(SharedSessionContract session, PersonPE registrator, List<? extends AttachmentHolderPE> attachmentHolders) { List<RelationshipHistoryEntry> relationshipHistoryEntries = new ArrayList<>(); @@ -224,15 +233,14 @@ public class EntityHistoryCreator { fileNames.add(attachment.getFileName()); } - Map<String, AttachmentEntry> deletedAttachments - = attachmentDAO.deleteAttachments(holder, "", fileNames, registrator); + Map<String, AttachmentEntry> deletedAttachments = attachmentDAO.deleteAttachments(holder, "", fileNames, registrator); Set<Entry<String, AttachmentEntry>> entrySet = deletedAttachments.entrySet(); for (Entry<String, AttachmentEntry> entry : entrySet) { RelationshipHistoryEntry relationshipHistoryEntry = new RelationshipHistoryEntry(); relationshipHistoryEntry.userId = entry.getValue().userId; relationshipHistoryEntry.entityType = "ATTACHMENT"; - relationshipHistoryEntry.permId = holder.getPermId() ; + relationshipHistoryEntry.permId = holder.getPermId(); relationshipHistoryEntry.relatedEntity = entry.getKey(); relationshipHistoryEntry.relationType = "OWNER"; relationshipHistoryEntry.validFrom = entry.getValue().validFrom; @@ -241,7 +249,7 @@ public class EntityHistoryCreator } return relationshipHistoryEntries; } - + private List<AttributeEntry> selectAttributeEntries(SQLQuery sqlQuery, List<Long> entityIdsToDelete) { List<Map<String, Object>> rows = getRows(sqlQuery, entityIdsToDelete); @@ -446,11 +454,12 @@ public class EntityHistoryCreator } } - + private static class AttachmentHolder { long id; + String permId; } - + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/EntityModification.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/EntityModification.java index 60d7d36cecd8e3d7ac05259d22cd11f1150bc6f3..b3f457e439f5d07d6b49cfcf1390bb661143bf3e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/EntityModification.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/EntityModification.java @@ -10,7 +10,7 @@ public class EntityModification { @JsonInclude(Include.NON_EMPTY) public String userId; - + @JsonIgnore public String permId; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/PropertyHistoryEntry.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/PropertyHistoryEntry.java index 49546304a56a2a015909b899bca7b865a9edddb4..189de5d88a56b46d5deeed91c0d371e3767c56b6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/PropertyHistoryEntry.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/PropertyHistoryEntry.java @@ -2,12 +2,10 @@ package ch.systemsx.cisd.openbis.generic.server.dataaccess.db.deletion; import com.fasterxml.jackson.annotation.JsonProperty; - - public class PropertyHistoryEntry extends EntityModification { public final String type = "PROPERTY"; - + @JsonProperty("key") public String propertyCode; @@ -17,7 +15,7 @@ public class PropertyHistoryEntry extends EntityModification public String toString() { return "HistoryPropertyEntry [permId=" + permId + ", propertyCode=" + propertyCode + ", value=" + value - + ", user_id=" + userId + + ", user_id=" + userId + ", valid_from_timestamp=" + validFrom + ", valid_until_timestamp=" + validUntil + "]"; } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/RelationshipHistoryEntry.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/RelationshipHistoryEntry.java index 4dfa99e5762c8957d7531084b2630842ed22f272..3f3b1438240af923006d4019528a914d80a2bb47 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/RelationshipHistoryEntry.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/deletion/RelationshipHistoryEntry.java @@ -2,12 +2,10 @@ package ch.systemsx.cisd.openbis.generic.server.dataaccess.db.deletion; import com.fasterxml.jackson.annotation.JsonProperty; - - public class RelationshipHistoryEntry extends EntityModification { public final String type = "RELATIONSHIP"; - + @JsonProperty("key") public String relationType; @@ -20,7 +18,7 @@ public class RelationshipHistoryEntry extends EntityModification public String toString() { return "RelationshipHistoryEntry [permId=" + permId + ", relationType=" + relationType + ", relatedEntity=" - + relatedEntity + ", entityType=" + entityType + ", userId=" + userId + ", validFromTimestamp=" + + relatedEntity + ", entityType=" + entityType + ", userId=" + userId + ", validFromTimestamp=" + validFrom + ", validUntilTimestamp=" + validUntil + "]"; } } \ No newline at end of file diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/CharacterHelper.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/CharacterHelper.java index 0c8d82d702a0e92ec90883c73e56157e55f64e5e..9a31f8d4619371207ab6ee0163c7e27887ed79e0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/CharacterHelper.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/CharacterHelper.java @@ -31,7 +31,7 @@ public class CharacterHelper private static final char ESCAPE_CHARACTER = '\\'; public final static Set<Character> SPECIAL_CHARACTERS = new HashSet<Character>(Arrays.asList( - // Special code characters + // Special code characters '.', ':', '-', '_', // Special word characters diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/HibernateSearchContext.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/HibernateSearchContext.java index cd9408794b525559c72460fe07a83c1411da40e6..3aa88581c3159b749d3f088be984610069bc60fb 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/HibernateSearchContext.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/HibernateSearchContext.java @@ -33,8 +33,7 @@ import ch.systemsx.cisd.common.reflection.ModifiedShortPrefixToStringStyle; /** * A bean class that contains properties related to <i>Hibernate Search</i>. * <p> - * This bean must be initialized before <code>hibernate-session-factory</code> bean as it will - * remove the <code>indexBase</code> directory. + * This bean must be initialized before <code>hibernate-session-factory</code> bean as it will remove the <code>indexBase</code> directory. * </p> * * @author Christian Ribeaud diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IFullTextIndexUpdateScheduler.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IFullTextIndexUpdateScheduler.java index 81ca1bb53ae82b89d2740b0979acb58785e3e1d4..fbd5de16b694c6ffa75037135e0b9e503c4235c6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IFullTextIndexUpdateScheduler.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IFullTextIndexUpdateScheduler.java @@ -17,9 +17,8 @@ package ch.systemsx.cisd.openbis.generic.server.dataaccess.db.search; /** - * Each implementation is able to schedule a <i>full-text</i> index update. Updates are expected to - * be executed asynchronously in the order they had been scheduled. The thread executing updates - * will run with low priority. + * Each implementation is able to schedule a <i>full-text</i> index update. Updates are expected to be executed asynchronously in the order they had + * been scheduled. The thread executing updates will run with low priority. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IFullTextIndexUpdater.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IFullTextIndexUpdater.java index a158dea6f898c3c9db4e0aac3dace5f888bbd28b..ea7cc234cdab5b1e522b6aa387a3f477d622a248 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IFullTextIndexUpdater.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IFullTextIndexUpdater.java @@ -17,9 +17,8 @@ package ch.systemsx.cisd.openbis.generic.server.dataaccess.db.search; /** - * Each implementation is able to perform a <i>full-text</i> index update. Updates are expected to - * be executed asynchronously in the order they had been scheduled. The thread executing updates - * will run with low priority. + * Each implementation is able to perform a <i>full-text</i> index update. Updates are expected to be executed asynchronously in the order they had + * been scheduled. The thread executing updates will run with low priority. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IFullTextIndexer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IFullTextIndexer.java index a0e484f72aac02e60387b8d61c87f3f3bbc6fd92..c065a8a5dd8042cca5e2671ed58877c6689533f7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IFullTextIndexer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IFullTextIndexer.java @@ -31,22 +31,19 @@ public interface IFullTextIndexer { /** - * Performs a <i>full-text</i> index on entities of given <var>clazz</var> using given - * <i>Hibernate</i> session. + * Performs a <i>full-text</i> index on entities of given <var>clazz</var> using given <i>Hibernate</i> session. */ public <T> void doFullTextIndex(final Session hibernateSession, final Class<T> clazz) throws DataAccessException; /** - * Performs a <i>full-text</i> index update on entities of given <var>clazz</var> with given - * <var>ids</var> using given <i>Hibernate</i> session. + * Performs a <i>full-text</i> index update on entities of given <var>clazz</var> with given <var>ids</var> using given <i>Hibernate</i> session. */ public <T> void doFullTextIndexUpdate(final Session hibernateSession, final Class<T> clazz, final List<Long> ids) throws DataAccessException; /** - * Removes entities of given <var>clazz</var> with given <var>ids</var> from the - * <i>full-text</i> index using given <i>Hibernate</i> session. + * Removes entities of given <var>clazz</var> with given <var>ids</var> from the <i>full-text</i> index using given <i>Hibernate</i> session. */ public <T> void removeFromIndex(final Session hibernateSession, final Class<T> clazz, final List<Long> ids) throws DataAccessException; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IndexMode.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IndexMode.java index 36cbae20f5fe578fd89cd11d6b14299e731b71e3..872396de1fa38f009e6681630f458d9df1d73c65 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IndexMode.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IndexMode.java @@ -20,11 +20,9 @@ package ch.systemsx.cisd.openbis.generic.server.dataaccess.db.search; * The mode in which the indexing is working: * <ul> * <li><b>NO_INDEX</b>: no manual index will be performed.</li> - * <li><b>SKIP_IF_MARKER_FOUND</b>: skips the indexing if - * {@link FullTextIndexerRunnable#FULL_TEXT_INDEX_MARKER_FILENAME} marker file is found (meaning - * that a manual index has already been performed).</li> - * <li><b>INDEX_FROM_SCRATCH</b>: performs a manual index from the scratch, deleting the whole - * <code>index-base</code> directory.</li> + * <li><b>SKIP_IF_MARKER_FOUND</b>: skips the indexing if {@link FullTextIndexerRunnable#FULL_TEXT_INDEX_MARKER_FILENAME} marker file is found + * (meaning that a manual index has already been performed).</li> + * <li><b>INDEX_FROM_SCRATCH</b>: performs a manual index from the scratch, deleting the whole <code>index-base</code> directory.</li> * </ul> * * @author Christian Ribeaud diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IndexingQueryOptimizer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IndexingQueryOptimizer.java index 6162d4f3ddb98a2d58e8b50e63e6d3d4b9865d13..b6e9af685056862901aa9d3db8f2c3f8d2d086e3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IndexingQueryOptimizer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IndexingQueryOptimizer.java @@ -44,10 +44,9 @@ public class IndexingQueryOptimizer } /** - * Modifies a Criteria instance to optimize database queries that are used to do full text - * indexing. Sets fetch mode to FetchMode.JOIN for all properties of an entity class that are - * either annotated with IndexedEmbedded or they are eagerly fetched associations annotated with - * OneToOne, ManyToOne, OneToMany or ManyToMany. + * Modifies a Criteria instance to optimize database queries that are used to do full text indexing. Sets fetch mode to FetchMode.JOIN for all + * properties of an entity class that are either annotated with IndexedEmbedded or they are eagerly fetched associations annotated with OneToOne, + * ManyToOne, OneToMany or ManyToMany. * * @param clazz Entity class whose instances are to be queried * @param criteria Criteria query to be optimized diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/LuceneQueryBuilder.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/LuceneQueryBuilder.java index 795d9787f7101036c4701b0d20c721732ed5d4e7..b68b9faf8150cfbd8500eb0cdab99712b57b8758 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/LuceneQueryBuilder.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/LuceneQueryBuilder.java @@ -207,7 +207,7 @@ public class LuceneQueryBuilder String fieldName = fieldNames.get(i); String searchPattern = searchPatterns.get(i); Analyzer analyzer = analyzers.get(i); - + Query query = parseQuery(fieldName, searchPattern, analyzer); Occur occur = occurs.get(i); if (Occur.MUST_NOT.equals(occur)) @@ -244,7 +244,7 @@ public class LuceneQueryBuilder { parser.setAllowLeadingWildcard(true); BooleanQuery.setMaxClauseCount(Integer.MAX_VALUE); - + try { return parser.parse(wholeQuery); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/PackageBasedIndexedEntityFinder.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/PackageBasedIndexedEntityFinder.java index f14b2c4056bcb250c364bdfb0a53f3e92c1511b3..369348686de976914edc348d80ab0bbfdea24b54 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/PackageBasedIndexedEntityFinder.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/PackageBasedIndexedEntityFinder.java @@ -26,11 +26,9 @@ import ch.systemsx.cisd.common.reflection.ClassUtils; import ch.systemsx.cisd.common.reflection.IClassFilter; /** - * A {@link IIndexedEntityFinder} based on a package name specified in the constructor. Classes - * ending with <code>Test</code> will be ignored. + * A {@link IIndexedEntityFinder} based on a package name specified in the constructor. Classes ending with <code>Test</code> will be ignored. * <p> - * This does not work recursively and expects to find all the correctly annotated classes in the - * given package. + * This does not work recursively and expects to find all the correctly annotated classes in the given package. * </p> * * @author Christian Ribeaud diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/detailed/DetailedQueryBuilder.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/detailed/DetailedQueryBuilder.java index 5271725b3697206efa0da43cae7ea974372bee7f..66072f122a887b99b9f360abeb1b79e097ca5625 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/detailed/DetailedQueryBuilder.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/detailed/DetailedQueryBuilder.java @@ -88,7 +88,7 @@ public class DetailedQueryBuilder { this.entityKind = entityKind; } - + private Query createQuery(String userId, DetailedSearchCriteria searchCriteria, List<IAssociationCriteria> associations, Map<String, DocValuesType> fieldTypes) { @@ -121,11 +121,12 @@ public class DetailedQueryBuilder fieldPattern = LuceneQueryBuilder.adaptQuery(fieldUserQuery, useWildcardSearchMode, false); fieldAnalyzer = new IgnoreCaseAnalyzer(); - } else if(isNumeric && criterion.getType() != null) + } else if (isNumeric && criterion.getType() != null) { fieldPattern = getRangeNumberQuery(criterion, fieldPattern); fieldAnalyzer = PassThroughAnalyzer.INSTANCE; - } else { + } else + { fieldPattern = LuceneQueryBuilder.adaptQuery(value, useWildcardSearchMode); fieldAnalyzer = searchAnalyzer; } @@ -135,7 +136,7 @@ public class DetailedQueryBuilder fieldOccur.add(criterion.isNegated() ? Occur.MUST_NOT : Occur.SHOULD); } - Query luceneQuery = LuceneQueryBuilder.parseQuery(criterion.getType(), fieldNames, + Query luceneQuery = LuceneQueryBuilder.parseQuery(criterion.getType(), fieldNames, fieldPatterns, fieldAnalyzers, fieldOccur); resultQuery.add(luceneQuery, occureCondition); } else @@ -164,7 +165,8 @@ public class DetailedQueryBuilder private String getRangeNumberQuery(DetailedSearchCriterion criterion, String fieldPattern) { String parsedNumberValue = SortableNumberBridgeUtils.getNumberForLucene(criterion.getValue()); - switch(criterion.getType()) { + switch (criterion.getType()) + { case LESS_THAN: return "{* TO " + parsedNumberValue + "}"; case LESS_THAN_OR_EQUAL: @@ -178,7 +180,7 @@ public class DetailedQueryBuilder } return fieldPattern; } - + private Occur createOccureCondition(SearchCriteriaConnection connection) { switch (connection) @@ -191,8 +193,9 @@ public class DetailedQueryBuilder throw InternalErr.error("unknown enum " + connection); } } - - public static List<String> getIndexFieldNames(List<DetailedSearchCriterion> criteria, EntityKind entityKind) { + + public static List<String> getIndexFieldNames(List<DetailedSearchCriterion> criteria, EntityKind entityKind) + { List<String> fieldNames = new ArrayList<String>(); for (DetailedSearchCriterion criterion : criteria) { @@ -200,7 +203,7 @@ public class DetailedQueryBuilder } return fieldNames; } - + private static List<String> getIndexFieldNames(DetailedSearchField searchField, EntityKind entityKind) { DetailedSearchFieldKind fieldKind = searchField.getKind(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/detailed/IndexFieldNameHelper.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/detailed/IndexFieldNameHelper.java index d9a2195afc4434b61e23967e1ee29e30784df910..6dac8cd7a6f2fe924fe83326b74e023033217278 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/detailed/IndexFieldNameHelper.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/detailed/IndexFieldNameHelper.java @@ -49,7 +49,7 @@ class IndexFieldNameHelper return SearchFieldConstants.EXPERIMENT_ID; } throw createAssociationNotHandledException(entityKind, associationKind); - + case SAMPLE: if (entityKind == EntityKind.DATA_SET) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/DynamicPropertyEvaluator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/DynamicPropertyEvaluator.java index c3ff30ec57edb030f3c7516ea9e6ffa80d758c74..e4584b2fe06edd3c35d2e5fc0ed94346eeb1efbc 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/DynamicPropertyEvaluator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/DynamicPropertyEvaluator.java @@ -113,14 +113,16 @@ public class DynamicPropertyEvaluator implements IDynamicPropertyEvaluator .setParameter("sample", entity); allPropertyTypes = propertyTypeQuery.list(); - if (allPropertyTypes.size() > 0) { + if (allPropertyTypes.size() > 0) + { propertyQuery = session.createQuery( "SELECT property FROM SamplePropertyPE property WHERE " + "property.entity = :sample AND property.entityTypePropertyType IN (:types)") .setParameter("sample", entity).setParameterList("types", allPropertyTypes); existingProperties = propertyQuery.list(); - } else { + } else + { existingProperties = new ArrayList<EntityPropertyPE>(); } break; @@ -131,14 +133,16 @@ public class DynamicPropertyEvaluator implements IDynamicPropertyEvaluator .setParameter("data", entity); allPropertyTypes = propertyTypeQuery.list(); - if (allPropertyTypes.size() > 0) { + if (allPropertyTypes.size() > 0) + { propertyQuery = session.createQuery( "SELECT property FROM DataSetPropertyPE property WHERE " + "property.entity = :data AND property.entityTypePropertyType IN (:types)") .setParameter("data", entity).setParameterList("types", allPropertyTypes); existingProperties = propertyQuery.list(); - } else { + } else + { existingProperties = new ArrayList<EntityPropertyPE>(); } break; @@ -149,17 +153,19 @@ public class DynamicPropertyEvaluator implements IDynamicPropertyEvaluator .setParameter("experiment", entity); allPropertyTypes = propertyTypeQuery.list(); - if (allPropertyTypes.size() > 0) { + if (allPropertyTypes.size() > 0) + { propertyQuery = session.createQuery( "SELECT property FROM ExperimentPropertyPE property WHERE " + "property.entity = :experiment AND property.entityTypePropertyType IN (:types)") .setParameter("experiment", entity).setParameterList("types", allPropertyTypes); existingProperties = propertyQuery.list(); - } else { + } else + { existingProperties = new ArrayList<EntityPropertyPE>(); } - + break; case MATERIAL: propertyTypeQuery = @@ -168,14 +174,16 @@ public class DynamicPropertyEvaluator implements IDynamicPropertyEvaluator .setParameter("material", entity); allPropertyTypes = propertyTypeQuery.list(); - if (allPropertyTypes.size() > 0) { + if (allPropertyTypes.size() > 0) + { propertyQuery = session.createQuery( "SELECT property FROM MaterialPropertyPE property WHERE " + "property.entity = :material AND property.entityTypePropertyType IN (:types)") .setParameter("material", entity).setParameterList("types", allPropertyTypes); existingProperties = propertyQuery.list(); - } else { + } else + { existingProperties = new ArrayList<EntityPropertyPE>(); } break; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/IBatchDynamicPropertyEvaluator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/IBatchDynamicPropertyEvaluator.java index 5569bd95d69a419a820a93e6bf1c8c1dda29b062..6b73cb15dce5f73b0f2ec2db9b25878fdbb36f02 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/IBatchDynamicPropertyEvaluator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/IBatchDynamicPropertyEvaluator.java @@ -24,8 +24,8 @@ import org.springframework.dao.DataAccessException; import ch.systemsx.cisd.openbis.generic.shared.dto.IEntityInformationWithPropertiesHolder; /** - * Each implementation is able to evaluate dynamic properties of specified entities in batches. - * After evaluation of properties the entities will be reindexed. + * Each implementation is able to evaluate dynamic properties of specified entities in batches. After evaluation of properties the entities will be + * reindexed. * * @author Piotr Buczek */ @@ -33,8 +33,7 @@ public interface IBatchDynamicPropertyEvaluator { /** - * Evaluates dynamic properties of all entities of given <var>clazz</var> using given - * <i>Hibernate</i> session. + * Evaluates dynamic properties of all entities of given <var>clazz</var> using given <i>Hibernate</i> session. * * @return list of ids of entities with dynamic properties that have been evaluated */ @@ -42,8 +41,7 @@ public interface IBatchDynamicPropertyEvaluator final Session hibernateSession, final Class<T> clazz) throws DataAccessException; /** - * Evaluates dynamic properties of entities of given <var>clazz</var> with given <var>ids</var> - * using given <i>Hibernate</i> session. + * Evaluates dynamic properties of entities of given <var>clazz</var> with given <var>ids</var> using given <i>Hibernate</i> session. * * @return list of ids of entities with dynamic properties that have been evaluated */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/calculator/DynamicPropertyAdaptor.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/calculator/DynamicPropertyAdaptor.java index 04d136d4ca55eb17668e01680e19499549c067f8..d2c0d8262eddfad6fd970809cfe4b80439155325 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/calculator/DynamicPropertyAdaptor.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/calculator/DynamicPropertyAdaptor.java @@ -24,8 +24,7 @@ import ch.systemsx.cisd.openbis.generic.shared.hotdeploy_plugins.api.IEntityAdap import ch.systemsx.cisd.openbis.generic.shared.hotdeploy_plugins.api.IEntityPropertyAdaptor; /** - * {@link IEntityPropertyAdaptor} for dynamic property with lazy evaluation and cyclic dependencies - * detection. + * {@link IEntityPropertyAdaptor} for dynamic property with lazy evaluation and cyclic dependencies detection. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/calculator/DynamicPropertyFunctions.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/calculator/DynamicPropertyFunctions.java index 298cb7a2fb24648ba7d055af06e6468b61d8e49d..2456b03c5cf45ec61989c0fb0763707ce5f65bf1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/calculator/DynamicPropertyFunctions.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/calculator/DynamicPropertyFunctions.java @@ -28,8 +28,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialIdentifier; public final class DynamicPropertyFunctions { /** - * @return String representation of material identifier for given material code and material - * type code. + * @return String representation of material identifier for given material code and material type code. */ public static String material(String code, String typeCode) { @@ -37,8 +36,7 @@ public final class DynamicPropertyFunctions } /** - * @return code of material with given identifier or null if the identifier is not a valid - * material identifier + * @return code of material with given identifier or null if the identifier is not a valid material identifier */ public static String materialCode(String materialIdentifier) { @@ -48,8 +46,7 @@ public final class DynamicPropertyFunctions } /** - * @return type of material with given identifier or null if the identifier is not a valid - * material identifier + * @return type of material with given identifier or null if the identifier is not a valid material identifier */ public static String materialTypeCode(String materialIdentifier) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/calculator/ISampleAdaptorRelationsQuery.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/calculator/ISampleAdaptorRelationsQuery.java index 1630b8ccca91bc53c736165b1eb793f98f9cc45a..e098f5fc6bc31e8ba62ac60b43da31639a75cede 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/calculator/ISampleAdaptorRelationsQuery.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/calculator/ISampleAdaptorRelationsQuery.java @@ -43,7 +43,7 @@ public interface ISampleAdaptorRelationsQuery extends BaseQuery + " sr.relationship_id = rt.id AND sr.sample_id_parent = s.id AND " + " s.saty_id = st.id AND sr.sample_id_child = ?{1} AND " + " rt.code = '" + BasicConstant.PARENT_CHILD_DB_RELATIONSHIP + "' AND st.id = any(?{2})", parameterBindings = - { TypeMapper.class, LongSetMapper.class }, fetchSize = FETCH_SIZE) + { TypeMapper.class, LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<Long> getParentIdsOfTypes(Long childId, LongSet parentTypeIds); @Select(sql = "SELECT sr.sample_id_child FROM sample_relationships sr, " @@ -51,7 +51,7 @@ public interface ISampleAdaptorRelationsQuery extends BaseQuery + " sr.relationship_id = rt.id AND sr.sample_id_child = s.id AND " + " s.saty_id = st.id AND sr.sample_id_parent = ?{1} AND " + " rt.code = '" + BasicConstant.PARENT_CHILD_DB_RELATIONSHIP + "' AND st.id = any(?{2})", parameterBindings = - { TypeMapper.class, LongSetMapper.class }, fetchSize = FETCH_SIZE) + { TypeMapper.class, LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<Long> getChildIdsOfTypes(Long parentId, LongSet childTypeIds); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/calculator/XmlPropertyAdaptor.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/calculator/XmlPropertyAdaptor.java index 0d308cc207a54df15722bdcf6bac216ce0285c1f..fb81cf717b0121e64e83a1095fcc50442725d866 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/calculator/XmlPropertyAdaptor.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/calculator/XmlPropertyAdaptor.java @@ -21,8 +21,7 @@ import ch.systemsx.cisd.openbis.generic.shared.hotdeploy_plugins.api.IEntityProp import ch.systemsx.cisd.openbis.generic.shared.util.XmlUtils; /** - * {@link IEntityPropertyAdaptor} implementation for xml property with lazy evaluation of rendered - * value using XSLT script. + * {@link IEntityPropertyAdaptor} implementation for xml property with lazy evaluation of rendered value using XSLT script. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/calculator/api/ISampleAdaptor.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/calculator/api/ISampleAdaptor.java index f83cc94c5c2ef903fc0a7b423748ae0799524bbd..0d1332c143652bc024b6f4b9445a3886653ca85c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/calculator/api/ISampleAdaptor.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/dynamic_property/calculator/api/ISampleAdaptor.java @@ -34,8 +34,7 @@ public interface ISampleAdaptor extends IEntityAdaptor public Iterable<ISampleAdaptor> parents(); /** - * Returns parent samples of this sample. Types of the returned parent samples must match the - * specified regular expression. + * Returns parent samples of this sample. Types of the returned parent samples must match the specified regular expression. */ public Iterable<ISampleAdaptor> parentsOfType(String typeCodeRegexp); @@ -45,8 +44,7 @@ public interface ISampleAdaptor extends IEntityAdaptor public Iterable<ISampleAdaptor> children(); /** - * Returns child samples of this sample. Types of the returned child samples must match the - * specified regular expression. + * Returns child samples of this sample. Types of the returned child samples must match the specified regular expression. */ public Iterable<ISampleAdaptor> childrenOfType(String typeCodeRegexp); @@ -61,8 +59,7 @@ public interface ISampleAdaptor extends IEntityAdaptor public Iterable<ISampleAdaptor> contained(); /** - * Returns contained samples of this sample. Types of the returned contained samples must match - * the specified regular expression. + * Returns contained samples of this sample. Types of the returned contained samples must match the specified regular expression. */ public Iterable<ISampleAdaptor> containedOfType(String typeCodeRegexp); @@ -72,8 +69,7 @@ public interface ISampleAdaptor extends IEntityAdaptor public Iterable<IDataAdaptor> dataSets(); /** - * Returns data sets of this sample. Types of the returned data sets must match the specified - * regular expression. + * Returns data sets of this sample. Types of the returned data sets must match the specified regular expression. */ public Iterable<IDataAdaptor> dataSetsOfType(String typeCodeRegexp); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/entity_validation/AbstractEntityValidator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/entity_validation/AbstractEntityValidator.java index 26697ef95b45ecd2cf14d2a1cfb6bf2affd43ad2..426f5b98f202c591325a7b3c07237002a97b6632 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/entity_validation/AbstractEntityValidator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/entity_validation/AbstractEntityValidator.java @@ -28,8 +28,7 @@ public abstract class AbstractEntityValidator implements IEntityValidator protected IValidationRequestDelegate<INonAbstractEntityAdapter> validationRequestedDelegate; @Override - public final void init(@SuppressWarnings("hiding") - IValidationRequestDelegate<INonAbstractEntityAdapter> validationRequestedDelegate) + public final void init(@SuppressWarnings("hiding") IValidationRequestDelegate<INonAbstractEntityAdapter> validationRequestedDelegate) { this.validationRequestedDelegate = validationRequestedDelegate; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/entity_validation/api/IEntityValidator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/entity_validation/api/IEntityValidator.java index c0bd826fea0daa1a7582dcbd8142bf1109111297..ac1526b5f5e7281ae14301aa4dda96da0055af94 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/entity_validation/api/IEntityValidator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/entity_validation/api/IEntityValidator.java @@ -30,8 +30,7 @@ public interface IEntityValidator /** * Before the validation is triggered, the validator is initialized by calling this method. * - * @param validationRequestedDelegate object responsible for handling requests for entity - * validation + * @param validationRequestedDelegate object responsible for handling requests for entity validation */ public void init( IValidationRequestDelegate<INonAbstractEntityAdapter> validationRequestedDelegate); @@ -40,8 +39,7 @@ public interface IEntityValidator * Main method, that performs actual validation * * @param entity entity that needs to be validated - * @param isNew <code>true</code> if the entity is freshly created, <code>false</code> if the - * entity was only updated. + * @param isNew <code>true</code> if the entity is freshly created, <code>false</code> if the entity was only updated. */ public String validate(IEntityAdaptor entity, boolean isNew); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/migration/MigrationStepFrom022To023.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/migration/MigrationStepFrom022To023.java index 26eb0eb15dcc5e14dcc41c5ac002f6f878f8232f..7b909eb5f48d8c217ced7a73787028ee7c0713a5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/migration/MigrationStepFrom022To023.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/migration/MigrationStepFrom022To023.java @@ -27,11 +27,9 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.TableNames; import ch.systemsx.cisd.openbis.generic.shared.util.UuidUtil; /** - * Finishes migration of the database version 22 to version 23 by setting the <i>UUID</i> code of - * the database instance. + * Finishes migration of the database version 22 to version 23 by setting the <i>UUID</i> code of the database instance. * <p> - * Note that, at that time, the <i>UUID</i> column label was <code>GLOBAL_CODE</code> and not - * <code>UUID</code>. + * Note that, at that time, the <i>UUID</i> column label was <code>GLOBAL_CODE</code> and not <code>UUID</code>. * </p> * * @author Tomasz Pylak diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/migration/MigrationStepFrom023To024.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/migration/MigrationStepFrom023To024.java index e75fd08eb01332641eed2dccdd6f0079f230d502..625895e71b1500751516e26ee8bed567c65d8fa8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/migration/MigrationStepFrom023To024.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/migration/MigrationStepFrom023To024.java @@ -38,9 +38,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.TableNames; /** * A migration step from database version <code>v23</code> to version <code>v24</code>. * <p> - * This migration step does the following: it migrate the dataset locations in the database ( - * <code>Instance_<instance code></code> renamed Instance_<UUID> when <instance - * code> is the original source). + * This migration step does the following: it migrate the dataset locations in the database ( <code>Instance_<instance code></code> renamed + * Instance_<UUID> when <instance code> is the original source). * </p> * * @author Christian Ribeaud diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/migration/MigrationStepFrom025To026.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/migration/MigrationStepFrom025To026.java index 1d0cba3311c9554c1dc87df896e7a14dec247de5..ef298c42d2b9a5f814c33d377a75654d41922f7f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/migration/MigrationStepFrom025To026.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/migration/MigrationStepFrom025To026.java @@ -40,8 +40,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.TableNames; /** * A migration step from database version <code>v25</code> to version <code>v26</code>. * <p> - * Adapts the data set locations in database after OBSERVABLE_TYPE has been renamed to - * DATA_SET_TYPE. + * Adapts the data set locations in database after OBSERVABLE_TYPE has been renamed to DATA_SET_TYPE. * </p> * * @author Izabela Adamczyk diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/migration/MigrationStepFrom046To047.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/migration/MigrationStepFrom046To047.java index 513587e7f671b3cb6ec6796810d231be72522c1c..c7e70032685ccba35f32b7030e281123d36ded35 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/migration/MigrationStepFrom046To047.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/migration/MigrationStepFrom046To047.java @@ -41,8 +41,8 @@ import ch.systemsx.cisd.openbis.generic.shared.util.DisplaySettingsSerialization /** * A migration step from database version <code>v46</code> to version <code>v47</code>. * <p> - * Sets wildcard search mode for old users apart from system user. After this migration all users - * will have a serialized display settings object in the DB (before it could be null). + * Sets wildcard search mode for old users apart from system user. After this migration all users will have a serialized display settings object in + * the DB (before it could be null). * </p> * * @author Piotr Buczek diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/util/UpdateUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/util/UpdateUtils.java index dba3e3781d3c31c3401b79b1c850dbe7731cf73d..5a9ee1603697e33bb7c9f41dfee6cdd1a7d5b725 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/util/UpdateUtils.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/util/UpdateUtils.java @@ -32,8 +32,6 @@ import ch.systemsx.cisd.openbis.generic.server.dataaccess.DynamicPropertyEvaluat import ch.systemsx.cisd.openbis.generic.server.dataaccess.db.search.FullTextIndexUpdater; /** - * - * * @author Franz-Josef Elmer */ public class UpdateUtils @@ -45,14 +43,14 @@ public class UpdateUtils FullTextIndexUpdater indexUpdater = (FullTextIndexUpdater) applicationContext.getBean("full-text-index-updater"); DynamicPropertyEvaluationScheduler dynamicPropertyScheduler = (DynamicPropertyEvaluationScheduler) applicationContext.getBean("dynamic-property-scheduler"); - + if (indexUpdater != null) { while (true) { IExtendedBlockingQueue<DynamicPropertyEvaluationOperation> dynamicPropertiesQueue = dynamicPropertyScheduler.getEvaluatorQueue(); int indexingQueueSize = indexUpdater.getQueueSize(); - + try { if (dynamicPropertiesQueue != null && dynamicPropertiesQueue.size() > 0) @@ -76,7 +74,7 @@ public class UpdateUtils } } } - + public static Date getTransactionTimeStamp(SessionFactory sessionFactory) { Session currentSession = sessionFactory.getCurrentSession(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IDataSetType.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IDataSetType.java index d66c54d2d0580b2e99d8c94a65fa9cf76373c3ec..5b515c656fae9875cf320dabf2b68a0ff2cabd2e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IDataSetType.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IDataSetType.java @@ -23,8 +23,7 @@ public interface IDataSetType extends IDataSetTypeImmutable, IEntityTypeMutable { /** - * @deprecated use {@link #setDataSetKind(String)} instead Set to <code>true</code> if the type - * is a container type. + * @deprecated use {@link #setDataSetKind(String)} instead Set to <code>true</code> if the type is a container type. */ @Deprecated public void setContainerType(boolean isContainerType); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IEntityType.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IEntityType.java index 89771146cda52a351b00b69d8b1d1663eeaaeee3..bcd3486e420b670b62bb34a4cb3623ba7bdb3ce4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IEntityType.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IEntityType.java @@ -16,7 +16,6 @@ package ch.systemsx.cisd.openbis.generic.server.jython.api.v1; - /** * The superinterface for all entity types (as opposed to property types). * diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IMasterDataRegistrationTransaction.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IMasterDataRegistrationTransaction.java index 3b0900916bbf903204b33ef358aca732e55a28eb..ecbe663e4ad1d9adf9eb57c7a390cd074391e847 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IMasterDataRegistrationTransaction.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IMasterDataRegistrationTransaction.java @@ -19,8 +19,7 @@ package ch.systemsx.cisd.openbis.generic.server.jython.api.v1; import java.util.List; /** - * API for master data registration. Offers methods for creation and retrieval of openBIS types, - * property assignments, vocabularies etc. + * API for master data registration. Offers methods for creation and retrieval of openBIS types, property assignments, vocabularies etc. * * @author Kaloyan Enimanev */ @@ -35,8 +34,7 @@ public interface IMasterDataRegistrationTransaction IExperimentType createNewExperimentType(String code); /** - * Get an experiment type from the openBIS AS. Returns null if the experiment type does not - * exist. + * Get an experiment type from the openBIS AS. Returns null if the experiment type does not exist. * * @return An experiment type or null */ @@ -45,8 +43,8 @@ public interface IMasterDataRegistrationTransaction /** * Gets or creates experiment type from the openBIS AS. * - * @return the already existing type or a freshly created one if it doesn't exist. Setter - * methods on the returned type are ignored if the type already exists. + * @return the already existing type or a freshly created one if it doesn't exist. Setter methods on the returned type are ignored if the type + * already exists. */ IExperimentType getOrCreateNewExperimentType(String code); @@ -72,8 +70,8 @@ public interface IMasterDataRegistrationTransaction /** * Gets or creates sample type from the openBIS AS. * - * @return the already existing type or a freshly created one if it doesn't exist. Setter - * methods on the returned type are ignored if the type already exists. + * @return the already existing type or a freshly created one if it doesn't exist. Setter methods on the returned type are ignored if the type + * already exists. */ ISampleType getOrCreateNewSampleType(String code); @@ -99,8 +97,8 @@ public interface IMasterDataRegistrationTransaction /** * Gets or creates data set type from the openBIS AS. * - * @return the already existing type or a freshly created one if it doesn't exist. Setter - * methods on the returned type are ignored if the type already exists. + * @return the already existing type or a freshly created one if it doesn't exist. Setter methods on the returned type are ignored if the type + * already exists. */ IDataSetType getOrCreateNewDataSetType(String code); @@ -119,8 +117,8 @@ public interface IMasterDataRegistrationTransaction /** * Gets or creates a script from the openBIS AS. * - * @return the already existing script or a freshly created one if it doesn't exist. Setter - * methods on the returned script are ignored if the script already exists. + * @return the already existing script or a freshly created one if it doesn't exist. Setter methods on the returned script are ignored if the + * script already exists. */ IScript getOrCreateNewScript(String code); @@ -146,8 +144,8 @@ public interface IMasterDataRegistrationTransaction /** * Gets or creates material type from the openBIS AS. * - * @return the already existing type or a freshly created one if it doesn't exist. Setter - * methods on the returned type are ignored if the type already exists. + * @return the already existing type or a freshly created one if it doesn't exist. Setter methods on the returned type are ignored if the type + * already exists. */ IMaterialType getOrCreateNewMaterialType(String code); @@ -175,8 +173,8 @@ public interface IMasterDataRegistrationTransaction * Gets or creates property type from the openBIS AS. * * @param dataType the data type of the property in case it has to be created. - * @return the already existing type or a freshly created one if it doesn't exist. Setter - * methods on the returned type are ignored if the type already exists. + * @return the already existing type or a freshly created one if it doesn't exist. Setter methods on the returned type are ignored if the type + * already exists. */ IPropertyType getOrCreateNewPropertyType(String code, DataType dataType); @@ -186,11 +184,10 @@ public interface IMasterDataRegistrationTransaction List<IPropertyTypeImmutable> listPropertyTypes(); /** - * Assigns a property type to an entity type. If the assignment is already established an object - * is returned where all setter method invocations are silently be ignored. + * Assigns a property type to an entity type. If the assignment is already established an object is returned where all setter method invocations + * are silently be ignored. * - * @param entityType One of IExperimentTypeImmutable, ISampleTypeImmutable, - * IDataSetTypeImmutable, or IMaterialTypeImmutable. + * @param entityType One of IExperimentTypeImmutable, ISampleTypeImmutable, IDataSetTypeImmutable, or IMaterialTypeImmutable. * @param propertyType The property type to assign to the entity type. * @return An object representing the assignment. */ @@ -210,8 +207,7 @@ public interface IMasterDataRegistrationTransaction IFileFormatType createNewFileFormatType(String code); /** - * Get a file format type from the openBIS AS. Returns null if the file format type does not - * exist. + * Get a file format type from the openBIS AS. Returns null if the file format type does not exist. * * @return A file format type or null */ @@ -220,8 +216,8 @@ public interface IMasterDataRegistrationTransaction /** * Gets or creates file format type from the openBIS AS. * - * @return the already existing type or a freshly created one if it doesn't exist. Setter - * methods on the returned type are ignored if the type already exists. + * @return the already existing type or a freshly created one if it doesn't exist. Setter methods on the returned type are ignored if the type + * already exists. */ IFileFormatType getOrCreateNewFileFormatType(String code); @@ -247,8 +243,8 @@ public interface IMasterDataRegistrationTransaction /** * Gets or creates vocabulary type from the openBIS AS. * - * @return the already existing type or a freshly created one if it doesn't exist. Setter - * methods on the returned type are ignored if the type already exists. + * @return the already existing type or a freshly created one if it doesn't exist. Setter methods on the returned type are ignored if the type + * already exists. */ IVocabulary getOrCreateNewVocabulary(String code); @@ -258,8 +254,7 @@ public interface IMasterDataRegistrationTransaction List<IVocabularyImmutable> listVocabularies(); /** - * Create a new vocabulary term. The resulting object can be added to a vocabulary via the - * {@link IVocabulary#addTerm(IVocabularyTerm)} method. + * Create a new vocabulary term. The resulting object can be added to a vocabulary via the {@link IVocabulary#addTerm(IVocabularyTerm)} method. * * @param code the vocabulary term's code */ @@ -285,8 +280,7 @@ public interface IMasterDataRegistrationTransaction IExternalDataManagementSystem createNewExternalDataManagementSystem(String code); /** - * Get an external data management system from the openBIS AS. Returns null if the external data - * management system does not exist. + * Get an external data management system from the openBIS AS. Returns null if the external data management system does not exist. * * @return An external data management system or null */ @@ -295,8 +289,8 @@ public interface IMasterDataRegistrationTransaction /** * Gets or creates external data management system from the openBIS AS. * - * @return the already existing system or a freshly created one if it doesn't exist. Setter - * methods on the returned type are ignored if the type already exists. + * @return the already existing system or a freshly created one if it doesn't exist. Setter methods on the returned type are ignored if the type + * already exists. */ IExternalDataManagementSystem getOrCreateNewExternalDataManagementSystem(String code); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IPropertyAssignment.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IPropertyAssignment.java index eb24f6087076fa4416de18e50e39acab3b9b2184..e881d335d10ac0d80755ee69b96240e58086a80e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IPropertyAssignment.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IPropertyAssignment.java @@ -28,8 +28,8 @@ public interface IPropertyAssignment extends IPropertyAssignmentImmutable void setMandatory(boolean mandatory); /** - * Set the name of the form section. It will appear when editing objects of the specified entity - * in openBIS. Specifying a section name is optional. + * Set the name of the form section. It will appear when editing objects of the specified entity in openBIS. Specifying a section name is + * optional. */ void setSection(String section); @@ -39,8 +39,7 @@ public interface IPropertyAssignment extends IPropertyAssignmentImmutable void setDefaultValue(String defaultValue); /** - * Sets the position where the property will appear in forms. If not specified the property will - * be displayed at the bottom of the form. + * Sets the position where the property will appear in forms. If not specified the property will be displayed at the bottom of the form. */ void setPositionInForms(Long position); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IPropertyAssignmentImmutable.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IPropertyAssignmentImmutable.java index 08bb02d3c1203818b573ed3fc77710099a6bd53f..468f9401606253086d7ebcd2edbd0c5a6a4d7dfe 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IPropertyAssignmentImmutable.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IPropertyAssignmentImmutable.java @@ -49,8 +49,7 @@ public interface IPropertyAssignmentImmutable String getSection(); /** - * Return the position at which the property will be rendered when editing/registering objects - * of the specified entity type. + * Return the position at which the property will be rendered when editing/registering objects of the specified entity type. */ Long getPositionInForms(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IPropertyType.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IPropertyType.java index bfb637124b5f6747e624727e38494f6940cf38e2..6939b15c884561118e3c987ef9a503f8a8c34205 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IPropertyType.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IPropertyType.java @@ -22,14 +22,12 @@ package ch.systemsx.cisd.openbis.generic.server.jython.api.v1; public interface IPropertyType extends IPropertyTypeImmutable { /** - * Set the description for this property type. This is a mandatory parameter and must not be - * left emtpy when creating new {@link IPropertyType}-s. + * Set the description for this property type. This is a mandatory parameter and must not be left emtpy when creating new {@link IPropertyType}-s. */ void setDescription(String description); /** - * Set the label for this property type. This is a mandatory parameter and must not be left - * emtpy when creating new {@link IPropertyType}-s. + * Set the label for this property type. This is a mandatory parameter and must not be left emtpy when creating new {@link IPropertyType}-s. */ void setLabel(String label); @@ -49,16 +47,14 @@ public interface IPropertyType extends IPropertyTypeImmutable void setXmlSchema(String schema); /** - * Set an XSLT transformation to be applied to properties of XML {@link DataType} before - * rendering in the UI. + * Set an XSLT transformation to be applied to properties of XML {@link DataType} before rendering in the UI. */ void setTransformation(String xsltTransformation); void setManagedInternally(boolean isManagedInternally); /** - * Property of internal names receive a special prefix to avoid naming conflicts with - * user-defined property types. + * Property of internal names receive a special prefix to avoid naming conflicts with user-defined property types. */ void setInternalNamespace(boolean isInternalNamespace); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IPropertyTypeImmutable.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IPropertyTypeImmutable.java index ba733829f2931d4c1d91de99a852fd9774d5029c..5fe5d099f71bbaad0efc1e6722c963654d01d199 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IPropertyTypeImmutable.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IPropertyTypeImmutable.java @@ -44,14 +44,14 @@ public interface IPropertyTypeImmutable extends IAbstractType IVocabularyImmutable getVocabulary(); /** - * Return an XSD used to verify the validity of properties with XML {@link DataType}. Return - * <code>null</code> if the DataType is not XML or there is no schema set. + * Return an XSD used to verify the validity of properties with XML {@link DataType}. Return <code>null</code> if the DataType is not XML or there + * is no schema set. */ String getXmlSchema(); /** - * Return an XSLT transformation applied to properties with XML {@link DataType}. Return - * <code>null</code> if the DataType is not XML or there is no transformation set. + * Return an XSLT transformation applied to properties with XML {@link DataType}. Return <code>null</code> if the DataType is not XML or there is + * no transformation set. */ String getTransformation(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IVocabulary.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IVocabulary.java index d13410328956a3e8749edcb7303df0b654efe174..09a9b0eb2c1be884e6b6fa8cc08f1eb0c3b596ea 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IVocabulary.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IVocabulary.java @@ -40,8 +40,7 @@ public interface IVocabulary extends IVocabularyImmutable void setChosenFromList(boolean isChosenFromList); /** - * Sets a URL template (e.g a search query) that can display additional information for the - * concrete vocabulary terms. + * Sets a URL template (e.g a search query) that can display additional information for the concrete vocabulary terms. */ void setUrlTemplate(String urlTemplate); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IVocabularyImmutable.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IVocabularyImmutable.java index 619183a337d7d09aa0e3dac5c0d6f140f9e28674..d72f1951e85792b8be053f3f22fba018a0ce98e2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IVocabularyImmutable.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IVocabularyImmutable.java @@ -49,8 +49,7 @@ public interface IVocabularyImmutable boolean isChosenFromList(); /** - * Returns a URL template (e.g a search query) that can display additional information for the - * concrete vocabulary terms. Can return null. + * Returns a URL template (e.g a search query) that can display additional information for the concrete vocabulary terms. Can return null. */ String getUrlTemplate(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/ExternalDataManagementSystemWrapper.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/ExternalDataManagementSystemWrapper.java index e9137d8688369fab7973a1a6fec20dcbb4f0ee66..27f1d98f75bdb97667e9b48015324989945b33ab 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/ExternalDataManagementSystemWrapper.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/ExternalDataManagementSystemWrapper.java @@ -19,8 +19,7 @@ package ch.systemsx.cisd.openbis.generic.server.jython.api.v1.impl; import ch.systemsx.cisd.openbis.generic.server.jython.api.v1.IExternalDataManagementSystem; /** - * Wrapper of {@link ExternalDataManagementSystemImmutable} as {@link IExternalDataManagementSystem} - * where setters do nothing. + * Wrapper of {@link ExternalDataManagementSystemImmutable} as {@link IExternalDataManagementSystem} where setters do nothing. * * @author Pawel Glyzewski */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/MasterDataRegistrationScriptRunnerStandalone.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/MasterDataRegistrationScriptRunnerStandalone.java index 2a573e80de7698c1f3b85ddde67ab6fefc54e962..ab7cc01004c657cd8cac1580212d6cc76e37f20f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/MasterDataRegistrationScriptRunnerStandalone.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/MasterDataRegistrationScriptRunnerStandalone.java @@ -28,8 +28,7 @@ import ch.systemsx.cisd.common.logging.LogLevel; import ch.systemsx.cisd.openbis.generic.shared.cli.OpenBisConsoleClientArguments; /** - * A standalone command line tool allowing the execution of Jython scripts to initialize the master - * data on an openBIS AS. + * A standalone command line tool allowing the execution of Jython scripts to initialize the master data on an openBIS AS. * * @author Kaloyan Enimanev */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/PropertyAssignmentWrapper.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/PropertyAssignmentWrapper.java index d2589dd5dbd64d3dce7cf9a390c639becffcdb63..522e43ddca928e5634daa318fb4bbe654159d4aa 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/PropertyAssignmentWrapper.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/PropertyAssignmentWrapper.java @@ -19,8 +19,7 @@ package ch.systemsx.cisd.openbis.generic.server.jython.api.v1.impl; import ch.systemsx.cisd.openbis.generic.server.jython.api.v1.IPropertyAssignment; /** - * Wrapper of {@link PropertyAssignmentImmutable} as {@link IPropertyAssignment} where setters do - * nothing. + * Wrapper of {@link PropertyAssignmentImmutable} as {@link IPropertyAssignment} where setters do nothing. * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/Script.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/Script.java index e248896cba1d7aa8a32b96a3e7c2af4de031c0a7..2604ae60d189a58d78c5368af6426ffbd13abb74 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/Script.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/Script.java @@ -63,7 +63,7 @@ public class Script extends ScriptImmutable implements IScript } else { script.setEntityKind(new EntityKind[] - { EntityKind.valueOf(entityKind) }); + { EntityKind.valueOf(entityKind) }); } } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/AbstractPluginRegistry.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/AbstractPluginRegistry.java index 84fdd3cf1889491bd8575c7d4dd268a070c64bcf..8515ff75a89efbb4ca560186bc5da70aec6a8e05 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/AbstractPluginRegistry.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/AbstractPluginRegistry.java @@ -113,8 +113,7 @@ abstract class AbstractPluginRegistry<P extends IServerPlugin> implements BeanFa /** * Returns the appropriate plug-in for the specified entity kind and entity type. * - * @return never <code>null</code> but could return the <i>generic</i> implementation if none - * has been found. + * @return never <code>null</code> but could return the <i>generic</i> implementation if none has been found. */ public final synchronized P getPlugin(EntityKind entityKind, EntityTypePE entityType) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/DataSetServerPluginRegistry.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/DataSetServerPluginRegistry.java index ef4fd18f7a1a7a1474b3d60e9c2c3ddbcd2f67c5..f86a5968fcf73cba0346b9d7551c2638ac8b8e23 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/DataSetServerPluginRegistry.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/DataSetServerPluginRegistry.java @@ -20,7 +20,6 @@ import org.springframework.stereotype.Component; import ch.systemsx.cisd.openbis.generic.shared.ResourceNames; - /** * A registry for data set server plug-ins. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/IDataSetServerPlugin.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/IDataSetServerPlugin.java index 8c588cdd9cc551d5f28c62176828b01c29c5b875..dc11dffdc3bf9505796e2cb97a53ebb9fc8976eb 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/IDataSetServerPlugin.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/IDataSetServerPlugin.java @@ -19,7 +19,7 @@ package ch.systemsx.cisd.openbis.generic.server.plugin; /** * Plug-in interface for data sets. * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ public interface IDataSetServerPlugin extends IServerPlugin { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/IDataSetTypeSlaveServerPlugin.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/IDataSetTypeSlaveServerPlugin.java index 37a6ba7a6300e47cfcb2aba73b174a83d37f949b..42017e86dd24468ae22234332cb251bf7e2ca4fc 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/IDataSetTypeSlaveServerPlugin.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/IDataSetTypeSlaveServerPlugin.java @@ -26,8 +26,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.Session; /** * The slave server plug-in for a Data set type * <p> - * The implementation will give access to {@link DAOFactory} and appropriate business object - * factory. Each method specified here must start with {@link Session} parameter. + * The implementation will give access to {@link DAOFactory} and appropriate business object factory. Each method specified here must start with + * {@link Session} parameter. * </p> * * @author Christian Ribeaud @@ -38,8 +38,7 @@ public interface IDataSetTypeSlaveServerPlugin /** * Permanently deletes the specified data sets for the specified reason. * - * @deprecated this is legacy code and should be removed when we remove the option of disabled - * trash + * @deprecated this is legacy code and should be removed when we remove the option of disabled trash */ @Deprecated public void permanentlyDeleteDataSets(Session session, List<DataPE> dataSets, String reason, diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/ISampleTypeSlaveServerPlugin.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/ISampleTypeSlaveServerPlugin.java index 5f6f870cc51068a573b5c50540d735d074fdf4e6..e0aa031fa29c77cc7cbfc68c6681d58a0ec875fa 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/ISampleTypeSlaveServerPlugin.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/ISampleTypeSlaveServerPlugin.java @@ -30,8 +30,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.Session; /** * The slave server plug-in for a <i>Sample Type</i>. * <p> - * The implementation will give access to {@link DAOFactory} and appropriate business object - * factory. Each method specified here must start with {@link Session} parameter. + * The implementation will give access to {@link DAOFactory} and appropriate business object factory. Each method specified here must start with + * {@link Session} parameter. * </p> * * @author Christian Ribeaud diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/IServerPlugin.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/IServerPlugin.java index 336b9f10936cb12c01a9b579612072820f410e45..5a553de0e9fbc0f3f156f0a4113f896d449a4542 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/IServerPlugin.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/IServerPlugin.java @@ -21,15 +21,12 @@ import java.util.Set; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; /** - * - * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ public interface IServerPlugin { /** - * Returns all the entity type codes for specified entity kind which are supported by this - * server plugin. + * Returns all the entity type codes for specified entity kind which are supported by this server plugin. */ public Set<String> getEntityTypeCodes(final EntityKind entityKind); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/IServerPluginWithWildcards.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/IServerPluginWithWildcards.java index 091e3f51e80a608e915f8638e60f15d7de2698b5..017d7969262efc65e69c637333a4d3bd94678007 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/IServerPluginWithWildcards.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/IServerPluginWithWildcards.java @@ -21,16 +21,14 @@ import java.util.List; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; /** - * An extension of the @{link IServerPlugin} that supports using regular expression wildcards in the - * codes. + * An extension of the @{link IServerPlugin} that supports using regular expression wildcards in the codes. * * @author Chandrasekhar Ramakrishnan */ public interface IServerPluginWithWildcards extends IServerPlugin { /** - * Returns all the entity type codes for given <var>entityKind</var> supported by this - * implementation. + * Returns all the entity type codes for given <var>entityKind</var> supported by this implementation. */ public List<String> getOrderedEntityTypeCodes(final EntityKind entityKind); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/SampleServerPluginRegistry.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/SampleServerPluginRegistry.java index 44c68f4b21c78e518a08aff4a356d8c7c2b4b571..bbfab1bb9aa2f341c540f5d58fe6fc253faef3d0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/SampleServerPluginRegistry.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/SampleServerPluginRegistry.java @@ -20,14 +20,13 @@ import org.springframework.stereotype.Component; import ch.systemsx.cisd.openbis.generic.shared.ResourceNames; - /** * A registry for sample server plug-ins. */ @Component(ResourceNames.SAMPLE_PLUGIN_REGISTRY) public final class SampleServerPluginRegistry extends AbstractPluginRegistry<ISampleServerPlugin> { - + @Override protected String getBeanNameOfGenericPlugin() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/WildcardSupportingPluginMap.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/WildcardSupportingPluginMap.java index 8c2808f25da04d8473a2c8099404c8be2770aaf0..6dd924127364f5be50f08964f6716029f8f10bbf 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/WildcardSupportingPluginMap.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/plugin/WildcardSupportingPluginMap.java @@ -20,8 +20,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.WildcardSupportingMap; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKindAndTypeCode; /** - * Utility class that manages mappings from entity types/codes (possibly including wildcards) to - * IServerPlugin objects. + * Utility class that manages mappings from entity types/codes (possibly including wildcards) to IServerPlugin objects. * * @author Chandrasekhar Ramakrishnan */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/BatchSampleRegistrationTempCodeUpdaterTask.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/BatchSampleRegistrationTempCodeUpdaterTask.java index 3e5b3c5af60ef9a345bdf8e49f297808f1c8b465..0e9bccdff5d20ef1682dde63103ee34499602fb6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/BatchSampleRegistrationTempCodeUpdaterTask.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/BatchSampleRegistrationTempCodeUpdaterTask.java @@ -39,16 +39,16 @@ public class BatchSampleRegistrationTempCodeUpdaterTask implements IMaintenanceT { private static final Logger operationLog = LogFactory.getLogger(LogCategory.OPERATION, BatchSampleRegistrationTempCodeUpdaterTask.class); - + private BatchSampleRegistrationTempCodeUpdaterBean bean; @Override public void setUp(String pluginName, Properties properties) { } - // TODO FJE: Do the update in single queue which is also fed by the - // GenericClientService.updateTemporaryCodes() + // TODO FJE: Do the update in single queue which is also fed by the + // GenericClientService.updateTemporaryCodes() // this bean is programmatically created so that we can use spring managed transactions // in this maintenance task. Otherwise QueryTool needs to set the datasource/connection @@ -143,7 +143,7 @@ public class BatchSampleRegistrationTempCodeUpdaterTask implements IMaintenanceT sampleDAO.createOrUpdateSamples(samplePEs, personPE, true); } } - + @Override public void execute() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/DataSetRegistrationSummaryTask.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/DataSetRegistrationSummaryTask.java index dd656cbec21d0425296afc794ad431b65f56c191..5ebb267eb67740fe0eb29eabd25535c71a8c7111 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/DataSetRegistrationSummaryTask.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/DataSetRegistrationSummaryTask.java @@ -57,13 +57,11 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.SessionContextDTO; /** * Maintenance task send e-mails with reports on recently registered data sets. * <p> - * The maintenance task may be run in one of two modes, the normal mode is to report on data sets - * registered in the period specified by the days-of-month or days-of-week. The period goes from the - * current day to the last day the maintenance task was run. + * The maintenance task may be run in one of two modes, the normal mode is to report on data sets registered in the period specified by the + * days-of-month or days-of-week. The period goes from the current day to the last day the maintenance task was run. * <p> - * Sometimes, however, for the first run, the user may want to explicitly specify the date range for - * the maintenance task. This can be done, but the maintenance task should then only be run once, - * because it will always report on the specified date range. + * Sometimes, however, for the first run, the user may want to explicitly specify the date range for the maintenance task. This can be done, but the + * maintenance task should then only be run once, because it will always report on the specified date range. * * @author Franz-Josef Elmer */ @@ -297,8 +295,7 @@ public class DataSetRegistrationSummaryTask implements IMaintenanceTask } /** - * @return True if the data set type should <b>not</b> be included in the report; return false - * if it should be included in the report. + * @return True if the data set type should <b>not</b> be included in the report; return false if it should be included in the report. */ private boolean excludeDataSetType(DataSetType dataSetType) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/MaterialExternalDBSyncTask.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/MaterialExternalDBSyncTask.java index 29e7bc451261ae888e182e576a2a3f7fb6441fc0..d36d852718cd1c0bb444b21943cf1d2887ce22ec 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/MaterialExternalDBSyncTask.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/MaterialExternalDBSyncTask.java @@ -672,8 +672,8 @@ public class MaterialExternalDBSyncTask implements IMaintenanceTask { String sql = tryToReadTimestamp() == null ? insertTimestampSql : updateTimestampSql; jdbcTemplate.update(sql, new Object[] - { newTimestamp }, new int[] - { Types.TIMESTAMP }); + { newTimestamp }, new int[] + { Types.TIMESTAMP }); } @Private diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/RevokeUserAccessMaintenanceTask.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/RevokeUserAccessMaintenanceTask.java index 2386a8b77c81f0e9bb17b6f12c6e1007b036581b..f6d839aa1735af79112e99a1e70da1971032d825 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/RevokeUserAccessMaintenanceTask.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/RevokeUserAccessMaintenanceTask.java @@ -46,123 +46,130 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.SessionContextDTO; * * @author Juan Fuentes */ -public class RevokeUserAccessMaintenanceTask implements IMaintenanceTask { - private static final Logger operationLog = LogFactory.getLogger(LogCategory.OPERATION, RevokeUserAccessMaintenanceTask.class); - private static final String AUTH_SERVICE_BEAN = "authentication-service"; - private static final IAuthenticationService authService; - - static { - IAuthenticationService authServiceAux = (IAuthenticationService) CommonServiceProvider.tryToGetBean(AUTH_SERVICE_BEAN); - - if (authServiceAux instanceof StackedAuthenticationService && ((StackedAuthenticationService) authServiceAux).allServicesSupportListingByUserId()) - { - authService = authServiceAux; - } else if(authServiceAux.supportsListingByUserId()) - { - authService = authServiceAux; - } - else - { - authService = null; - } - } - - @Override - public void setUp(String pluginName, Properties properties) { - operationLog.info("Task " + pluginName + " initialized."); - } - - @Override - public void execute() - { - operationLog.info("execution started"); - //0. Initial Check - if(authService == null) - { - operationLog.info("This plugin doesn't work with authentication services that don't support listing by user idt."); - return; - } - // 1. Grab all users, user roles and user authorization groups - IPersonDAO personDAO = CommonServiceProvider.getDAOFactory().getPersonDAO(); - IRoleAssignmentDAO rolesDAO = CommonServiceProvider.getDAOFactory().getRoleAssignmentDAO(); - - // Used to manage the authorization groups since the IPersonDAO throw a session exception when accessing this information. - ICommonServerForInternalUse server = CommonServiceProvider.getCommonServer(); - SessionContextDTO contextOrNull = server.tryToAuthenticateAsSystem(); - - List<PersonPE> people = personDAO.listActivePersons(); - - // 2. Users to Revoke - List<PersonPE> peopleToRevoke = new ArrayList<PersonPE>(); - - // 3. Check if the users exists on LDAP currently - personCheck: - for (PersonPE person : people) - { - if (false == person.isSystemUser() && person.isActive() && false == isUserValid(person.getUserId())) - { - List<RoleAssignmentPE> roles = rolesDAO.listRoleAssignmentsByPerson(person); - for (RoleAssignmentPE role : roles) - { - if (role.getRole().name().equals("ETL_SERVER")) - { - continue personCheck; - } - } - peopleToRevoke.add(person); - } - } - - // 4. If is not found on the authentication service, revoke access - for (PersonPE person : peopleToRevoke) - { - String userIdToRevoke = person.getUserId(); - operationLog.info("person " + userIdToRevoke + " is going to be revoked."); - - // Delete person roles - for (RoleAssignmentPE role : rolesDAO.listRoleAssignmentsByPerson(person)) - { - rolesDAO.delete(role); - } - - // Delete person from groups - List<AuthorizationGroup> groups = server.listAuthorizationGroups(contextOrNull.getSessionToken()); - - for (AuthorizationGroup group : groups) - { - List<Person> peopleInGroup = server.listPersonInAuthorizationGroup(contextOrNull.getSessionToken(), new TechId(group.getId())); - for (Person personInGroup : peopleInGroup) - { - if (personInGroup.getUserId().equals(userIdToRevoke)) - { - List<String> toRemoveFromGroup = new ArrayList<String>(); - toRemoveFromGroup.add(person.getUserId()); - server.removePersonsFromAuthorizationGroup(contextOrNull.getSessionToken(), new TechId(group.getId()), toRemoveFromGroup); - } - } - } - - // Change userId and disable - person.setUserId(person.getUserId() + "-" + getTimeStamp()); - person.setActive(false); - personDAO.updatePerson(person); - - operationLog.info("person " + userIdToRevoke + " has been revoked."); - } - - operationLog.info("task executed"); - } - - /* - * We can only delete the users if, the Principals are listable and they are not available. - */ - private boolean isUserValid(String userId) { - return authService.supportsListingByUserId() && false == authService.listPrincipalsByUserId(userId).isEmpty(); - } - - private String getTimeStamp() { - DateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd"); - return dateFormat.format(new Date()); - } +public class RevokeUserAccessMaintenanceTask implements IMaintenanceTask +{ + private static final Logger operationLog = LogFactory.getLogger(LogCategory.OPERATION, RevokeUserAccessMaintenanceTask.class); + + private static final String AUTH_SERVICE_BEAN = "authentication-service"; + + private static final IAuthenticationService authService; + + static + { + IAuthenticationService authServiceAux = (IAuthenticationService) CommonServiceProvider.tryToGetBean(AUTH_SERVICE_BEAN); + + if (authServiceAux instanceof StackedAuthenticationService + && ((StackedAuthenticationService) authServiceAux).allServicesSupportListingByUserId()) + { + authService = authServiceAux; + } else if (authServiceAux.supportsListingByUserId()) + { + authService = authServiceAux; + } + else + { + authService = null; + } + } + + @Override + public void setUp(String pluginName, Properties properties) + { + operationLog.info("Task " + pluginName + " initialized."); + } + + @Override + public void execute() + { + operationLog.info("execution started"); + // 0. Initial Check + if (authService == null) + { + operationLog.info("This plugin doesn't work with authentication services that don't support listing by user idt."); + return; + } + // 1. Grab all users, user roles and user authorization groups + IPersonDAO personDAO = CommonServiceProvider.getDAOFactory().getPersonDAO(); + IRoleAssignmentDAO rolesDAO = CommonServiceProvider.getDAOFactory().getRoleAssignmentDAO(); + + // Used to manage the authorization groups since the IPersonDAO throw a session exception when accessing this information. + ICommonServerForInternalUse server = CommonServiceProvider.getCommonServer(); + SessionContextDTO contextOrNull = server.tryToAuthenticateAsSystem(); + + List<PersonPE> people = personDAO.listActivePersons(); + + // 2. Users to Revoke + List<PersonPE> peopleToRevoke = new ArrayList<PersonPE>(); + + // 3. Check if the users exists on LDAP currently + personCheck: for (PersonPE person : people) + { + if (false == person.isSystemUser() && person.isActive() && false == isUserValid(person.getUserId())) + { + List<RoleAssignmentPE> roles = rolesDAO.listRoleAssignmentsByPerson(person); + for (RoleAssignmentPE role : roles) + { + if (role.getRole().name().equals("ETL_SERVER")) + { + continue personCheck; + } + } + peopleToRevoke.add(person); + } + } + + // 4. If is not found on the authentication service, revoke access + for (PersonPE person : peopleToRevoke) + { + String userIdToRevoke = person.getUserId(); + operationLog.info("person " + userIdToRevoke + " is going to be revoked."); + + // Delete person roles + for (RoleAssignmentPE role : rolesDAO.listRoleAssignmentsByPerson(person)) + { + rolesDAO.delete(role); + } + + // Delete person from groups + List<AuthorizationGroup> groups = server.listAuthorizationGroups(contextOrNull.getSessionToken()); + + for (AuthorizationGroup group : groups) + { + List<Person> peopleInGroup = server.listPersonInAuthorizationGroup(contextOrNull.getSessionToken(), new TechId(group.getId())); + for (Person personInGroup : peopleInGroup) + { + if (personInGroup.getUserId().equals(userIdToRevoke)) + { + List<String> toRemoveFromGroup = new ArrayList<String>(); + toRemoveFromGroup.add(person.getUserId()); + server.removePersonsFromAuthorizationGroup(contextOrNull.getSessionToken(), new TechId(group.getId()), toRemoveFromGroup); + } + } + } + + // Change userId and disable + person.setUserId(person.getUserId() + "-" + getTimeStamp()); + person.setActive(false); + personDAO.updatePerson(person); + + operationLog.info("person " + userIdToRevoke + " has been revoked."); + } + + operationLog.info("task executed"); + } + + /* + * We can only delete the users if, the Principals are listable and they are not available. + */ + private boolean isUserValid(String userId) + { + return authService.supportsListingByUserId() && false == authService.listPrincipalsByUserId(userId).isEmpty(); + } + + private String getTimeStamp() + { + DateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd"); + return dateFormat.format(new Date()); + } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/util/LifeCycleListener.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/util/LifeCycleListener.java index 749f47e28a61c3ebe627d906ab152dd2d997ad4e..6a1ab8115cde99dc9f23a168637a786e58b0c79a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/util/LifeCycleListener.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/util/LifeCycleListener.java @@ -19,8 +19,7 @@ package ch.systemsx.cisd.openbis.generic.server.util; import org.eclipse.jetty.util.component.LifeCycle; /** - * Stops a component (e.g. Web Server) if it goes into state "Failure". Prints messages - * on console in case of success and failure. + * Stops a component (e.g. Web Server) if it goes into state "Failure". Prints messages on console in case of success and failure. * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/util/MethodInvocationUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/util/MethodInvocationUtils.java index b21c54b3e7fef7723d8b959a609dbfa4f162d19c..19542c1d6924fd70ca832636b181dbd8b8d10af0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/util/MethodInvocationUtils.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/util/MethodInvocationUtils.java @@ -43,12 +43,10 @@ public class MethodInvocationUtils } /** - * Returns either the method of the specified {@link MethodInvocation} object or the method of - * the target object. The later is returned if <code>methodInvocation.getMethod()</code> has - * none the specified annotations and the target object class isn't a synthetic proxy class. + * Returns either the method of the specified {@link MethodInvocation} object or the method of the target object. The later is returned if + * <code>methodInvocation.getMethod()</code> has none the specified annotations and the target object class isn't a synthetic proxy class. * <p> - * This function should be used if it isn't known whether the interface of a proxy or the real - * target has the annotation. + * This function should be used if it isn't known whether the interface of a proxy or the real target has the annotation. */ public static Method getMethod(final MethodInvocation methodInvocation, List<Class<? extends Annotation>> annotationClasses) throws NoSuchMethodException diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/AbstractServerLogger.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/AbstractServerLogger.java index 3a8464b2711e15e3f42fabcf105244aee1021cc2..b37bc9ba85a475bd7fe0ecc147252778c1bcc0ef 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/AbstractServerLogger.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/AbstractServerLogger.java @@ -198,7 +198,7 @@ public abstract class AbstractServerLogger implements IServer if (parameter instanceof Collection) { unquotedParameter = CollectionUtils.abbreviate((Collection<?>) unquotedParameter, 20); - } + } parameters[i] = "'" + unquotedParameter + "'"; } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/DatabaseCreateOrDeleteModification.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/DatabaseCreateOrDeleteModification.java index a449dbab6f861e82d291efdcebe966a2ae3faf71..98815ed817275c01263e168e718597eeeef9fce2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/DatabaseCreateOrDeleteModification.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/DatabaseCreateOrDeleteModification.java @@ -26,8 +26,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKin import ch.systemsx.cisd.openbis.generic.shared.basic.dto.LastModificationState; /** - * Annotation used to mark methods which create or delete specified database objects. It can be used - * by a (GUI) client to trigger view updates. For more details see {@link LastModificationState}. + * Annotation used to mark methods which create or delete specified database objects. It can be used by a (GUI) client to trigger view updates. For + * more details see {@link LastModificationState}. * * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/DatabaseUpdateModification.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/DatabaseUpdateModification.java index acdc68fbdaae7be4f54f688ebb3044137f0191f2..271759554fbb43e34e7d9e6841c77003457136a8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/DatabaseUpdateModification.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/DatabaseUpdateModification.java @@ -26,8 +26,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKin import ch.systemsx.cisd.openbis.generic.shared.basic.dto.LastModificationState; /** - * Annotation used to mark methods which update specified database objects. It can be used by a - * (GUI) client to trigger view updates. For more details see {@link LastModificationState}. + * Annotation used to mark methods which update specified database objects. It can be used by a (GUI) client to trigger view updates. For more details + * see {@link LastModificationState}. * * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ICommonServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ICommonServer.java index d391dc59d4588ab13bd21c2e66d75ee4283c6cd6..ed4a20cf23d5d2dc71cf1582d472680ae1530112 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ICommonServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ICommonServer.java @@ -663,7 +663,7 @@ public interface ICommonServer extends IServer * Searches on a search domain. The result is sorted by score in descending order. */ @Transactional(readOnly = true) - public List<SearchDomainSearchResultWithFullEntity> searchOnSearchDomain(String sessionToken, + public List<SearchDomainSearchResultWithFullEntity> searchOnSearchDomain(String sessionToken, String preferredSearchDomainOrNull, String searchString, Map<String, String> optionalParametersOrNull); /** @@ -1600,7 +1600,7 @@ public interface ICommonServer extends IServer */ @Transactional(readOnly = true) public List<String> listPredeployedPlugins(String sessionToken, ScriptType scriptType); - + /** * Gets text for front page if the AS is disabled, null otherwise. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/IDataStoreService.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/IDataStoreService.java index fc42bc011b25f2c3605c4949653f5860a3f29a87..0f8aa36a02439c2cb53c3db4794d89a1512f50f1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/IDataStoreService.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/IDataStoreService.java @@ -174,8 +174,8 @@ public interface IDataStoreService public void cleanupSession(String userSessionToken); /** - * Searches for the specified sequence snippet. If no preferred search domain is specified the first available one will be used. If the - * preferred search domain doesn't exist or isn't available also the first one will be used. + * Searches for the specified sequence snippet. If no preferred search domain is specified the first available one will be used. If the preferred + * search domain doesn't exist or isn't available also the first one will be used. * * @param preferredSearchDomainOrNull The key of the preferred search domain or <code>null</code>. * @param sequenceSnippet Snippet of nucleotid or aminoacid sequence. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/IRemoteHostValidator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/IRemoteHostValidator.java index c6a007b6f044cd9c45a7b6d68e11f3fa39cdd376..fbe6e4b252a2af43bc820250b14f1fbbc74b6a25 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/IRemoteHostValidator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/IRemoteHostValidator.java @@ -26,5 +26,5 @@ public interface IRemoteHostValidator /** * Returns <code>true</code> if the specified remote host is allowed. */ - public boolean isValidRemoteHost(String remoteHost); + public boolean isValidRemoteHost(String remoteHost); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/IServiceForDataStoreServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/IServiceForDataStoreServer.java index e4b4e6a1b49e582223ae814a5599dd2797b21ebe..3b24403428277273c0687f857587e4c6c2a6eb7a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/IServiceForDataStoreServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/IServiceForDataStoreServer.java @@ -521,7 +521,7 @@ public interface IServiceForDataStoreServer extends IServer, ISessionProvider */ @Transactional(readOnly = true) public boolean isDataSetOnTrashCanOrDeleted(String sessionToken, String dataSetCode); - + /** * Updates share id and size of specified data set. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ISessionProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ISessionProvider.java index c38e9a0ed13491a6b389a3b4a482af0bdd1c165d..382067dbae61bdfc5f25ab5ea280da79b7879dbd 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ISessionProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ISessionProvider.java @@ -22,7 +22,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.IAuthSession; /** * Provider of {@link IAuthSession}. * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ public interface ISessionProvider { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ResourceNames.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ResourceNames.java index 0b7d5e1967e9ce61cde2512d38b7a335794bf577..03492b312079b84558098fe65c3523c72c1577a5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ResourceNames.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ResourceNames.java @@ -19,9 +19,8 @@ package ch.systemsx.cisd.openbis.generic.shared; /** * Resource name used in <i>generic</i>. * <p> - * Be aware about the uniqueness of the bean names loaded by <i>Spring</i>. Names defined here - * should not conflict with already existing bean names. Look for other <code>ResourceNames</code> - * classes. + * Be aware about the uniqueness of the bean names loaded by <i>Spring</i>. Names defined here should not conflict with already existing bean names. + * Look for other <code>ResourceNames</code> classes. * </p> * * @author Christian Ribeaud diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/Translator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/Translator.java index 266e51e07a228d29a6d0e0072b31da46eae2b7f4..ddec8c194a23fa2f2fb24e5cc6138c8a5ae6e17d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/Translator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/Translator.java @@ -535,7 +535,8 @@ public class Translator } initializer.setStorageConfirmed(externalDatum.isStorageConfirmation()); initializer.setStub(externalDatum.isStub()); - if(externalDatum.isContainer() == false) { + if (externalDatum.isContainer() == false) + { initializer.setPostRegistered(externalDatum.isPostRegistered()); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/CodeConverter.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/CodeConverter.java index a09e06214efd6277eaa4ba7d53620667b6858a5b..a0f0427542502b9ece022a7b40eaf9bd0dbc31c8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/CodeConverter.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/CodeConverter.java @@ -35,9 +35,8 @@ public final class CodeConverter /** * Converts a code from database form to business layer form. * <p> - * If <var>internalNamespace</var> is <code>true</code>, the prefix '$' will be used, because - * internal properties will be represented as 'NAME' in the database and as $NAME in the - * business layer. + * If <var>internalNamespace</var> is <code>true</code>, the prefix '$' will be used, because internal properties will be represented as 'NAME' in + * the database and as $NAME in the business layer. * * @return The code appropriate for the business layer. */ @@ -56,8 +55,8 @@ public final class CodeConverter /** * Converts a property type code from business layer form to database form. * <p> - * The code will be translated to upper case. Internal properties will be represented as 'NAME' - * in the database and as $NAME in the business layer. + * The code will be translated to upper case. Internal properties will be represented as 'NAME' in the database and as $NAME in the business + * layer. * * @return The code appropriate for the database. */ @@ -78,8 +77,7 @@ public final class CodeConverter } /** - * Returns <code>true</code>, if the <var>codeFromBusinessLayerOrNull</var> represents a - * internal property code. + * Returns <code>true</code>, if the <var>codeFromBusinessLayerOrNull</var> represents a internal property code. */ public static boolean isInternalNamespace(final String codeFromBusinessLayerOrNull) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/CodeNormalizer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/CodeNormalizer.java index c8823dda0164980d6d3cdf8495be184bd9a9045f..f85979a7d0f154fc1b12fbb575145bff39137995 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/CodeNormalizer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/CodeNormalizer.java @@ -29,8 +29,8 @@ public class CodeNormalizer } /** - * Normalizes the specified code. That is lower-case characters are turned to upper case and any - * symbol which isn't from A-Z, 0-9 or '-' is replaced by an underscore character. + * Normalizes the specified code. That is lower-case characters are turned to upper case and any symbol which isn't from A-Z, 0-9 or '-' is + * replaced by an underscore character. */ public static String normalize(String code) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/DataSetUploadInfo.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/DataSetUploadInfo.java index 935c19a90e4814740fa2bd2e77a480517d36f47f..66659a214e6d91eae53093cf768cd640904bf8a5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/DataSetUploadInfo.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/DataSetUploadInfo.java @@ -101,7 +101,6 @@ public class DataSetUploadInfo { this.parents = parents; } - @Override public String toString() @@ -124,7 +123,6 @@ public class DataSetUploadInfo return builder.toString(); } - public static class DataSetUploadInfoHelper { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/EntityVisitComparatorByTimeStamp.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/EntityVisitComparatorByTimeStamp.java index dc60c0a532f7fab84aad50937766de7edf504bdf..ff5d5b6d45ce295ed3d7e165409a8d1e4dd498f5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/EntityVisitComparatorByTimeStamp.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/EntityVisitComparatorByTimeStamp.java @@ -5,7 +5,7 @@ import java.util.Comparator; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityVisit; /** - * Comparator between {@link EntityVisit} instances. Newer visit comes before older visit. + * Comparator between {@link EntityVisit} instances. Newer visit comes before older visit. * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/ExpressionUtil.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/ExpressionUtil.java index f59e4c729920ce3e10ce8c6922d4815e61d3e296..5e829809d8c37f40d7ca21c71cf89e4d5e02ac33 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/ExpressionUtil.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/ExpressionUtil.java @@ -27,8 +27,9 @@ import java.util.List; public class ExpressionUtil { public static final String START = "${"; + public static final String END = "}"; - + private static final int START_LENGTH = START.length(); /** @@ -72,7 +73,7 @@ public class ExpressionUtil } return result; } - + private ExpressionUtil() { } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/GenericSharedConstants.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/GenericSharedConstants.java index d3eba6e3abe28f85451f607ee7e6d6401a1142c6..e7c85654cef9e6a68428539355482623bf93d223 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/GenericSharedConstants.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/GenericSharedConstants.java @@ -37,7 +37,7 @@ public final class GenericSharedConstants /** Part of the URL of the DSS service. */ public static final String DATA_STORE_SERVER_SERVICE_NAME = DATA_STORE_SERVER_WEB_APPLICATION_NAME + "/dss"; - + public static final String SESSION_ID_PARAMETER = "sessionID"; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/GridRowModel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/GridRowModel.java index c962f2fbeab9ffd86d619eb5f1af18e716f666aa..7a97e35bc8b43431471dd832a35ee0a644aad945 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/GridRowModel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/GridRowModel.java @@ -23,8 +23,7 @@ import java.util.Map; import com.google.gwt.user.client.rpc.IsSerializable; /** - * Stores the original object which will be a basis to calculate a grid row together with calculated - * all custom columns values. + * Stores the original object which will be a basis to calculate a grid row together with calculated all custom columns values. * * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IColumnDefinition.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IColumnDefinition.java index efde92ff9142c4265270351bbc150778016fa144..16809f5f8db72b04ff47d91a25e5e44b18c61f0e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IColumnDefinition.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IColumnDefinition.java @@ -21,8 +21,7 @@ import com.google.gwt.user.client.rpc.IsSerializable; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataTypeCode; /** - * Describes table column's metadata. Has the ability to render cell values for the column given the - * row model. + * Describes table column's metadata. Has the ability to render cell values for the column given the row model. * * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IEntityInformationHolderWithIdentifier.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IEntityInformationHolderWithIdentifier.java index 9f9821ae45346ed0a4aee13e8a8e252b7b1a1e42..4201df39220fbd147ebb57b0249794696bb64503 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IEntityInformationHolderWithIdentifier.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IEntityInformationHolderWithIdentifier.java @@ -17,8 +17,7 @@ package ch.systemsx.cisd.openbis.generic.shared.basic; /** - * Contains the information stored in both {@link IIdentifierHolder} and - * {@link IEntityInformationHolderWithPermId}. + * Contains the information stored in both {@link IIdentifierHolder} and {@link IEntityInformationHolderWithPermId}. * * @author Izabela Adamczyk */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IEntityInformationHolderWithPermId.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IEntityInformationHolderWithPermId.java index ed4d798e90f1bea874a5cc49e065cffa4d255476..170736074c2010be1fd438f21f64ecb1aa571e92 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IEntityInformationHolderWithPermId.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IEntityInformationHolderWithPermId.java @@ -17,8 +17,7 @@ package ch.systemsx.cisd.openbis.generic.shared.basic; /** - * Contains the information stored in both {@link IPermIdHolder} and - * {@link IEntityInformationHolder}. + * Contains the information stored in both {@link IPermIdHolder} and {@link IEntityInformationHolder}. * * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IEntityInformationHolderWithProperties.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IEntityInformationHolderWithProperties.java index 2b4ed00a3bf7aeee416b29e571853c458e09d631..80f5835ada4d070d205105f1c73c344927ebdc3d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IEntityInformationHolderWithProperties.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IEntityInformationHolderWithProperties.java @@ -19,8 +19,7 @@ package ch.systemsx.cisd.openbis.generic.shared.basic; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityPropertiesHolder; /** - * Contains the information stored in both {@link IEntityInformationHolderWithIdentifier} and - * {@link IEntityPropertiesHolder}. + * Contains the information stored in both {@link IEntityInformationHolderWithIdentifier} and {@link IEntityPropertiesHolder}. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IManagedPropertyGridInformationProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IManagedPropertyGridInformationProvider.java index 5e4db7d1cedb98f2cdb308b21920bae00a550a99..ed999373ca4b7f3ff4a53b70ce9aa0c084529ed4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IManagedPropertyGridInformationProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/IManagedPropertyGridInformationProvider.java @@ -22,8 +22,7 @@ package ch.systemsx.cisd.openbis.generic.shared.basic; public interface IManagedPropertyGridInformationProvider { /** - * the key of a grid that can be used when creating ids (unique in the context of an entity, - * doesn't contain spaces) + * the key of a grid that can be used when creating ids (unique in the context of an entity, doesn't contain spaces) */ public String getKey(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/MaterialCodeConverter.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/MaterialCodeConverter.java index 83f3f3060e49018fd88c652621250126778084be..184f94fc355d6cdc441c911e56d4b70565175480 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/MaterialCodeConverter.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/MaterialCodeConverter.java @@ -19,8 +19,7 @@ package ch.systemsx.cisd.openbis.generic.shared.basic; import ch.systemsx.cisd.openbis.generic.shared.util.MaterialConfigurationProvider; /** - * Methods to convert material codes from business layer to database and from database to business - * layer. + * Methods to convert material codes from business layer to database and from database to business layer. * * @author Kaloyan Enimanev */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/MetaprojectName.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/MetaprojectName.java index 2cc5ea706588f12ab1255258c6e6da9afec6f73e..551172fd6a3c65b1fda963fe0e5f713725acbf35 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/MetaprojectName.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/MetaprojectName.java @@ -21,8 +21,7 @@ import java.util.regex.Pattern; import ch.systemsx.cisd.common.exceptions.UserFailureException; /** - * Metaproject name representation. The name cannot be null, empty or contain white spaces, commas, - * slashes or backslashes. + * Metaproject name representation. The name cannot be null, empty or contain white spaces, commas, slashes or backslashes. * * @author pkupczyk */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/PermlinkUtilities.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/PermlinkUtilities.java index bdfa260d11771cbeaccfd49de5ee4f583dae1a1b..e15a64f85b3d1ab2c3865b24ffa588056a173262 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/PermlinkUtilities.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/PermlinkUtilities.java @@ -34,7 +34,7 @@ public class PermlinkUtilities /** The HTTP URL parameter used to specify the entity kind. */ public static final String ENTITY_KIND_PARAMETER_KEY = "entity"; - /** The optional HTTP URL parameter used to specify the subtab that should be opened. */ + /** The optional HTTP URL parameter used to specify the subtab that should be opened. */ public static final String SUBTAB_PARAMETER_KEY = "ui-subtab"; public final static String createPermlinkURL(final String baseIndexURL, diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/PrimitiveValue.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/PrimitiveValue.java index aafabd47fb1d7c24031d697caa4a95add3b1e605..96c24b87b81837806b1a69d726fa088e4127656d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/PrimitiveValue.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/PrimitiveValue.java @@ -23,11 +23,9 @@ import com.google.gwt.user.client.rpc.IsSerializable; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataTypeCode; /** - * Stores one primitive value: Double, Long or String (null is represented as "" - - * {@link PrimitiveValue#NULL}). + * Stores one primitive value: Double, Long or String (null is represented as "" - {@link PrimitiveValue#NULL}). * <p> - * Such a type is needed because GWT does not support serialization fields of Object or Serializable - * type. + * Such a type is needed because GWT does not support serialization fields of Object or Serializable type. * </p> * * @author Tomasz Pylak @@ -89,7 +87,7 @@ public class PrimitiveValue implements IsSerializable, Serializable, Comparable< @Override @SuppressWarnings( - { "unchecked", "rawtypes" }) + { "unchecked", "rawtypes" }) public int compareTo(PrimitiveValue o) { Integer thisTypeOrdinal = getComparableDataTypeOrdinal(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/SimpleImageHtmlRenderer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/SimpleImageHtmlRenderer.java index 6b5ce2206947498c076eb67800bbbc956a6015d6..0fb58d8d0e9359b703f261b86e55bedc0c6459ca 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/SimpleImageHtmlRenderer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/SimpleImageHtmlRenderer.java @@ -16,7 +16,6 @@ package ch.systemsx.cisd.openbis.generic.shared.basic; - /** * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/TableCellUtil.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/TableCellUtil.java index 653b0ec033ae24c987da71dcca7b277af9370cbc..780c9cb1ba540953818bbc0417540ef73942fa27 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/TableCellUtil.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/TableCellUtil.java @@ -35,9 +35,8 @@ public class TableCellUtil public static final String INTERN_PREFIX = "INTERN-"; /** - * Returns an appropriate table cell for the specified string token. If it can be parsed as an - * integer number a {@link IntegerTableCell} is returned. If it can be parsed as a floating - * point number a {@link DoubleTableCell} is returned. Otherwise a {@link StringTableCell} is + * Returns an appropriate table cell for the specified string token. If it can be parsed as an integer number a {@link IntegerTableCell} is + * returned. If it can be parsed as a floating point number a {@link DoubleTableCell} is returned. Otherwise a {@link StringTableCell} is * returned. */ public static ISerializableComparable createTableCell(String token) @@ -63,8 +62,8 @@ public class TableCellUtil } /** - * Returns the code of specified property type with prefix <code>INTERN-</code> or - * <code>USER-</code> depending on whether it is internal name space or not. + * Returns the code of specified property type with prefix <code>INTERN-</code> or <code>USER-</code> depending on whether it is internal name + * space or not. */ public static String getPropertyTypeCode(PropertyType propertyType) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/URLMethodWithParameters.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/URLMethodWithParameters.java index 6a5ae4f0a55dc8008d5fd5c4f381fccbf27eda92..6868194fed5ecbc19621e88cbb901b51578e7fa2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/URLMethodWithParameters.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/URLMethodWithParameters.java @@ -21,9 +21,8 @@ import com.google.gwt.user.client.rpc.IsSerializable; import ch.systemsx.cisd.common.shared.basic.string.StringUtils; /** - * Helper class to create URL's with parameters. Characters in path, parameter names and values are - * URL encoded except '0'-'9', 'a'-'z', 'A'-'Z', ':', '/', '.', '*', '-', and '_'. Space character - * is replaced by '+'. + * Helper class to create URL's with parameters. Characters in path, parameter names and values are URL encoded except '0'-'9', 'a'-'z', 'A'-'Z', ':', + * '/', '.', '*', '-', and '_'. Space character is replaced by '+'. * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/ValidationUtilities.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/ValidationUtilities.java index 61e0d6c4f3955b4cc11a642d52f43a8b31cafc66..78c16bdb3498f6c389e798de500d1b97a015920b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/ValidationUtilities.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/ValidationUtilities.java @@ -36,7 +36,7 @@ public class ValidationUtilities private static final String HYPERLINK_REGEXP = "[^<>()\\[\\]]*"; private static final String[] HYPERLINK_VALID_PROTOCOLS = - { "http://", "https://", "ftp://" }; + { "http://", "https://", "ftp://" }; /** @return does given <var>string</var> start with a valid external hyperlink protocol */ public static final boolean isProtocolValid(String string) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/ViewMode.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/ViewMode.java index 2acc4442c9c2ddcfd640bc696ae7d2dd5cef186b..7f9982e34a2f4e8cbae1a658e7d373b1fdf72ff5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/ViewMode.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/ViewMode.java @@ -26,9 +26,8 @@ public enum ViewMode implements IsSerializable SIMPLE, /** - * Embedded mode inherits most of the SIMPLE mode behaviors. But it has less widgets (e.g. top - * toolbar and footer are invisible, grids have only "Export" button) to allow embedding the - * application on other web sites. + * Embedded mode inherits most of the SIMPLE mode behaviors. But it has less widgets (e.g. top toolbar and footer are invisible, grids have only + * "Export" button) to allow embedding the application on other web sites. */ EMBEDDED, diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/WildcardSupportingMap.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/WildcardSupportingMap.java index 1937db13803153e55bb21f0bf5f5fbe263197eaa..727fc5652e89e89ff54767bd7561f2ea4c8d5eb6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/WildcardSupportingMap.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/WildcardSupportingMap.java @@ -21,8 +21,7 @@ import java.util.ArrayList; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKindAndTypeCode; /** - * Utility class that manages mappings from entity types/codes (possibly including wildcards) to - * IServerPlugin objects. + * Utility class that manages mappings from entity types/codes (possibly including wildcards) to IServerPlugin objects. * * @author Chandrasekhar Ramakrishnan */ @@ -30,8 +29,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKindAndTypeCode; public class WildcardSupportingMap<T> { /** - * Internal class for keeping mappings from entityKind/codes (which may include wildcards) to - * factories. + * Internal class for keeping mappings from entityKind/codes (which may include wildcards) to factories. * * @author Chandrasekhar Ramakrishnan */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/annotation/DoNotEscape.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/annotation/DoNotEscape.java index 84573cd7236d49a4edc1f49720a74cdb051b2cab..3f0cdeec127f64b5dfa99d8333228215d84cb1c7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/annotation/DoNotEscape.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/annotation/DoNotEscape.java @@ -23,12 +23,10 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * An annotation for marking an object that should not be escaped when returned to the client from - * server. There may be two reasons for this: + * An annotation for marking an object that should not be escaped when returned to the client from server. There may be two reasons for this: * <p> * <ol> - * <li>object contains important information used internally by application that are not shown to - * the user and shouldn't be escaped (like session id) + * <li>object contains important information used internally by application that are not shown to the user and shouldn't be escaped (like session id) * <li>object is escaped in a different place (e.g. in ResultSetTranslator) * </ol> * diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/AbstractEntityProperty.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/AbstractEntityProperty.java index fe2d078ffa0caad29910fc9ba365031e70f3c7f4..a8b5ee7d89557370463cbd390ed234380227b9db 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/AbstractEntityProperty.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/AbstractEntityProperty.java @@ -17,11 +17,10 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; /** - * The abstract base implementation of {@link IEntityProperty}, only featuring a - * {@link PropertyType}. + * The abstract base implementation of {@link IEntityProperty}, only featuring a {@link PropertyType}. * <p> - * All getters (except {@link #getPropertyType()} will return <code>null</code>, all setters (except - * {@link #setPropertyType(PropertyType)} will throw an {@link UnsupportedOperationException}. + * All getters (except {@link #getPropertyType()} will return <code>null</code>, all setters (except {@link #setPropertyType(PropertyType)} will throw + * an {@link UnsupportedOperationException}. * * @author Bernd Rinn */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/AbstractExternalData.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/AbstractExternalData.java index 29867311fb4ea713697e437307fa41d881b866e2..1fbe2a7d9d34b22ca2ecdd7d7e14c9e730b8914c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/AbstractExternalData.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/AbstractExternalData.java @@ -117,7 +117,7 @@ public abstract class AbstractExternalData extends private boolean storageConfirmation; private boolean isStub; - + private boolean isPostRegistered; private Collection<Metaproject> metaprojects; @@ -475,7 +475,7 @@ public abstract class AbstractExternalData extends { return this.isStub; } - + public boolean isPostRegistered() { return isPostRegistered; @@ -495,7 +495,7 @@ public abstract class AbstractExternalData extends { this.accessTimestamp = accessTimestamp; } - + public Space getSpace() { if (experiment != null) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/AssociatedEntityKind.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/AssociatedEntityKind.java index 51462e3c04dbeef2911ef49ab6bef4e7ad0f123a..91fee5efe1ac83d6ce37401b5bd72fd9888984a0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/AssociatedEntityKind.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/AssociatedEntityKind.java @@ -23,8 +23,7 @@ import java.util.List; import java.util.Set; /** - * The <i>GWT</i> counterpart to - * ch.systemsx.cisd.openbis.generic.shared.api.v1.SearchableEntityKind. + * The <i>GWT</i> counterpart to ch.systemsx.cisd.openbis.generic.shared.api.v1.SearchableEntityKind. * * @author Piotr Buczek */ @@ -34,7 +33,7 @@ public enum AssociatedEntityKind implements Serializable EXPERIMENT("Experiment", EntityKind.EXPERIMENT, EnumSet.of(EntityKind.SAMPLE, EntityKind.DATA_SET)), - + DATA_SET("Data Set", EntityKind.DATA_SET, EnumSet.noneOf(EntityKind.class)), DATA_SET_PARENT("Parent", EntityKind.DATA_SET, EnumSet.of(EntityKind.DATA_SET)), diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/AttachmentWithContent.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/AttachmentWithContent.java index 53b248a46bc4b70d2d70664bdf20c93baf8b978d..652ffaf764f5c8a41e48006da4d214dad45e96e1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/AttachmentWithContent.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/AttachmentWithContent.java @@ -17,7 +17,7 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; /** - * An {@link Attachment} which has the actual content. + * An {@link Attachment} which has the actual content. * * @author Bernd Rinn */ @@ -25,9 +25,9 @@ public class AttachmentWithContent extends Attachment { private static final long serialVersionUID = ServiceVersionHolder.VERSION; - + private byte[] content; - + public AttachmentWithContent() { } @@ -42,6 +42,4 @@ public class AttachmentWithContent extends Attachment this.content = content; } - - } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/BasicProjectIdentifier.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/BasicProjectIdentifier.java index fbf86cffd966c6cc02f7209a5a69e66f00685908..5f716b679fb4828b4f1d917001ac3154999d0562 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/BasicProjectIdentifier.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/BasicProjectIdentifier.java @@ -19,8 +19,7 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; import java.io.Serializable; /** - * The <i>GWT</i> counterpart to - * {@link ch.systemsx.cisd.openbis.generic.shared.dto.identifier.ProjectIdentifier}. + * The <i>GWT</i> counterpart to {@link ch.systemsx.cisd.openbis.generic.shared.dto.identifier.ProjectIdentifier}. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/BatchRegistrationResult.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/BatchRegistrationResult.java index 86b9da34ede7d2e41feb78062feb799cd32f02d2..ccefc091aca4e8210812c899477e7a397d8051e4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/BatchRegistrationResult.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/BatchRegistrationResult.java @@ -19,8 +19,8 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; import java.io.Serializable; /** - * Batch registration is based on file input. This class returns to the client a small message after - * each file has been uploaded and handled on the server side. + * Batch registration is based on file input. This class returns to the client a small message after each file has been uploaded and handled on the + * server side. * * @author Christian Ribeaud */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/CodeAndLabel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/CodeAndLabel.java index 8bc977b9e5dcdf2790772c0d513840624be3e354..ed299178d84ff474e7c16930b7aeff023539f1e8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/CodeAndLabel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/CodeAndLabel.java @@ -21,9 +21,8 @@ import java.util.ArrayList; import java.util.List; /** - * Value object which has a label and a normalized code. Normalized means that the original code - * arguments turn to upper case and any symbol which isn't from A-Z or 0-9 is replaced by an - * underscore character. + * Value object which has a label and a normalized code. Normalized means that the original code arguments turn to upper case and any symbol which + * isn't from A-Z or 0-9 is replaced by an underscore character. * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ColumnSetting.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ColumnSetting.java index 61a1ca3fde528adc3c1dd497d0f3755d92325a7c..386532bb246734b47bd95ea2a291d33a741a2ff4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ColumnSetting.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ColumnSetting.java @@ -21,9 +21,8 @@ import java.io.Serializable; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SortInfo.SortDir; /** - * Class storing personalised display settings for a table column. This class implements - * {@link Serializable} not only for transferring it's content remotely but also to store it in the - * database. Thus, CHANGES IN THIS CLASS MIGHT LEAD TO A LOST OF PERSONAL SETTINGS. + * Class storing personalised display settings for a table column. This class implements {@link Serializable} not only for transferring it's content + * remotely but also to store it in the database. Thus, CHANGES IN THIS CLASS MIGHT LEAD TO A LOST OF PERSONAL SETTINGS. * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ContainerDataSet.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ContainerDataSet.java index 2b4ac7180645dff69af4750c3b3cf5b1d13d9af2..98f17f4298c96fef74c6ccef33236752f1fafed3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ContainerDataSet.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ContainerDataSet.java @@ -20,8 +20,8 @@ import java.util.ArrayList; import java.util.List; /** - * A virtual data set "containing" other data sets. Container data sets have no physical - * representation. Their sole purpose is to provide a merged view of their contents. + * A virtual data set "containing" other data sets. Container data sets have no physical representation. Their sole purpose is to provide a merged + * view of their contents. * * @author Kaloyan Enimanev */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DateTableCell.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DateTableCell.java index 57ec6454be6cffd301c6b22428ca863382c99033..95dcb099f2932e26311a010a087c16cc692e0a3a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DateTableCell.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DateTableCell.java @@ -26,19 +26,19 @@ import java.util.Date; public class DateTableCell implements ISerializableComparable { private static final long serialVersionUID = ServiceVersionHolder.VERSION; - + private long dateTime; - + public DateTableCell(long dateTime) { this.dateTime = dateTime; } - + public DateTableCell(Date date) { dateTime = date.getTime(); } - + public Date getDateTime() { return new Date(dateTime); @@ -73,6 +73,7 @@ public class DateTableCell implements ISerializableComparable { return new Date(dateTime).toString(); } + // --------------------------- // GWT only diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Deletion.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Deletion.java index 04be5dce282430141c8e71c4f38c0db5d7bc2736..c8e4b0d736dcf51072dcfce127d12066cc283f53 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Deletion.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Deletion.java @@ -77,8 +77,7 @@ public final class Deletion extends AbstractRegistrationHolder implements IIdHol } /* - * The deletion counts are supposed to be used in situations when not all deleted entities are - * fetched into the <code>deletedEntities<?code> + * The deletion counts are supposed to be used in situations when not all deleted entities are fetched into the <code>deletedEntities<?code> */ public int getTotalSamplesCount() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DetailedSearchCriterion.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DetailedSearchCriterion.java index 76e7d1b6b580aedd043e3c6b17a9afb5233bca72..1292e005937ec6ae3604b723fca85b8255494eaf 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DetailedSearchCriterion.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DetailedSearchCriterion.java @@ -36,7 +36,7 @@ public class DetailedSearchCriterion implements Serializable private String value; private String timezone; - + private boolean negated; public DetailedSearchCriterion() @@ -55,14 +55,14 @@ public class DetailedSearchCriterion implements Serializable { this(field, type, date, SERVER_TIMEZONE); } - + public DetailedSearchCriterion(DetailedSearchField field, CompareType type, Number value) { this.field = field; this.value = value.toString(); this.type = type; } - + public DetailedSearchCriterion(DetailedSearchField field, CompareType type, String value, String timezoneOrNull) { this.field = field; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DetailedSearchField.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DetailedSearchField.java index 342085c9f26876df791f856af25e0121cad42089..95371a3b231900ce12f3ba7f43cbf6ad1a635d07 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DetailedSearchField.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DetailedSearchField.java @@ -20,8 +20,7 @@ import java.io.Serializable; import java.util.List; /** - * Full specification of the field connected with an entity which can be used in detailed text - * queries. + * Full specification of the field connected with an entity which can be used in detailed text queries. * * @author Tomasz Pylak * @author Piotr Buczek diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DoubleTableCell.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DoubleTableCell.java index 44c2b7d2f99dc7a127db59808ed1d1d84b288914..f71986f9748f15d5cbb6686b05df3bf9671dbaa2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DoubleTableCell.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DoubleTableCell.java @@ -24,19 +24,19 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; public class DoubleTableCell implements ISerializableComparable { private static final long serialVersionUID = ServiceVersionHolder.VERSION; - + private double number; - + public DoubleTableCell(double doubleValue) { this.number = doubleValue; } - + public double getNumber() { return number; } - + @Override public int compareTo(ISerializableComparable o) { @@ -68,7 +68,7 @@ public class DoubleTableCell implements ISerializableComparable { return Double.toString(number); } - + // --------------------------- // GWT only diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/EntityReference.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/EntityReference.java index 24896499ae120600ed11b6dd4f978b2472f28406..3ae7c37ae6376034cf7e40d56dcc92ac2c540b72 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/EntityReference.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/EntityReference.java @@ -21,8 +21,7 @@ import java.io.Serializable; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithPermId; /** - * Reference to an entity with minimal information to uniquely identify it in the database and to - * choose the right plugin to handle it. + * Reference to an entity with minimal information to uniquely identify it in the database and to choose the right plugin to handle it. * * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/EntityType.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/EntityType.java index 11be668e3e712870ce1da91c6a088c494e033f97..bdb666a8d27b55bb75180d84c40bc646b22081b5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/EntityType.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/EntityType.java @@ -73,6 +73,6 @@ abstract public class EntityType extends BasicEntityType * return true if this entity type is of given kind, or if the kind is null */ public abstract boolean isEntityKind(EntityKind kind); - + public abstract EntityKind getEntityKind(); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/EntityTypePropertyType.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/EntityTypePropertyType.java index 907b083eda6bcf6e002fa39e5ae5c9641e629f5d..914b42a7c3fcfc89c74444325427b607b656106d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/EntityTypePropertyType.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/EntityTypePropertyType.java @@ -106,12 +106,10 @@ public abstract class EntityTypePropertyType<T extends EntityType> implements Se } /** - * Some properties, managed properties in particular, may or may not need to be available in - * edit and update views. + * Some properties, managed properties in particular, may or may not need to be available in edit and update views. * <p> - * The current behavior is to always return true for non-script-based properties and always - * return false for dynamically computed properties. Only dynamically managed properties take - * this value into account. + * The current behavior is to always return true for non-script-based properties and always return false for dynamically computed properties. Only + * dynamically managed properties take this value into account. * * @return True if the property should be shown in edit and update views. */ @@ -120,18 +118,17 @@ public abstract class EntityTypePropertyType<T extends EntityType> implements Se if (isDynamic()) { return false; - } else { + } else + { return showInEditView; } } /** - * Some properties, managed properties in particular, may or may not need to be available in - * edit and update views. + * Some properties, managed properties in particular, may or may not need to be available in edit and update views. * <p> - * The current behavior is to always use the value true for non-script-based properties and - * always use false for dynamically computed properties. Only dynamically managed properties - * take this value into account. + * The current behavior is to always use the value true for non-script-based properties and always use false for dynamically computed properties. + * Only dynamically managed properties take this value into account. * * @param showInEditView Pass in true if this property should be shown in edit and update views. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/EntityVisit.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/EntityVisit.java index bd1fcdfc270032b844bce486a1c0d7e0a202a58d..143c2d1d7e477f9827d0ccd048bffc7abe79bcea 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/EntityVisit.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/EntityVisit.java @@ -22,8 +22,7 @@ import java.util.Date; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithIdentifier; /** - * Visit of an entity. Objects of this class are created when the detail view of an entity is opened - * in the GUI. + * Visit of an entity. Objects of this class are created when the detail view of an entity is opened in the GUI. * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ExperimentType.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ExperimentType.java index 6c58ac1390f034fbe8eb518c53c60fd074dcc0b4..bf62425ba5b7fb49087db156525840137c18f495 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ExperimentType.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ExperimentType.java @@ -46,7 +46,7 @@ public class ExperimentType extends EntityType { return kind == null || kind == EntityKind.EXPERIMENT; } - + @Override public EntityKind getEntityKind() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/FileFormatType.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/FileFormatType.java index 1097c0d488c0aaec170bf6cef3fc02c8bd3654a2..c2d6dc22762dc4edda67a11485e1ab15e3981522 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/FileFormatType.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/FileFormatType.java @@ -16,7 +16,6 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; - /** * The <i>GWT</i> equivalent to FileFormatTypePE. * diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/GenericEntityProperty.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/GenericEntityProperty.java index 1eec8e212945ce531e79f7c2200ca565cb22045c..39c1ebe5338e385dcd6ad107757d0e355c284f82 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/GenericEntityProperty.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/GenericEntityProperty.java @@ -17,8 +17,7 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; /** - * A {@link IEntityProperty} class that only stores the generic value, but not a vocabulary term - * value or a material value. + * A {@link IEntityProperty} class that only stores the generic value, but not a vocabulary term value or a material value. * * @author Bernd Rinn */ @@ -28,6 +27,7 @@ public class GenericEntityProperty extends AbstractEntityProperty private static final long serialVersionUID = ServiceVersionHolder.VERSION; private String originalValue; + private String value; @Override diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IDatasetLocationNode.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IDatasetLocationNode.java index dfe3c184f442a116c9d306b5a9edf19466fc3c79..a24524cfeee996765963919e7949935904df06f7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IDatasetLocationNode.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IDatasetLocationNode.java @@ -37,8 +37,7 @@ public interface IDatasetLocationNode boolean isContainer(); /** - * Returns a collection of component locations. For a data set that is not a container always - * returns an empty collection. Never returns null. + * Returns a collection of component locations. For a data set that is not a container always returns an empty collection. Never returns null. */ Collection<IDatasetLocationNode> getComponents(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IEntityProperty.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IEntityProperty.java index 1e202f4a3e5f3d28069d7753b2cb85b39ba137bb..a82021c09413aa461bf0077fb5dc474342fa25a9 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IEntityProperty.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IEntityProperty.java @@ -28,8 +28,8 @@ public interface IEntityProperty extends Serializable, Comparable<IEntityPropert public static final IEntityProperty[] EMPTY_ARRAY = new IEntityProperty[0]; /** - * Returns a string representation of whatever value this property represents. Vocabulary terms - * will be represented as their CODE, material values will be represented as "CODE (TYPE_CODE)". + * Returns a string representation of whatever value this property represents. Vocabulary terms will be represented as their CODE, material values + * will be represented as "CODE (TYPE_CODE)". */ public String tryGetAsString(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IExpressionUpdates.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IExpressionUpdates.java index b6c7917352b2a80657780851bba59cc41e629651..aad406108a6e794d76f489b743d010b3ad23d375 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IExpressionUpdates.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IExpressionUpdates.java @@ -22,8 +22,7 @@ import java.util.Date; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder; /** - * Description of the updates which should be performed on a stored expression (e.g. grid custom - * filter or column expression). + * Description of the updates which should be performed on a stored expression (e.g. grid custom filter or column expression). * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IPropertiesBean.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IPropertiesBean.java index 8dfb9110404b71c603d06cd950929622f244f039..ee86bc3619bd64cc3b6607d0d34797ac03f29ba1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IPropertiesBean.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IPropertiesBean.java @@ -16,7 +16,6 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; - /** * Interface implemented by beans with properties attribute. * @@ -25,6 +24,6 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; public interface IPropertiesBean { public IEntityProperty[] getProperties(); - + public void setProperties(IEntityProperty[] properties); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ISerializableComparable.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ISerializableComparable.java index b489934cb6e935d4a5c96bcac02cbb2b6e84c935..7d6286e1406a99d02b7b76de0de9b9fbde9912b3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ISerializableComparable.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ISerializableComparable.java @@ -19,8 +19,8 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; import java.io.Serializable; /** - * Interface for objects which are comparable, java.io.Serializable and GWT serializable. - * Implementations should override {@link Object#equals(Object)} and {@link Object#hashCode()}. + * Interface for objects which are comparable, java.io.Serializable and GWT serializable. Implementations should override + * {@link Object#equals(Object)} and {@link Object#hashCode()}. * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ImageTableCell.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ImageTableCell.java index 609aede0eb02dd378b005e23cd76ad062702df1d..c7c8fd20c01baff5b467a0dab4a8dcb403376f13 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ImageTableCell.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ImageTableCell.java @@ -22,7 +22,7 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; public class ImageTableCell implements ISerializableComparable { private static final long serialVersionUID = ServiceVersionHolder.VERSION; - + private static final String SLASH = "/"; private static String getPath(String dataSetCode, String dataSetLocation, String originalPath) @@ -36,7 +36,7 @@ public class ImageTableCell implements ISerializableComparable String relativePath = originalPath.substring(indexOfLocation + dataSetLocation.length()); return getPath(dataSetCode, relativePath); } - + private static String getPath(String dataSetCode, String relativePath) { String delimiter = ""; @@ -52,16 +52,15 @@ public class ImageTableCell implements ISerializableComparable private int maxThumbnailWidth; private int maxThumbnailHeight; - + public ImageTableCell(String dataSetCode, String dataSetLocation, String originalPath, int maxThumbnailWidth, int maxThumbnailHeight) { this(getPath(dataSetCode, dataSetLocation, originalPath), maxThumbnailWidth, maxThumbnailHeight); } - + /** - * @param relativePathFromDataSetRoot the relative path to this image file starting from the - * data set root. + * @param relativePathFromDataSetRoot the relative path to this image file starting from the data set root. */ public ImageTableCell(String dataSetCode, String relativePathFromDataSetRoot, int maxThumbnailWidth, @@ -77,17 +76,17 @@ public class ImageTableCell implements ISerializableComparable this.maxThumbnailWidth = maxThumbnailWidth; this.maxThumbnailHeight = maxThumbnailHeight; } - + public String getPath() { return path; } - + public int getMaxThumbnailWidth() { return maxThumbnailWidth; } - + public int getMaxThumbnailHeight() { return maxThumbnailHeight; @@ -104,19 +103,19 @@ public class ImageTableCell implements ISerializableComparable { return this == obj || (obj instanceof ImageTableCell && ((ImageTableCell) obj).path.equals(path)); } - + @Override public int hashCode() { return path.hashCode(); } - + @Override public String toString() { return path; } - + // --------------------------- // GWT only @@ -125,4 +124,3 @@ public class ImageTableCell implements ISerializableComparable { } } - diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/LastModificationState.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/LastModificationState.java index 653e6c3acaed19f620a5fa20090823412a1fa879..3f3522680a23d717eb28d1bb72236a4ef5562fe2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/LastModificationState.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/LastModificationState.java @@ -28,31 +28,24 @@ import ch.systemsx.cisd.openbis.generic.shared.ICommonServer; import ch.systemsx.cisd.openbis.generic.shared.basic.annotation.DoNotEscape; /** - * Stores information about the time and {@link DatabaseModificationKind} of the last modification, - * separately for each kind of database object. + * Stores information about the time and {@link DatabaseModificationKind} of the last modification, separately for each kind of database object. * <p> * A {@link DatabaseModificationKind} has two bits of information: * <ul> - * <li>The kind of database object (e.g. Sample, Experiment etc. see - * {@link DatabaseModificationKind.ObjectKind}). - * <li>The kind of operation either update or creation/deletion (see - * {@link DatabaseModificationKind.OperationKind}). + * <li>The kind of database object (e.g. Sample, Experiment etc. see {@link DatabaseModificationKind.ObjectKind}). + * <li>The kind of operation either update or creation/deletion (see {@link DatabaseModificationKind.OperationKind}). * </ul> - * Instances of {@link LastModificationState} store for each combination of object kind and - * operation kind the time stamp of last invocation of a service method annotated with either - * {@link DatabaseCreateOrDeleteModification} or {@link DatabaseUpdateModification}. + * Instances of {@link LastModificationState} store for each combination of object kind and operation kind the time stamp of last invocation of a + * service method annotated with either {@link DatabaseCreateOrDeleteModification} or {@link DatabaseUpdateModification}. * <p> - * The method {@link #getLastModificationTime(DatabaseModificationKind)} allows to retrieve this - * time stamp. + * The method {@link #getLastModificationTime(DatabaseModificationKind)} allows to retrieve this time stamp. * <p> - * The service method {@link ICommonServer#getLastModificationState(String)} provides an instance of - * this class with the latest time stamps. It can be used by a client to update views (see for - * example ch.systemsx + * The service method {@link ICommonServer#getLastModificationState(String)} provides an instance of this class with the latest time stamps. It can be + * used by a client to update views (see for example ch.systemsx * .cisd.openbis.generic.client.web.client.application.framework.LastModificationStateUpdater). * <p> - * Note, that only the kind of object not the actual type or even instance is stored. That means for - * example that the creation of a new sample will lead to an update of any sample detailed view in - * the Web GUI. + * Note, that only the kind of object not the actual type or even instance is stored. That means for example that the creation of a new sample will + * lead to an update of any sample detailed view in the Web GUI. * * @author Tomasz Pylak */ @@ -84,10 +77,9 @@ public class LastModificationState implements Serializable } /** - * To avoid expensive computation of the last modification time at the beginning (which would - * require browsing the whole database) at the beginning we assume that it's equal to the - * initialization time of the whole state. We can do this since all the future modifications - * will happen after this moment. + * To avoid expensive computation of the last modification time at the beginning (which would require browsing the whole database) at the + * beginning we assume that it's equal to the initialization time of the whole state. We can do this since all the future modifications will + * happen after this moment. * * @return The last registered time of the specified kind of database modification. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/LinkDataSet.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/LinkDataSet.java index fdb8d700c2a15f94b5f68fe6fa9450a25ced4f80..730b5bf489abdba9d0a8df2f732c0591f7995fe4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/LinkDataSet.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/LinkDataSet.java @@ -17,8 +17,8 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; /** - * A virtual data set storing the reference to the data set in external data management system. Link - * data sets have no physical representation in local dss. + * A virtual data set storing the reference to the data set in external data management system. Link data sets have no physical representation in + * local dss. * * @author Pawel Glyzewski */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/LinkModel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/LinkModel.java index 37ed54a57c1f420f76fa5c49d172919595f63a71..47eecfdf4e1b6274958e382f898b4176fe0484d4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/LinkModel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/LinkModel.java @@ -23,8 +23,8 @@ import java.util.List; import com.google.gwt.user.client.rpc.IsSerializable; /** - * A model for reporting plug-ins of type DSS_LINK. It keeps the different parts of the URL separate - * so that users can easily use only the parts they need. + * A model for reporting plug-ins of type DSS_LINK. It keeps the different parts of the URL separate so that users can easily use only the parts they + * need. * <p> * The url is broken into schemAndDomain, path, and query parameters. An example: <br> * https://openbis.ethz.ch/datastore_server/2010093083732894?param1=482745¶m2=something @@ -34,8 +34,8 @@ import com.google.gwt.user.client.rpc.IsSerializable; * <li>param1=482745¶m2=something <b>[parameters]</b></li> * </ul> * <p> - * LinkModels returned by the server do not (necessarily) contain a sessionID. The client should - * provide the session Id to the LinkModel before using it. + * LinkModels returned by the server do not (necessarily) contain a sessionID. The client should provide the session Id to the LinkModel before using + * it. * * @author Chandrasekhar Ramakrishnan */ @@ -167,8 +167,8 @@ public class LinkModel implements Serializable } /** - * The session token is a special parameter. It is returned as one of the parameters by - * {@link #getParameters()}, but it can be retrieved directly this way. + * The session token is a special parameter. It is returned as one of the parameters by {@link #getParameters()}, but it can be retrieved directly + * this way. */ public String trySessionId() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ListMaterialCriteria.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ListMaterialCriteria.java index 3e9d0a2b2cae43738d1dcf4e64c42011faea1a4b..0b9dafeeca8acc7b5c68b0d374abb81d3f63dd16 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ListMaterialCriteria.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ListMaterialCriteria.java @@ -86,13 +86,14 @@ public final class ListMaterialCriteria implements Serializable { return materialIdentifiersOrNull; } - + @Override - public String toString() { + public String toString() + { return "ListMaterialCriteria [materialTypeOrNull=" + materialTypeOrNull + ", materialIdsOrNull=" + materialIdsOrNull + ", materialIdentifiersOrNull=" + materialIdentifiersOrNull + "]"; - } + } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ListOrSearchSampleCriteria.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ListOrSearchSampleCriteria.java index e13126f3232f432a54bd8b3912fe77f81085a1ad..677f52ec2bbe1edc69efe8b2ba156757790a9b5a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ListOrSearchSampleCriteria.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ListOrSearchSampleCriteria.java @@ -27,8 +27,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; * <li>detailed sample search * <li>tracking new samples of particular type * </ul> - * Additionally one can decide if dependent samples that are loaded (parents and containers) should - * be enriched with properties. By default only 'primary' samples are enriched.<br> + * Additionally one can decide if dependent samples that are loaded (parents and containers) should be enriched with properties. By default only + * 'primary' samples are enriched.<br> * <br> * NOTE: This bean is not serializable. * diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedHtmlWidgetDescription.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedHtmlWidgetDescription.java index fb74439e51a3f2ac7ed68413d8b344da206ab1a3..576d5a2298a9405ca879c722978c4396757ce735 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedHtmlWidgetDescription.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedHtmlWidgetDescription.java @@ -20,9 +20,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.api.IManagedOutputWidge import ch.systemsx.cisd.openbis.generic.shared.basic.dto.api.ManagedOutputWidgetType; /** - * {@link IManagedOutputWidgetDescription} implementation for multi-line text fields. This class - * functions as a simple marker that the UI should use an HTML widget to display the result, and - * offers no configuration options or behavior. + * {@link IManagedOutputWidgetDescription} implementation for multi-line text fields. This class functions as a simple marker that the UI should use + * an HTML widget to display the result, and offers no configuration options or behavior. * * @author Chandrasekhar Ramakrishnan */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedUiActionDescription.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedUiActionDescription.java index c1a4582f2ff187778b329ec4c99860facad11741..d11cb5d040efa27da8af91c7d9438d34eb0f9dbb 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedUiActionDescription.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedUiActionDescription.java @@ -25,8 +25,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.api.IManagedUiAction; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.api.IPerson; /** - * Object that declaratively describes a UI for an action (e.g. describing UI of a dialog that - * should be shown after clicking on a button). + * Object that declaratively describes a UI for an action (e.g. describing UI of a dialog that should be shown after clicking on a button). * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedUiTableActionDescription.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedUiTableActionDescription.java index 7581366c903dc9498602dbef3838cb1a82c16e76..e5e98ad983545adbae0eec595ffc8d3b8c0d3311 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedUiTableActionDescription.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ManagedUiTableActionDescription.java @@ -26,8 +26,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.api.IManagedUiTableActi import ch.systemsx.cisd.openbis.generic.shared.basic.dto.api.ManagedTableActionRowSelectionType; /** - * Object that declaratively describes a UI for an action related to a table (e.g. describing UI of - * a dialog that should be shown after clicking on a button when some table rows are selected). + * Object that declaratively describes a UI for an action related to a table (e.g. describing UI of a dialog that should be shown after clicking on a + * button when some table rows are selected). * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/MaterialAttributeSearchFieldKind.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/MaterialAttributeSearchFieldKind.java index 96fb5a2b50f33c974d5352d954c2882818e6aa5e..ee2a14b26abf81452ba6d67a8c216cb042c531a6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/MaterialAttributeSearchFieldKind.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/MaterialAttributeSearchFieldKind.java @@ -28,7 +28,7 @@ public enum MaterialAttributeSearchFieldKind implements Serializable, IAttribute ID("Id"), CODE("Code"), - + PERM_ID("Perm Id"), MATERIAL_TYPE("Material Type"), diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/MaterialEntityProperty.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/MaterialEntityProperty.java index cf37bd85cc497ab823556cbf869efff0341186d3..86ff90f2a620cf7fb16efb5d2d828653b346b65a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/MaterialEntityProperty.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/MaterialEntityProperty.java @@ -17,8 +17,7 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; /** - * A {@link IEntityProperty} class that only stores the material value, but not a generic value or a - * vocabulary term value. + * A {@link IEntityProperty} class that only stores the material value, but not a generic value or a vocabulary term value. * * @author Bernd Rinn */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/MaterialIdentifier.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/MaterialIdentifier.java index 1bf36e93fa337ad201d5c917f75f82242bbfeb82..372efb5e22fc5b4c0f1b672da9840b648ac43e09 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/MaterialIdentifier.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/MaterialIdentifier.java @@ -44,8 +44,7 @@ public final class MaterialIdentifier implements Serializable private String code; /** - * The code of material type of this material: together with code uniquely identifies the - * material. + * The code of material type of this material: together with code uniquely identifies the material. * <p> * Could not be <code>null</code>. * </p> @@ -89,12 +88,10 @@ public final class MaterialIdentifier implements Serializable // ----------- /** - * Creates material identifier from specified identifier or code and material type code if no - * full identifier is specified. + * Creates material identifier from specified identifier or code and material type code if no full identifier is specified. * * @return <code>null</code> if no full identifier specified and material type is unknown. - * @throw {@link IllegalArgumentException} if material type of full identifier doesn't match - * specified material type. + * @throw {@link IllegalArgumentException} if material type of full identifier doesn't match specified material type. */ public static MaterialIdentifier tryCreate(String codeOrIdentifierOrNull, ICodeHolder materialTypeCodeHolderOrNull) @@ -125,8 +122,7 @@ public final class MaterialIdentifier implements Serializable } /** - * Parses the material code and type. Assumes the syntax: "code (type)". Returns the chosen - * material if parsing went ok, null otherwise. + * Parses the material code and type. Assumes the syntax: "code (type)". Returns the chosen material if parsing went ok, null otherwise. */ public static MaterialIdentifier tryParseIdentifier(String value) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/NewColumnOrFilter.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/NewColumnOrFilter.java index 1b6c2b9fb36867e3b0400c44117f3bc26d7cf531..e84e4ee6078c1fd34c9666220c7aa2556734d6d7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/NewColumnOrFilter.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/NewColumnOrFilter.java @@ -16,7 +16,6 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; - /** * A custom grid filter or column to register. * @@ -25,7 +24,7 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; public class NewColumnOrFilter extends NewExpression { private static final long serialVersionUID = ServiceVersionHolder.VERSION; - + private String gridId; public String getGridId() diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/NewPTNewAssigment.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/NewPTNewAssigment.java index 485b37b809f0c4b21de129bbd91cc397c70edbf8..e39f248f4993778972b225980029e9a1639459c2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/NewPTNewAssigment.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/NewPTNewAssigment.java @@ -5,32 +5,39 @@ import java.io.Serializable; public class NewPTNewAssigment implements Serializable { private boolean existingPropertyType; + private PropertyType propertyType; + private NewETPTAssignment assignment; - + public boolean isExistingPropertyType() { return existingPropertyType; } + public void setExistingPropertyType(boolean existingPropertyType) { this.existingPropertyType = existingPropertyType; } + public PropertyType getPropertyType() { return propertyType; } + public void setPropertyType(PropertyType propertyType) { this.propertyType = propertyType; } + public NewETPTAssignment getAssignment() { return assignment; } + public void setAssignment(NewETPTAssignment assignment) { this.assignment = assignment; } - + } \ No newline at end of file diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/NewSample.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/NewSample.java index 679fd72d6a8c32f584f011376e4916764b9487d7..a982ec05d7bc42da0a349f3d76b4490e235e70b9 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/NewSample.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/NewSample.java @@ -59,8 +59,7 @@ public class NewSample extends Identifier<NewSample> implements Comparable<NewSa private SampleType sampleType; /** - * Set of parent sample codes or identifiers. It will be assumed that all the samples belong to - * the same group as the child sample. + * Set of parent sample codes or identifiers. It will be assumed that all the samples belong to the same group as the child sample. */ private String[] parentsOrNull; @@ -70,8 +69,8 @@ public class NewSample extends Identifier<NewSample> implements Comparable<NewSa private String containerIdentifier; /** - * The current container identifier. Used only if the sample identifier does not have the - * container specified. In such a case it will be assumed that the sample is in that container. + * The current container identifier. Used only if the sample identifier does not have the container specified. In such a case it will be assumed + * that the sample is in that container. */ private String currentContainerIdentifier; @@ -194,8 +193,7 @@ public class NewSample extends Identifier<NewSample> implements Comparable<NewSa } /** - * @deprecated kept for backward compatibility and used as a convenience method for tests - use - * {@link #setParents(String)} instead + * @deprecated kept for backward compatibility and used as a convenience method for tests - use {@link #setParents(String)} instead */ @Deprecated @BeanProperty(label = PARENT, optional = true) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/PortletConfiguration.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/PortletConfiguration.java index 42552d62f486042af5c2540fee42af7f0d6285db..4412c2dadcc9e1966dd851b1c2793a98bc759cc4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/PortletConfiguration.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/PortletConfiguration.java @@ -21,8 +21,8 @@ import java.io.Serializable; /** * Configuration parameters of a portlet. * <p> - * Instances of this class are serialized in the personal {@link DisplaySettings} of a user. Thus, - * CHANGES IN THIS CLASS MIGHT LEAD TO A LOST OF PERSONAL SETTINGS + * Instances of this class are serialized in the personal {@link DisplaySettings} of a user. Thus, CHANGES IN THIS CLASS MIGHT LEAD TO A LOST OF + * PERSONAL SETTINGS * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/PropertyType.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/PropertyType.java index ecee128b259f1fe80ebbfc79d666889527e1347c..9632d69a7403046bd46e5c4896b437b4de1eba33 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/PropertyType.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/PropertyType.java @@ -31,8 +31,8 @@ public class PropertyType extends Code<PropertyType> implements IPropertyTypeUpd private Long id; /** - * Only used for displaying/viewing. With <code>managedInternally</code> is unambiguous (meaning - * that <code>simpleCode</code> alone could be not unique). + * Only used for displaying/viewing. With <code>managedInternally</code> is unambiguous (meaning that <code>simpleCode</code> alone could be not + * unique). * <p> * We have to use it, partly because <i>Javascript</i> handle '.' in an object-oriented way. * </p> diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/RelationshipType.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/RelationshipType.java index 940cf75a3f9aaa3ed96dce4500548d56cb26d0ce..eae92967a965f1711153fc9b2289141d7c48841f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/RelationshipType.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/RelationshipType.java @@ -30,8 +30,8 @@ public class RelationshipType extends Code<PropertyType> implements Serializable private Long id; /** - * Only used for displaying/viewing. With <code>managedInternally</code> is unambiguous (meaning - * that <code>simpleCode</code> alone could be not unique). + * Only used for displaying/viewing. With <code>managedInternally</code> is unambiguous (meaning that <code>simpleCode</code> alone could be not + * unique). * <p> * We have to use it, partly because <i>Javascript</i> handle '.' in an object-oriented way. * </p> diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ReportingPluginType.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ReportingPluginType.java index 9702dfe2b4c2a0224ac9ff5c01b8a534a2f50bd4..1368a60829fd576ce315b902fdf30f748da88dd9 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ReportingPluginType.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ReportingPluginType.java @@ -19,8 +19,8 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; import java.io.Serializable; /** - * Different kinds of reporting plug-ins that are supported. Also keeps track of which - * IReportingPluginTask methods can be invoked on the different types of plugin types. + * Different kinds of reporting plug-ins that are supported. Also keeps track of which IReportingPluginTask methods can be invoked on the different + * types of plugin types. * * @author Chandrasekhar Ramakrishnan */ @@ -30,13 +30,12 @@ public enum ReportingPluginType implements Serializable TABLE_MODEL(ImplementedPluginMethods.CREATE_REPORT), DSS_LINK(new ImplementedPluginMethods[] - { ImplementedPluginMethods.CREATE_REPORT, ImplementedPluginMethods.CREATE_LINK }), + { ImplementedPluginMethods.CREATE_REPORT, ImplementedPluginMethods.CREATE_LINK }), AGGREGATION_TABLE_MODEL(ImplementedPluginMethods.CREATE_AGGREGATION_REPORT); /** - * An enum representing the methods implemented by the - * ch.systemsx.cisd.openbis.dss.generic.server.plugins.tasks.IReportingPluginTask interface. + * An enum representing the methods implemented by the ch.systemsx.cisd.openbis.dss.generic.server.plugins.tasks.IReportingPluginTask interface. * * @author Chandrasekhar Ramakrishnan */ @@ -50,7 +49,7 @@ public enum ReportingPluginType implements Serializable private ReportingPluginType(ImplementedPluginMethods implementedMethods) { this(new ImplementedPluginMethods[] - { implementedMethods }); + { implementedMethods }); } private ReportingPluginType(ImplementedPluginMethods[] implementedMethods) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/RoleAssignment.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/RoleAssignment.java index fd4cbb0cefc605308f537d7cbd93242a3e503514..f10dbd86da84af041bf64253dd574d355e0a95bb 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/RoleAssignment.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/RoleAssignment.java @@ -16,7 +16,6 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; - /** * The DTO for authorization role assignments. * diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/RoleWithHierarchy.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/RoleWithHierarchy.java index 5acdb31460b726807be855fca71db739da5a08d9..dc2db87f2ae57c13af33f945e9b898c8110a12b7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/RoleWithHierarchy.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/RoleWithHierarchy.java @@ -23,25 +23,23 @@ import java.util.Set; import com.google.gwt.user.client.rpc.IsSerializable; /** - * Hierarchical role. Combines {@link RoleCode} with {@link RoleLevel} and a set of - * {@link RoleWithHierarchy}s that are stronger. + * Hierarchical role. Combines {@link RoleCode} with {@link RoleLevel} and a set of {@link RoleWithHierarchy}s that are stronger. * <p> * Available roles can: * <ol> * <li>be presented to the user * <li>be easily mapped to database structure * <li>be used to restrict access to server methods - * <li>define the role hierarchy by specifying which roles are stronger (users that have only the - * "stronger" role will also be able to access given server method) + * <li>define the role hierarchy by specifying which roles are stronger (users that have only the "stronger" role will also be able to access given + * server method) * </ol> * </p> * <h4>Example:</h4>To annotate an interface method with a new role e.g. <code>SECRET_AGENT</code>: * <ol> * <li>Add <code>SECRET_AGENT</code> to {@link RoleCode} enumerator. - * <li>Add <code>SECRET_AGENT</code> to <code>authorization_role</code> domain in the database (and - * prepare migration). - * <li>Add <code>INSTANCE_SECRET_AGENT</code> (or <code>SPACE_SECRET_AGENT</code>) to - * {@link RoleWithHierarchy} enumerator and define the "stronger" roles. + * <li>Add <code>SECRET_AGENT</code> to <code>authorization_role</code> domain in the database (and prepare migration). + * <li>Add <code>INSTANCE_SECRET_AGENT</code> (or <code>SPACE_SECRET_AGENT</code>) to {@link RoleWithHierarchy} enumerator and define the "stronger" + * roles. * <li>Use the new {@link RoleWithHierarchy} to annotate the interface method. * </ol> * diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Sample.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Sample.java index 6b4120ee80243f1364efeffe239115aeccad1954..c5e3967b4ead535a7161f5048b8d3b3ca0b3716d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Sample.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Sample.java @@ -275,9 +275,10 @@ public final class Sample extends CodeWithRegistrationAndModificationDate<Sample @Override public final int compareTo(final Sample o) { - if (getIdentifier() == null) { - return o.getIdentifier() == null ? 0 : 1; - } + if (getIdentifier() == null) + { + return o.getIdentifier() == null ? 0 : 1; + } return getIdentifier().compareTo(o.getIdentifier()); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SampleAttributeSearchFieldKind.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SampleAttributeSearchFieldKind.java index 9cdf9d33d03e1dbbf4e670e52ba1e5dfaa5fa92d..1d9f7f7878cfbb5c29a1091de0ab7b88f7f96350 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SampleAttributeSearchFieldKind.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SampleAttributeSearchFieldKind.java @@ -38,7 +38,7 @@ public enum SampleAttributeSearchFieldKind implements Serializable, IAttributeSe PROJECT_PERM_ID("Project Perm Id"), PROJECT_SPACE("Project Space"), - + METAPROJECT("Metaproject"), REGISTRATION_DATE(CommonAttributeSearchFieldKindDecsriptions.REGISTRATION_DATE_DESCRIPTION, diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SampleParentWithDerived.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SampleParentWithDerived.java index 3a1c17267fc67896b466e013b412e0ffc96bf3bc..65a603b2b955a187971f3c07def567fb48c7e277 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SampleParentWithDerived.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SampleParentWithDerived.java @@ -19,8 +19,7 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; import java.io.Serializable; /** - * A <code>SampleParentWithDerived</code> encapsulates a <code>Sample</code> (the parent) and its - * derived <code>Sample</code>s. + * A <code>SampleParentWithDerived</code> encapsulates a <code>Sample</code> (the parent) and its derived <code>Sample</code>s. * * @author Christian Ribeaud */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SampleTypePropertyType.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SampleTypePropertyType.java index 09d18dcd8cf9362e9fe6c6f43aea0d9fa18f2395..c6ca092718d4a8ec1212685a36421a6896465b60 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SampleTypePropertyType.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SampleTypePropertyType.java @@ -16,7 +16,6 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; - /** * The {@link EntityTypePropertyType} extension for <i>Sample Type</i>. * diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SearchDomainSearchResultWithFullEntity.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SearchDomainSearchResultWithFullEntity.java index 4d30780931477122fac4347f02cb4dff94a624d3..603f08be8f722fc05d35d0672f4f91a3e9a66923 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SearchDomainSearchResultWithFullEntity.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SearchDomainSearchResultWithFullEntity.java @@ -29,7 +29,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWit public class SearchDomainSearchResultWithFullEntity implements Serializable { private static final long serialVersionUID = ServiceVersionHolder.VERSION; - + private IEntityInformationHolderWithPermId entity; private SearchDomainSearchResult searchResult; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SearchFieldBooleanCriterionFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SearchFieldBooleanCriterionFactory.java index 146f8946d340078149aff97df47b128f79029ab2..427b43be5afa323b1338ffce9d275bba586485e8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SearchFieldBooleanCriterionFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SearchFieldBooleanCriterionFactory.java @@ -17,8 +17,7 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; /** - * Creates a criterion for a boolean field. Accepts following values: "true", "yes", "false", "no". - * For other values is returns "*". + * Creates a criterion for a boolean field. Accepts following values: "true", "yes", "false", "no". For other values is returns "*". * * @author pkupczyk */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SearchFieldDateCriterionFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SearchFieldDateCriterionFactory.java index 44281809a4eb45ad1c8918d59da7919fc70307fb..cfaf10b5315313420783c8c8585ef5a08b087c42 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SearchFieldDateCriterionFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SearchFieldDateCriterionFactory.java @@ -17,8 +17,7 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; /** - * Creates a criterion for a date field. Supports registration and modification dates with equals, - * from and until versions. + * Creates a criterion for a date field. Supports registration and modification dates with equals, from and until versions. * * @author pkupczyk */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SerializableComparableIDDecorator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SerializableComparableIDDecorator.java index 2620f59df3d62fe487c9a437240ea297a77d29d4..d85b7200337f4005d361a7103d95713f52839107 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SerializableComparableIDDecorator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SerializableComparableIDDecorator.java @@ -26,22 +26,23 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; public class SerializableComparableIDDecorator implements ISerializableComparable { private static final long serialVersionUID = ServiceVersionHolder.VERSION; - + private ISerializableComparable serializableComparable; + private Long id; - + public SerializableComparableIDDecorator(ISerializableComparable serializableComparable, Long idOrNull) { assert serializableComparable != null : "Unspecified ISerializableComparable"; this.serializableComparable = serializableComparable; this.id = idOrNull; } - + public Long getID() { return id; } - + @Override public int compareTo(ISerializableComparable o) { @@ -66,20 +67,20 @@ public class SerializableComparableIDDecorator implements ISerializableComparabl } SerializableComparableIDDecorator decorator = (SerializableComparableIDDecorator) obj; return serializableComparable.equals(decorator.serializableComparable); - } - + } + @Override public int hashCode() { return serializableComparable.hashCode(); } - + @Override public String toString() { return serializableComparable.toString(); } - + // --------------------------- // GWT only diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SimpleAttributeSearchFieldKind.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SimpleAttributeSearchFieldKind.java index ff1d172c4b332a5530dd4c24f0511f16d6aeb791..7069f5eb620bb6621c068097b87ea2d24a5a99fe 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SimpleAttributeSearchFieldKind.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/SimpleAttributeSearchFieldKind.java @@ -24,6 +24,7 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; public class SimpleAttributeSearchFieldKind implements IAttributeSearchFieldKind { private String code; + private String description; public SimpleAttributeSearchFieldKind(String code, String description) @@ -31,7 +32,7 @@ public class SimpleAttributeSearchFieldKind implements IAttributeSearchFieldKind this.code = code; this.description = description; } - + @Override public ISearchFieldAvailability getAvailability() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/StandardPortletNames.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/StandardPortletNames.java index 3bca556e674d546c971e200e7400cff36926a0a3..93628e8b8dab7b2fe78db507f720209376d135e2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/StandardPortletNames.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/StandardPortletNames.java @@ -19,14 +19,14 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; /** * Names of standard portlets. * <p> - * Portlet names are part of a {@link PortletConfiguration} instance. Because a portlet - * configuration is stored in the personal {@link DisplaySettings} of a user a CHANGE OF PORTLET - * NAMES MIGHT LEAD TO A LOST OF PERSONAL SETTINGS + * Portlet names are part of a {@link PortletConfiguration} instance. Because a portlet configuration is stored in the personal + * {@link DisplaySettings} of a user a CHANGE OF PORTLET NAMES MIGHT LEAD TO A LOST OF PERSONAL SETTINGS * * @author Franz-Josef Elmer */ public class StandardPortletNames { public static final String WELCOME = "Welcome"; + public static final String HISTORY = "History"; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/TrackingDataSetCriteria.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/TrackingDataSetCriteria.java index 23ac5831b709d45aaf63fa6747db5f64e8ce85f4..975a771020b7692e42ef84aaa0e7a46ee8b547b3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/TrackingDataSetCriteria.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/TrackingDataSetCriteria.java @@ -19,11 +19,11 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; import java.io.Serializable; /** - * Criteria for tracking <i>data sets</i> with technical id bigger than the specified one. Optional, - * the search is restricted to data sets connected to samples of a certain type. + * Criteria for tracking <i>data sets</i> with technical id bigger than the specified one. Optional, the search is restricted to data sets connected + * to samples of a certain type. * <p> - * Connected samples should be loaded as well as their parent and container samples according to - * {@link SampleType} hierarchy depths. All referenced samples should have all properties loaded. + * Connected samples should be loaded as well as their parent and container samples according to {@link SampleType} hierarchy depths. All referenced + * samples should have all properties loaded. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/TrackingSampleCriteria.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/TrackingSampleCriteria.java index 67ad6dbf6f51130e10ef50de8a286baa0d470748..7d693f6a58e0998a34b00fb95873bbfe97b7c283 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/TrackingSampleCriteria.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/TrackingSampleCriteria.java @@ -20,11 +20,10 @@ import java.io.Serializable; import java.util.Collection; /** - * Criteria for tracking <i>samples</i> of particular type with certain property set to specified - * value. + * Criteria for tracking <i>samples</i> of particular type with certain property set to specified value. * <p> - * Parent and Container samples should be loaded according to {@link SampleType} hierarchy depths. - * All referenced samples should have all properties loaded. + * Parent and Container samples should be loaded according to {@link SampleType} hierarchy depths. All referenced samples should have all properties + * loaded. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/TypedTableModel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/TypedTableModel.java index e83ad98cf6a428e52b52e5d973d1778ae9894b2b..23dbb507ad06c2b11e38c06ebe415e685cec183f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/TypedTableModel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/TypedTableModel.java @@ -22,9 +22,8 @@ import java.util.List; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.TypedTableGrid; /** - * Table model for {@link TypedTableGrid} classes. It contains column meta-data as a list of - * {@link TableModelColumnHeader} instances and the row data as a list of - * {@link TableModelRowWithObject} instances for row objects of type <code>T</code>. + * Table model for {@link TypedTableGrid} classes. It contains column meta-data as a list of {@link TableModelColumnHeader} instances and the row data + * as a list of {@link TableModelRowWithObject} instances for row objects of type <code>T</code>. * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/VocabularyTermEntityProperty.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/VocabularyTermEntityProperty.java index b691553545a788575a948a2bac69b4206e736ed0..9cb2a03aaab4d4b5bd51a76be1d55fa417f1f910 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/VocabularyTermEntityProperty.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/VocabularyTermEntityProperty.java @@ -17,8 +17,7 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto; /** - * A {@link IEntityProperty} class that only stores the vocabulary term value, but not a generic - * value or a material value. + * A {@link IEntityProperty} class that only stores the vocabulary term value, but not a generic value or a material value. * * @author Bernd Rinn */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/IManagedInputWidgetDescriptionFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/IManagedInputWidgetDescriptionFactory.java index 3d4504807523340e9eded83b40ab9971b8575838..bd310f57e946144e4653d70adb6249bf7afb7b0a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/IManagedInputWidgetDescriptionFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/IManagedInputWidgetDescriptionFactory.java @@ -38,8 +38,7 @@ public interface IManagedInputWidgetDescriptionFactory extends Serializable IManagedInputWidgetDescription createMultilineTextInputField(String label); /** - * @return a combo box input field with given <var>label</var> and specified list of selectable - * <var>values</var>. + * @return a combo box input field with given <var>label</var> and specified list of selectable <var>values</var>. */ IManagedInputWidgetDescription createComboBoxInputField(String labels, String[] values); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/IManagedProperty.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/IManagedProperty.java index 901985422ef0a722c212cbdc5b5480d54e55ef0f..cf71d73d7120657e2bcf72781f76c0f357788aab 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/IManagedProperty.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/IManagedProperty.java @@ -31,8 +31,7 @@ public interface IManagedProperty extends Serializable String getPropertyTypeCode(); /** - * Returns <var>true</var> if the detailed view of the entity owning the property will show the - * managed property in an extra tab. + * Returns <var>true</var> if the detailed view of the entity owning the property will show the managed property in an extra tab. */ boolean isOwnTab(); @@ -40,8 +39,7 @@ public interface IManagedProperty extends Serializable void setOwnTab(boolean ownTab); /** - * Returns <code>true</code> if the value is special, that is either a place-holder value or an - * error message. + * Returns <code>true</code> if the value is special, that is either a place-holder value or an error message. */ boolean isSpecialValue(); @@ -52,8 +50,7 @@ public interface IManagedProperty extends Serializable void setValue(String value); /** - * Return an object which allows to manage data for the user interface (input as well as - * output). + * Return an object which allows to manage data for the user interface (input as well as output). */ IManagedUiDescription getUiDescription(); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/IManagedUiAction.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/IManagedUiAction.java index 0ba850ca044e3087f6559f16c036fa02c0fd4ac0..95cb1952e04d33cc0f4041d6df50cdffde16a4d0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/IManagedUiAction.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/IManagedUiAction.java @@ -41,20 +41,17 @@ public interface IManagedUiAction extends Serializable public IManagedUiAction setDescription(String description); /** - * Adds specified input widget descriptions that will be used in user interface for modifcation - * of a managed property. + * Adds specified input widget descriptions that will be used in user interface for modifcation of a managed property. */ public void addInputWidgets(IManagedInputWidgetDescription... widgets); /** - * Returns list of objects describing input widgets that will be used in user interface for - * modification of the managed property. + * Returns list of objects describing input widgets that will be used in user interface for modification of the managed property. */ public List<IManagedInputWidgetDescription> getInputWidgetDescriptions(); /** - * Convenience method returning value of input widget with given label or null if such widget - * doesn't exist. + * Convenience method returning value of input widget with given label or null if such widget doesn't exist. */ public String getInputValue(String inputLabel); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/IManagedUiDescription.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/IManagedUiDescription.java index 024e9000cbfecf5bd7af62b325c572c75b31c35a..7421b5a050cfba2c01a0d32ff3ca051b20178534 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/IManagedUiDescription.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/IManagedUiDescription.java @@ -28,8 +28,8 @@ import java.util.List; public interface IManagedUiDescription extends Serializable { /** - * Sets the given table model to define an output that will be shown in detail view of the - * entity owning the property. The table will be shown in an extra tab. + * Sets the given table model to define an output that will be shown in detail view of the entity owning the property. The table will be shown in + * an extra tab. */ void useTableOutput(ITableModel tableModel); @@ -39,14 +39,12 @@ public interface IManagedUiDescription extends Serializable void useHtmlOutput(String htmlString); /** - * Adds a table action with given name to actions that can be performed in the user interface - * for modification of the managed property. + * Adds a table action with given name to actions that can be performed in the user interface for modification of the managed property. */ IManagedUiTableAction addTableAction(String name); /** - * Adds an action with given <var>name</var> to actions that can be performed in the user - * interface for modification of the managed property. + * Adds an action with given <var>name</var> to actions that can be performed in the user interface for modification of the managed property. * <p> * NOTE: currently there is only support for table actions */ @@ -58,8 +56,7 @@ public interface IManagedUiDescription extends Serializable List<IManagedUiAction> getActions(); /** - * Returns description of the widget that will be shown in detail view of the entity owning the - * property. + * Returns description of the widget that will be shown in detail view of the entity owning the property. */ IManagedOutputWidgetDescription getOutputWidgetDescription(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/IManagedUiTableAction.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/IManagedUiTableAction.java index e63839c5da8a20364dc526650f766dd623a8d657..55270a876c31713111dbe0f2772dd71df2e78ae1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/IManagedUiTableAction.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/IManagedUiTableAction.java @@ -22,11 +22,11 @@ import java.util.Map; /** * Extension of {@link IManagedUiAction} for actions assigned with a table output. * <p> - * Every table action can specify table selection mode required for the action to be enabled. If an - * action requires table rows to be selected than it will contain list of indices of selected rows. + * Every table action can specify table selection mode required for the action to be enabled. If an action requires table rows to be selected than it + * will contain list of indices of selected rows. * <p> - * For actions that require single row to be selected it is possible to bind values of selected - * row's columns with input fields (e.g. useful in edit actions). + * For actions that require single row to be selected it is possible to bind values of selected row's columns with input fields (e.g. useful in edit + * actions). * * @see ManagedTableActionRowSelectionType * @author Piotr Buczek diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/ValidationException.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/ValidationException.java index 967c204a21d18e19841772802270cf68dc376aa0..c339cb3c569a11e9d25468d003999cff71b8eaac 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/ValidationException.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/api/ValidationException.java @@ -16,7 +16,6 @@ package ch.systemsx.cisd.openbis.generic.shared.basic.dto.api; - /** * Exception thrown by jython scripts in case of invalid input. * diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/coreplugin/CorePluginsUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/coreplugin/CorePluginsUtils.java index 6cd59375a4ca7bf2fe08bca27f89cc74c61b743e..407e03181df26f840d23fcb93eeae3b16c5a0683 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/coreplugin/CorePluginsUtils.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/coreplugin/CorePluginsUtils.java @@ -38,11 +38,9 @@ public class CorePluginsUtils public static final String CORE_PLUGINS_PROPERTIES_FILE = "core-plugins.properties"; /** - * Adds the content of <code>core-plugins.properties</code> file to the specified properties. - * The folder with the core plugins properties file is specified by the property - * <code>core-plugins-folder</code> of the specified properties. If undefined a default value is - * used. Note, that the core plugin properties might overwrite value in the specified properties - * object. + * Adds the content of <code>core-plugins.properties</code> file to the specified properties. The folder with the core plugins properties file is + * specified by the property <code>core-plugins-folder</code> of the specified properties. If undefined a default value is used. Note, that the + * core plugin properties might overwrite value in the specified properties object. */ public static void addCorePluginsProperties(Properties properties, ScannerType scannerType) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/coreplugin/IPluginType.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/coreplugin/IPluginType.java index 70365c4de329f3265d23fc819cf29c0c5d537630..99215b2121b76644f0ac7c92aa03027c1966dbe7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/coreplugin/IPluginType.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/coreplugin/IPluginType.java @@ -19,8 +19,7 @@ package ch.systemsx.cisd.openbis.generic.shared.coreplugin; import java.util.Properties; /** - * A core plugin type is defined by a name which is used as a folder and an optional property which - * lists all keys of the plugins of this type. + * A core plugin type is defined by a name which is used as a folder and an optional property which lists all keys of the plugins of this type. * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AbstractRegistrationHolder.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AbstractRegistrationHolder.java index 9db40ae3d1678a76bcbc1cf150a469a9f3d53259..375363c3e9e38a0decb748b7f68a7c483ff2b8f4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AbstractRegistrationHolder.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AbstractRegistrationHolder.java @@ -21,7 +21,7 @@ import java.util.Date; /** * Super class of DTOs which hold registration data. * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ public abstract class AbstractRegistrationHolder extends Id { @@ -63,8 +63,7 @@ public abstract class AbstractRegistrationHolder extends Id /** * Sets the person who has registered the experiment. * - * @throws AssertionError if <code>registratorID</code> is defined but unequal - * <code>registrator.getId()</code>. + * @throws AssertionError if <code>registratorID</code> is defined but unequal <code>registrator.getId()</code>. */ public final void setRegistrator(final PersonPE registrator) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AttachmentPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AttachmentPE.java index 68b9a4c1c9f9f1b629dd0f2a65f1f7b46c345dc3..d82aafe7b32eca0d3c5f84963f0781d6b46f7e7c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AttachmentPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AttachmentPE.java @@ -102,8 +102,8 @@ public class AttachmentPE extends HibernateAbstractRegistrationHolder implements public static class AttachmentSearchBridge implements FieldBridge { @Override - public void set(String name, Object/* AttachmentPE */ value, - Document/* Lucene document */ document, LuceneOptions luceneOptions) + public void set(String name, Object/* AttachmentPE */value, + Document/* Lucene document */document, LuceneOptions luceneOptions) { AttachmentPE attachment = (AttachmentPE) value; String attachmentName = attachment.getFileName(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/CorePluginPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/CorePluginPE.java index ad064d88b36d6fc1fb42fdc1a1c888b3d20b6dbf..1ac165a6327578645f294caeba9f7397af14303b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/CorePluginPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/CorePluginPE.java @@ -38,8 +38,8 @@ import org.hibernate.annotations.GenerationTime; */ @Entity @Table(name = TableNames.CORE_PLUGINS_TABLE, uniqueConstraints = - { @UniqueConstraint(columnNames = - { ColumnNames.NAME_COLUMN, ColumnNames.VERSION_COLUMN }) }) +{ @UniqueConstraint(columnNames = +{ ColumnNames.NAME_COLUMN, ColumnNames.VERSION_COLUMN }) }) public final class CorePluginPE implements Comparable<CorePluginPE> { transient private Long id; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataPE.java index e6bca2894f8bedd670faa141dc5f85635f027f5b..98a264e9161cfa0e70d39786558b4b8872b6b5d0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataPE.java @@ -84,11 +84,11 @@ import ch.systemsx.cisd.openbis.generic.shared.util.HibernateUtils; * @author Bernd Rinn */ @Entity -@Table(name = TableNames.DATA_VIEW, uniqueConstraints = @UniqueConstraint(columnNames = ColumnNames.CODE_COLUMN) ) +@Table(name = TableNames.DATA_VIEW, uniqueConstraints = @UniqueConstraint(columnNames = ColumnNames.CODE_COLUMN)) @Inheritance(strategy = InheritanceType.JOINED) @Indexed(index = "DataPE") @ClassBridge(impl = DataGlobalSearchBridge.class) -public class DataPE extends AbstractIdAndCodeHolder<DataPE>implements +public class DataPE extends AbstractIdAndCodeHolder<DataPE> implements IEntityInformationWithPropertiesHolder, IMatchingEntity, IIdentifierHolder, IDeletablePE, IEntityWithMetaprojects, IModifierAndModificationDateBean { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSetPropertyPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSetPropertyPE.java index b7af5aa6a46e26c1858dcd1b42d2108bb8e57e2c..07a83ac8b3fdddafef32919e89467a413c7c0b93 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSetPropertyPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSetPropertyPE.java @@ -41,7 +41,7 @@ import ch.systemsx.cisd.openbis.generic.shared.IServer; */ @Entity @Table(name = TableNames.DATA_SET_PROPERTIES_TABLE, uniqueConstraints = @UniqueConstraint(columnNames = - { ColumnNames.DATA_SET_COLUMN, ColumnNames.DATA_SET_TYPE_PROPERTY_TYPE_COLUMN })) +{ ColumnNames.DATA_SET_COLUMN, ColumnNames.DATA_SET_TYPE_PROPERTY_TYPE_COLUMN })) @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) public class DataSetPropertyPE extends EntityPropertyPE { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSetRelationshipPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSetRelationshipPE.java index d5e52cdd3231ac8d48710a3da7a122cb90960e45..ded922095abd05371cb3e05c6b6c477c53a5fefe 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSetRelationshipPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSetRelationshipPE.java @@ -49,7 +49,7 @@ import ch.systemsx.cisd.openbis.generic.shared.IServer; @Table(name = TableNames.DATA_SET_RELATIONSHIPS_VIEW, uniqueConstraints = @UniqueConstraint(columnNames = { ColumnNames.DATA_PARENT_COLUMN, ColumnNames.DATA_CHILD_COLUMN, ColumnNames.RELATIONSHIP_COLUMN })) @IdClass(DataSetRelationshipId.class) -@TypeDefs({@TypeDef(name="transactiontimestamp", typeClass=DbTimestampType.class)}) +@TypeDefs({ @TypeDef(name = "transactiontimestamp", typeClass = DbTimestampType.class) }) public class DataSetRelationshipPE implements Serializable { private static final long serialVersionUID = IServer.VERSION; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSetTypePropertyTypePE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSetTypePropertyTypePE.java index 11c8ec100ae8b872eb0a1bdca1ba40d28849ff16..1ff7161582d7b2a71b86246d53c3bed7aa14df35 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSetTypePropertyTypePE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSetTypePropertyTypePE.java @@ -42,8 +42,8 @@ import ch.systemsx.cisd.openbis.generic.shared.IServer; */ @Entity @Table(name = TableNames.DATA_SET_TYPE_PROPERTY_TYPE_TABLE, uniqueConstraints = - { @UniqueConstraint(columnNames = - { ColumnNames.DATA_SET_TYPE_COLUMN, ColumnNames.PROPERTY_TYPE_COLUMN }) }) +{ @UniqueConstraint(columnNames = +{ ColumnNames.DATA_SET_TYPE_COLUMN, ColumnNames.PROPERTY_TYPE_COLUMN }) }) public class DataSetTypePropertyTypePE extends EntityTypePropertyTypePE { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSetUploadContext.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSetUploadContext.java index 21d988e9151aaefa13a847f5edde156d55da5dbd..aff96c4e50a4706af10c091b4e5af204ddf020c8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSetUploadContext.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSetUploadContext.java @@ -29,7 +29,7 @@ import ch.systemsx.cisd.openbis.generic.shared.IServer; /** * Context data needed for uploading data sets to a CIFEX server. * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ public class DataSetUploadContext implements Serializable { @@ -46,9 +46,9 @@ public class DataSetUploadContext implements Serializable private String comment; private String email; - + private String sessionUserID; - + public final String getFileName() { return fileName; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSourceDefinition.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSourceDefinition.java index 23444811ea85c6c886e62a783c312c853f820973..d453cb547f6d7b689034d67a7b00d5fc905228cc 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSourceDefinition.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSourceDefinition.java @@ -55,8 +55,7 @@ public class DataSourceDefinition implements Serializable, Cloneable } /** - * Creates a list of definitions from specified string which could be the output of - * {@link #toString(List)}. + * Creates a list of definitions from specified string which could be the output of {@link #toString(List)}. */ public static List<DataSourceDefinition> listFromString(String serializedDefinitions) { @@ -73,8 +72,7 @@ public class DataSourceDefinition implements Serializable, Cloneable } /** - * Creates a string representation of specified definition. It can be used as an input of - * {@link #listFromString(String)}. + * Creates a string representation of specified definition. It can be used as an input of {@link #listFromString(String)}. */ public static String toString(List<DataSourceDefinition> definitions) { @@ -87,8 +85,7 @@ public class DataSourceDefinition implements Serializable, Cloneable } /** - * Creates an instance from the specified string. The input could be the output of - * {@link #toString()}. + * Creates an instance from the specified string. The input could be the output of {@link #toString()}. */ public static DataSourceDefinition fromString(String serializedDefinition) { @@ -241,8 +238,7 @@ public class DataSourceDefinition implements Serializable, Cloneable } /** - * Returns this instance as a string which allows reconstruction by applying - * {@link #fromString(String)}. + * Returns this instance as a string which allows reconstruction by applying {@link #fromString(String)}. */ @Override public String toString() diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSourceWithDefinition.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSourceWithDefinition.java index 5cc522d68978cff93a693df356eca0b1fa5d34f6..64f70bc62ee12aeff8e14da45c862113f221133f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSourceWithDefinition.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSourceWithDefinition.java @@ -18,7 +18,6 @@ package ch.systemsx.cisd.openbis.generic.shared.dto; import javax.sql.DataSource; - /** * Bean for a {@link DataSource} together with its {@link DataSourceDefinition}. * @@ -27,6 +26,7 @@ import javax.sql.DataSource; public class DataSourceWithDefinition { private final DataSource dataSource; + private final DataSourceDefinition definition; public DataSourceWithDefinition(DataSource dataSource, DataSourceDefinition definitionOrNull) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataStoreServerInfo.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataStoreServerInfo.java index 5f858101c4e5d0c589d1615f278d9397c87e3f07..38c1a1135bb2bd4fd481fd3b68f822c80bd7ad91 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataStoreServerInfo.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataStoreServerInfo.java @@ -28,11 +28,9 @@ import ch.systemsx.cisd.openbis.generic.shared.IServer; * <p> * It contains * <ul> - * <li>the port on which the DSS is reachable. Note, that the host can be inferred by the asking - * {@link HttpServletRequest}. + * <li>the port on which the DSS is reachable. Note, that the host can be inferred by the asking {@link HttpServletRequest}. * <li>the DSS session token which has to used when invoking methods on the DSS. - * <li>the download URL which is the URL at which the DSS Web server can be accessed from a Web - * browser. + * <li>the download URL which is the URL at which the DSS Web server can be accessed from a Web browser. * <li>the unique code of the DSS, * <li>information about available services. * </ul> diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataTypePE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataTypePE.java index d3451d075dc0d6903af5079df0a6b644235b0598..84b63111a8a38cc3f5cf24de2b074430b33dde55 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataTypePE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataTypePE.java @@ -50,8 +50,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataTypeCode; */ @Entity @Table(name = TableNames.DATA_TYPES_TABLE, uniqueConstraints = - { @UniqueConstraint(columnNames = - { ColumnNames.CODE_COLUMN }) }) +{ @UniqueConstraint(columnNames = +{ ColumnNames.CODE_COLUMN }) }) public final class DataTypePE implements IIdHolder, Serializable, Comparable<DataTypePE> { private static final long serialVersionUID = IServer.VERSION; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DeletedExternalDataPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DeletedExternalDataPE.java index 5f9777595bdddb66b0b081ad12696639e4fa3dce..82f949bfb6412431431ce4fcada26f1b2c39a101 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DeletedExternalDataPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DeletedExternalDataPE.java @@ -33,14 +33,13 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetArchivingStatus; import ch.systemsx.cisd.openbis.generic.shared.dto.hibernate.Location; /** - * {@link ExternalDataPE} counterpart for deleted data sets mapping only those attributes that are - * needed for permanent deletion of data sets. + * {@link ExternalDataPE} counterpart for deleted data sets mapping only those attributes that are needed for permanent deletion of data sets. * * @author Piotr Buczek */ @Entity @Table(name = TableNames.EXTERNAL_DATA_TABLE, uniqueConstraints = @UniqueConstraint(columnNames = - { ColumnNames.LOCATION_COLUMN, ColumnNames.LOCATOR_TYPE_COLUMN })) +{ ColumnNames.LOCATION_COLUMN, ColumnNames.LOCATOR_TYPE_COLUMN })) @PrimaryKeyJoinColumn(name = ColumnNames.DATA_ID_COLUMN) public final class DeletedExternalDataPE extends DeletedDataPE { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EntityCollectionForCreationOrUpdate.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EntityCollectionForCreationOrUpdate.java index 03117d8287c2c5fb3eb9219e746688feaa6054ab..70fae40719a27feecee53f311e95170d2cb42591 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EntityCollectionForCreationOrUpdate.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EntityCollectionForCreationOrUpdate.java @@ -24,16 +24,16 @@ import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewExperiment; /** - * Collections of {@link NewExternalData}, {@link NewExperiment}. + * Collections of {@link NewExternalData}, {@link NewExperiment}. * * @author Franz-Josef Elmer */ public class EntityCollectionForCreationOrUpdate implements Serializable { private static final long serialVersionUID = IServer.VERSION; - + private final List<NewExperiment> newExperiments = new ArrayList<NewExperiment>(); - + private final List<NewExternalData> newDataSets = new ArrayList<NewExternalData>(); public List<NewExperiment> getNewExperiments() diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EntityOperationsLogEntryPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EntityOperationsLogEntryPE.java index da7f5638e6498e1ef2760f6a2c0f3ec2a982d677..53d06506ef859debff82284d51cb0348ff100ecd 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EntityOperationsLogEntryPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EntityOperationsLogEntryPE.java @@ -11,14 +11,12 @@ import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.validation.constraints.NotNull; -import ch.systemsx.cisd.openbis.generic.server.ServiceForDataStoreServer; import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder; /** - * Persistent entity representing an invocation of the - * {@link ServiceForDataStoreServer#performEntityOperations(String, AtomicEntityOperationDetails)} method. This - * table is used to check if the results of an invocation of this method made it into the database. + * Persistent entity representing an invocation of the {@link ServiceForDataStoreServer#performEntityOperations(String, AtomicEntityOperationDetails)} + * method. This table is used to check if the results of an invocation of this method made it into the database. * * @author Chandrasekhar Ramakrishnan */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EntityPropertyFiller.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EntityPropertyFiller.java index 86a1ecc8b28ca0cc113ac157250aa3e0f562bb3a..5deb384f89a6eed31f0bb04766332c254f78100d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EntityPropertyFiller.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EntityPropertyFiller.java @@ -23,8 +23,8 @@ import ch.systemsx.cisd.common.reflection.AbstractHashable; import ch.systemsx.cisd.openbis.generic.shared.IServer; /** - * Used when assigning mandatory property to an entity, which has some instances or when mandatory - * flag is change from optional and properties for some entities are unset. + * Used when assigning mandatory property to an entity, which has some instances or when mandatory flag is change from optional and properties for + * some entities are unset. * * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EntityPropertyPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EntityPropertyPE.java index e0a4d11a95a4f3b0fc192b8fde841d0eed3f95b7..cadebaa63f756db48baa75863f64bc6ffe649487 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EntityPropertyPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EntityPropertyPE.java @@ -71,7 +71,7 @@ import ch.systemsx.cisd.openbis.generic.shared.util.SimplePropertyValidator.Supp */ @MappedSuperclass @ClassBridge(index = Index.YES, store = Store.YES, impl = EntityPropertyPE.EntityPropertySearchBridge.class) -@TypeDefs({@TypeDef(name="transactiontimestamp", typeClass=DbTimestampType.class)}) +@TypeDefs({ @TypeDef(name = "transactiontimestamp", typeClass = DbTimestampType.class) }) public abstract class EntityPropertyPE extends HibernateAbstractRegistrationHolder implements IUntypedValueSetter, IEntityPropertyHolder { @@ -114,7 +114,7 @@ public abstract class EntityPropertyPE extends HibernateAbstractRegistrationHold private PersonPE author; private Date modificationDate; - + /** * This bridge allows to save in the search index not only the value of property, but also the corresponding property code. */ @@ -130,9 +130,9 @@ public abstract class EntityPropertyPE extends HibernateAbstractRegistrationHold @Override public void set( - String name, + String name, Object/* EntityPropertyPE */value, - Document/* Lucene document */document, + Document/* Lucene document */document, LuceneOptions luceneOptions) { EntityPropertyPE entityProperty = (EntityPropertyPE) value; @@ -154,29 +154,48 @@ public abstract class EntityPropertyPE extends HibernateAbstractRegistrationHold { // leave the original value } - field = new Field(fieldFullName, fieldValue, luceneOptions.getStore(), indexingStrategy); + field = new Field(fieldFullName, fieldValue, luceneOptions.getStore(), indexingStrategy); } - else if(DataTypeCode.INTEGER.equals(entityProperty.getEntityTypePropertyType().getPropertyType().getType().getCode())) { + else if (DataTypeCode.INTEGER.equals(entityProperty.getEntityTypePropertyType().getPropertyType().getType().getCode())) + { try { String numericTextValue = SortableNumberBridgeUtils.getNumberForLucene(fieldValue); field = new Field(fieldFullName, numericTextValue, luceneOptions.getStore(), Field.Index.NOT_ANALYZED_NO_NORMS); - fieldIsdocTypeSortedNumeric = new SortedNumericDocValuesField(fieldFullName, Long.parseLong(fieldValue)); //Needed to identify the field as number, if not type is not stored + fieldIsdocTypeSortedNumeric = new SortedNumericDocValuesField(fieldFullName, Long.parseLong(fieldValue)); // Needed to identify + // the field as number, + // if not type is not + // stored } catch (Exception e) { // leave the original value } - } else if(DataTypeCode.REAL.equals(entityProperty.getEntityTypePropertyType().getPropertyType().getType().getCode())) { + } else if (DataTypeCode.REAL.equals(entityProperty.getEntityTypePropertyType().getPropertyType().getType().getCode())) + { try { String numericTextValue = SortableNumberBridgeUtils.getNumberForLucene(fieldValue); field = new Field(fieldFullName, numericTextValue, luceneOptions.getStore(), Field.Index.NOT_ANALYZED_NO_NORMS); - fieldIsdocTypeSortedNumeric = new SortedNumericDocValuesField(fieldFullName, NumericUtils.doubleToSortableLong(Double.parseDouble(fieldValue))); //Needed to identify the field as number, if not type is not stored + fieldIsdocTypeSortedNumeric = + new SortedNumericDocValuesField(fieldFullName, NumericUtils.doubleToSortableLong(Double.parseDouble(fieldValue))); // Needed + // to + // identify + // the + // field + // as + // number, + // if + // not + // type + // is + // not + // stored } catch (Exception e) { // leave the original value } - } else if(DataTypeCode.MULTILINE_VARCHAR.equals(entityProperty.getEntityTypePropertyType().getPropertyType().getType().getCode())) { + } else if (DataTypeCode.MULTILINE_VARCHAR.equals(entityProperty.getEntityTypePropertyType().getPropertyType().getType().getCode())) + { try { XMLInputFactory xif = XMLInputFactory.newFactory(); @@ -197,16 +216,19 @@ public abstract class EntityPropertyPE extends HibernateAbstractRegistrationHold fieldValue = valueBuff.toString(); } catch (Exception e) { - //Do Nothing + // Do Nothing } - field = new Field(fieldFullName, fieldValue, luceneOptions.getStore(), indexingStrategy); //Strips out XML tags from text that can be rich text using HTML format - } else { + field = new Field(fieldFullName, fieldValue, luceneOptions.getStore(), indexingStrategy); // Strips out XML tags from text that can be + // rich text using HTML format + } else + { field = new Field(fieldFullName, fieldValue, luceneOptions.getStore(), indexingStrategy); } - + field.setBoost(luceneOptions.getBoost()); document.add(field); - if(fieldIsdocTypeSortedNumeric != null) { + if (fieldIsdocTypeSortedNumeric != null) + { document.add(fieldIsdocTypeSortedNumeric); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExperimentPropertyPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExperimentPropertyPE.java index b2d47b9cdd3dbe6793c1cca5d6c2fdf2ed1ec13d..938de7362ae44ed74cfc95b08021a150401e23f6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExperimentPropertyPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExperimentPropertyPE.java @@ -41,7 +41,7 @@ import ch.systemsx.cisd.openbis.generic.shared.IServer; */ @Entity @Table(name = TableNames.EXPERIMENT_PROPERTIES_TABLE, uniqueConstraints = @UniqueConstraint(columnNames = - { ColumnNames.EXPERIMENT_COLUMN, ColumnNames.EXPERIMENT_TYPE_PROPERTY_TYPE_COLUMN })) +{ ColumnNames.EXPERIMENT_COLUMN, ColumnNames.EXPERIMENT_TYPE_PROPERTY_TYPE_COLUMN })) @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) public class ExperimentPropertyPE extends EntityPropertyPE { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExperimentTypePropertyTypePE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExperimentTypePropertyTypePE.java index 8a4b41637bac20826925d4d69bc6e29365fa9ebe..268921ba76fb4829a6b7985f9308f09ac0e77505 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExperimentTypePropertyTypePE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExperimentTypePropertyTypePE.java @@ -42,8 +42,8 @@ import ch.systemsx.cisd.openbis.generic.shared.IServer; */ @Entity @Table(name = TableNames.EXPERIMENT_TYPE_PROPERTY_TYPE_TABLE, uniqueConstraints = - { @UniqueConstraint(columnNames = - { ColumnNames.EXPERIMENT_TYPE_COLUMN, ColumnNames.PROPERTY_TYPE_COLUMN }) }) +{ @UniqueConstraint(columnNames = +{ ColumnNames.EXPERIMENT_TYPE_COLUMN, ColumnNames.PROPERTY_TYPE_COLUMN }) }) public class ExperimentTypePropertyTypePE extends EntityTypePropertyTypePE { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExternalDataPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExternalDataPE.java index 304a0e9af1087b7c4ce5e45e7a4e70c4f7b0cbdc..2ca29505aa855ecf419019a59b9697427ab326c0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExternalDataPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExternalDataPE.java @@ -54,7 +54,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.hibernate.SearchFieldConstant */ @Entity @Table(name = TableNames.EXTERNAL_DATA_TABLE, uniqueConstraints = @UniqueConstraint(columnNames = { ColumnNames.LOCATION_COLUMN, - ColumnNames.LOCATOR_TYPE_COLUMN }) ) + ColumnNames.LOCATOR_TYPE_COLUMN })) @PrimaryKeyJoinColumn(name = ColumnNames.DATA_ID_COLUMN) @Indexed(index = "DataPE") @ClassBridge(impl = ExternalDataGlobalSearchBridge.class) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExtractableData.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExtractableData.java index 37c78adae8bf54a415bee8dcd990fba56d703533..838eacbfec082a1d1227b961477085b2907497eb 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExtractableData.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExtractableData.java @@ -45,8 +45,7 @@ public class ExtractableData extends Code<ExtractableData> private List<NewProperty> dataSetProperties = new ArrayList<NewProperty>(); /** - * Returns the date when the measurement / calculation that produced this external data set has - * been performed. + * Returns the date when the measurement / calculation that produced this external data set has been performed. * <p> * This may not be known in which case this method will return <code>null</code>. */ @@ -56,8 +55,7 @@ public class ExtractableData extends Code<ExtractableData> } /** - * Sets the date when the measurement / calculation that produced this external data set has - * been performed. + * Sets the date when the measurement / calculation that produced this external data set has been performed. */ public void setProductionDate(final Date productionDate) { @@ -65,8 +63,7 @@ public class ExtractableData extends Code<ExtractableData> } /** - * Returns the code identifying the data source (i.e. measurement device or software pipeline) - * that produced this external data set. + * Returns the code identifying the data source (i.e. measurement device or software pipeline) that produced this external data set. * <p> * This may not be known in which case this method will return <code>null</code>. */ @@ -76,8 +73,7 @@ public class ExtractableData extends Code<ExtractableData> } /** - * Sets the code identifying the data source (i.e. measurement device or software pipeline) that - * produced this external data set. + * Sets the code identifying the data source (i.e. measurement device or software pipeline) that produced this external data set. */ public void setDataProducerCode(final String dataProducerCode) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/HibernateAbstractRegistrationHolder.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/HibernateAbstractRegistrationHolder.java index 601ff90a1bd548cd095923681951df69903b7bf7..3266db2b79e9223581b65605f150239cf509ad40 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/HibernateAbstractRegistrationHolder.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/HibernateAbstractRegistrationHolder.java @@ -33,8 +33,7 @@ import ch.systemsx.cisd.openbis.generic.shared.IServer; /** * Super class of <i>Persistent Entities</i> which hold registration data. * <p> - * <b>Note:</b> there is no <i>NOT-NULL</i> constraint applied to registrator (by comparison with - * the database where there almost one). + * <b>Note:</b> there is no <i>NOT-NULL</i> constraint applied to registrator (by comparison with the database where there almost one). * </p> * * @author Christian Ribeaud @@ -61,8 +60,7 @@ public abstract class HibernateAbstractRegistrationHolder implements Serializabl private Date registrationDate; /** - * Ensures that given <var>date</var> is a real one (<code>java.util.Date</code>) and not a - * <i>SQL</i> one. + * Ensures that given <var>date</var> is a real one (<code>java.util.Date</code>) and not a <i>SQL</i> one. */ public final static Date getDate(final Date date) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/IEntityInformationWithPropertiesHolder.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/IEntityInformationWithPropertiesHolder.java index 0494c6a7a2c1a159b7e7a7537d48bde2eddbe2c7..74cdba9ea52c445e58f1229ca2e99f8627727916 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/IEntityInformationWithPropertiesHolder.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/IEntityInformationWithPropertiesHolder.java @@ -16,7 +16,6 @@ package ch.systemsx.cisd.openbis.generic.shared.dto; - /** * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/IIdAndCodeHolder.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/IIdAndCodeHolder.java index 4c01667c26dd2a86b804282f938d810e16131c63..d4ff71b103f075a04ce91668d4fcfcb72bcfd8a7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/IIdAndCodeHolder.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/IIdAndCodeHolder.java @@ -20,8 +20,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.ICodeHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder; /** - * Read-only interface for beans with a (unique) business code as a string and a unique technical - * ID. + * Read-only interface for beans with a (unique) business code as a string and a unique technical ID. * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/IMatchingEntity.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/IMatchingEntity.java index 2c5257652e0ee32060f9adeb06d5549cd00075e9..5dd8f95c2689884ada3db818d73fdc63b36a3c42 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/IMatchingEntity.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/IMatchingEntity.java @@ -16,7 +16,6 @@ package ch.systemsx.cisd.openbis.generic.shared.dto; - /** * A entity that matches the <i>Hibernate Search</i> request. * diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/IUntypedValueSetter.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/IUntypedValueSetter.java index 9b6f071eb423edd7efaa1b15d79b52870d8c5e33..716ac9270c64375da94a689369d02288468f597b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/IUntypedValueSetter.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/IUntypedValueSetter.java @@ -19,7 +19,7 @@ package ch.systemsx.cisd.openbis.generic.shared.dto; /** * Holds the untyped property value. * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ public interface IUntypedValueSetter { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/LimitFilter.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/LimitFilter.java index f486545c389e138f92e72472e0f28c35741e1a14..71f99308818f94ef11c663da298485178c31faf5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/LimitFilter.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/LimitFilter.java @@ -24,8 +24,7 @@ import ch.systemsx.cisd.openbis.generic.shared.IServer; /** * A <i>Java Bean</i> that filters a list of results. * <p> - * Typically this filter is applied to results returned by the database before sending them to the - * client. + * Typically this filter is applied to results returned by the database before sending them to the client. * </p> * * @author Christian Ribeaud diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/LocatorTypePE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/LocatorTypePE.java index 8d6a0086c01eb26764b9f50747d0ab94d94d1219..f6d512fb8cab41a2103ca8324ce70aedc8b652d7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/LocatorTypePE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/LocatorTypePE.java @@ -34,8 +34,8 @@ import ch.systemsx.cisd.openbis.generic.shared.IServer; */ @Entity @Table(name = TableNames.LOCATOR_TYPES_TABLE, uniqueConstraints = - { @UniqueConstraint(columnNames = - { ColumnNames.CODE_COLUMN }) }) +{ @UniqueConstraint(columnNames = +{ ColumnNames.CODE_COLUMN }) }) public final class LocatorTypePE extends AbstractTypePE { private static final long serialVersionUID = IServer.VERSION; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/MaterialPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/MaterialPE.java index f6bbda01ef9ae6f7ed2dcc8d3b1cba0ccf82a25e..0b25fd44f290cf6da5ab76f901ddf31eda233a7d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/MaterialPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/MaterialPE.java @@ -75,7 +75,7 @@ import ch.systemsx.cisd.openbis.generic.shared.util.HibernateUtils; */ @Entity @Table(name = TableNames.MATERIALS_TABLE, uniqueConstraints = @UniqueConstraint(columnNames = { ColumnNames.CODE_COLUMN, - ColumnNames.MATERIAL_TYPE_COLUMN }) ) + ColumnNames.MATERIAL_TYPE_COLUMN })) @Indexed(index = "MaterialPE") @ClassBridge(impl = MaterialGlobalSearchBridge.class) public class MaterialPE implements IIdAndCodeHolder, Comparable<MaterialPE>, diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/MaterialPropertyPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/MaterialPropertyPE.java index 7a3d932098a2127d072f7d39041e5cc873fb40c1..1caed7ac6fe5db06ceb626f2f67c7d8ea7af04fc 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/MaterialPropertyPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/MaterialPropertyPE.java @@ -41,7 +41,7 @@ import ch.systemsx.cisd.openbis.generic.shared.IServer; */ @Entity @Table(name = TableNames.MATERIAL_PROPERTIES_TABLE, uniqueConstraints = @UniqueConstraint(columnNames = - { ColumnNames.MATERIAL_COLUMN, ColumnNames.MATERIAL_TYPE_PROPERTY_TYPE_COLUMN })) +{ ColumnNames.MATERIAL_COLUMN, ColumnNames.MATERIAL_TYPE_PROPERTY_TYPE_COLUMN })) @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) public class MaterialPropertyPE extends EntityPropertyPE { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/MaterialTypePropertyTypePE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/MaterialTypePropertyTypePE.java index d539616171443e55948566bedd0a0fe21efa14e9..bc0a71ec568c838600dfdc8f7a661e8b3f4b7a15 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/MaterialTypePropertyTypePE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/MaterialTypePropertyTypePE.java @@ -43,8 +43,8 @@ import ch.systemsx.cisd.openbis.generic.shared.IServer; */ @Entity @Table(name = TableNames.MATERIAL_TYPE_PROPERTY_TYPE_TABLE, uniqueConstraints = - { @UniqueConstraint(columnNames = - { ColumnNames.MATERIAL_TYPE_COLUMN, ColumnNames.PROPERTY_TYPE_COLUMN }) }) +{ @UniqueConstraint(columnNames = +{ ColumnNames.MATERIAL_TYPE_COLUMN, ColumnNames.PROPERTY_TYPE_COLUMN }) }) public class MaterialTypePropertyTypePE extends EntityTypePropertyTypePE { private static final long serialVersionUID = IServer.VERSION; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/MetaprojectPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/MetaprojectPE.java index dccc0642dd2f7bcb586c3a30b632c9ad8bc28e4a..ffb9ecead7140767d33571ab0f9f926a39c651c7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/MetaprojectPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/MetaprojectPE.java @@ -62,7 +62,7 @@ import ch.systemsx.cisd.openbis.generic.shared.util.EqualsHashUtils; * @author Pawel Glyzewski */ @Entity -@Table(name = TableNames.METAPROJECTS_TABLE, uniqueConstraints = @UniqueConstraint(columnNames = { ColumnNames.NAME_COLUMN, ColumnNames.OWNER }) ) +@Table(name = TableNames.METAPROJECTS_TABLE, uniqueConstraints = @UniqueConstraint(columnNames = { ColumnNames.NAME_COLUMN, ColumnNames.OWNER })) public class MetaprojectPE implements Serializable, IIdHolder, ICodeHolder { private static final long serialVersionUID = IServer.VERSION; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/NewContainerDataSet.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/NewContainerDataSet.java index 716f7da383cf2c2090a77e796722a9aad785689f..e869a1e72d5287a794f02a9cdba646096a7028f0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/NewContainerDataSet.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/NewContainerDataSet.java @@ -37,6 +37,5 @@ public class NewContainerDataSet extends NewExternalData { this.containedDataSetCodes = containedDataSetCodes; } - - + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/NewExternalData.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/NewExternalData.java index 9f3fd67b3c89ecf7477a81c47e32e340506a73f7..c133c9119e01bfaffad7e898ab040afe9bf576c6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/NewExternalData.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/NewExternalData.java @@ -77,7 +77,7 @@ public class NewExternalData implements Serializable private ExperimentIdentifier experimentIdentifierOrNull; private SampleIdentifier sampleIdentifierOrNull; - + private String samplePermIdOrNull; public ExperimentIdentifier getExperimentIdentifierOrNull() @@ -237,10 +237,9 @@ public class NewExternalData implements Serializable } /** - * Returns {@link BooleanOrUnknown#T}, if the data set is complete in the data store and - * {@link BooleanOrUnknown#F}, if some parts of the data are missing. If the completeness is not - * known (e.g. because the data set is stored in a format that does not allow to assess the - * completeness, {@link BooleanOrUnknown#U} is returned. + * Returns {@link BooleanOrUnknown#T}, if the data set is complete in the data store and {@link BooleanOrUnknown#F}, if some parts of the data are + * missing. If the completeness is not known (e.g. because the data set is stored in a format that does not allow to assess the completeness, + * {@link BooleanOrUnknown#U} is returned. */ public final BooleanOrUnknown getComplete() { @@ -248,9 +247,8 @@ public class NewExternalData implements Serializable } /** - * Sets whether this data set is complete in the data store or not. The default is - * {@link BooleanOrUnknown#U}, which corresponds to the case where the data are stored in a - * format that does not allow to assess completeness. + * Sets whether this data set is complete in the data store or not. The default is {@link BooleanOrUnknown#U}, which corresponds to the case where + * the data are stored in a format that does not allow to assess completeness. */ public final void setComplete(final BooleanOrUnknown complete) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/NewLinkDataSet.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/NewLinkDataSet.java index a39104f066de7648886fc713e9be807ae29921dd..d0cbdcfe88f6e6e2f6f8d149294985ffbb286f42 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/NewLinkDataSet.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/NewLinkDataSet.java @@ -16,7 +16,6 @@ package ch.systemsx.cisd.openbis.generic.shared.dto; - /** * @author Jakub Straszewski */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/NewProcessingInstruction.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/NewProcessingInstruction.java index d83ba0c6f042004b8f6389963141590179c41f00..c2835d11bee7dc4ea7c9ed2c7673084b3c59abc8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/NewProcessingInstruction.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/NewProcessingInstruction.java @@ -25,7 +25,7 @@ import ch.systemsx.cisd.openbis.generic.shared.IServer; /** * Processing instruction is a specific experiment attachment. * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ public final class NewProcessingInstruction extends AbstractHashable implements Serializable { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/NewProperty.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/NewProperty.java index 4141127fb1d0c9d906aa4124cab45d4f7414d402..420f90e4ed6deed144ce54aa41b1b33004b54076 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/NewProperty.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/NewProperty.java @@ -99,5 +99,4 @@ public class NewProperty implements Serializable return false; } - } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/OpenBISSessionHolder.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/OpenBISSessionHolder.java index d858357f611a61c2a562d658e975939d9694a8df..2b3cf73750f670fc04e33536a9b3514082f2c73e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/OpenBISSessionHolder.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/OpenBISSessionHolder.java @@ -21,8 +21,7 @@ import java.io.Serializable; import ch.systemsx.cisd.common.server.ISessionTokenProvider; /** - * A class that holds information about the openBIS session. It has the information necessary to - * connect to any of the openBIS APIs. + * A class that holds information about the openBIS session. It has the information necessary to connect to any of the openBIS APIs. * * @author Kaloyan Enimanev */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ProcessingInstructionDTO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ProcessingInstructionDTO.java index 3939f00a31e90c43d64c27f048ed6224c4d5d425..3aa2f001c7df45c1b548580c226cb9495d4b12c3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ProcessingInstructionDTO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ProcessingInstructionDTO.java @@ -19,7 +19,7 @@ package ch.systemsx.cisd.openbis.generic.shared.dto; /** * Processing instruction needed to process raw data. * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ public class ProcessingInstructionDTO extends AbstractRegistrationHolder { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ProcessingParameters.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ProcessingParameters.java index cc50c7ba12ecdc17da1390a08f88a0667d8db84d..24ecca2459c93564e8a66587031dbfaa8aca8af9 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ProcessingParameters.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ProcessingParameters.java @@ -21,10 +21,9 @@ import java.io.Serializable; import ch.systemsx.cisd.openbis.generic.shared.IServer; /** - * Processing parameters are a binary byte sequence from a file. It is stored BASE64 encoded in - * order to be marshalling and unmarshalling for SOAP. + * Processing parameters are a binary byte sequence from a file. It is stored BASE64 encoded in order to be marshalling and unmarshalling for SOAP. * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ public class ProcessingParameters implements Serializable { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/RoleAssignmentPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/RoleAssignmentPE.java index c23baf199bad0d81ed1ccdbe714fb4afdd406cd1..f26512388b752ab6ac39c6913be77d56f5a51ff1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/RoleAssignmentPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/RoleAssignmentPE.java @@ -55,136 +55,155 @@ import ch.systemsx.cisd.openbis.generic.shared.util.EqualsHashUtils; @Check(constraints = "((AG_ID_GRANTEE IS NOT NULL AND PERS_ID_GRANTEE IS NULL) OR (AG_ID_GRANTEE IS NULL AND PERS_ID_GRANTEE IS NOT NULL))") @Table(name = TableNames.ROLE_ASSIGNMENTS_TABLE) public final class RoleAssignmentPE extends HibernateAbstractRegistrationHolder - implements IIdHolder, Serializable { - - private static final long serialVersionUID = IServer.VERSION; - - public static final RoleAssignmentPE[] EMPTY_ARRAY = new RoleAssignmentPE[0]; - - private transient Long id; - - // private DatabaseInstancePE databaseInstance; - - private SpacePE space; - - private PersonPE person; - - private AuthorizationGroupPE authorizationGroup; - - private RoleCode role; - - @NotNull(message = ValidationMessages.ROLE_NOT_NULL_MESSAGE) - @Column(name = ColumnNames.ROLE_COLUMN) - @Enumerated(EnumType.STRING) - public final RoleCode getRole() { - return role; - } - - public final void setRole(final RoleCode role) { - this.role = role; - } - - @ManyToOne(fetch = FetchType.EAGER) - @JoinColumn(name = ColumnNames.PERSON_GRANTEE_COLUMN, updatable = false) - @Private - public final PersonPE getPersonInternal() { - return person; - } - - @Private - public final void setPersonInternal(final PersonPE person) { - this.person = person; - } - - @ManyToOne(fetch = FetchType.EAGER) - @JoinColumn(name = ColumnNames.AUTHORIZATION_GROUP_ID_GRANTEE_COLUMN, updatable = false) - @Private - public final AuthorizationGroupPE getAuthorizationGroupInternal() { - return authorizationGroup; - } - - @Private - public final void setAuthorizationGroupInternal( - final AuthorizationGroupPE authorizationGroup) { - this.authorizationGroup = authorizationGroup; - } - - @Transient - public final PersonPE getPerson() { - return getPersonInternal(); - } - - @Transient - public final AuthorizationGroupPE getAuthorizationGroup() { - return getAuthorizationGroupInternal(); - } - - public final void setId(final Long id) { - this.id = id; - } - - @ManyToOne(fetch = FetchType.EAGER) - @JoinColumn(name = ColumnNames.SPACE_COLUMN, updatable = false) - public final SpacePE getSpace() { - return space; - } - - public final void setSpace(final SpacePE space) { - this.space = space; - } - - // - // IIdHolder - // - - @Override - @SequenceGenerator(name = SequenceNames.ROLE_ASSIGNMENT_SEQUENCE, sequenceName = SequenceNames.ROLE_ASSIGNMENT_SEQUENCE, allocationSize = 1) - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = SequenceNames.ROLE_ASSIGNMENT_SEQUENCE) - public final Long getId() { - return id; - } - - // - // Object - // - - @Override - public final boolean equals(final Object obj) { - EqualsHashUtils.assertDefined(getRole(), "role"); - if (getPerson() == null) { - EqualsHashUtils.assertDefined(getAuthorizationGroupInternal(), - "authorization group"); - } - - if (obj == this) { - return true; - } - if (obj instanceof RoleAssignmentPE == false) { - return false; - } - final RoleAssignmentPE that = (RoleAssignmentPE) obj; - final EqualsBuilder builder = new EqualsBuilder(); - builder.append(getRole(), that.getRole()); - builder.append(getPerson(), that.getPerson()); - builder.append(getAuthorizationGroup(), that.getAuthorizationGroup()); - builder.append(getSpace(), that.getSpace()); - return builder.isEquals(); - } - - @Override - public final int hashCode() { - final HashCodeBuilder builder = new HashCodeBuilder(); - builder.append(getRole()); - builder.append(getPerson()); - builder.append(getSpace()); - return builder.toHashCode(); - } - - @Override - public final String toString() { - return ToStringBuilder.reflectionToString(this, - ModifiedShortPrefixToStringStyle.MODIFIED_SHORT_PREFIX_STYLE); - } + implements IIdHolder, Serializable +{ + + private static final long serialVersionUID = IServer.VERSION; + + public static final RoleAssignmentPE[] EMPTY_ARRAY = new RoleAssignmentPE[0]; + + private transient Long id; + + // private DatabaseInstancePE databaseInstance; + + private SpacePE space; + + private PersonPE person; + + private AuthorizationGroupPE authorizationGroup; + + private RoleCode role; + + @NotNull(message = ValidationMessages.ROLE_NOT_NULL_MESSAGE) + @Column(name = ColumnNames.ROLE_COLUMN) + @Enumerated(EnumType.STRING) + public final RoleCode getRole() + { + return role; + } + + public final void setRole(final RoleCode role) + { + this.role = role; + } + + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(name = ColumnNames.PERSON_GRANTEE_COLUMN, updatable = false) + @Private + public final PersonPE getPersonInternal() + { + return person; + } + + @Private + public final void setPersonInternal(final PersonPE person) + { + this.person = person; + } + + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(name = ColumnNames.AUTHORIZATION_GROUP_ID_GRANTEE_COLUMN, updatable = false) + @Private + public final AuthorizationGroupPE getAuthorizationGroupInternal() + { + return authorizationGroup; + } + + @Private + public final void setAuthorizationGroupInternal( + final AuthorizationGroupPE authorizationGroup) + { + this.authorizationGroup = authorizationGroup; + } + + @Transient + public final PersonPE getPerson() + { + return getPersonInternal(); + } + + @Transient + public final AuthorizationGroupPE getAuthorizationGroup() + { + return getAuthorizationGroupInternal(); + } + + public final void setId(final Long id) + { + this.id = id; + } + + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(name = ColumnNames.SPACE_COLUMN, updatable = false) + public final SpacePE getSpace() + { + return space; + } + + public final void setSpace(final SpacePE space) + { + this.space = space; + } + + // + // IIdHolder + // + + @Override + @SequenceGenerator(name = SequenceNames.ROLE_ASSIGNMENT_SEQUENCE, sequenceName = SequenceNames.ROLE_ASSIGNMENT_SEQUENCE, allocationSize = 1) + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = SequenceNames.ROLE_ASSIGNMENT_SEQUENCE) + public final Long getId() + { + return id; + } + + // + // Object + // + + @Override + public final boolean equals(final Object obj) + { + EqualsHashUtils.assertDefined(getRole(), "role"); + if (getPerson() == null) + { + EqualsHashUtils.assertDefined(getAuthorizationGroupInternal(), + "authorization group"); + } + + if (obj == this) + { + return true; + } + if (obj instanceof RoleAssignmentPE == false) + { + return false; + } + final RoleAssignmentPE that = (RoleAssignmentPE) obj; + final EqualsBuilder builder = new EqualsBuilder(); + builder.append(getRole(), that.getRole()); + builder.append(getPerson(), that.getPerson()); + builder.append(getAuthorizationGroup(), that.getAuthorizationGroup()); + builder.append(getSpace(), that.getSpace()); + return builder.isEquals(); + } + + @Override + public final int hashCode() + { + final HashCodeBuilder builder = new HashCodeBuilder(); + builder.append(getRole()); + builder.append(getPerson()); + builder.append(getSpace()); + return builder.toHashCode(); + } + + @Override + public final String toString() + { + return ToStringBuilder.reflectionToString(this, + ModifiedShortPrefixToStringStyle.MODIFIED_SHORT_PREFIX_STYLE); + } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SampleParentWithDerivedDTO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SampleParentWithDerivedDTO.java index ecc88027db65cdfa69d09472ec1dce097312fbfe..798f1dcd00d797f9c80e160f67c1ac7bfcd58d7d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SampleParentWithDerivedDTO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SampleParentWithDerivedDTO.java @@ -22,8 +22,7 @@ import java.util.List; import ch.systemsx.cisd.openbis.generic.shared.IServer; /** - * A <code>SampleParentWithDerivedDTO</code> encapsulates a <code>SamplePE</code> (the parent) and - * its derived <code>SamplePE</code>s. + * A <code>SampleParentWithDerivedDTO</code> encapsulates a <code>SamplePE</code> (the parent) and its derived <code>SamplePE</code>s. * * @author Christian Ribeaud */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SamplePropertyPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SamplePropertyPE.java index 31ba368dcbb9cbac4bec033aeeff13011afb9457..59c55b21ffa52ab9944bce44bd2bc99b0b3a5f8e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SamplePropertyPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SamplePropertyPE.java @@ -41,8 +41,8 @@ import ch.systemsx.cisd.openbis.generic.shared.IServer; */ @Entity @Table(name = TableNames.SAMPLE_PROPERTIES_TABLE, uniqueConstraints = - { @UniqueConstraint(columnNames = - { ColumnNames.SAMPLE_COLUMN, ColumnNames.SAMPLE_TYPE_PROPERTY_TYPE_COLUMN }) }) +{ @UniqueConstraint(columnNames = +{ ColumnNames.SAMPLE_COLUMN, ColumnNames.SAMPLE_TYPE_PROPERTY_TYPE_COLUMN }) }) @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) public class SamplePropertyPE extends EntityPropertyPE { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SampleRelationshipPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SampleRelationshipPE.java index b8fd693e0102e162a232f30fece809b182e5847d..de6a5792736ed24063bb0349a0638852396531e5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SampleRelationshipPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SampleRelationshipPE.java @@ -53,7 +53,7 @@ import ch.systemsx.cisd.openbis.generic.shared.IServer; @Table(name = TableNames.SAMPLE_RELATIONSHIPS_VIEW, uniqueConstraints = @UniqueConstraint(columnNames = { ColumnNames.PARENT_SAMPLE_COLUMN, ColumnNames.CHILD_SAMPLE_COLUMN, ColumnNames.RELATIONSHIP_COLUMN })) -@TypeDefs({@TypeDef(name="transactiontimestamp", typeClass=DbTimestampType.class)}) +@TypeDefs({ @TypeDef(name = "transactiontimestamp", typeClass = DbTimestampType.class) }) public class SampleRelationshipPE implements Serializable { private static final long serialVersionUID = IServer.VERSION; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SampleSkeleton.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SampleSkeleton.java index 79265eac88866e47b686e88de84eb55a50a634eb..16a57c23052c5f1821b5a27c051c40ec4d0c77e3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SampleSkeleton.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SampleSkeleton.java @@ -24,13 +24,13 @@ package ch.systemsx.cisd.openbis.generic.shared.dto; public class SampleSkeleton { private long id; - + private Long databaseInstanceID; - + private Long spaceID; - + private long typeID; - + private Long experimentID; public final long getId() @@ -82,5 +82,5 @@ public class SampleSkeleton { this.experimentID = experimentID; } - + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SampleTypePropertyTypePE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SampleTypePropertyTypePE.java index 40878e679f10227c3fd97f0cbdc758de98232383..b0ce1a8ef0215553e8a6ef93d08188e01b9c541d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SampleTypePropertyTypePE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SampleTypePropertyTypePE.java @@ -43,8 +43,8 @@ import ch.systemsx.cisd.openbis.generic.shared.IServer; */ @Entity @Table(name = TableNames.SAMPLE_TYPE_PROPERTY_TYPE_TABLE, uniqueConstraints = - { @UniqueConstraint(columnNames = - { ColumnNames.SAMPLE_TYPE_COLUMN, ColumnNames.PROPERTY_TYPE_COLUMN }) }) +{ @UniqueConstraint(columnNames = +{ ColumnNames.SAMPLE_TYPE_COLUMN, ColumnNames.PROPERTY_TYPE_COLUMN }) }) public class SampleTypePropertyTypePE extends EntityTypePropertyTypePE { private static final long serialVersionUID = IServer.VERSION; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/StorageFormat.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/StorageFormat.java index ffc0cec5efdbdd98c4fc9efce82ad12249cb4aa8..8109a009890fac0c3f8f696d9d027130d5ef802b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/StorageFormat.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/StorageFormat.java @@ -31,8 +31,7 @@ public enum StorageFormat /** The proprietary data format as acquired from the measurement device. */ PROPRIETARY("PROPRIETARY"), /** - * The standardized data according to the Biological Data Standard format, using a directory - * container. + * The standardized data according to the Biological Data Standard format, using a directory container. */ BDS_DIRECTORY("BDS_DIRECTORY"); @@ -67,8 +66,7 @@ public enum StorageFormat } /** - * Returns the appropriate format for the given <var>code</var>, or <code>null</code>, if there - * is no format for this <var>code</var>. + * Returns the appropriate format for the given <var>code</var>, or <code>null</code>, if there is no format for this <var>code</var>. */ public final static StorageFormat tryGetFromCode(final String code) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/TimeInterval.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/TimeInterval.java index 872261eb9006f66e80b7d4d9367a0d276c47e7da..baa52962c55a0423b56f8728495a33b88a982ce8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/TimeInterval.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/TimeInterval.java @@ -32,7 +32,7 @@ import ch.systemsx.cisd.openbis.generic.shared.IServer; * Note that both dates can be <code>null</code>. * </p> * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ public final class TimeInterval implements Serializable { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/VocabularyTermPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/VocabularyTermPE.java index 74b31aad53c3b592a4f1b830889ca1b995251066..9ed2801e11ea5aa213c58048d2ca920c0885d5bb 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/VocabularyTermPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/VocabularyTermPE.java @@ -55,8 +55,8 @@ import ch.systemsx.cisd.openbis.generic.shared.util.EqualsHashUtils; */ @Entity @Table(name = TableNames.CONTROLLED_VOCABULARY_TERM_TABLE, uniqueConstraints = - { @UniqueConstraint(columnNames = - { ColumnNames.CODE_COLUMN, ColumnNames.CONTROLLED_VOCABULARY_COLUMN }) }) +{ @UniqueConstraint(columnNames = +{ ColumnNames.CODE_COLUMN, ColumnNames.CONTROLLED_VOCABULARY_COLUMN }) }) public class VocabularyTermPE extends HibernateAbstractRegistrationHolder implements IIdAndCodeHolder, Comparable<VocabularyTermPE>, Serializable { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/hibernate/InternalNamespace.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/hibernate/InternalNamespace.java index 7d59e99a29848f1907f45469c0710e39b4852c3a..38eb95e3a5468c3bb431d1cafd10cccd73b79d49 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/hibernate/InternalNamespace.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/hibernate/InternalNamespace.java @@ -28,13 +28,12 @@ import javax.validation.Constraint; import javax.validation.Payload; /** - * <code>boolean</code> value has to be <code>false</code> for entities that must not be in the - * internal namespace. + * <code>boolean</code> value has to be <code>false</code> for entities that must not be in the internal namespace. * * @author Christian Ribeaud */ @Target( - { METHOD, FIELD }) +{ METHOD, FIELD }) @Retention(RetentionPolicy.RUNTIME) @Documented @Constraint(validatedBy = InternalNamespaceValidator.class) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/hibernate/Location.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/hibernate/Location.java index 4e6897cc38205cc427be03e595fbf65db0cd28b9..23bf12b0e80a08ccdbe0bd5f97e18fe5f1597f97 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/hibernate/Location.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/hibernate/Location.java @@ -33,7 +33,7 @@ import javax.validation.Payload; * @author Christian Ribeaud */ @Target( - { METHOD, FIELD }) +{ METHOD, FIELD }) @Retention(RetentionPolicy.RUNTIME) @Documented @Constraint(validatedBy = LocationValidator.class) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/hibernate/SearchFieldConstants.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/hibernate/SearchFieldConstants.java index b1c5d38a57d87f0d3eb54664e2f25ba3d237e880..cc113acfe29cf0e34ea24f93500aca569f5f8ca0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/hibernate/SearchFieldConstants.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/hibernate/SearchFieldConstants.java @@ -56,10 +56,10 @@ public final class SearchFieldConstants public static final String PREFIX_METAPROJECT = "metaproject" + SEPARATOR; public static final String[] PREFIXES = - { PREFIX_PROPERTIES, PREFIX_EXPERIMENT, PREFIX_SAMPLE, PREFIX_ENTITY_TYPE, - PREFIX_FILE_FORMAT_TYPE, PREFIX_FILE_FORMAT_TYPE, PREFIX_PROJECT, PREFIX_SPACE, - PREFIX_REGISTRATOR, PREFIX_ATTACHMENT, PREFIX_PROPERTIES + PREFIX_VOCABULARY_TERM, - PREFIX_METAPROJECT }; + { PREFIX_PROPERTIES, PREFIX_EXPERIMENT, PREFIX_SAMPLE, PREFIX_ENTITY_TYPE, + PREFIX_FILE_FORMAT_TYPE, PREFIX_FILE_FORMAT_TYPE, PREFIX_PROJECT, PREFIX_SPACE, + PREFIX_REGISTRATOR, PREFIX_ATTACHMENT, PREFIX_PROPERTIES + PREFIX_VOCABULARY_TERM, + PREFIX_METAPROJECT }; public static final String ID = "id"; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/hibernate/SortableNumberBridgeUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/hibernate/SortableNumberBridgeUtils.java index 27b081c1ac00120a8f663126a523123b67c00d38..7ebe53b2e5c0c8ad6ca4fe195a58d09d6638a468 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/hibernate/SortableNumberBridgeUtils.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/hibernate/SortableNumberBridgeUtils.java @@ -5,52 +5,68 @@ public class SortableNumberBridgeUtils // // Util Methods // - private static int LUCENE_INTEGER_PADDING = 19; //On the UI a integer field can't have more than 18 characters, a long can have 19 taking out the minus sign - - public static String getNumberForLucene(String number) { - try { + private static int LUCENE_INTEGER_PADDING = 19; // On the UI a integer field can't have more than 18 characters, a long can have 19 taking out the + // minus sign + + public static String getNumberForLucene(String number) + { + try + { return getNumberForLucene(Long.parseLong(number)); - } catch(Exception ex) { - try { + } catch (Exception ex) + { + try + { return getNumberForLucene(Double.parseDouble(number)); - } catch(Exception ex2) { + } catch (Exception ex2) + { return number; } } } - - private static String getNumberForLucene(Number number) { - if(number instanceof Integer || number instanceof Long) { + + private static String getNumberForLucene(Number number) + { + if (number instanceof Integer || number instanceof Long) + { return getIntegerAsStringForLucene(number) + ".0"; - } if(number instanceof Float || number instanceof Double) { + } + if (number instanceof Float || number instanceof Double) + { String rawReal = number.toString(); int indexOfDot = rawReal.indexOf('.'); return getIntegerAsStringForLucene(Long.parseLong(rawReal.substring(0, indexOfDot))) + rawReal.substring(indexOfDot, rawReal.length()); - } else { + } else + { return number.toString(); } } - - private static String getIntegerAsStringForLucene(Number number) { + + private static String getIntegerAsStringForLucene(Number number) + { String rawInteger = number.toString(); - + StringBuilder paddedInteger = new StringBuilder(); - - if(rawInteger.startsWith("-")) { + + if (rawInteger.startsWith("-")) + { rawInteger = rawInteger.substring(1, rawInteger.length()); paddedInteger.append('-'); - } else { + } else + { paddedInteger.append('+'); } - - if (rawInteger.length() > LUCENE_INTEGER_PADDING) { - throw new IllegalArgumentException( "Try to pad on a number too big" ); + + if (rawInteger.length() > LUCENE_INTEGER_PADDING) + { + throw new IllegalArgumentException("Try to pad on a number too big"); } - - for ( int padIndex = rawInteger.length() ; padIndex < LUCENE_INTEGER_PADDING ; padIndex++ ) { + + for (int padIndex = rawInteger.length(); padIndex < LUCENE_INTEGER_PADDING; padIndex++) + { paddedInteger.append('0'); } - + paddedInteger.append(rawInteger); return paddedInteger.toString(); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/identifier/LocalExperimentIdentifier.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/identifier/LocalExperimentIdentifier.java index 2429394a21b61ab1060f3752dcd6b34091ce5d7b..6190df5f620e6add8da4e57ecd10ac0012a13503 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/identifier/LocalExperimentIdentifier.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/identifier/LocalExperimentIdentifier.java @@ -21,8 +21,7 @@ import java.io.Serializable; import ch.systemsx.cisd.openbis.generic.shared.IServer; /** - * Identifies the experiment. This identifier points to an experiment if a group and database - * instance is provided in addition. + * Identifies the experiment. This identifier points to an experiment if a group and database instance is provided in addition. * * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/types/DataSetTypeCode.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/types/DataSetTypeCode.java index a2cbcc93449c7e704f2d087ff5c4c7276e420d38..5cb4314baf0695aca9997ad751de67f5cd39e7da 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/types/DataSetTypeCode.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/types/DataSetTypeCode.java @@ -19,8 +19,7 @@ package ch.systemsx.cisd.openbis.generic.shared.dto.types; /** * The current <code>DataSetType</code> codes. * <p> - * This enumeration should reflect the values in the database and is <i>Unit</i> tested to ensure - * this point. + * This enumeration should reflect the values in the database and is <i>Unit</i> tested to ensure this point. * </p> * * @author Christian Ribeaud diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/types/ExperimentTypeCode.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/types/ExperimentTypeCode.java index 1bd6015c4b41120a239b59d82160d0b7613f88e2..4486b13266151bef4327b24648456db276ebafec 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/types/ExperimentTypeCode.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/types/ExperimentTypeCode.java @@ -19,8 +19,7 @@ package ch.systemsx.cisd.openbis.generic.shared.dto.types; /** * The current <code>ExperimentType</code> codes. * <p> - * This enumeration should reflect the values in the database and is <i>Unit</i> tested to ensure - * this point. + * This enumeration should reflect the values in the database and is <i>Unit</i> tested to ensure this point. * </p> * * @author Christian Ribeaud diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/SimpleTableModelBuilderAdaptor.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/SimpleTableModelBuilderAdaptor.java index 2e70fd56fa55d935c7bdd3517ac049a1c67e553d..d058fb0763834733b2dbc24862704e5208ac678d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/SimpleTableModelBuilderAdaptor.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/SimpleTableModelBuilderAdaptor.java @@ -29,11 +29,10 @@ import ch.systemsx.cisd.openbis.generic.shared.util.IRowBuilder; import ch.systemsx.cisd.openbis.generic.shared.util.SimpleTableModelBuilder; /** - * An {@link ISimpleTableModelBuilderAdaptor} implementation adapting - * {@link SimpleTableModelBuilder}. + * An {@link ISimpleTableModelBuilderAdaptor} implementation adapting {@link SimpleTableModelBuilder}. * <p> - * The intent of the interface and adaptor is not to expose {@link SimpleTableModelBuilder} - * interface in Managed Property API and optionally add convenience methods for scripts. + * The intent of the interface and adaptor is not to expose {@link SimpleTableModelBuilder} interface in Managed Property API and optionally add + * convenience methods for scripts. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/EntityLinkElementKind.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/EntityLinkElementKind.java index 1cc88d3e6d7ee3c6150de21ca688c0124f3a7b1e..7aa03d27b32bcaa928ab6d3f53691fc2370143af 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/EntityLinkElementKind.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/EntityLinkElementKind.java @@ -60,8 +60,7 @@ public enum EntityLinkElementKind } /** - * @return the {@link EntityLinkElementKind} for a given element name or <code>null</code> if no - * matching kind exists. + * @return the {@link EntityLinkElementKind} for a given element name or <code>null</code> if no matching kind exists. */ public static EntityLinkElementKind tryGetForElementName(String elementName) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/IElement.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/IElement.java index 3fb13c8232463990a9e1f626d00fcacf3c2c6c2e..091b1b1d2dc12206ed3acdce271990d3a137fa7b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/IElement.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/IElement.java @@ -20,12 +20,10 @@ import java.util.List; import java.util.Map; /** - * An {@link IElement} is an object that can be transparently converted to {@link String} (see - * {@link IStructuredPropertyConverter}) e.g. when we want to save the value of a structured - * (managed) property. + * An {@link IElement} is an object that can be transparently converted to {@link String} (see {@link IStructuredPropertyConverter}) e.g. when we want + * to save the value of a structured (managed) property. * <p> - * {@link IElement}-s are meant to be used as a convenient, hierarchical property-value persistence - * technique for managed properties. + * {@link IElement}-s are meant to be used as a convenient, hierarchical property-value persistence technique for managed properties. * * @author Piotr Buczek * @author Kaloyan Enimanev @@ -46,14 +44,12 @@ public interface IElement String getAttribute(String key); /** - * @return the value of an attribute or <code>defaultValue</code> if the attribute is not - * defined for this {@link IElement} + * @return the value of an attribute or <code>defaultValue</code> if the attribute is not defined for this {@link IElement} */ String getAttribute(String key, String defaultValue); /** - * The "Data" field is intended for a chunk raw data that can be attached to an element - * instance. This might be useful in scenarios where + * The "Data" field is intended for a chunk raw data that can be attached to an element instance. This might be useful in scenarios where */ String getData(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/IElementFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/IElementFactory.java index ca1ea3bb5211f8980dcff2be8384e08e29550253..207e56b7876d4e37af6ab0a34bbbfe78eeea84e7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/IElementFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/IElementFactory.java @@ -46,15 +46,13 @@ public interface IElementFactory IEntityLinkElement createDataSetLink(String permId); /** - * @return creates an link element pointing towards a material with given code and typeCode - * parameters. + * @return creates an link element pointing towards a material with given code and typeCode parameters. */ IEntityLinkElement createMaterialLink(String code, String typeCode); /** - * @return <code>true</code> if the specified element is a link element, <code>false</code> - * otherwise. This method might come handy in Jython scripts, where it is undesirable to - * hard-code class names or invoke "instanceof". + * @return <code>true</code> if the specified element is a link element, <code>false</code> otherwise. This method might come handy in Jython + * scripts, where it is undesirable to hard-code class names or invoke "instanceof". */ boolean isEntityLink(IElement element); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/IEntityInformationProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/IEntityInformationProvider.java index 829d4b47ca14cc30709a7d82b2af7cde2f2d6b9d..161f675ac98407f5a6c1f555552c6ba099ee1548 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/IEntityInformationProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/IEntityInformationProvider.java @@ -27,20 +27,17 @@ import java.util.List; public interface IEntityInformationProvider { /** - * @return identifier of entity specified by given link, <code>null</code> if such an entity - * doesn't exist + * @return identifier of entity specified by given link, <code>null</code> if such an entity doesn't exist */ String getIdentifier(IEntityLinkElement entityLink); /** - * @return permId of sample specified by given space and code, <code>null</code> if such a - * sample doesn't exist + * @return permId of sample specified by given space and code, <code>null</code> if such a sample doesn't exist */ String getSamplePermId(String spaceCode, String sampleCode); /** - * @return permId of sample specified by given identifier, <code>null</code> if such a sample - * doesn't exist + * @return permId of sample specified by given identifier, <code>null</code> if such a sample doesn't exist */ String getSamplePermId(String sampleIdentifier); @@ -55,8 +52,7 @@ public interface IEntityInformationProvider List<String> getSampleParentPermIds(String permId); /** - * @return value of a property with given code of a sample with given permIds, empty string if - * the property doesn't exist + * @return value of a property with given code of a sample with given permIds, empty string if the property doesn't exist */ String getSamplePropertyValue(String permId, String propertyCode); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/IRowBuilderAdaptor.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/IRowBuilderAdaptor.java index 19a7d8d3dde6beecaa50d49f0e0653c5e3d822fa..a72f4d0d7311a0b4f66e84e5de2beacc476849a5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/IRowBuilderAdaptor.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/IRowBuilderAdaptor.java @@ -49,14 +49,12 @@ public interface IRowBuilderAdaptor public void setCell(String headerTitle, Date value); /** - * Sets the value of the column specified by the header title to the specified entity link - * rendered using identifier. + * Sets the value of the column specified by the header title to the specified entity link rendered using identifier. */ public void setCell(String headerTitle, IEntityLinkElement value); /** - * Sets the value of the column specified by the header title to the specified entity link - * rendered using given text. + * Sets the value of the column specified by the header title to the specified entity link rendered using given text. */ public void setCell(String headerTitle, IEntityLinkElement value, String linkText); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/ISimpleTableModelBuilderAdaptor.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/ISimpleTableModelBuilderAdaptor.java index 540fe223c717d5f02312ac1fd24dc43ac0f2d233..a706c58bba8e24ee671ff04c854f018d3d37c5f0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/ISimpleTableModelBuilderAdaptor.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/ISimpleTableModelBuilderAdaptor.java @@ -60,8 +60,7 @@ public interface ISimpleTableModelBuilderAdaptor void addHeader(String title, String code); /** - * A convenience method for adding complete header with columns with specified titles and - * default column width 150. + * A convenience method for adding complete header with columns with specified titles and default column width 150. * * @throws UserFailureException if header titles are not unique. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/IStructuredPropertyConverter.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/IStructuredPropertyConverter.java index 76ef98deebbf79b5197081a31a58063e52446acb..227d83a422b25693f941d2bef7ce3d29df0f1bc3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/IStructuredPropertyConverter.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/IStructuredPropertyConverter.java @@ -44,8 +44,7 @@ public interface IStructuredPropertyConverter List<IElement> convertStringToElements(String propertyValue); /** - * @return a {@link String} representation of the specified elements that can be persisted in - * the database. + * @return a {@link String} representation of the specified elements that can be persisted in the database. */ String convertToString(List<IElement> elements); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/structured/ElementFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/structured/ElementFactory.java index 120103d700ed18f87fa659baad30d8808fa4329f..9152f11a2e029cfb2d189e5305f157d6337fbe41 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/structured/ElementFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/structured/ElementFactory.java @@ -23,8 +23,8 @@ import ch.systemsx.cisd.openbis.generic.shared.managed_property.api.IElementFact import ch.systemsx.cisd.openbis.generic.shared.managed_property.api.IEntityLinkElement; /** - * For now we only expose methods for creation of Sample and Material links, but it is quite easy to - * add support for experiment and datasets links in the future. + * For now we only expose methods for creation of Sample and Material links, but it is quite easy to add support for experiment and datasets links in + * the future. * * @author Kaloyan Enimanev */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/structured/XmlOrJsonStructuredPropertyConverter.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/structured/XmlOrJsonStructuredPropertyConverter.java index 8b1680908c9beabf70d24f2dd1270fb6792cd8ee..cdc8bd8a825bc4eaf7d6b4001bde97898b5b025b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/structured/XmlOrJsonStructuredPropertyConverter.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/structured/XmlOrJsonStructuredPropertyConverter.java @@ -24,8 +24,8 @@ import ch.systemsx.cisd.openbis.generic.shared.managed_property.api.IElement; import ch.systemsx.cisd.openbis.generic.shared.managed_property.api.IStructuredPropertyConverter; /** - * An implementation of {@link IStructuredPropertyConverter}, that translates elements either to XML - * or to JSON and that can translate back both formats. + * An implementation of {@link IStructuredPropertyConverter}, that translates elements either to XML or to JSON and that can translate back both + * formats. * * @author Bernd Rinn */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/parser/BisExcelFileLoader.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/parser/BisExcelFileLoader.java index 56556fce0f7cff0b748e1123c184b29560258261..f0159c65f3b63c9184a3372fccde012564440f5d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/parser/BisExcelFileLoader.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/parser/BisExcelFileLoader.java @@ -30,8 +30,8 @@ import ch.systemsx.cisd.common.parser.ParsingException; import ch.systemsx.cisd.common.parser.TabFileLoader; /** - * A <i>openBIS</i> {@link TabFileLoader} extension which translates a {@link ParsingException} into - * a more user friendly {@link UserFailureException}. + * A <i>openBIS</i> {@link TabFileLoader} extension which translates a {@link ParsingException} into a more user friendly {@link UserFailureException} + * . * <p> * Note that this extension prefers to work with {@link NamedReader}. * </p> diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/parser/BisTabFileLoader.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/parser/BisTabFileLoader.java index 5f80d90cb4f1caacc29d5834792651572952f150..d67b040411f81eff55ed548bc271a0bec498b498 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/parser/BisTabFileLoader.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/parser/BisTabFileLoader.java @@ -28,8 +28,8 @@ import ch.systemsx.cisd.common.parser.ParsingException; import ch.systemsx.cisd.common.parser.TabFileLoader; /** - * A <i>openBIS</i> {@link TabFileLoader} extension which translates a {@link ParsingException} into - * a more user friendly {@link UserFailureException}. + * A <i>openBIS</i> {@link TabFileLoader} extension which translates a {@link ParsingException} into a more user friendly {@link UserFailureException} + * . * <p> * Note that this extension prefers to work with {@link NamedReader}. * </p> diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/parser/GlobalProperties.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/parser/GlobalProperties.java index c35035444ab0f699734608a637cd29368189a8a1..36e14c0f72f1f41161c8d2f5bd993ea8b7a44404 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/parser/GlobalProperties.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/parser/GlobalProperties.java @@ -32,8 +32,7 @@ public class GlobalProperties } /** - * Adds property with given key and value.Throws {@link IllegalArgumentException} if property - * already defined. + * Adds property with given key and value.Throws {@link IllegalArgumentException} if property already defined. */ public void add(String key, String value) { @@ -45,8 +44,7 @@ public class GlobalProperties } /** - * Returns value of given property. Throws {@link IllegalArgumentException} if property not - * defined. + * Returns value of given property. Throws {@link IllegalArgumentException} if property not defined. */ public String get(String key) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/parser/GlobalPropertiesLoader.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/parser/GlobalPropertiesLoader.java index 32497f1cbf51b02406dc2c2ed8d4b91d98801201..1648b99ec911595fc027ff9637ab369af057c32b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/parser/GlobalPropertiesLoader.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/parser/GlobalPropertiesLoader.java @@ -28,9 +28,8 @@ import org.apache.commons.lang.StringUtils; /** * Loads global properties. * <p> - * Global properties are defined as comments and start with a line - * <code>#! GLOBAL_PROPERTIES:</code> (followed by a new line character.) Each property is defined - * in a separate line and has the following format: + * Global properties are defined as comments and start with a line <code>#! GLOBAL_PROPERTIES:</code> (followed by a new line character.) Each + * property is defined in a separate line and has the following format: * <p> * #! key = value * </p> diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/parser/UpdatedSampleParserObjectFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/parser/UpdatedSampleParserObjectFactory.java index 553e18576462dd114e714a2b2c82c26d59601330..8210dca8d28c78340365eed8d00e4274ffcad7cf 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/parser/UpdatedSampleParserObjectFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/parser/UpdatedSampleParserObjectFactory.java @@ -47,8 +47,8 @@ final class UpdatedSampleParserObjectFactory extends NewSampleParserObjectFactor } /** - * Prepares details about which values should be updated in general taking into account only the - * information about availability of columns in the file. + * Prepares details about which values should be updated in general taking into account only the information about availability of columns in the + * file. */ private SampleBatchUpdateDetails createBasicBatchUpdateDetails() { @@ -85,8 +85,8 @@ final class UpdatedSampleParserObjectFactory extends NewSampleParserObjectFactor // /** - * Returns details about which values should be updated for the specified sample. If a cell was - * left empty in the file the corresponding value will not be modified. + * Returns details about which values should be updated for the specified sample. If a cell was left empty in the file the corresponding value + * will not be modified. */ private SampleBatchUpdateDetails createBatchUpdateDetails(NewSample newSample) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/DeletedEntityTranslator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/DeletedEntityTranslator.java index bcadfbd6cf801d8b247e720cd617a70f3868ee6c..d6042791c0b768a7a94ca8c9e62ecb654925cd6d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/DeletedEntityTranslator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/DeletedEntityTranslator.java @@ -31,8 +31,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.PropertyTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.SampleTypePE; /** - * A generic translator for deleted entities. In the future, if we need to access specific fields of - * a deleted entity in the UI we'll have to create a DTO layer of deleted object. + * A generic translator for deleted entities. In the future, if we need to access specific fields of a deleted entity in the UI we'll have to create a + * DTO layer of deleted object. * <p> * For now, a single DeletedEntity covers all required uses cases of the trash can. * diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/PropertyTranslatorUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/PropertyTranslatorUtils.java index 88358f6ae0ff28645a903689b46ba5f5b54b3779..1cdf9509e8baeb1c90a0e12e19187be72f9b89fa 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/PropertyTranslatorUtils.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/PropertyTranslatorUtils.java @@ -59,8 +59,7 @@ final class PropertyTranslatorUtils } /** - * Creates an appropriate {@link IEntityProperty} for the given <var>propertyPE</var> based on - * its type. + * Creates an appropriate {@link IEntityProperty} for the given <var>propertyPE</var> based on its type. */ static IEntityProperty createEntityProperty(EntityPropertyPE propertyPE) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/CacheManager.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/CacheManager.java index 8c9f00f26fcbf9ba6ce3200d0e27fe53d6bacd58..ec68911861890f21230f160a1263afa9870efda1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/CacheManager.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/CacheManager.java @@ -111,9 +111,9 @@ public class CacheManager implements ICacheManager { timeStamp = new Date(timeProvider.getTimeInMilliseconds()); fileName = new MessageFormat(FILE_NAME_FORMAT).format(new Object[] - { timeStamp, counter++ }); + { timeStamp, counter++ }); } - + @Override public String toString() { @@ -122,28 +122,46 @@ public class CacheManager implements ICacheManager } private static final int DAY = 24 * 60 * 60 * 1000; - @Private public static final String CACHE_FOLDER_KEY = "cache-folder"; + + @Private + public static final String CACHE_FOLDER_KEY = "cache-folder"; + private static final String CACHE_FOLDER_DEFAULT_VALUE = "cache"; - @Private static final String MINIMUM_FREE_DISK_SPACE_KEY = "minimum-free-disk-space-in-MB"; + + @Private + static final String MINIMUM_FREE_DISK_SPACE_KEY = "minimum-free-disk-space-in-MB"; + private static final int MINIMUM_FREE_DISK_SPACE_DEFAULT_VALUE = 1024; - @Private static final String MAXIMUM_RETENTION_TIME_KEY = "maximum-retention-time-in-days"; + + @Private + static final String MAXIMUM_RETENTION_TIME_KEY = "maximum-retention-time-in-days"; + private static final int MAXIMUM_RETENTION_TIME_DEFAULT_VALUE = 7; - - @Private static final String CACHE_VERSION_FILE_NAME = ".cache-version"; - @Private static final String KEY_FILE_TYPE = ".key"; - @Private static final String DATA_FILE_TYPE = ".data"; - + + @Private + static final String CACHE_VERSION_FILE_NAME = ".cache-version"; + + @Private + static final String KEY_FILE_TYPE = ".key"; + + @Private + static final String DATA_FILE_TYPE = ".data"; + private static final Logger operationLog = LogFactory.getLogger(LogCategory.OPERATION, CacheManager.class); - + private final ITimeProvider timeProvider; + private final Map<Key, FileName> keyToFileNameMap; + private final IFreeSpaceProvider freeSpaceProvider; + private final File cacheFolder; + private final long minimumFreeDiskSpaceInKB; + private final long maximumRetentionTimeInMillis; - - + public CacheManager(WebClientConfiguration configuration, String technologyName, ITimeProvider timeProvider, IFreeSpaceProvider freeSpaceProvider, String cacheVersion) { @@ -208,7 +226,7 @@ public class CacheManager implements ICacheManager } return key; } - + private int getIntegerProperty(WebClientConfiguration configuration, String technologyName, String key, int defaultValue) { String value = configuration.getPropertyOrNull(technologyName, key); @@ -232,7 +250,7 @@ public class CacheManager implements ICacheManager String value = configuration.getPropertyOrNull(technologyName, key); return value == null ? defaultValue : value; } - + @Override public Object tryToGetData(Key key) { @@ -299,7 +317,7 @@ public class CacheManager implements ICacheManager } } } - + private void cleanUp() { long currentTime = timeProvider.getTimeInMilliseconds(); @@ -335,7 +353,7 @@ public class CacheManager implements ICacheManager operationLog.warn("Can not obtain available free disk space.", ex); } } - + private void removeFromCache(Key key) { FileName fileName = keyToFileNameMap.remove(key); @@ -361,7 +379,7 @@ public class CacheManager implements ICacheManager operationLog.warn("For key " + key + " removing from cache caused some unknown error: " + file); } } - + private void assertFreeSpaceAvailableFor(int numberOfBytes) throws IOException { long freeSpace = 1024 * freeSpaceProvider.freeSpaceKb(new HostAwareFile(cacheFolder)); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/DataTypeUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/DataTypeUtils.java index 51216a6b996b9da1e4fc1e6f2d5b0b8f43df9df3..505871804585ca0d5cab50561d881eb1e6a8f435 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/DataTypeUtils.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/DataTypeUtils.java @@ -102,7 +102,7 @@ public class DataTypeUtils { String pattern = SupportedDatePattern.CANONICAL_DATE_PATTERN.getPattern(); return DateUtils.parseDate(value, new String[] - { pattern }); + { pattern }); } catch (ParseException ex) { throw new IllegalArgumentException("Is not a date in canonical format: " diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/EntityHelper.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/EntityHelper.java index 0df7488d769d8e5328e9973d6a68acba31ccc82f..fff63b2ac787d764e50a6d6e0a3f3a1d5df959b3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/EntityHelper.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/EntityHelper.java @@ -57,7 +57,7 @@ public class EntityHelper /** * Returns <code>true</code> if both entities are <code>null</code> or have the same id (which could be <code>null</code>). */ - public static <T extends IIdHolder >boolean equalEntities(T entity1OrNull, T entity2OrNull) + public static <T extends IIdHolder> boolean equalEntities(T entity1OrNull, T entity2OrNull) { if (entity1OrNull == null || entity2OrNull == null) { @@ -100,8 +100,7 @@ public class EntityHelper } /** - * @return finds and returns an {@link IEntityProperty} for a specified code. Returns - * <code>null</code> if no matching property is found. + * @return finds and returns an {@link IEntityProperty} for a specified code. Returns <code>null</code> if no matching property is found. */ public static IEntityProperty tryFindProperty(Iterable<IEntityProperty> properties, final String propertyCode) @@ -237,8 +236,7 @@ public class EntityHelper } /** - * Creates a property with specified code and value. An already existing property with same code - * will be removed. + * Creates a property with specified code and value. An already existing property with same code will be removed. */ public static void createOrUpdateProperty(IEntityPropertiesHolder holder, String propertyCode, String propertyValue) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/ICacheManager.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/ICacheManager.java index c62204ed00c392d392c10e14180053ee62dcecc2..365d47a8adbf35f628754d05cd755f6077536976 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/ICacheManager.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/ICacheManager.java @@ -19,20 +19,19 @@ package ch.systemsx.cisd.openbis.generic.shared.util; /** * Interface of a manager of objects which are stored in a cache using a unique {@link Key}. * - * * @author Franz-Josef Elmer */ public interface ICacheManager { /** - * Tries to retrieve object for specified key. + * Tries to retrieve object for specified key. * * @return <code>null</code> if not found in cache. */ public Object tryToGetData(Key key); /** - * Stores specified object for specified key. + * Stores specified object for specified key. */ public void storeData(Key key, Object object); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/IColumnGroup.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/IColumnGroup.java index ed70a747de584599e8234c2334ab5d7d7a14d0cd..19a84397e4f1c8b66acc3823b2b13e87d4b56733 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/IColumnGroup.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/IColumnGroup.java @@ -37,22 +37,19 @@ public interface IColumnGroup public IColumn column(String id); /** - * Intends uneditable property columns for all property columns added by one of the add methods - * after this method has been invoked. + * Intends uneditable property columns for all property columns added by one of the add methods after this method has been invoked. */ public IColumnGroup uneditablePropertyColumns(); /** - * Adds for all assigned property types of the specified entity type a column. The group name is - * used as a prefix which combined with the property type code to determine the column id. The - * property type label is used as column title. + * Adds for all assigned property types of the specified entity type a column. The group name is used as a prefix which combined with the property + * type code to determine the column id. The property type label is used as column title. */ public void addColumnsForAssignedProperties(EntityType entityType); /** - * Adds for all assigned property types of the specified entity type a column. The specified - * identifier prefix is used as a prefix which combined with the property type code to determine - * the column id. The property type label is used as column title. + * Adds for all assigned property types of the specified entity type a column. The specified identifier prefix is used as a prefix which combined + * with the property type code to determine the column id. The property type label is used as column title. */ public void addColumnsForAssignedProperties(String idPrefix, EntityType entityType); @@ -67,30 +64,27 @@ public interface IColumnGroup public void addColumnsForPropertyTypesForUpdate(List<PropertyType> propertyTypes); /** - * Adds a column for all given property types. The specified identifier prefix is used as a - * prefix which combined with the property type code to determine the column id. The property - * type label is used as column title. + * Adds a column for all given property types. The specified identifier prefix is used as a prefix which combined with the property type code to + * determine the column id. The property type label is used as column title. */ public void addColumnsForPropertyTypes(String idPrefix, List<PropertyType> propertyTypes, boolean forUpdate); /** - * Adds all specified properties. The group name is used as a prefix which is combined with the - * property type code to determine the column id. The property type label is used as column - * title. + * Adds all specified properties. The group name is used as a prefix which is combined with the property type code to determine the column id. The + * property type label is used as column title. */ public void addProperties(Collection<IEntityProperty> properties); /** - * Adds all specified properties. The specified identifier prefix is combined with the property - * type code to determine the column id. The property type label is used as column title. + * Adds all specified properties. The specified identifier prefix is combined with the property type code to determine the column id. The property + * type label is used as column title. */ public void addProperties(String idPrefix, Collection<IEntityProperty> properties); /** - * Adds all specified properties such that the table can be used for batch update. The original - * property type code determines the column id. For vocabulary terms only the code is added as - * value. + * Adds all specified properties such that the table can be used for batch update. The original property type code determines the column id. For + * vocabulary terms only the code is added as value. */ public void addPropertiesForUpdate(Collection<IEntityProperty> properties); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/IColumnMetaData.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/IColumnMetaData.java index cbdea36525bfb5dc24a96606b4d44d816b100edf..b6525994f0635d01ed520057b8b64b7bb9f0bd16 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/IColumnMetaData.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/IColumnMetaData.java @@ -19,8 +19,7 @@ package ch.systemsx.cisd.openbis.generic.shared.util; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataTypeCode; /** - * Interface for setting meta data of columns defined by - * {@link TypedTableModelBuilder#addColumn(String)}. + * Interface for setting meta data of columns defined by {@link TypedTableModelBuilder#addColumn(String)}. * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/IDataSourceFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/IDataSourceFactory.java index 10037320e3e34fb9228b83042c4874507a72284a..aaadf5d8b713f5c7ca49cf85b8da4b7bc76f80ef 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/IDataSourceFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/IDataSourceFactory.java @@ -27,8 +27,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.DataSourceWithDefinition; public interface IDataSourceFactory { /** - * Creates a data source optional definition from specified properties. Note, that if the - * definition is provided its code attribute might be undefined. + * Creates a data source optional definition from specified properties. Note, that if the definition is provided its code attribute might be + * undefined. */ public DataSourceWithDefinition create(Properties dbProps); } \ No newline at end of file diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/Key.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/Key.java index 02dbe560299170ce8fc3849456f16b92a4dbce55..14fbd6c6714343496350f499d4b73b29378adc2c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/Key.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/Key.java @@ -26,9 +26,9 @@ import java.io.Serializable; public final class Key implements Serializable { private static final long serialVersionUID = 1L; - + private final Object[] objects; - + public Key(Object... objects) { this.objects = objects; @@ -61,7 +61,7 @@ public final class Key implements Serializable } return true; } - + @Override public int hashCode() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/MaterialConfigurationProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/MaterialConfigurationProvider.java index f6bb1bda68e44dd47fe8395c10020f294d52b77d..66da13ffdd3fb5ea3583d5dc7ad4d4f29729c73a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/MaterialConfigurationProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/MaterialConfigurationProvider.java @@ -78,8 +78,7 @@ public class MaterialConfigurationProvider } /** - * Return <code>true</code> if the material codes can contain only alphanumeric characters and - * underscores. + * Return <code>true</code> if the material codes can contain only alphanumeric characters and underscores. */ public boolean isStrictCodeConstraints() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/RelationshipUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/RelationshipUtils.java index c1a2f29dec68057e2dd8c4c8931da204087648d3..a6f1b86f24b76cb9004883aa2b3b7c8d2ab4c6ab 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/RelationshipUtils.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/RelationshipUtils.java @@ -49,7 +49,7 @@ public class RelationshipUtils } } - public static void updateModificationDateAndModifierOfRelatedEntitiesOfSamples(List<SamplePE> samples, + public static void updateModificationDateAndModifierOfRelatedEntitiesOfSamples(List<SamplePE> samples, IAuthSession session, Date modificationTimestamp) { for (SamplePE sample : samples) @@ -84,7 +84,7 @@ public class RelationshipUtils } } - public static void updateModificationDateAndModifierOfRelatedEntitiesOfDataSets(List<DataPE> dataSets, + public static void updateModificationDateAndModifierOfRelatedEntitiesOfDataSets(List<DataPE> dataSets, IAuthSession session, Date modificationTimestamp) { for (DataPE dataSet : dataSets) @@ -106,7 +106,7 @@ public class RelationshipUtils } } - private static void updateModificationDateAndModifierOfDataSets(List<DataPE> dataSets, + private static void updateModificationDateAndModifierOfDataSets(List<DataPE> dataSets, IAuthSession session, Date modificationTimestamp) { if (dataSets != null) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/RuntimeCache.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/RuntimeCache.java index 9d5df52ada84950b29e562ac4ac2bdc9149da5f9..141bbea600c546cbd405387ff51b60d8ac77be7b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/RuntimeCache.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/RuntimeCache.java @@ -36,8 +36,6 @@ import ch.systemsx.cisd.common.parser.MemorySizeFormatter; import ch.systemsx.cisd.common.parser.PercentFormatter; /** - * - * * @author Franz-Josef Elmer */ public class RuntimeCache<K, V> @@ -56,14 +54,14 @@ public class RuntimeCache<K, V> this.name = name; this.cacheSizePropertyName = cacheSizePropertyName; } - + @SuppressWarnings("unchecked") public V get(K key) { Element element = getCache().get(key); return element == null ? null : ((ValueWrapper<V>) element.getObjectValue()).getValue(); } - + public void put(K key, V value) { Element element = getCache().get(key); @@ -82,12 +80,12 @@ public class RuntimeCache<K, V> getCache().recalculateSize(key); } } - + public boolean remove(K key) { return getCache().remove(key); } - + public void initCache() { Cache cache = cacheManager.getCache(name); @@ -115,7 +113,7 @@ public class RuntimeCache<K, V> operationLog.info("The cache " + name + " already exists. It must have been configured in ehcache.xml file."); } } - + protected long getCacheSize() { String propertyValue = getSystemProperty(cacheSizePropertyName); @@ -159,7 +157,7 @@ public class RuntimeCache<K, V> { return System.getProperty(propertyName); } - + private Cache getCache() { return cacheManager.getCache(name); @@ -175,7 +173,7 @@ public class RuntimeCache<K, V> + cacheSizePropertyName + "' system property in openbis.conf file."); return cacheSize; } - + private static final class ValueWrapper<V> { private V value; @@ -200,5 +198,6 @@ public class RuntimeCache<K, V> { return String.valueOf(value); } - - }} + + } +} diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/RuntimeCacheEventListener.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/RuntimeCacheEventListener.java index 05d26a2511d4a668a30c836f0938139444e5e281..5c5a033de4ca1ee246e3fb71f7dcded75cdebdd9 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/RuntimeCacheEventListener.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/RuntimeCacheEventListener.java @@ -86,7 +86,7 @@ public class RuntimeCacheEventListener implements CacheEventListener { StringBuilder sb = new StringBuilder(); sb.append("Cache entry " + entry.hashCode() + " that contains search result with " + entry + " " + operation + "."); - + int cacheSize = cache.getSize(); if (cacheSize == 1) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/ServerUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/ServerUtils.java index b878cf0f62595b8985d1e4232360b33f2f150ea6..bc2512dc4420a97aad4c0ace3238a33129521dd9 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/ServerUtils.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/ServerUtils.java @@ -64,8 +64,7 @@ public class ServerUtils /** * Extracts from the comma-separated list of strings all distinct strings. * - * @return an empty list if the argument is <code>null</code>, an empty string or starts with - * '$'. + * @return an empty list if the argument is <code>null</code>, an empty string or starts with '$'. */ public static Set<String> extractSet(String commaSeparatedList) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/SpaceCodeHelper.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/SpaceCodeHelper.java index 35086c17f3e0af54435344bf37634d76df8a00d2..8c234210f23a6d5c04567d2f08ed306fe7cc4b67 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/SpaceCodeHelper.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/SpaceCodeHelper.java @@ -40,8 +40,7 @@ public class SpaceCodeHelper /** * Tries to find out the space. * <p> - * If not specified in given {@link SpaceIdentifier} the real space must be specified as home - * space in given {@link PersonPE}. + * If not specified in given {@link SpaceIdentifier} the real space must be specified as home space in given {@link PersonPE}. * </p> * * @throws UndefinedSpaceException if no space could be found. @@ -55,8 +54,7 @@ public class SpaceCodeHelper /** * Tries to find out the space. * <p> - * If not specified in given {@link SpacePE} the real space must be specified as home space in - * given {@link PersonPE}. + * If not specified in given {@link SpacePE} the real space must be specified as home space in given {@link PersonPE}. * </p> * * @throws UndefinedSpaceException if no space could be found. @@ -70,9 +68,8 @@ public class SpaceCodeHelper /** * Tries to find out the space. * <p> - * If given <var>spaceCode</var> specifies the home space, the home space of the - * {@link PersonPE} is returned. May return <code>null</code>, if no home space is defined for - * the user. + * If given <var>spaceCode</var> specifies the home space, the home space of the {@link PersonPE} is returned. May return <code>null</code>, if no + * home space is defined for the user. * </p> */ public final static String tryGetSpaceCode(final PersonPE person, final String spaceCode) @@ -95,8 +92,7 @@ public class SpaceCodeHelper /** * Tries to find out the space. * <p> - * If given <var>spaceCode</var> is a home space, the real space must be specified as home space - * in given {@link PersonPE}. + * If given <var>spaceCode</var> is a home space, the real space must be specified as home space in given {@link PersonPE}. * </p> * * @throws UndefinedSpaceException if no space could be found. @@ -115,8 +111,7 @@ public class SpaceCodeHelper /** * Tries to find out the space. * <p> - * If given <var>spaceCode</var> is a home space, the real space must be specified as - * <var>homeSpaceCode</var>. + * If given <var>spaceCode</var> is a home space, the real space must be specified as <var>homeSpaceCode</var>. * </p> * * @throws UndefinedSpaceException if no space could be found. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/UuidUtil.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/UuidUtil.java index 78a3f511159c3228e1429fe54413855324b55cff..005024e9b0c958925fc506ad926550a7161cbf73 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/UuidUtil.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/UuidUtil.java @@ -26,8 +26,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.CodeConverter; /** * Some utility methods based on {@link UUID}. * <p> - * In its canonical form, a <i>UUID</i> consists of 32 hexadecimal digits, displayed in 5 groups - * separated by hyphens, in the form 8-4-4-4-12 for a total of 36 characters.<br> + * In its canonical form, a <i>UUID</i> consists of 32 hexadecimal digits, displayed in 5 groups separated by hyphens, in the form 8-4-4-4-12 for a + * total of 36 characters.<br> * For example: * * <pre> diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/WebClientFilesUpdater.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/WebClientFilesUpdater.java index 86a59e8a1f194066edc0df3ad57c7ec1a41b123f..38c9f5618bf7c320531042b30d8d77c72b0384bc 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/WebClientFilesUpdater.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/WebClientFilesUpdater.java @@ -32,10 +32,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.plugin.Def /** * Class which updates <code>OpenBIS.gwt.xml</code> and {@link DefaultClientPluginFactoryProvider}. * <p> - * Usage: - * <tt>java {@link WebClientFilesUpdater} [<working directory> [<technology 1> <technology 2> ...]]</tt> - * Without technology arguments all technologies found in the code base are available. If at least - * one technology is specified only the specified technologies will be available. + * Usage: <tt>java {@link WebClientFilesUpdater} [<working directory> [<technology 1> <technology 2> ...]]</tt> Without technology arguments all + * technologies found in the code base are available. If at least one technology is specified only the specified technologies will be available. * * @author Christian Ribeaud */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/XmlUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/XmlUtils.java index 3388155555ce54559f07cedd617cd5c8cf6c4dc7..6afa1649118219160275d563f7e5b96fe3abc4de 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/XmlUtils.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/util/XmlUtils.java @@ -62,7 +62,7 @@ public class XmlUtils /** indentation to be used when serializing to xml. */ public static final Integer INDENTATION = 2; - + /** * Parse given string as XML {@link Document}. * diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/AbstractPluginBusinessObjectFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/AbstractPluginBusinessObjectFactory.java index 5d2cddf3f5e7f8e696d3e40c5abf48f34db51a62..ad8d343de94f11d4205145e940216981463c67de 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/AbstractPluginBusinessObjectFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/AbstractPluginBusinessObjectFactory.java @@ -23,8 +23,8 @@ import ch.systemsx.cisd.openbis.generic.server.business.bo.AbstractBusinessObjec import ch.systemsx.cisd.openbis.generic.server.business.bo.ICommonBusinessObjectFactory; /** - * An <i>abstract</i> {@link AbstractBusinessObjectFactory} extension which is able to delegate - * calls to the encapsulated {@link ICommonBusinessObjectFactory}. + * An <i>abstract</i> {@link AbstractBusinessObjectFactory} extension which is able to delegate calls to the encapsulated + * {@link ICommonBusinessObjectFactory}. * * @author Christian Ribeaud */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/AbstractSampleServerPlugin.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/AbstractSampleServerPlugin.java index 9326f2d7eb95382484a3753751384838198165aa..31df2e3f65620a14335c66160289141f773e248d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/AbstractSampleServerPlugin.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/AbstractSampleServerPlugin.java @@ -27,12 +27,10 @@ import ch.systemsx.cisd.openbis.generic.server.plugin.SampleServerPluginRegistry import ch.systemsx.cisd.openbis.generic.shared.ResourceNames; /** - * An abstract {@link ISampleServerPlugin} which registers itself to - * {@link SampleServerPluginRegistry}. + * An abstract {@link ISampleServerPlugin} which registers itself to {@link SampleServerPluginRegistry}. * <p> - * Each subclass should be annotated with {@link Component} so that it automatically gets registered - * to {@link SampleServerPluginRegistry} by <i>Spring</i>. It is a good idea as well to make the - * empty constructor <i>private</i>. + * Each subclass should be annotated with {@link Component} so that it automatically gets registered to {@link SampleServerPluginRegistry} by + * <i>Spring</i>. It is a good idea as well to make the empty constructor <i>private</i>. * </p> * * @author Christian Ribeaud @@ -41,7 +39,7 @@ public abstract class AbstractSampleServerPlugin implements ISampleServerPlugin, { @Resource(name = ResourceNames.SAMPLE_PLUGIN_REGISTRY) private SampleServerPluginRegistry sampleServerPluginRegistry; - + @Resource(name = ResourceNames.GENERIC_SAMPLE_TYPE_SLAVE_SERVER_PLUGIN) private ISampleTypeSlaveServerPlugin genericSampleTypeSlaveServerPlugin; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/IDemoClientService.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/IDemoClientService.java index 46678255a0dae2fd616ff5f05a1239963e59f44f..9755c1e350e0ff4dc22f322c11aa33747b83aa36 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/IDemoClientService.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/IDemoClientService.java @@ -25,9 +25,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleParentWithDerived /** * Service interface for the <i>demo</i> <i>GWT</i> client. * <p> - * Each method should declare throwing {@link UserFailureException}. The authorization framework can - * throw it when the user has insufficient privileges. If it is not marked, the GWT client will - * report unexpected exception. + * Each method should declare throwing {@link UserFailureException}. The authorization framework can throw it when the user has insufficient + * privileges. If it is not marked, the GWT client will report unexpected exception. * </p> * * @author Christian Ribeaud diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/Dict.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/Dict.java index b6fdfc1df848dfbd89e95e7fe01578dabeb4191d..304ed432c8ddb10037f771677ac1fc49e4482e6d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/Dict.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/Dict.java @@ -17,8 +17,7 @@ package ch.systemsx.cisd.openbis.plugin.demo.client.web.client.application; /** - * An {@link ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict} extension for - * <i>demo</i> specific message keys. + * An {@link ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict} extension for <i>demo</i> specific message keys. * * @author Christian Ribeaud */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/module/StatisticsWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/module/StatisticsWidget.java index 53c98f7095662aefb349f2781ceb935e222acd57..2480265dcba784b3d78ef3cdd12d860cafad768b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/module/StatisticsWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/module/StatisticsWidget.java @@ -94,7 +94,7 @@ public class StatisticsWidget extends ContentPanel implements IDatabaseModificat public DatabaseModificationKind[] getRelevantModifications() { return new DatabaseModificationKind[] - { DatabaseModificationKind.createOrDelete(ObjectKind.EXPERIMENT) }; + { DatabaseModificationKind.createOrDelete(ObjectKind.EXPERIMENT) }; } @Override diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/server/DemoClientServiceServlet.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/server/DemoClientServiceServlet.java index 3b7b912e7c905256afb2cbb8a410ef9cbda7bce9..e943c4ec48cd7273721ad029bc5b61d6c9a9afd7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/server/DemoClientServiceServlet.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/server/DemoClientServiceServlet.java @@ -29,16 +29,15 @@ import ch.systemsx.cisd.openbis.plugin.demo.shared.ResourceNames; /** * The {@link GWTRPCServiceExporter} for the <i>demo</i> service. * <p> - * <i>URL</i> mappings are: <code>/demo</code> and <code>/openbis/demo</code>. The encapsulated - * {@link ICommonClientService} service implementation is expected to be defined as bean with name - * <code>demo-service</code>. + * <i>URL</i> mappings are: <code>/demo</code> and <code>/openbis/demo</code>. The encapsulated {@link ICommonClientService} service implementation is + * expected to be defined as bean with name <code>demo-service</code>. * </p> * * @author Christian Ribeaud */ @Controller @RequestMapping( - { "/demo", "/openbis/demo" }) +{ "/demo", "/openbis/demo" }) public final class DemoClientServiceServlet extends GWTRPCServiceExporter { private static final long serialVersionUID = 1L; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/server/DemoSampleServerPlugin.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/server/DemoSampleServerPlugin.java index 89cc5663d3d20dae0b41298dff16a4544b27745a..083cb72b73df946182ffbb19a6196789a5f51782 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/server/DemoSampleServerPlugin.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/server/DemoSampleServerPlugin.java @@ -31,8 +31,7 @@ import ch.systemsx.cisd.openbis.plugin.demo.shared.ResourceNames; /** * The {@link ISampleServerPlugin} implementation for plates of type <code>DEMO_PLUGIN</code>. * <p> - * This class is annotated with {@link Component} so that it automatically gets registered to - * {@link SampleServerPluginRegistry} by <i>Spring</i>. + * This class is annotated with {@link Component} so that it automatically gets registered to {@link SampleServerPluginRegistry} by <i>Spring</i>. * </p> * * @author Christian Ribeaud diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/shared/IDemoServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/shared/IDemoServer.java index c50ee03544ad265ce58f8631e67aa79ca7ec2458..d4bf8c7ba5a5b568f9151986d8f3c86f55f68b5c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/shared/IDemoServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/shared/IDemoServer.java @@ -47,8 +47,8 @@ public interface IDemoServer extends IServer * For given {@link TechId} returns the {@link Sample} and its derived (child) samples. * * @return never <code>null</code>. - * @throws UserFailureException if given <var>sessionToken</var> is invalid or whether sample - * uniquely identified by given <var>sampleId</var> does not exist. + * @throws UserFailureException if given <var>sessionToken</var> is invalid or whether sample uniquely identified by given <var>sampleId</var> + * does not exist. */ @Transactional(readOnly = true) public SampleParentWithDerived getSampleInfo(final String sessionToken, final TechId sampleId) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/shared/ResourceNames.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/shared/ResourceNames.java index c98f88e01575a923410e0b987a294d589b5c8a82..9c050fd6205e68a99610e2695a5e1d7c7f09275e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/shared/ResourceNames.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/shared/ResourceNames.java @@ -19,9 +19,8 @@ package ch.systemsx.cisd.openbis.plugin.demo.shared; /** * Resource name used in <i>demo</i> plug-in. * <p> - * Be aware about the uniqueness of the bean names loaded by <i>Spring</i>. Names defined here - * should not conflict with already existing bean names. Look for other <code>ResourceNames</code> - * classes. + * Be aware about the uniqueness of the bean names loaded by <i>Spring</i>. Names defined here should not conflict with already existing bean names. + * Look for other <code>ResourceNames</code> classes. * </p> * * @author Christian Ribeaud diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/DelegatedClientPlugin.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/DelegatedClientPlugin.java index ad865252e5c6c22c9959a489d2ba84d442e660cd..051ba0bec7914cc4c26cd5e9393e4e781a1053d2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/DelegatedClientPlugin.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/DelegatedClientPlugin.java @@ -33,8 +33,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.api.IManagedInputWidgetDescription; /** - * delegates all operations to generic plugin, should be subclasssed and the needed functionality - * can override the default behaviour + * delegates all operations to generic plugin, should be subclasssed and the needed functionality can override the default behaviour */ public class DelegatedClientPlugin<T extends BasicEntityType> implements IClientPlugin<T, IIdAndCodeHolder> diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/DataSetRelationshipBrowser.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/DataSetRelationshipBrowser.java index 9beea2bbf300acce366f9363931da3318f0ea5f9..1e25cd40b6fa3154b6d7999d3627fb9c0da09785 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/DataSetRelationshipBrowser.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/DataSetRelationshipBrowser.java @@ -32,8 +32,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AbstractExternalData; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRowWithObject; /** - * {@link AbstractExternalDataGrid} containing data sets directly connected with a specified data - * set being in a specified relationship role (parent/child). + * {@link AbstractExternalDataGrid} containing data sets directly connected with a specified data set being in a specified relationship role + * (parent/child). * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewer.java index 2451756fcbe3aa5b09a795237f253bfe7069d3d8..28f2552ef692e60cdc1725bc81c7c34490add9b9 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewer.java @@ -133,7 +133,7 @@ abstract public class GenericDataSetViewer extends AbstractViewerWithVerticalSpl { Widget spaceBreadcrumb = createSpaceLink(originalData.getSpace()); widgets.add(spaceBreadcrumb); - + Experiment experiment = originalData.getExperiment(); if (experiment != null) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/AbstractGenericExperimentRegisterEditForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/AbstractGenericExperimentRegisterEditForm.java index 0650a729d453437ba4871f1f4e539bb795d3e463..0721f1ed2caf47d4c94cd1ee26483de9a945e31b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/AbstractGenericExperimentRegisterEditForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/AbstractGenericExperimentRegisterEditForm.java @@ -65,8 +65,7 @@ import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.IGenericClientS import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.AbstractGenericEntityRegistrationForm; /** - * A {@link AbstractGenericEntityRegistrationForm} extension for registering and editing - * experiments. + * A {@link AbstractGenericEntityRegistrationForm} extension for registering and editing experiments. * * @author Izabela Adamczyk */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ExperimentPropertiesPanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ExperimentPropertiesPanel.java index dbd06b0a23d7c038bf736952808532b316ec2756..30611d60617e47277229977288a092a0973a17d5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ExperimentPropertiesPanel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ExperimentPropertiesPanel.java @@ -157,16 +157,16 @@ public class ExperimentPropertiesPanel extends ContentPanel public DatabaseModificationKind[] getRelevantModifications() { return new DatabaseModificationKind[] - { - DatabaseModificationKind.edit(ObjectKind.EXPERIMENT), - DatabaseModificationKind.createOrDelete(ObjectKind.EXPERIMENT), - DatabaseModificationKind - .createOrDelete(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), - DatabaseModificationKind.edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), - DatabaseModificationKind.createOrDelete(ObjectKind.VOCABULARY_TERM), - DatabaseModificationKind.edit(ObjectKind.VOCABULARY_TERM), - DatabaseModificationKind.createOrDelete(ObjectKind.METAPROJECT), - DatabaseModificationKind.edit(ObjectKind.METAPROJECT) }; + { + DatabaseModificationKind.edit(ObjectKind.EXPERIMENT), + DatabaseModificationKind.createOrDelete(ObjectKind.EXPERIMENT), + DatabaseModificationKind + .createOrDelete(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), + DatabaseModificationKind.edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), + DatabaseModificationKind.createOrDelete(ObjectKind.VOCABULARY_TERM), + DatabaseModificationKind.edit(ObjectKind.VOCABULARY_TERM), + DatabaseModificationKind.createOrDelete(ObjectKind.METAPROJECT), + DatabaseModificationKind.edit(ObjectKind.METAPROJECT) }; } @Override diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/PropertiesEditor.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/PropertiesEditor.java index 0f6e4afd89e0d97bd256b2176357fa3100c0493a..23211a8ef3c201cda1aadd447f5a86e265757353 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/PropertiesEditor.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/PropertiesEditor.java @@ -227,8 +227,7 @@ abstract public class PropertiesEditor<T extends EntityType, S extends EntityTyp } /** - * Returns a list of fields appropriate for entity type - property type assignments specific to - * given {@link PropertiesEditor}. + * Returns a list of fields appropriate for entity type - property type assignments specific to given {@link PropertiesEditor}. */ public final List<DatabaseModificationAwareField<?>> getPropertyFields() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/material/GenericMaterialViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/material/GenericMaterialViewer.java index 93d238683d081a34e28f6c7458bb219e73cb002a..6872e36e1f52c47d42f60f1096bbf743f9448c88 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/material/GenericMaterialViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/material/GenericMaterialViewer.java @@ -147,8 +147,7 @@ abstract public class GenericMaterialViewer extends AbstractViewerWithVerticalSp } /** - * To be subclassed. Creates additional panels of the viewer in the right side section besides - * components, datasets and attachments + * To be subclassed. Creates additional panels of the viewer in the right side section besides components, datasets and attachments */ protected List<TabContent> createAdditionalSectionPanels(Material material) { @@ -262,15 +261,15 @@ abstract public class GenericMaterialViewer extends AbstractViewerWithVerticalSp public DatabaseModificationKind[] getRelevantModifications() { return new DatabaseModificationKind[] - { - DatabaseModificationKind.edit(ObjectKind.MATERIAL), - DatabaseModificationKind - .createOrDelete(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), - DatabaseModificationKind.edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), - DatabaseModificationKind.createOrDelete(ObjectKind.VOCABULARY_TERM), - DatabaseModificationKind.edit(ObjectKind.VOCABULARY_TERM), - DatabaseModificationKind.createOrDelete(ObjectKind.METAPROJECT), - DatabaseModificationKind.edit(ObjectKind.METAPROJECT) }; + { + DatabaseModificationKind.edit(ObjectKind.MATERIAL), + DatabaseModificationKind + .createOrDelete(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), + DatabaseModificationKind.edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), + DatabaseModificationKind.createOrDelete(ObjectKind.VOCABULARY_TERM), + DatabaseModificationKind.edit(ObjectKind.VOCABULARY_TERM), + DatabaseModificationKind.createOrDelete(ObjectKind.METAPROJECT), + DatabaseModificationKind.edit(ObjectKind.METAPROJECT) }; } @Override diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/EntityConnectionTypeProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/EntityConnectionTypeProvider.java index 123c3509e4132a871fd98e5706a456ebba3090f5..f2f674715f8f20b82e72a4774e296c33398fa3d5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/EntityConnectionTypeProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/EntityConnectionTypeProvider.java @@ -25,8 +25,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDele import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDirectlyConnectedController; /** - * Class capsulating a {@link CheckBox} and delegating check box changes to an associated - * {@link IDelegatedAction}. + * Class capsulating a {@link CheckBox} and delegating check box changes to an associated {@link IDelegatedAction}. * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java index 107d6891d91b1d1227c67789a030f6582d2b2f14..106b47a9d87df50ff310eda6a70b2acdc1ee038f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java @@ -184,19 +184,19 @@ abstract public class GenericSampleViewer extends AbstractViewerWithVerticalSpli List<TechId> sampleIds = new ArrayList<TechId>(Arrays.asList(TechId.create(getOriginalData()))); viewContext.getCommonService().getSampleChildrenInfo(sampleIds, true, new AbstractAsyncCallback<List<SampleChildrenInfo>>(viewContext) - { - @Override - protected void process(List<SampleChildrenInfo> info) - { - SampleChildrenInfo sampleInfo = info.get(0); + { + @Override + protected void process(List<SampleChildrenInfo> info) + { + SampleChildrenInfo sampleInfo = info.get(0); - additionalMessage.append(EntityDeletionConfirmationUtils.getMessageForSingleSample(sampleInfo)); + additionalMessage.append(EntityDeletionConfirmationUtils.getMessageForSingleSample(sampleInfo)); - new SampleListDeletionConfirmationDialog(getViewContext() - .getCommonViewContext(), getOriginalDataAsSingleton(), callback, - getOriginalData(), additionalMessage.toString()).show(); - } - }); + new SampleListDeletionConfirmationDialog(getViewContext() + .getCommonViewContext(), getOriginalDataAsSingleton(), callback, + getOriginalData(), additionalMessage.toString()).show(); + } + }); } })); addToolBarButton(createRevertDeletionButton(new IDelegatedAction() diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientService.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientService.java index e6501d400107a687e869ec41b70ae35cdba65e6a..8ccd75f054a6384c729d5d341cb1ae1328c44410 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientService.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientService.java @@ -294,7 +294,7 @@ public class GenericClientService extends AbstractClientService implements IGene private void updateTemporaryCodes(final String sessionToken, BatchSamplesOperation info) { - // TODO FJE: Do the update in single queue which is also fed by the + // TODO FJE: Do the update in single queue which is also fed by the // BatchSampleRegistrationTempCodeUpdaterTask // 1. Fill Structure Map<String, List<String>> sampleTypeCodeToTemporaryIdentifiers = new HashMap<String, List<String>>(); @@ -546,7 +546,7 @@ public class GenericClientService extends AbstractClientService implements IGene { files.add(new NamedInputStream(f.getInputStream(), f.getOriginalFilename())); } - + BatchSamplesOperation batchSamplesOperation = SampleUploadSectionsParser.prepareSamples(sampleType, files, defaultGroupIdentifier, sampleCodeGeneratorOrNull, allowExperiments, diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientServiceServlet.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientServiceServlet.java index 33610c755e0de96a38750910fd651c3ffbb691ab..0ed383b19bc8b8f321c7a966110532032bc1a472 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientServiceServlet.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientServiceServlet.java @@ -29,16 +29,15 @@ import ch.systemsx.cisd.openbis.plugin.generic.shared.ResourceNames; /** * The {@link GWTRPCServiceExporter} for the <i>generic</i> service. * <p> - * <i>URL</i> mappings are: <code>/generic</code> and <code>/openbis/generic</code>. The - * encapsulated {@link ICommonClientService} service implementation is expected to be defined as - * bean with name <code>generic-service</code>. + * <i>URL</i> mappings are: <code>/generic</code> and <code>/openbis/generic</code>. The encapsulated {@link ICommonClientService} service + * implementation is expected to be defined as bean with name <code>generic-service</code>. * </p> * * @author Christian Ribeaud */ @Controller @RequestMapping( - { "/generic", "/openbis/generic" }) +{ "/generic", "/openbis/generic" }) public final class GenericClientServiceServlet extends GWTRPCServiceExporter { private static final long serialVersionUID = 1L; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/parser/UpdatedDataSetParserObjectFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/parser/UpdatedDataSetParserObjectFactory.java index 85c024e16f8f96125937a2af1b0494300ab7ea79..27a5bada53bcab04bce72b2f056698a79a7fde94 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/parser/UpdatedDataSetParserObjectFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/parser/UpdatedDataSetParserObjectFactory.java @@ -89,8 +89,8 @@ public final class UpdatedDataSetParserObjectFactory extends } /** - * Prepares details about which values should be updated in general taking into account only the - * information about availability of columns in the file. + * Prepares details about which values should be updated in general taking into account only the information about availability of columns in the + * file. */ private DataSetBatchUpdateDetails createBasicBatchUpdateDetails() { @@ -104,8 +104,8 @@ public final class UpdatedDataSetParserObjectFactory extends } /** - * Returns details about which values should be updated for the specified data set. If a cell - * was left empty in the file the corresponding value will not be modified. + * Returns details about which values should be updated for the specified data set. If a cell was left empty in the file the corresponding value + * will not be modified. */ private DataSetBatchUpdateDetails createBatchUpdateDetails(NewDataSet dataSet) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/AbstractGenericServerPlugin.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/AbstractGenericServerPlugin.java index c0613108bdd8d3fad43818510834796f9d88f7aa..9e234ad1547e93905351323f899ab4fbade3eb81 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/AbstractGenericServerPlugin.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/AbstractGenericServerPlugin.java @@ -22,9 +22,7 @@ import ch.systemsx.cisd.openbis.generic.server.plugin.IServerPlugin; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; /** - * - * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ abstract class AbstractGenericServerPlugin implements IServerPlugin { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericDataSetServerPlugin.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericDataSetServerPlugin.java index e80f30253664641599845845afcf1384d53e1492..e5a8147729ee524440dfeee5c690264d7011583e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericDataSetServerPlugin.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericDataSetServerPlugin.java @@ -26,7 +26,7 @@ import ch.systemsx.cisd.openbis.generic.server.plugin.IDataSetTypeSlaveServerPlu /** * The default {@link IDataSetServerPlugin} implementation for the <i>generic</i> technology. * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ @Component(ch.systemsx.cisd.openbis.generic.shared.ResourceNames.GENERIC_DATA_SET_SERVER_PLUGIN) public class GenericDataSetServerPlugin extends AbstractGenericServerPlugin implements diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServer.java index f68105915608eba1e4995a778d5118c38ffb2069..2713cccc6b4f214f152d214284a1b54508e1942d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServer.java @@ -293,8 +293,7 @@ public final class GenericServer extends AbstractServer<IGenericServerInternal> @Override @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) public AbstractExternalData getDataSetInfo(String sessionToken, - @AuthorizationGuard(guardClass = DataSetTechIdPredicate.class) - TechId datasetId) + @AuthorizationGuard(guardClass = DataSetTechIdPredicate.class) TechId datasetId) { return commonServer.getDataSetInfo(sessionToken, datasetId); } @@ -302,8 +301,7 @@ public final class GenericServer extends AbstractServer<IGenericServerInternal> @Override @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) public AttachmentWithContent getExperimentFileAttachment(String sessionToken, - @AuthorizationGuard(guardClass = ExperimentTechIdPredicate.class) - TechId experimentId, String filename, Integer versionOrNull) + @AuthorizationGuard(guardClass = ExperimentTechIdPredicate.class) TechId experimentId, String filename, Integer versionOrNull) throws UserFailureException { final Session session = getSession(sessionToken); @@ -734,8 +732,7 @@ public final class GenericServer extends AbstractServer<IGenericServerInternal> @Override @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) public AttachmentWithContent getProjectFileAttachment(String sessionToken, - @AuthorizationGuard(guardClass = ProjectTechIdPredicate.class) - TechId projectId, String fileName, Integer versionOrNull) + @AuthorizationGuard(guardClass = ProjectTechIdPredicate.class) TechId projectId, String fileName, Integer versionOrNull) { final Session session = getSession(sessionToken); final IProjectBO bo = businessObjectFactory.createProjectBO(session); @@ -747,8 +744,7 @@ public final class GenericServer extends AbstractServer<IGenericServerInternal> @Override @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) public AttachmentWithContent getSampleFileAttachment(String sessionToken, - @AuthorizationGuard(guardClass = SampleTechIdPredicate.class) - TechId sampleId, String fileName, Integer versionOrNull) + @AuthorizationGuard(guardClass = SampleTechIdPredicate.class) TechId sampleId, String fileName, Integer versionOrNull) { final Session session = getSession(sessionToken); final ISampleBO bo = businessObjectFactory.createSampleBO(session); @@ -779,8 +775,7 @@ public final class GenericServer extends AbstractServer<IGenericServerInternal> @RolesAllowed(RoleWithHierarchy.SPACE_USER) @Capability("WRITE_EXPERIMENT_SAMPLE") public ExperimentUpdateResult updateExperiment(String sessionToken, - @AuthorizationGuard(guardClass = ExperimentUpdatesPredicate.class) - ExperimentUpdatesDTO updates) + @AuthorizationGuard(guardClass = ExperimentUpdatesPredicate.class) ExperimentUpdatesDTO updates) { final Session session = getSession(sessionToken); if (updates.isRegisterSamples()) @@ -810,8 +805,7 @@ public final class GenericServer extends AbstractServer<IGenericServerInternal> @Override @RolesAllowed(RoleWithHierarchy.SPACE_USER) public SampleUpdateResult updateSample(String sessionToken, - @AuthorizationGuard(guardClass = SampleUpdatesPredicate.class) - SampleUpdatesDTO updates) + @AuthorizationGuard(guardClass = SampleUpdatesPredicate.class) SampleUpdatesDTO updates) { return commonServer.updateSample(sessionToken, updates); } @@ -820,8 +814,7 @@ public final class GenericServer extends AbstractServer<IGenericServerInternal> @RolesAllowed(RoleWithHierarchy.SPACE_POWER_USER) @Capability("WRITE_DATASET") public DataSetUpdateResult updateDataSet(String sessionToken, - @AuthorizationGuard(guardClass = DataSetUpdatesPredicate.class) - DataSetUpdatesDTO updates) + @AuthorizationGuard(guardClass = DataSetUpdatesPredicate.class) DataSetUpdatesDTO updates) { return commonServer.updateDataSet(sessionToken, updates); } @@ -1020,14 +1013,17 @@ public final class GenericServer extends AbstractServer<IGenericServerInternal> Map<String, SpacePE> spaceCache = new HashMap<String, SpacePE>(); Map<String, List<String>> spaceToOldSampleCodes = new HashMap<String, List<String>>(); Map<String, String> identifiersToNewSampleCodes = new HashMap<String, String>(); - + // Generate Updates for each space and build helper maps - for(String sampleTypeCode : sampleTypeCodeToTemporaryIdentifiers.keySet()) { + for (String sampleTypeCode : sampleTypeCodeToTemporaryIdentifiers.keySet()) + { String codePrefix = getGeneratedCodePrefix(sessionToken, sampleTypeCode); List<String> temporaryIdentifiers = sampleTypeCodeToTemporaryIdentifiers.get(sampleTypeCode); int numberOfCodesToGenerate = temporaryIdentifiers.size(); - List<String> newCodes = new SampleCodeGeneratorByType(getDAOFactory()).generateCodes(codePrefix, ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind.SAMPLE, numberOfCodesToGenerate); - for(int tIdx = 0; tIdx < numberOfCodesToGenerate; tIdx++) + List<String> newCodes = + new SampleCodeGeneratorByType(getDAOFactory()).generateCodes(codePrefix, + ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind.SAMPLE, numberOfCodesToGenerate); + for (int tIdx = 0; tIdx < numberOfCodesToGenerate; tIdx++) { String tempIdentifier = temporaryIdentifiers.get(tIdx); String spaceCode = tempIdentifier.split("/")[1]; @@ -1048,7 +1044,7 @@ public final class GenericServer extends AbstractServer<IGenericServerInternal> identifiersToNewSampleCodes.put(tempIdentifier, newCodes.get(tIdx)); } } - + // Retrieve all sample PE objects List<SamplePE> allSamplesPE = new ArrayList<SamplePE>(); for (String spaceCode : spaceToOldSampleCodes.keySet()) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServerLogger.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServerLogger.java index c736c6567b439d3a6043fc40521dd3c6cef0225c..91cad13420e6999b5f319d903db0d5c79eed1f4c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServerLogger.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServerLogger.java @@ -268,7 +268,7 @@ final class GenericServerLogger extends AbstractServerLogger implements IGeneric logTracking(sessionToken, "update_experiments", "TYPE(%s) EXPERIMENTS(%s)", experiments .getExperimentType().getCode(), experiments.getUpdatedExperiments().size()); } - + @Override public void registerOrUpdateSamplesAndMaterials(final String sessionToken, final List<NewSamplesWithTypes> newSamplesWithType, diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServiceServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServiceServer.java index 491e68ad6c247f05eb4f3f463d66c9a562ce442f..03e496ba5db90a131c5e30a93d30e6fec5cca1ef 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServiceServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/server/GenericServiceServer.java @@ -48,10 +48,11 @@ public class GenericServiceServer extends WhiteAndBlackListHttpInvokerServiceExp } @RequestMapping( - { "/rmi-plugin-generic", "/openbis/rmi-plugin-generic" }) + { "/rmi-plugin-generic", "/openbis/rmi-plugin-generic" }) @Override public void handleRequest(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { + throws ServletException, IOException + { super.handleRequest(request, response); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/shared/IGenericServerInternal.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/shared/IGenericServerInternal.java index e7b9d5fb82280f84c8cebd2ce8ba86b39b8abb59..28627563be03bcba93fc216372bfd6f722462e0c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/shared/IGenericServerInternal.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/shared/IGenericServerInternal.java @@ -25,8 +25,6 @@ import ch.systemsx.cisd.openbis.generic.shared.DatabaseUpdateModification; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.ObjectKind; /** - * - * * @author Franz-Josef Elmer */ public interface IGenericServerInternal extends IGenericServer diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/shared/ResourceNames.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/shared/ResourceNames.java index 51c93e0716ee021004f767bb37bfdaad3504959b..66a443fc534a90051609cce2aa6f3611752cd2ca 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/shared/ResourceNames.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/shared/ResourceNames.java @@ -19,9 +19,8 @@ package ch.systemsx.cisd.openbis.plugin.generic.shared; /** * Resource name used in <i>generic</i> plug-in. * <p> - * Be aware about the uniqueness of the bean names loaded by <i>Spring</i>. Names defined here - * should not conflict with already existing bean names. Look for other <code>ResourceNames</code> - * classes. + * Be aware about the uniqueness of the bean names loaded by <i>Spring</i>. Names defined here should not conflict with already existing bean names. + * Look for other <code>ResourceNames</code> classes. * </p> * * @author Christian Ribeaud diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/api/v1/IQueryApiFacade.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/api/v1/IQueryApiFacade.java index 079dd9726c4470b9006693e1e384b860ef541180..79c6d5eab87243c2c9bda3f98820dd804568ceb9 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/api/v1/IQueryApiFacade.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/api/v1/IQueryApiFacade.java @@ -58,18 +58,17 @@ public interface IQueryApiFacade public List<ReportDescription> listTableReportDescriptions(); /** - * Creates for the specified data sets and specified report description a report. Available - * report descriptions can be obtained by {@link #listTableReportDescriptions()}. + * Creates for the specified data sets and specified report description a report. Available report descriptions can be obtained by + * {@link #listTableReportDescriptions()}. */ @Retry public QueryTableModel createReportFromDataSets(ReportDescription reportDescription, List<String> dataSetCodes); /** - * Creates for the specified data sets and specified report key a report. It groups the data - * sets by a data store and creates a report for each group of objects on appropriate data store - * server. Results from the data stores are combined and returned as a result of this method. - * Available report keys can be obtained by {@link #listTableReportDescriptions()}. + * Creates for the specified data sets and specified report key a report. It groups the data sets by a data store and creates a report for each + * group of objects on appropriate data store server. Results from the data stores are combined and returned as a result of this method. Available + * report keys can be obtained by {@link #listTableReportDescriptions()}. */ @Retry public QueryTableModel createReportFromDataSets(String reportKey, List<String> dataSetCodes); @@ -87,9 +86,8 @@ public interface IQueryApiFacade public List<AggregationServiceDescription> listAggregationServices(); /** - * Executes the specified aggregation or ingestion service for the specified parameters and - * creates a report. Available service descriptions can be obtained by - * {@link #listAggregationServices()}. + * Executes the specified aggregation or ingestion service for the specified parameters and creates a report. Available service descriptions can + * be obtained by {@link #listAggregationServices()}. */ @Retry public QueryTableModel createReportFromAggregationService( diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/IQueryClientService.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/IQueryClientService.java index f3c5b547b085d5158158975afd3dd70f4e2ae15a..8b2f904cfe311dc99587e64a46aff2d945e0d111 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/IQueryClientService.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/IQueryClientService.java @@ -38,9 +38,8 @@ import ch.systemsx.cisd.openbis.plugin.query.shared.basic.dto.QueryParameterBind /** * Service interface for the query module GWT client. * <p> - * Each method should declare throwing {@link UserFailureException}. The authorization framework can - * throw it when the user has insufficient privileges. If it is not marked, the GWT client will - * report unexpected exception. + * Each method should declare throwing {@link UserFailureException}. The authorization framework can throw it when the user has insufficient + * privileges. If it is not marked, the GWT client will report unexpected exception. * </p> * * @author Piotr Buczek diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/IQueryClientServiceAsync.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/IQueryClientServiceAsync.java index 2d6aea7ea64e4f64f156316dc650bc35370d697d..4817369641a0529868c610e8874f70ea751e4e7e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/IQueryClientServiceAsync.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/IQueryClientServiceAsync.java @@ -54,8 +54,7 @@ public interface IQueryClientServiceAsync extends IClientServiceAsync AsyncCallback<TableModelReference> callback); /** - * @see IQueryClientService#createQueryResultsReport(QueryDatabase, String, - * QueryParameterBindings) + * @see IQueryClientService#createQueryResultsReport(QueryDatabase, String, QueryParameterBindings) */ public void createQueryResultsReport(QueryDatabase queryDatabase, String sqlQuery, QueryParameterBindings bindingsOrNull, AsyncCallback<TableModelReference> callback); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/Dict.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/Dict.java index 3e5f277debd240be407ec67e2d3250ea87bf6f5b..a51620ee10be87361f07a0b4a9119cb0ba63430d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/Dict.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/Dict.java @@ -17,8 +17,7 @@ package ch.systemsx.cisd.openbis.plugin.query.client.web.client.application; /** - * An {@link ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict} extension for - * <i>query</i> specific message keys. + * An {@link ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict} extension for <i>query</i> specific message keys. * * @author Christian Ribeaud */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/module/QueryDatabaseSelectionWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/module/QueryDatabaseSelectionWidget.java index 3db3d9db74b281ebe8e4571f69104ae234f2a7b3..d2e35a2cef1bb166de7f5203d6df6cbd95b20840 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/module/QueryDatabaseSelectionWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/module/QueryDatabaseSelectionWidget.java @@ -85,7 +85,7 @@ public final class QueryDatabaseSelectionWidget extends return DatabaseModificationKind.any(ObjectKind.QUERY); } - // + // // initial value support // diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/dto/QueryBrowserGridColumnIDs.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/dto/QueryBrowserGridColumnIDs.java index 9500051c736972c160581679e4b2b93f77585a1e..c430925f3c6f0853ee2b167988a9545f97b73bd3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/dto/QueryBrowserGridColumnIDs.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/dto/QueryBrowserGridColumnIDs.java @@ -26,12 +26,20 @@ import ch.systemsx.cisd.openbis.plugin.query.client.web.client.application.modul public class QueryBrowserGridColumnIDs { public static final String NAME = "NAME"; + public static final String DESCRIPTION = "DESCRIPTION"; + public static final String SQL_QUERY = "SQL_QUERY"; + public static final String IS_PUBLIC = "IS_PUBLIC"; + public static final String QUERY_TYPE = "QUERY_TYPE"; + public static final String ENTITY_TYPE = "ENTITY_TYPE"; + public static final String QUERY_DATABASE = "QUERY_DATABASE"; + public static final String REGISTRATOR = "REGISTRATOR"; + public static final String REGISTRATION_DATE = "REGISTRATION_DATE"; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/server/QueryClientServiceServlet.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/server/QueryClientServiceServlet.java index 935833b48dadf039b520f287c39502e817b9da56..377ee0f755b2f014c763ac94d6edafc6d10f6419 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/server/QueryClientServiceServlet.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/server/QueryClientServiceServlet.java @@ -29,16 +29,15 @@ import ch.systemsx.cisd.openbis.plugin.query.shared.ResourceNames; /** * The {@link GWTRPCServiceExporter} for the <i>query</i> service. * <p> - * <i>URL</i> mappings are: <code>/query</code> and <code>/openbis/query</code>. The encapsulated - * {@link ICommonClientService} service implementation is expected to be defined as bean with name - * <code>query-plugin-service</code>. + * <i>URL</i> mappings are: <code>/query</code> and <code>/openbis/query</code>. The encapsulated {@link ICommonClientService} service implementation + * is expected to be defined as bean with name <code>query-plugin-service</code>. * </p> * * @author Christian Ribeaud */ @Controller @RequestMapping( - { "/query", "/openbis/query" }) +{ "/query", "/openbis/query" }) public final class QueryClientServiceServlet extends GWTRPCServiceExporter { private static final long serialVersionUID = 1L; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/server/DAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/server/DAO.java index e537f82a4dcf68a05b6ba9621002bc52b41669de..f2609258191aa2c4bb33e8d4420b2971c281dc0a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/server/DAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/server/DAO.java @@ -264,9 +264,8 @@ class DAO extends SimpleJdbcDaoSupport implements IDAO /** * A class for figuring out the parameter type. * <p> - * Note that some JDBC drivers (like the one from Oracle) have - * {@link ParameterMetaData#getParameterType(int)} not implemented and thus requires setting it - * explicitly in the variable metadata. + * Note that some JDBC drivers (like the one from Oracle) have {@link ParameterMetaData#getParameterType(int)} not implemented and thus requires + * setting it explicitly in the variable metadata. */ private static class ParameterTypeProvider { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/server/api/v1/QueryServiceJsonServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/server/api/v1/QueryServiceJsonServer.java index 222e3fdba2cda62446a4279653893482d2e479ee..b4c79fc81fb84b4aec8aa68c97210336a6abccc9 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/server/api/v1/QueryServiceJsonServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/server/api/v1/QueryServiceJsonServer.java @@ -56,11 +56,12 @@ public class QueryServiceJsonServer extends AbstractApiJsonServiceExporter } @RequestMapping( - { IQueryApiServer.JSON_SERVICE_URL, "/openbis" + IQueryApiServer.JSON_SERVICE_URL }) + { IQueryApiServer.JSON_SERVICE_URL, "/openbis" + IQueryApiServer.JSON_SERVICE_URL }) @Override public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, - IOException { + IOException + { super.handleRequest(request, response); - } + } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/server/api/v1/ResourceNames.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/server/api/v1/ResourceNames.java index aa4c659946a51da805023ac065b6d645d760b383..d41255c5add131e2f2370e3cb868d973e9069174 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/server/api/v1/ResourceNames.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/server/api/v1/ResourceNames.java @@ -17,8 +17,6 @@ package ch.systemsx.cisd.openbis.plugin.query.server.api.v1; /** - * - * * @author Franz-Josef Elmer */ public class ResourceNames diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/server/authorization/resultfilter/QueryResultFilter.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/server/authorization/resultfilter/QueryResultFilter.java index 964d38b364fc1b7bbadf0650b7cd6f2e2955ba9b..be4ebf4f9e5a3141a0fb435c016efa7246e3e73b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/server/authorization/resultfilter/QueryResultFilter.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/server/authorization/resultfilter/QueryResultFilter.java @@ -37,8 +37,8 @@ import ch.systemsx.cisd.openbis.plugin.query.server.authorization.AuthorizationC import ch.systemsx.cisd.openbis.plugin.query.server.authorization.IAuthorizationChecker; /** - * Filters the rows of {@link TableModel} on magic columns (experiment, sample or data set - * referenced by 'experiment_key', 'sample_key', 'data_set_key'). + * Filters the rows of {@link TableModel} on magic columns (experiment, sample or data set referenced by 'experiment_key', 'sample_key', + * 'data_set_key'). * * @author Izabela Adamczyk */ @@ -49,7 +49,7 @@ public class QueryResultFilter private final IAuthorizationChecker authorizationChecker; private static final EntityKind[] FILTRABLE_ENTITY_KINDS = - { EntityKind.EXPERIMENT, EntityKind.SAMPLE, EntityKind.DATA_SET }; + { EntityKind.EXPERIMENT, EntityKind.SAMPLE, EntityKind.DATA_SET }; public QueryResultFilter(IDAOFactory daoFactory) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/IQueryDatabaseDefinitionProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/IQueryDatabaseDefinitionProvider.java index 2e01a350053e7b6e0e500d827c1f718f86a9953e..0720c922eae2bc36ca9ad90c4481753215d22d2c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/IQueryDatabaseDefinitionProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/IQueryDatabaseDefinitionProvider.java @@ -33,8 +33,7 @@ public interface IQueryDatabaseDefinitionProvider void initDatabaseDefinitions(); /** - * Returns {@link DatabaseDefinition} configured for given <var>dbKey</var> or null if such a - * definition doesn't exist. + * Returns {@link DatabaseDefinition} configured for given <var>dbKey</var> or null if such a definition doesn't exist. * * @throws UserFailureException if this provider wasn't initialized before */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/ResourceNames.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/ResourceNames.java index a622d2f8da89b655b3462eeb0d4d5e1ee0f8de9f..3177410c7208ac981949f8bd74fe8e9ef80c317b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/ResourceNames.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/ResourceNames.java @@ -19,9 +19,8 @@ package ch.systemsx.cisd.openbis.plugin.query.shared; /** * Resource name used in <i>query</i> plug-in. * <p> - * Be aware about the uniqueness of the bean names loaded by <i>Spring</i>. Names defined here - * should not conflict with already existing bean names. Look for other <code>ResourceNames</code> - * classes. + * Be aware about the uniqueness of the bean names loaded by <i>Spring</i>. Names defined here should not conflict with already existing bean names. + * Look for other <code>ResourceNames</code> classes. * </p> * * @author Franz-Josef Elmer diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/api/v1/IQueryApiServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/api/v1/IQueryApiServer.java index d4b3a367532c55ea6c5cd82b693c9d6796139896..f2442a1389582742bc25dad185ef1f2c098fa1fe 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/api/v1/IQueryApiServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/api/v1/IQueryApiServer.java @@ -48,8 +48,7 @@ public interface IQueryApiServer extends IRpcService public static final String JSON_SERVICE_URL = QUERY_PLUGIN_SERVER_URL + ".json"; /** - * Tries to authenticate specified user with specified password. Returns session token if - * succeeded otherwise <code>null</code> is returned. + * Tries to authenticate specified user with specified password. Returns session token if succeeded otherwise <code>null</code> is returned. */ @Transactional // this is not a readOnly transaction - it can create new users @@ -83,8 +82,7 @@ public interface IQueryApiServer extends IRpcService public List<ReportDescription> listTableReportDescriptions(String sessionToken); /** - * Creates for the specified data sets a report. Available reports can be obtained by - * {@link #listTableReportDescriptions(String)}. + * Creates for the specified data sets a report. Available reports can be obtained by {@link #listTableReportDescriptions(String)}. * * @param dataStoreCode Code of the data store. * @param serviceKey Key of the data store service. @@ -95,10 +93,9 @@ public interface IQueryApiServer extends IRpcService String serviceKey, List<String> dataSetCodes); /** - * Creates for the specified data sets a report. It groups the data sets by a data store and - * creates a report for each group of objects on appropriate data store server. Results from the - * data stores are combined and returned as a result of this method. Available report keys can - * be obtained by {@link #listTableReportDescriptions(String)}. + * Creates for the specified data sets a report. It groups the data sets by a data store and creates a report for each group of objects on + * appropriate data store server. Results from the data stores are combined and returned as a result of this method. Available report keys can be + * obtained by {@link #listTableReportDescriptions(String)}. * * @param serviceKey Key of the data store service. * @since 1.6 @@ -116,10 +113,8 @@ public interface IQueryApiServer extends IRpcService public List<AggregationServiceDescription> listAggregationServices(String sessionToken); /** - * Executes the specified aggregation or ingestion service for the specified parameters and - * creates a report. Available service descriptions can be obtained by - * {@link #listAggregationServices(String)}. The service resolved to by the serviceKey must be a - * service of type REPORT. + * Executes the specified aggregation or ingestion service for the specified parameters and creates a report. Available service descriptions can + * be obtained by {@link #listAggregationServices(String)}. The service resolved to by the serviceKey must be a service of type REPORT. * * @param sessionToken A valid session token. * @param dataStoreCode Code of the data store. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/api/v1/dto/QueryDescription.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/api/v1/dto/QueryDescription.java index bac747fbfe474b16d0fa9c4bca1231d13e37eb69..3346a88fbfae8109911fc6832f2a5d2955514a7f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/api/v1/dto/QueryDescription.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/api/v1/dto/QueryDescription.java @@ -26,8 +26,8 @@ import ch.systemsx.cisd.base.annotation.JsonObject; import ch.systemsx.cisd.openbis.generic.shared.api.v1.util.JsonPropertyUtil; /** - * Description of a query. Contains everything needed on client side to show to the user what - * queries are available, to specify parameter bindings, and to identify a query uniquely. + * Description of a query. Contains everything needed on client side to show to the user what queries are available, to specify parameter bindings, + * and to identify a query uniquely. * * @author Franz-Josef Elmer */ @@ -102,8 +102,7 @@ public class QueryDescription implements Serializable } /** - * Returns <code>true</code> if and only if the specified object is of type - * {@link QueryDescription} and has the same ID as this. + * Returns <code>true</code> if and only if the specified object is of type {@link QueryDescription} and has the same ID as this. */ @Override public boolean equals(Object obj) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/api/v1/dto/QueryTableModel.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/api/v1/dto/QueryTableModel.java index 077b258f3dcadf7d291df0d452c35165875a2380..1876c4f48a81f72950be4b38d9151d467a6eddc6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/api/v1/dto/QueryTableModel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/shared/api/v1/dto/QueryTableModel.java @@ -60,8 +60,7 @@ public class QueryTableModel implements Serializable /** * Adds a row of values. * - * @throws IllegalArgumentException if the number of values is not the same as the number of - * columns. + * @throws IllegalArgumentException if the number of values is not the same as the number of columns. */ public void addRow(Serializable[] values) { @@ -99,8 +98,7 @@ public class QueryTableModel implements Serializable } /** - * Jackson cannot deserialize things typed as Serializable because it has no idea what the - * correct type might be. + * Jackson cannot deserialize things typed as Serializable because it has no idea what the correct type might be. * <p> * Thus we convert the values to strings and add type information. */ diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/generic/server/asapi/v3/cache/SearchCacheTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/generic/server/asapi/v3/cache/SearchCacheTest.java index fd64a8caffbfd088820891bd8815fb921d9039e0..eeb7bd655b3128fa13e8062f9ba0c617b2bb8a30 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/generic/server/asapi/v3/cache/SearchCacheTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/generic/server/asapi/v3/cache/SearchCacheTest.java @@ -208,7 +208,7 @@ public class SearchCacheTest final CacheManager manager = new CacheManager(new ByteArrayInputStream(managerConfig.getBytes())); SearchCache cache = new SearchCache( - new RuntimeCache<Serializable, Serializable>(manager, SearchCache.CACHE_NAME, + new RuntimeCache<Serializable, Serializable>(manager, SearchCache.CACHE_NAME, SearchCache.CACHE_SIZE_PROPERTY_NAME) { @Override diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/AbstractSearchMethodExecutorTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/AbstractSearchMethodExecutorTest.java index 7707b9be848fa74566d017e50a40090be3fa2856..7945d0996f96e60aeaf8be40f0400215d75e1249 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/AbstractSearchMethodExecutorTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/AbstractSearchMethodExecutorTest.java @@ -58,7 +58,7 @@ public class AbstractSearchMethodExecutorTest private static final String SESSION_TOKEN2 = "sessionToken2"; private MessageChannel channel; - + private MessageChannel channel2; private TestSearchMethodExecutor executor; @@ -240,7 +240,7 @@ public class AbstractSearchMethodExecutorTest private Map<Thread, SearchCacheEntry<Object>> entries = new HashMap<>(); private IDelegatedAction getAction; - + private IDelegatedAction putAction; private SearchCacheEntry<Object> defaultEntry; @@ -280,7 +280,7 @@ public class AbstractSearchMethodExecutorTest } @Override - protected Collection doSearchAndTranslate(IOperationContext context, AbstractSearchCriteria criteria, + protected Collection doSearchAndTranslate(IOperationContext context, AbstractSearchCriteria criteria, FetchOptions fetchOptions) { return Collections.emptySet(); @@ -300,7 +300,7 @@ public class AbstractSearchMethodExecutorTest { this.getAction = getAction; } - + void setPutAction(IDelegatedAction putAction) { this.putAction = putAction; diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/FullSampleIdentifierTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/FullSampleIdentifierTest.java index 1706cce1642b8f4ff28eed853d1b1d8976feca9e..c0b0fae72ef8a9f4d24fc86101b7884e68e88513 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/FullSampleIdentifierTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/FullSampleIdentifierTest.java @@ -24,8 +24,6 @@ import org.testng.annotations.Test; import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.sample.FullSampleIdentifier; /** - * - * * @author Franz-Josef Elmer */ public class FullSampleIdentifierTest @@ -39,15 +37,15 @@ public class FullSampleIdentifierTest assertSampId("/SPACE1/S2"); assertSampId("/SPACE1/S2:A02"); // TODO: project samples -// assertSampId("/SPACE1/PROJECT1/S1"); -// assertSampId("/SPACE1/PROJECT1/S1:A02"); + // assertSampId("/SPACE1/PROJECT1/S1"); + // assertSampId("/SPACE1/PROJECT1/S1:A02"); assertSampIdWithHomeSpace("/HS/S1", "//s1", "HS"); assertSampIdWithHomeSpace("/HS/C1:S1", "//c1:s1", "HS"); -// assertSampIdWithHomeSpace("/HS/PROJECT1/S1", "//Project1/s1", "HS"); -// assertSampIdWithHomeSpace("/HS/PROJECT1/C1:S1", "//project1/c1:s1", "HS"); -// assertSampIdWithHomeSpace("/SP1/PROJECT1/C1:S1", "/sp1/project1/c1:s1", "HS"); + // assertSampIdWithHomeSpace("/HS/PROJECT1/S1", "//Project1/s1", "HS"); + // assertSampIdWithHomeSpace("/HS/PROJECT1/C1:S1", "//project1/c1:s1", "HS"); + // assertSampIdWithHomeSpace("/SP1/PROJECT1/C1:S1", "/sp1/project1/c1:s1", "HS"); } - + @Test public void testFailingCases() { @@ -56,17 +54,17 @@ public class FullSampleIdentifierTest assertInvalidSampId("Sample identifier has to start with a '/': A/BC", "A/BC"); assertInvalidSampId("Sample identifier can not contain more than three '/': /A/B/C/D", "/A/B/C/D"); assertInvalidSampId("Sample code can not contain more than one ':': /A/B:C:D", "/A/B:C:D"); - + assertInvalidSampId("Sample identifier don't contain any codes: ///", "///"); assertInvalidSampId("Sample identifier don't contain any codes: //", "//"); assertInvalidSampId("Sample identifier don't contain any codes: /", "/"); - + assertInvalidSampId("Space code can not be an empty string.", "//S1"); assertInvalidSampId("Project code can not be an empty string.", "/S//S1"); assertInvalidSampId("Sample code starts or ends with ':': /S/:S1", "/S/:S1"); assertInvalidSampId("Sample code starts or ends with ':': /S/C1:", "/S/C1:"); assertInvalidSampId("Sample code can not contain more than one ':': /S/C1:S1:", "/S/C1:S1:"); - + String prefix = " containing other characters than letters, numbers, '_', '-' and '.': "; assertInvalidSampId("Sample code" + prefix + "S1&*", "/S1&*"); assertInvalidSampId("Space code" + prefix + "SPA&CE1", "/SPA&CE1/S2"); @@ -74,12 +72,12 @@ public class FullSampleIdentifierTest assertInvalidSampId("Project code" + prefix + "PRO<>JECT1", "/SPACE1/PRO<>JECT1/S1"); assertInvalidSampId("Sample subcode" + prefix + "A0(2", "/SPACE1/PROJECT1/S1:A0(2"); } - + private void assertInvalidSampId(String expectedErrorMsg, String identifier) { assertInvalidSampId(expectedErrorMsg, identifier, null); } - + private void assertInvalidSampId(String expectedErrorMsg, String identifier, String homeSpaceOrNull) { try @@ -91,12 +89,12 @@ public class FullSampleIdentifierTest assertEquals(expectedErrorMsg, ex.getMessage()); } } - + private void assertSampId(String identifier) { assertEquals(new FullSampleIdentifier(identifier, null).toString(), identifier); } - + private void assertSampIdWithHomeSpace(String expectedIdentifier, String identifier, String homeSpace) { assertEquals(new FullSampleIdentifier(identifier, homeSpace).toString(), expectedIdentifier); diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/AbstractDataSetTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/AbstractDataSetTest.java index 82ee7a75e6953ab537f1850bbd509e2f442eb67f..85878b3c574ac8db8d04a48feeb012c3f9285ee4 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/AbstractDataSetTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/AbstractDataSetTest.java @@ -12,14 +12,13 @@ import ch.systemsx.cisd.common.collection.SimpleComparator; public class AbstractDataSetTest extends AbstractTest { protected static final SimpleComparator<DataSet, String> DATA_SET_COMPARATOR = new SimpleComparator<DataSet, String>() + { + @Override + public String evaluate(DataSet item) { - @Override - public String evaluate(DataSet item) - { - return item.getCode(); - } - }; - + return item.getCode(); + } + }; protected static void assertIdentifiers(Collection<DataSet> dataSets, String... expectedCodesIdentifiers) { diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/CreateExperimentTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/CreateExperimentTest.java index 605d5c75d8a03fb37a7e976662221ccc4eb323c3..54a5cc23eda09228c3d5fdd7d33db980401b4b1e 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/CreateExperimentTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/CreateExperimentTest.java @@ -258,7 +258,7 @@ public class CreateExperimentTest extends AbstractExperimentTest public void testCreateWithSystemProperty() { final String sessionToken = v3api.login(TEST_USER, PASSWORD); - + NewETPTAssignment assignment = new NewETPTAssignment(); assignment.setPropertyTypeCode("$PLATE_GEOMETRY"); assignment.setEntityTypeCode("SIRNA_HCS"); diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/CreateMaterialTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/CreateMaterialTest.java index fbfc7abe00b0ff7e9d705b626b286a1a9341bb72..2248b25283fe37efaaca286232a0f2dfea4962e8 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/CreateMaterialTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/CreateMaterialTest.java @@ -74,7 +74,7 @@ public class CreateMaterialTest extends AbstractSampleTest public void testMaterialCreationWithSystemProperty() { String sessionToken = v3api.login(TEST_USER, PASSWORD); - + NewETPTAssignment assignment = new NewETPTAssignment(); assignment.setPropertyTypeCode("$PLATE_GEOMETRY"); assignment.setEntityTypeCode("GENE"); @@ -95,7 +95,7 @@ public class CreateMaterialTest extends AbstractSampleTest Material material = map.get(new MaterialPermId("1982", "GENE")); assertEquals(material.getCode(), "1982"); assertEquals(material.getPermId().getTypeCode(), "GENE"); - + assertEquals(material.getProperty("$PLATE_GEOMETRY"), "384_WELLS_16X24"); } @@ -109,7 +109,7 @@ public class CreateMaterialTest extends AbstractSampleTest TagCode test123 = new TagCode("TEST_123"); TagCode testMetaprojects = new TagCode("TEST_METAPROJECTS"); m1.setTagIds(Arrays.asList(test123, testMetaprojects)); - + List<MaterialPermId> materialIds = v3api.createMaterials(sessionToken, Arrays.asList(m1)); MaterialFetchOptions fetchOptions = new MaterialFetchOptions(); @@ -236,6 +236,7 @@ public class CreateMaterialTest extends AbstractSampleTest } }, "Property type with code 'CODE_THAT_DOESNT_EXIST' does not exist"); } + private MaterialCreation materialCreation(MaterialPermId permId) { String code = permId.getCode(); diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/CreateSampleTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/CreateSampleTest.java index d74c97a9f5fcb8d4b7ddc00d6d9e074d0676992a..cf51c1d2d0fd41276a31a74813df436a53fbc760 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/CreateSampleTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/CreateSampleTest.java @@ -84,7 +84,7 @@ public class CreateSampleTest extends AbstractSampleTest final String sessionToken = v3api.login(TEST_USER, PASSWORD); final SampleCreation sample = sampleCreation("SAMPLE_WITH_USER_GIVEN_CODE"); sample.setAutoGeneratedCode(true); - + assertUserFailureException(new IDelegatedAction() { @Override @@ -103,12 +103,11 @@ public class CreateSampleTest extends AbstractSampleTest sample1.setAutoGeneratedCode(true); final SampleCreation sample2 = sampleCreation(null); sample2.setAutoGeneratedCode(true); - + List<SamplePermId> sampleWithAutogeneratedCode = v3api.createSamples(sessionToken, Arrays.asList(sample1, sample2)); AssertionUtil.assertCollectionSize(sampleWithAutogeneratedCode, 2); } - @Test public void testCreateWithCodeExisting() { diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/EntityDeletionTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/EntityDeletionTest.java index 6ff28dc476b87e0c171855e6a214a3fd418eebf5..d52c6bd5057330c7c9520fbf4169bf9667958f89 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/EntityDeletionTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/EntityDeletionTest.java @@ -33,7 +33,6 @@ import ch.systemsx.cisd.openbis.generic.server.business.bo.entitygraph.EntityNod import ch.systemsx.cisd.openbis.generic.server.business.bo.entitygraph.SampleNode; import ch.systemsx.cisd.openbis.systemtest.AbstractEntityDeletionTestCase; - /** * Implementation of {@link AbstractEntityDeletionTestCase} based on V3 API. * @@ -44,7 +43,7 @@ public class EntityDeletionTest extends AbstractEntityDeletionTestCase { private static final String CONTEXT_DESCRIPTION = " (Context: [])"; - + @Autowired protected IApplicationServerApi v3api; diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/GetSampleTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/GetSampleTest.java index f92321d6a6f04d5304e2288b3ea850b2fbbcd282..401b9a9fff2042ee16b541f1a109bbfc6bfe8c84 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/GetSampleTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/GetSampleTest.java @@ -1065,23 +1065,23 @@ public class GetSampleTest extends AbstractSampleTest assertSpaceNotFetched(sample); v3api.logout(sessionToken); } - + @Test public void testGetWithTypeAndPropertyAssignments() { String sessionToken = v3api.login(TEST_USER, PASSWORD); SampleFetchOptions fetchOptions = new SampleFetchOptions(); fetchOptions.withType().withPropertyAssignments().sortBy().label().desc(); - + List<SamplePermId> sampleIds = Collections.singletonList(new SamplePermId("200811050917877-331")); Map<ISampleId, Sample> map = v3api.getSamples(sessionToken, sampleIds, fetchOptions); List<Sample> samples = new ArrayList<Sample>(map.values()); - + assertEquals(samples.size(), 1); - + Sample sample = samples.get(0); assertEquals(sample.getIdentifier().toString(), "/CISD/MP002-1"); - + SampleType type = sample.getType(); assertEquals(type.getCode(), "MASTER_PLATE"); assertEquals(type.getFetchOptions().hasPropertyAssignments(), true); diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/ProjectSampleTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/ProjectSampleTest.java index b891fb6468af134f7f76e74db33173737f203944..94db197b4915934eb545d5b6542ed48495845d0d 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/ProjectSampleTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/ProjectSampleTest.java @@ -22,1165 +22,427 @@ import org.testng.annotations.Test; import ch.systemsx.cisd.openbis.systemtest.base.BaseTest; /** - * - * * @author Franz-Josef Elmer */ @TransactionConfiguration(transactionManager = "transaction-manager", defaultRollback = false) @Test(groups = "project-samples") public class ProjectSampleTest extends BaseTest { - /* - private static final String SYSTEM_USER = "system"; - private static final SpacePermId HOME_SPACE_ID = new SpacePermId("DEFAULT"); - private static final Logger operationLog = LogFactory.getLogger(LogCategory.OPERATION, ProjectSampleTest.class); - private static final EntityTypePermId ENTITY_TYPE_UNKNOWN = new EntityTypePermId("UNKNOWN"); - - @Autowired - protected IApplicationServerApi v3api; - - private ISpaceId space1; - private ISpaceId space2; - private ProjectPermId project1inSpace1; - private ProjectPermId project2inSpace1; - private ProjectPermId project1inSpace2; - private ProjectPermId project2inSpace2; - private ProjectPermId project1inHomeSpace; - private String adminSessionToken; - private String adminUser; - @BeforeClass - public void createData() - { - List<SpacePermId> spaces = createSpaces(systemSessionToken, "SPACE1", "SPACE2"); - space1 = spaces.get(0); - space2 = spaces.get(1); - List<ProjectPermId> projects = createProjects(systemSessionToken, space1, "PROJECT1", "PROJECT2"); - project1inSpace1 = projects.get(0); - project2inSpace1 = projects.get(1); - project1inSpace2 = createProjects(systemSessionToken, space2, "PROJECT1").get(0); - project2inSpace2 = createProjects(systemSessionToken, space2, "PROJECT2").get(0); - project1inHomeSpace = createProjects(systemSessionToken, HOME_SPACE_ID, "PROJECT1").get(0); - createSamples(systemSessionToken, null, null, null, "SHARED1", "SHARED2"); - createSamples(systemSessionToken, space1, null, null, "SAMPLE1", "SAMPLE2"); - createSamples(systemSessionToken, space1, project1inSpace1, null, "SAMPLE3", "SAMPLE4"); - createSamples(systemSessionToken, space2, project2inSpace2, null, "SAMPLE5", "SAMPLE6"); - waitAtLeastASecond(); // to allow checks on modification time stamps - UpdateUtils.waitUntilIndexUpdaterIsIdle(applicationContext, operationLog); - SessionBuilder session = aSession().withInstanceRole(RoleCode.ADMIN); - adminUser = session.getUserID(); - adminSessionToken = create(session); - commonServer.changeUserHomeSpace(adminSessionToken, new TechId(1)); // home space = DEFAULT - } - - @Override - @AfterTransaction - @Test(enabled = false) - public void cleanDatabase() - { - // super method deletes samples, experiments and data sets from the database - } - - @Test - public void testCreateASharedSampleWithASharedSampleAsComponent() - { - String sampleCode = createUniqueCode("S"); - SampleCreation s1 = new SampleCreation(); - s1.setCode(sampleCode); - s1.setTypeId(ENTITY_TYPE_UNKNOWN); - SampleCreation s2 = new SampleCreation(); - s2.setCode("A01"); - s2.setTypeId(ENTITY_TYPE_UNKNOWN); - s2.setContainerId(new SampleIdentifier(null, null, sampleCode)); - - List<SamplePermId> sampleIds = v3api.createSamples(systemSessionToken, Arrays.asList(s1, s2)); - - Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, sampleIds, new SampleFetchOptions()); - assertEquals(samples.get(sampleIds.get(0)).getIdentifier().getIdentifier(), "/" + sampleCode); - assertEquals(samples.get(sampleIds.get(1)).getIdentifier().getIdentifier(), "/" + sampleCode + ":A01"); - } - - @Test - public void testCreateASharedSampleWithASpaceSampleAsComponent() - { - String sampleCode = createUniqueCode("S"); - SampleCreation s1 = new SampleCreation(); - s1.setCode(sampleCode); - s1.setTypeId(ENTITY_TYPE_UNKNOWN); - SampleCreation s2 = new SampleCreation(); - s2.setCode("A01"); - s2.setTypeId(ENTITY_TYPE_UNKNOWN); - s2.setSpaceId(space1); - s2.setContainerId(new SampleIdentifier(null, null, sampleCode)); - - List<SamplePermId> sampleIds = v3api.createSamples(systemSessionToken, Arrays.asList(s1, s2)); - - Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, sampleIds, new SampleFetchOptions()); - assertEquals(samples.get(sampleIds.get(0)).getIdentifier().getIdentifier(), "/" + sampleCode); - assertEquals(samples.get(sampleIds.get(1)).getIdentifier().getIdentifier(), "/SPACE1/" + sampleCode + ":A01"); - } - - @Test - public void testCreateASharedSampleWithAProjectSampleAsComponent() - { - String projectCode = createUniqueCode("P"); - createProjects(systemSessionToken, space1, projectCode); - String sampleCode = createUniqueCode("S"); - SampleCreation s1 = new SampleCreation(); - s1.setCode(sampleCode); - s1.setTypeId(ENTITY_TYPE_UNKNOWN); - SampleCreation s2 = new SampleCreation(); - s2.setCode("A01"); - s2.setTypeId(ENTITY_TYPE_UNKNOWN); - s2.setSpaceId(space1); - s2.setProjectId(new ProjectIdentifier("SPACE1", projectCode)); - s2.setContainerId(new SampleIdentifier(null, null, sampleCode)); - - List<SamplePermId> sampleIds = v3api.createSamples(systemSessionToken, Arrays.asList(s1, s2)); - - Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, sampleIds, new SampleFetchOptions()); - assertEquals(samples.get(sampleIds.get(0)).getIdentifier().getIdentifier(), "/" + sampleCode); - assertEquals(samples.get(sampleIds.get(1)).getIdentifier().getIdentifier(), "/SPACE1/" + projectCode + "/" + sampleCode + ":A01"); - } - - @Test - public void testCreateASharedSampleWithAProjectExperimentSampleAsComponent() - { - String projectCode = createUniqueCode("P"); - ProjectPermId project = createProjects(systemSessionToken, space1, projectCode).get(0); - String experimentCode = createUniqueCode("E"); - createExperiments(systemSessionToken, project, experimentCode); - String sampleCode = createUniqueCode("S"); - SampleCreation s1 = new SampleCreation(); - s1.setCode(sampleCode); - s1.setTypeId(ENTITY_TYPE_UNKNOWN); - SampleCreation s2 = new SampleCreation(); - s2.setCode("A01"); - s2.setTypeId(ENTITY_TYPE_UNKNOWN); - s2.setSpaceId(space1); - s2.setProjectId(new ProjectIdentifier("SPACE1", projectCode)); - s2.setExperimentId(new ExperimentIdentifier("SPACE1", projectCode, experimentCode)); - s2.setContainerId(new SampleIdentifier(null, null, sampleCode)); - - List<SamplePermId> sampleIds = v3api.createSamples(systemSessionToken, Arrays.asList(s1, s2)); - - Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, sampleIds, new SampleFetchOptions()); - assertEquals(samples.get(sampleIds.get(0)).getIdentifier().getIdentifier(), "/" + sampleCode); - assertEquals(samples.get(sampleIds.get(1)).getIdentifier().getIdentifier(), "/SPACE1/" + projectCode + "/" + sampleCode + ":A01"); - } - - @Test - public void testCreateASharedSampleWithAnExperimentSampleAsComponent() - { - String projectCode = createUniqueCode("P"); - ProjectPermId project = createProjects(systemSessionToken, space1, projectCode).get(0); - String experimentCode = createUniqueCode("E"); - createExperiments(systemSessionToken, project, experimentCode); - String sampleCode = createUniqueCode("S"); - SampleCreation s1 = new SampleCreation(); - s1.setCode(sampleCode); - s1.setTypeId(ENTITY_TYPE_UNKNOWN); - SampleCreation s2 = new SampleCreation(); - s2.setCode("A01"); - s2.setTypeId(ENTITY_TYPE_UNKNOWN); - s2.setSpaceId(space1); - s2.setExperimentId(new ExperimentIdentifier("SPACE1", projectCode, experimentCode)); - s2.setContainerId(new SampleIdentifier(null, null, sampleCode)); - - List<SamplePermId> sampleIds = v3api.createSamples(systemSessionToken, Arrays.asList(s1, s2)); - - Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, sampleIds, new SampleFetchOptions()); - assertEquals(samples.get(sampleIds.get(0)).getIdentifier().getIdentifier(), "/" + sampleCode); - assertEquals(samples.get(sampleIds.get(1)).getIdentifier().getIdentifier(), "/SPACE1/" + sampleCode + ":A01"); - } - - @Test - public void testCreateSampleAndMapSamplesByPermId() - { - String sampleCode = createUniqueCode("S"); - SampleCreation sampleCreation = new SampleCreation(); - sampleCreation.setCode(sampleCode); - sampleCreation.setTypeId(ENTITY_TYPE_UNKNOWN); - sampleCreation.setSpaceId(space1); - sampleCreation.setProjectId(project1inSpace1); - - List<SamplePermId> ids = v3api.createSamples(systemSessionToken, Arrays.asList(sampleCreation)); - - SampleFetchOptions fetchOptions = new SampleFetchOptions(); - fetchOptions.withProject(); - Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, ids, fetchOptions); - Sample sample = samples.get(ids.get(0)); - assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE1/PROJECT1/" + sampleCode); - assertEquals(sample.getProject().getIdentifier().getIdentifier(), "/SPACE1/PROJECT1"); - } - - @Test - public void testCreateThreeSamplesWithSameCodeInDifferentProjectOfSameSpaceAndMapSamplesByIdentifier() - { - String sampleCode = createUniqueCode("S"); - SampleCreation s1 = new SampleCreation(); - s1.setCode(sampleCode); - s1.setTypeId(ENTITY_TYPE_UNKNOWN); - s1.setSpaceId(space1); - s1.setProjectId(project1inSpace1); - SampleCreation s2 = new SampleCreation(); - s2.setCode(sampleCode); - s2.setTypeId(ENTITY_TYPE_UNKNOWN); - s2.setSpaceId(space1); - s2.setProjectId(project2inSpace1); - SampleCreation s3 = new SampleCreation(); - s3.setCode(sampleCode); - s3.setTypeId(ENTITY_TYPE_UNKNOWN); - s3.setSpaceId(space1); - - v3api.createSamples(systemSessionToken, Arrays.asList(s1, s2, s3)); - - SampleFetchOptions fetchOptions = new SampleFetchOptions(); - fetchOptions.withProject(); - List<ISampleId> ids = new ArrayList<>(); - ids.add(new SampleIdentifier("/SPACE1/PROJECT1/" + sampleCode)); - ids.add(new SampleIdentifier("/SPACE1/PROJECT2/" + sampleCode)); - ids.add(new SampleIdentifier("/SPACE1/" + sampleCode)); - Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, ids, fetchOptions); - assertEquals(samples.get(ids.get(0)).getProject().getIdentifier().toString(), "/SPACE1/PROJECT1"); - assertEquals(samples.get(ids.get(1)).getProject().getIdentifier().toString(), "/SPACE1/PROJECT2"); - assertEquals(samples.get(ids.get(2)).getProject(), null); - } - - @Test - public void testCreateProjectSampleWithAProjectSampleComponentFromAnotherSpace() - { - String sampleCode = createUniqueCode("S"); - SampleCreation s1 = new SampleCreation(); - s1.setCode(sampleCode); - s1.setTypeId(ENTITY_TYPE_UNKNOWN); - s1.setSpaceId(space1); - s1.setProjectId(project1inSpace1); - SamplePermId s1PermId = v3api.createSamples(systemSessionToken, Arrays.asList(s1)).get(0); - SampleCreation s2 = new SampleCreation(); - s2.setCode("A01"); - s2.setTypeId(ENTITY_TYPE_UNKNOWN); - s2.setSpaceId(space2); - s2.setProjectId(project1inSpace2); - s2.setContainerId(s1PermId); - - v3api.createSamples(systemSessionToken, Arrays.asList(s2)); - - SampleFetchOptions fetchOptions = new SampleFetchOptions(); - fetchOptions.withProject(); - fetchOptions.withContainer(); - List<ISampleId> ids = new ArrayList<>(); - ids.add(new SampleIdentifier("/SPACE1/PROJECT1/" + sampleCode)); - ids.add(new SampleIdentifier("/SPACE2/PROJECT1/" + sampleCode + ":A01")); - Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, ids, fetchOptions); - assertEquals(samples.get(ids.get(0)).getProject().getIdentifier().toString(), "/SPACE1/PROJECT1"); - assertEquals(samples.get(ids.get(1)).getProject().getIdentifier().toString(), "/SPACE2/PROJECT1"); - } - - @Test - public void testCreateProjectSampleWithComponentInHomeSpace() - { - String sampleCode = createUniqueCode("S"); - SampleCreation s1 = new SampleCreation(); - s1.setCode(sampleCode); - s1.setTypeId(ENTITY_TYPE_UNKNOWN); - s1.setSpaceId(HOME_SPACE_ID); - s1.setProjectId(project1inHomeSpace); - SamplePermId s1PermId = v3api.createSamples(systemSessionToken, Arrays.asList(s1)).get(0); - SampleCreation s2 = new SampleCreation(); - s2.setCode("A01"); - s2.setTypeId(ENTITY_TYPE_UNKNOWN); - s2.setSpaceId(HOME_SPACE_ID); - s2.setProjectId(project1inHomeSpace); - s2.setContainerId(s1PermId); - - v3api.createSamples(systemSessionToken, Arrays.asList(s2)); - - SampleFetchOptions fetchOptions = new SampleFetchOptions(); - fetchOptions.withProject(); - fetchOptions.withContainer(); - List<ISampleId> ids = new ArrayList<>(); - ids.add(new SampleIdentifier("//PROJECT1/" + sampleCode)); - ids.add(new SampleIdentifier("//PROJECT1/" + sampleCode + ":A01")); - Map<ISampleId, Sample> samples = v3api.mapSamples(adminSessionToken, ids, fetchOptions); - assertEquals(samples.get(ids.get(0)).getProject().getIdentifier().toString(), "/DEFAULT/PROJECT1"); - assertEquals(samples.get(ids.get(1)).getProject().getIdentifier().toString(), "/DEFAULT/PROJECT1"); - } - - @Test - public void testAssignSpaceSampleToAProject() - { - String sampleCode = createUniqueCode("S"); - createSamples(systemSessionToken, space1, null, null, sampleCode); - String projectCode = createUniqueCode("P"); - ProjectPermId project = createProjects(systemSessionToken, space1, projectCode).get(0); - SampleUpdate sampleUpdate = new SampleUpdate(); - sampleUpdate.setSampleId(new SampleIdentifier("/SPACE1/" + sampleCode)); - sampleUpdate.setProjectId(project); - Date now = sleep(); - - v3api.updateSamples(adminSessionToken, Arrays.asList(sampleUpdate)); - - SampleFetchOptions fetchOptions = new SampleFetchOptions(); - fetchOptions.withModifier(); - fetchOptions.withSpace(); - fetchOptions.withProject().withModifier(); - SampleIdentifier newSampleIdentifier = new SampleIdentifier("/SPACE1/" + projectCode + "/" + sampleCode); - Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, Arrays.asList(newSampleIdentifier), fetchOptions); - Sample sample = samples.get(newSampleIdentifier); - assertModification(sample, sample, now, adminUser); - assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode + "/" + sampleCode); - Project sampleProject = sample.getProject(); - assertEquals(sampleProject.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode); - assertModification(sampleProject, sampleProject, now, adminUser); - } - - @Test - public void testAssignHomeSpaceSampleToAProjectInHomeSpace() - { - String sampleCode = createUniqueCode("S"); - createSamples(systemSessionToken, HOME_SPACE_ID, null, null, sampleCode); - String projectCode = createUniqueCode("P"); - ProjectPermId project = createProjects(systemSessionToken, HOME_SPACE_ID, projectCode).get(0); - SampleUpdate sampleUpdate = new SampleUpdate(); - sampleUpdate.setSampleId(new SampleIdentifier("//" + sampleCode)); - sampleUpdate.setProjectId(project); - Date now = sleep(); - - v3api.updateSamples(adminSessionToken, Arrays.asList(sampleUpdate)); - - SampleFetchOptions fetchOptions = new SampleFetchOptions(); - fetchOptions.withModifier(); - fetchOptions.withSpace(); - fetchOptions.withProject().withModifier(); - SampleIdentifier newSampleIdentifier = new SampleIdentifier("//" + projectCode + "/" + sampleCode); - Map<ISampleId, Sample> samples = v3api.mapSamples(adminSessionToken, Arrays.asList(newSampleIdentifier), fetchOptions); - Sample sample = samples.get(newSampleIdentifier); - assertModification(sample, sample, now, adminUser); - assertEquals(sample.getIdentifier().getIdentifier(), "/DEFAULT/" + projectCode + "/" + sampleCode); - Project sampleProject = sample.getProject(); - assertEquals(sampleProject.getIdentifier().getIdentifier(), "/DEFAULT/" + projectCode); - assertModification(sampleProject, sampleProject, now, adminUser); - } - - @Test - public void testAssignProjectSampleToADifferentProjectInTheSameSpace() - { - String projectCode1 = createUniqueCode("P"); - ProjectPermId project1 = createProjects(systemSessionToken, space1, projectCode1).get(0); - String sampleCode = createUniqueCode("S"); - SamplePermId spaceSample = createSamples(systemSessionToken, space1, project1, null, sampleCode).get(0); - String projectCode2 = createUniqueCode("P"); - ProjectPermId project2 = createProjects(systemSessionToken, space1, projectCode2).get(0); - SampleUpdate sampleUpdate = new SampleUpdate(); - sampleUpdate.setSampleId(new SampleIdentifier("/SPACE1/" + projectCode1 + "/" + sampleCode)); - sampleUpdate.setProjectId(project2); - Date now = sleep(); - - v3api.updateSamples(adminSessionToken, Arrays.asList(sampleUpdate)); - - SampleFetchOptions fetchOptions = new SampleFetchOptions(); - fetchOptions.withModifier(); - fetchOptions.withSpace(); - fetchOptions.withProject().withModifier(); - Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, Arrays.asList(spaceSample), fetchOptions); - Sample sample = samples.get(spaceSample); - assertModification(sample, sample, now, adminUser); - assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode2 + "/" + sampleCode); - Project sampleProject = sample.getProject(); - assertEquals(sampleProject.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode2); - assertModification(sampleProject, sampleProject, now, adminUser); - ProjectFetchOptions projectFetchOptions = new ProjectFetchOptions(); - projectFetchOptions.withModifier(); - Map<IProjectId, Project> projects = v3api.mapProjects(systemSessionToken, - Arrays.asList(project1), projectFetchOptions); - assertModification(projects.get(project1), projects.get(project1), now, adminUser); - } - - @Test - public void testAssignProjectSampleWithComponentToAProjectInADifferentSpace() - { - String projectCode = createUniqueCode("P"); - ProjectPermId project1 = createProjects(systemSessionToken, space1, projectCode).get(0); - String sampleCode = createUniqueCode("S"); - SampleCreation s1 = new SampleCreation(); - s1.setCode(sampleCode); - s1.setTypeId(ENTITY_TYPE_UNKNOWN); - s1.setSpaceId(space1); - s1.setProjectId(project1); - SampleCreation s2 = new SampleCreation(); - s2.setCode("A01"); - s2.setTypeId(ENTITY_TYPE_UNKNOWN); - s2.setSpaceId(space1); - s2.setProjectId(project1); - s2.setContainerId(new SampleIdentifier("/SPACE1/" + projectCode + "/" + sampleCode)); - v3api.createSamples(systemSessionToken, Arrays.asList(s1, s2)); - ProjectPermId project2 = createProjects(systemSessionToken, space2, projectCode).get(0); - SampleUpdate sampleUpdate = new SampleUpdate(); - sampleUpdate.setSampleId(new SampleIdentifier("/SPACE1/" + projectCode + "/" + sampleCode)); - sampleUpdate.setSpaceId(space2); - sampleUpdate.setProjectId(project2); - Date now = sleep(); - - v3api.updateSamples(adminSessionToken, Arrays.asList(sampleUpdate)); - - SampleFetchOptions fetchOptions = new SampleFetchOptions(); - fetchOptions.withModifier(); - fetchOptions.withSpace(); - fetchOptions.withProject().withModifier(); - SampleIdentifier containerID = new SampleIdentifier("/SPACE2/" + projectCode + "/" + sampleCode); - SampleIdentifier componentID = new SampleIdentifier("/SPACE1/" + projectCode + "/" + sampleCode + ":A01"); - Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, Arrays.asList(containerID, componentID), fetchOptions); - Sample sample = samples.get(containerID); - assertModification(sample, sample, now, adminUser); - assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE2/" + projectCode + "/" + sampleCode); - Project project = sample.getProject(); - assertEquals(project.getIdentifier().getIdentifier(), "/SPACE2/" + projectCode); - assertModification(project, project, now, adminUser); - Sample component = samples.get(componentID); - assertEquals(component.getModifier().getUserId(), SYSTEM_USER); - assertEquals(component.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode + "/" + sampleCode + ":A01"); - Project componentProject = component.getProject(); - assertEquals(componentProject.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode); - assertModification(componentProject, componentProject, now, adminUser); - } - - @Test - public void testAssignProjectSampleToAProjectInADifferentSpace() - { - String projectCode = createUniqueCode("P"); - ProjectPermId project1 = createProjects(systemSessionToken, space1, projectCode).get(0); - String sampleCode = createUniqueCode("S"); - SamplePermId spaceSample = createSamples(systemSessionToken, space1, project1, null, sampleCode).get(0); - ProjectPermId project2 = createProjects(systemSessionToken, space2, projectCode).get(0); - SampleUpdate sampleUpdate = new SampleUpdate(); - sampleUpdate.setSampleId(spaceSample); - sampleUpdate.setSpaceId(space2); - sampleUpdate.setProjectId(project2); - Date now = sleep(); - - v3api.updateSamples(adminSessionToken, Arrays.asList(sampleUpdate)); - - SampleFetchOptions fetchOptions = new SampleFetchOptions(); - fetchOptions.withModifier(); - fetchOptions.withSpace(); - fetchOptions.withProject().withModifier(); - Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, Arrays.asList(spaceSample), fetchOptions); - Sample sample = samples.get(spaceSample); - assertModification(sample, sample, now, adminUser); - assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE2/" + projectCode + "/" + sampleCode); - Project project = sample.getProject(); - assertEquals(project.getIdentifier().getIdentifier(), "/SPACE2/" + projectCode); - assertModification(project, project, now, adminUser); - } - - @Test - public void testAssignExperimentWithProjectSamplesToADifferentProject() - { - String projectCode1 = createUniqueCode("P"); - String projectCode2 = projectCode1 + "A"; - createProjects(systemSessionToken, space1, projectCode1, projectCode2); - String experimentCode = createUniqueCode("E"); - ProjectIdentifier project1 = new ProjectIdentifier("SPACE1", projectCode1); - ExperimentPermId experiment = createExperiments(systemSessionToken, project1, experimentCode).get(0); - String sampleCode = createUniqueCode("S"); - SamplePermId sample = createSamples(systemSessionToken, space1, project1, experiment, sampleCode).get(0); - ExperimentUpdate experimentUpdate = new ExperimentUpdate(); - experimentUpdate.setExperimentId(experiment); - experimentUpdate.setProjectId(new ProjectIdentifier("SPACE1", projectCode2)); - Date now = sleep(); - - v3api.updateExperiments(adminSessionToken, Arrays.asList(experimentUpdate)); - - SampleFetchOptions fetchOptions = new SampleFetchOptions(); - fetchOptions.withModifier(); - fetchOptions.withSpace(); - fetchOptions.withProject().withModifier(); - Sample experimentSample = v3api.mapSamples(systemSessionToken, Arrays.asList(sample), fetchOptions).values().iterator().next(); - assertModification(experimentSample, experimentSample, now, adminUser); - assertEquals(experimentSample.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode2 + "/" + sampleCode); - Project project = experimentSample.getProject(); - assertEquals(project.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode2); - assertModification(project, project, now, adminUser); - ExperimentFetchOptions experimentFetchOptions = new ExperimentFetchOptions(); - experimentFetchOptions.withModifier(); - Experiment sampleExperiment = v3api.mapExperiments(systemSessionToken, Arrays.asList(experiment), - experimentFetchOptions).values().iterator().next(); - assertModification(sampleExperiment, sampleExperiment, now, adminUser); - } - - @Test - public void testDeleteExperimentWithProjectSamples() - { - String projectCode = createUniqueCode("P"); - createProjects(systemSessionToken, space1, projectCode); - String experimentCode = createUniqueCode("E"); - ProjectIdentifier project = new ProjectIdentifier("SPACE1", projectCode); - ExperimentPermId experiment = createExperiments(systemSessionToken, project, experimentCode).get(0); - String sampleCode = createUniqueCode("S"); - SamplePermId sample = createSamples(systemSessionToken, space1, project, experiment, sampleCode).get(0); - ExperimentDeletionOptions deletionOptions = new ExperimentDeletionOptions(); - deletionOptions.setReason("a test"); - - v3api.deleteExperiments(adminSessionToken, Arrays.asList(experiment), deletionOptions); - - assertEquals(v3api.mapSamples(systemSessionToken, Arrays.asList(sample), new SampleFetchOptions()).size(), 0); - ExperimentFetchOptions experimentFetchOptions = new ExperimentFetchOptions(); - experimentFetchOptions.withModifier(); - assertEquals(v3api.mapExperiments(systemSessionToken, Arrays.asList(experiment), - experimentFetchOptions).size(), 0); - } - - @Test - public void testUnassignProjectSampleFromProject() - { - String projectCode = createUniqueCode("P"); - ProjectPermId project = createProjects(systemSessionToken, space1, projectCode).get(0); - String sampleCode = createUniqueCode("S"); - SamplePermId projectSample = createSamples(systemSessionToken, space1, project, null, sampleCode).get(0); - SampleUpdate sampleUpdate = new SampleUpdate(); - sampleUpdate.setSampleId(projectSample); - sampleUpdate.setProjectId(null); - Date now = sleep(); - - v3api.updateSamples(adminSessionToken, Arrays.asList(sampleUpdate)); - - SampleFetchOptions fetchOptions = new SampleFetchOptions(); - fetchOptions.withModifier(); - fetchOptions.withSpace(); - fetchOptions.withProject().withModifier(); - Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, Arrays.asList(projectSample), fetchOptions); - Sample sample = samples.get(projectSample); - assertModification(sample, sample, now, adminUser); - assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE1/" + sampleCode); - assertEquals(sample.getProject(), null); - ProjectFetchOptions projectFetchOptions = new ProjectFetchOptions(); - projectFetchOptions.withModifier(); - Map<IProjectId, Project> projects = v3api.mapProjects(systemSessionToken, - Arrays.asList(project), projectFetchOptions); - Project previousProject = projects.values().iterator().next(); - assertModification(previousProject, previousProject, now, adminUser); - } - - @Test - public void testUnassignProjectSampleFromProjectAndSpace() - { - String projectCode = createUniqueCode("P"); - ProjectPermId project = createProjects(systemSessionToken, space1, projectCode).get(0); - String sampleCode = createUniqueCode("S"); - SamplePermId projectSample = createSamples(systemSessionToken, space1, project, null, sampleCode).get(0); - SampleUpdate sampleUpdate = new SampleUpdate(); - sampleUpdate.setSampleId(projectSample); - sampleUpdate.setProjectId(null); - sampleUpdate.setSpaceId(null); - Date now = sleep(); - - v3api.updateSamples(adminSessionToken, Arrays.asList(sampleUpdate)); - - SampleFetchOptions fetchOptions = new SampleFetchOptions(); - fetchOptions.withModifier(); - fetchOptions.withSpace(); - fetchOptions.withProject().withModifier(); - Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, Arrays.asList(projectSample), fetchOptions); - Sample sample = samples.get(projectSample); - assertModification(sample, sample, now, adminUser); - assertEquals(sample.getIdentifier().getIdentifier(), "/" + sampleCode); - assertEquals(sample.getProject(), null); - ProjectFetchOptions projectFetchOptions = new ProjectFetchOptions(); - projectFetchOptions.withModifier(); - Map<IProjectId, Project> projects = v3api.mapProjects(systemSessionToken, - Arrays.asList(project), projectFetchOptions); - Project previousProject = projects.values().iterator().next(); - assertModification(previousProject, previousProject, now, adminUser); - } - - @Test - public void testUnassignProjectExperimentSampleFromExperiment() - { - String projectCode = createUniqueCode("P"); - ProjectPermId project = createProjects(systemSessionToken, space1, projectCode).get(0); - String experimentCode = createUniqueCode("E"); - ExperimentPermId experiment = createExperiments(systemSessionToken, project, experimentCode).get(0); - String sampleCode = createUniqueCode("S"); - SamplePermId projectSample = createSamples(systemSessionToken, space1, project, experiment, sampleCode).get(0); - SampleUpdate sampleUpdate = new SampleUpdate(); - sampleUpdate.setSampleId(projectSample); - sampleUpdate.setExperimentId(null); - Date now = sleep(); - - v3api.updateSamples(adminSessionToken, Arrays.asList(sampleUpdate)); - - SampleFetchOptions fetchOptions = new SampleFetchOptions(); - fetchOptions.withModifier(); - fetchOptions.withSpace(); - fetchOptions.withProject().withModifier(); - Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, Arrays.asList(projectSample), fetchOptions); - Sample sample = samples.get(projectSample); - assertModification(sample, sample, now, adminUser); - assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode + "/" + sampleCode); - Project sampleProject = sample.getProject(); - assertEquals(sampleProject.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode); - assertEquals(sampleProject.getModifier().getUserId(), SYSTEM_USER); - ExperimentFetchOptions experimentFetchOptions = new ExperimentFetchOptions(); - experimentFetchOptions.withModifier(); - Experiment previousExperiment = v3api.mapExperiments(systemSessionToken, Arrays.asList(experiment), - experimentFetchOptions).values().iterator().next(); - assertModification(previousExperiment, previousExperiment, now, adminUser); - } - - @Test - public void testUpdateProjectSample() - { - String projectCode = createUniqueCode("P"); - ProjectPermId project = createProjects(systemSessionToken, space1, projectCode).get(0); - String sampleCode = createUniqueCode("S"); - SamplePermId projectSample = createSamples(systemSessionToken, space1, project, null, sampleCode).get(0); - SampleUpdate sampleUpdate = new SampleUpdate(); - sampleUpdate.setSampleId(projectSample); - Date now = sleep(); - - v3api.updateSamples(adminSessionToken, Arrays.asList(sampleUpdate)); - - SampleFetchOptions fetchOptions = new SampleFetchOptions(); - fetchOptions.withModifier(); - fetchOptions.withSpace(); - fetchOptions.withProject().withModifier(); - Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, Arrays.asList(projectSample), fetchOptions); - Sample sample = samples.get(projectSample); - assertModification(sample, sample, now, adminUser); - assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode + "/" + sampleCode); - assertEquals(sample.getProject().getIdentifier().getIdentifier(), "/SPACE1/" + projectCode); - ProjectFetchOptions projectFetchOptions = new ProjectFetchOptions(); - projectFetchOptions.withModifier(); - Map<IProjectId, Project> projects = v3api.mapProjects(systemSessionToken, - Arrays.asList(project), projectFetchOptions); - Project sampleProject = projects.values().iterator().next(); - assertEquals(sampleProject.getModifier().getUserId(), SYSTEM_USER); - } - - @Test - public void testAssignSpaceSampleToAnExperimentInTheSameSpace() - { - String projectCode = createUniqueCode("P"); - ProjectPermId project = createProjects(systemSessionToken, space1, projectCode).get(0); - String sampleCode = createUniqueCode("S"); - SamplePermId projectSample = createSamples(systemSessionToken, space1, null, null, sampleCode).get(0); - String experimentCode = createUniqueCode("E"); - createExperiments(systemSessionToken, project, experimentCode); - SampleUpdate sampleUpdate = new SampleUpdate(); - sampleUpdate.setSampleId(projectSample); - sampleUpdate.setExperimentId(new ExperimentIdentifier("SPACE1", projectCode, experimentCode)); - Date now = sleep(); - - v3api.updateSamples(adminSessionToken, Arrays.asList(sampleUpdate)); - - SampleFetchOptions fetchOptions = new SampleFetchOptions(); - fetchOptions.withModifier(); - fetchOptions.withSpace(); - fetchOptions.withProject().withModifier(); - fetchOptions.withExperiment().withModifier(); - Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, Arrays.asList(projectSample), fetchOptions); - Sample sample = samples.get(projectSample); - assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE1/" + sampleCode); - assertModification(sample, sample, now, adminUser); - assertEquals(sample.getProject(), null); - Experiment experiment = sample.getExperiment(); - assertEquals(experiment.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode + "/" + experimentCode); - assertModification(experiment, experiment, now, adminUser); - } - - @Test - public void testAssignProjectSampleToAnExperimentInTheSameProject() - { - String projectCode = createUniqueCode("P"); - ProjectPermId project = createProjects(systemSessionToken, space1, projectCode).get(0); - String sampleCode = createUniqueCode("S"); - SamplePermId projectSample = createSamples(systemSessionToken, space1, project, null, sampleCode).get(0); - String experimentCode = createUniqueCode("E"); - createExperiments(systemSessionToken, project, experimentCode); - SampleUpdate sampleUpdate = new SampleUpdate(); - sampleUpdate.setSampleId(projectSample); - sampleUpdate.setExperimentId(new ExperimentIdentifier("SPACE1", projectCode, experimentCode)); - Date now = sleep(); - - v3api.updateSamples(adminSessionToken, Arrays.asList(sampleUpdate)); - - SampleFetchOptions fetchOptions = new SampleFetchOptions(); - fetchOptions.withModifier(); - fetchOptions.withSpace(); - fetchOptions.withProject().withModifier(); - fetchOptions.withExperiment().withModifier(); - Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, Arrays.asList(projectSample), fetchOptions); - Sample sample = samples.get(projectSample); - assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode + "/" + sampleCode); - assertModification(sample, sample, now, adminUser); - assertEquals(sample.getProject().getModifier().getUserId(), SYSTEM_USER); - Experiment experiment = sample.getExperiment(); - assertEquals(experiment.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode + "/" + experimentCode); - assertModification(experiment, experiment, now, adminUser); - } - - @Test - public void testAssignProjectSampleWithExperimentToAnotherExperimentInTheSameProject() - { - String projectCode = createUniqueCode("P"); - ProjectPermId project = createProjects(systemSessionToken, space1, projectCode).get(0); - String experimentCode1 = createUniqueCode("E"); - String experimentCode2 = experimentCode1 + "A"; - createExperiments(systemSessionToken, project, experimentCode1, experimentCode2); - String sampleCode = createUniqueCode("S"); - SamplePermId projectSample = createSamples(systemSessionToken, space1, project, - new ExperimentIdentifier("SPACE1", projectCode, experimentCode1), sampleCode).get(0); - SampleUpdate sampleUpdate = new SampleUpdate(); - sampleUpdate.setSampleId(projectSample); - sampleUpdate.setExperimentId(new ExperimentIdentifier("SPACE1", projectCode, experimentCode2)); - Date now = sleep(); - - v3api.updateSamples(adminSessionToken, Arrays.asList(sampleUpdate)); - - SampleFetchOptions fetchOptions = new SampleFetchOptions(); - fetchOptions.withModifier(); - fetchOptions.withSpace(); - fetchOptions.withProject().withModifier(); - fetchOptions.withExperiment().withModifier(); - Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, Arrays.asList(projectSample), fetchOptions); - Sample sample = samples.get(projectSample); - assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode + "/" + sampleCode); - assertModification(sample, sample, now, adminUser); - assertEquals(sample.getProject().getModifier().getUserId(), SYSTEM_USER); - Experiment experiment = sample.getExperiment(); - assertEquals(experiment.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode + "/" + experimentCode2); - assertModification(experiment, experiment, now, adminUser); - ExperimentFetchOptions experimentFetchOptions = new ExperimentFetchOptions(); - experimentFetchOptions.withModifier(); - Experiment previousExperiment = v3api.mapExperiments(systemSessionToken, - Arrays.asList(new ExperimentIdentifier("SPACE1", projectCode, experimentCode1)), - experimentFetchOptions).values().iterator().next(); - assertModification(previousExperiment, previousExperiment, now, adminUser); - } - - @Test - public void testAssignProjectSampleToAnExperimentInADifferentProjectOfTheSameSpace() - { - String projectCode1 = createUniqueCode("P"); - ProjectPermId project1 = createProjects(systemSessionToken, space1, projectCode1).get(0); - String sampleCode = createUniqueCode("S"); - SamplePermId projectSample = createSamples(systemSessionToken, space1, project1, null, sampleCode).get(0); - String experimentCode = createUniqueCode("E"); - String projectCode2 = createUniqueCode("P"); - ProjectPermId project2 = createProjects(systemSessionToken, space1, projectCode2).get(0); - createExperiments(systemSessionToken, project2, experimentCode); - SampleUpdate sampleUpdate = new SampleUpdate(); - sampleUpdate.setSampleId(projectSample); - sampleUpdate.setProjectId(new ProjectIdentifier("SPACE1", projectCode2)); - sampleUpdate.setExperimentId(new ExperimentIdentifier("SPACE1", projectCode2, experimentCode)); - Date now = sleep(); - - v3api.updateSamples(adminSessionToken, Arrays.asList(sampleUpdate)); - - SampleFetchOptions fetchOptions = new SampleFetchOptions(); - fetchOptions.withModifier(); - fetchOptions.withSpace(); - fetchOptions.withProject().withModifier(); - fetchOptions.withExperiment().withModifier(); - Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, Arrays.asList(projectSample), fetchOptions); - Sample sample = samples.get(projectSample); - assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode2 + "/" + sampleCode); - assertModification(sample, sample, now, adminUser); - assertModification(sample.getProject(), sample.getProject(), now, adminUser); - Experiment experiment = sample.getExperiment(); - assertEquals(experiment.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode2 + "/" + experimentCode); - assertModification(experiment, experiment, now, adminUser); - } - - @Test - public void testDeleteProjectSample() - { - String projectCode = createUniqueCode("P"); - ProjectPermId project = createProjects(systemSessionToken, space1, projectCode).get(0); - String sampleCode = createUniqueCode("S"); - createSamples(systemSessionToken, space1, project, null, sampleCode); - SampleDeletionOptions deletionOptions = new SampleDeletionOptions(); - deletionOptions.setReason("test"); - List<SampleIdentifier> sampleIds = Arrays.asList(new SampleIdentifier("/SPACE1/" + projectCode + "/" + sampleCode)); - Date now = sleep(); - - v3api.deleteSamples(adminSessionToken, sampleIds, deletionOptions); - - assertEquals(v3api.mapSamples(systemSessionToken, sampleIds, new SampleFetchOptions()).size(), 0); - ProjectFetchOptions projectFetchOptions = new ProjectFetchOptions(); - projectFetchOptions.withModifier(); - Project sampleProject = v3api.mapProjects(systemSessionToken, Arrays.asList(project), - projectFetchOptions).values().iterator().next(); - assertModification(sampleProject, sampleProject, now, adminUser); - } - - @Test - public void testDeleteProjectExperimentSample() - { - String projectCode = createUniqueCode("P"); - ProjectPermId project = createProjects(systemSessionToken, space1, projectCode).get(0); - String sampleCode = createUniqueCode("S"); - String experimentCode = createUniqueCode("E"); - ExperimentPermId experiment = createExperiments(systemSessionToken, project, experimentCode).get(0); - SamplePermId sample = createSamples(systemSessionToken, space1, project, experiment, sampleCode).get(0); - SampleDeletionOptions deletionOptions = new SampleDeletionOptions(); - deletionOptions.setReason("test"); - List<SamplePermId> sampleIds = Arrays.asList(sample); - Date now = sleep(); - - v3api.deleteSamples(adminSessionToken, sampleIds, deletionOptions); - - assertEquals(v3api.mapSamples(systemSessionToken, sampleIds, new SampleFetchOptions()).size(), 0); - ProjectFetchOptions projectFetchOptions = new ProjectFetchOptions(); - projectFetchOptions.withModifier(); - Project sampleProject = v3api.mapProjects(systemSessionToken, Arrays.asList(project), - projectFetchOptions).values().iterator().next(); - assertModification(sampleProject, sampleProject, now, adminUser); - ExperimentFetchOptions experimentFetchOptions = new ExperimentFetchOptions(); - experimentFetchOptions.withModifier(); - Experiment sampleExperiment = v3api.mapExperiments(systemSessionToken, Arrays.asList(experiment), - experimentFetchOptions).values().iterator().next(); - assertModification(sampleExperiment, sampleExperiment, now, adminUser); - } - - @Test - @Transactional(propagation = Propagation.NEVER) - public void testCreateWithProjectAndSpaceInconsistent() - { - final SampleCreation creation = new SampleCreation(); - creation.setCode("SAMPLE_WITH_INCONSISTENT_PROJECT_AND_SPACE"); - creation.setTypeId(ENTITY_TYPE_UNKNOWN); - creation.setSpaceId(space1); - creation.setProjectId(project1inSpace2); - - assertUserFailureException(new IDelegatedAction() - { - @Override - public void execute() - { - v3api.createSamples(systemSessionToken, Collections.singletonList(creation)); - } - }, "Sample space must be the same as project space. " - + "Sample: /SPACE1/SAMPLE_WITH_INCONSISTENT_PROJECT_AND_SPACE, " - + "Project: /SPACE2/PROJECT1 " - + "(Context: [verify project for sample SAMPLE_WITH_INCONSISTENT_PROJECT_AND_SPACE])"); - } - - @Test - @Transactional(propagation = Propagation.NEVER) - public void testCreateWithProjectAndNoSpaceInconsistent() - { - final SampleCreation creation = new SampleCreation(); - creation.setCode("SAMPLE_WITH_INCONSISTENT_PROJECT_AND_NOSPACE"); - creation.setTypeId(ENTITY_TYPE_UNKNOWN); - creation.setProjectId(project1inSpace1); - - assertUserFailureException(new IDelegatedAction() - { - @Override - public void execute() - { - v3api.createSamples(systemSessionToken, Collections.singletonList(creation)); - } - }, "Shared samples cannot be attached to projects. " - + "Sample: /SAMPLE_WITH_INCONSISTENT_PROJECT_AND_NOSPACE, " - + "Project: /SPACE1/PROJECT1 " - + "(Context: [verify project for sample SAMPLE_WITH_INCONSISTENT_PROJECT_AND_NOSPACE])"); - } - - @Test - @Transactional(propagation = Propagation.NEVER) - public void testCreateWithProjectAndExperimentInconsistent() - { - final SampleCreation creation = new SampleCreation(); - creation.setCode("SAMPLE_WITH_INCONSISTENT_PROJECT_AND_EXPERIMENT"); - creation.setTypeId(ENTITY_TYPE_UNKNOWN); - creation.setSpaceId(space1); - creation.setProjectId(project2inSpace1); - String expCode = createUniqueCode("E"); - creation.setExperimentId(createExperiments(systemSessionToken, project1inSpace1, expCode).get(0)); - - assertUserFailureException(new IDelegatedAction() - { - @Override - public void execute() - { - v3api.createSamples(systemSessionToken, Collections.singletonList(creation)); - } - }, "Sample project must be the same as experiment project. " - + "Sample: /SPACE1/SAMPLE_WITH_INCONSISTENT_PROJECT_AND_EXPERIMENT, " - + "Project: /SPACE1/PROJECT2, " - + "Experiment: /SPACE1/PROJECT1/" + expCode + " " - + "(Context: [verify experiment for sample SAMPLE_WITH_INCONSISTENT_PROJECT_AND_EXPERIMENT])"); - } - - @Test - @Transactional(propagation = Propagation.NEVER) - public void testAssignSpaceSampleToProjectInDifferentSpace() - { - String code = createUniqueCode("S"); - ISampleId sampleId = createSamples(systemSessionToken, space1, null, null, code).get(0); - final SampleUpdate sampleUpdate = new SampleUpdate(); - sampleUpdate.setSampleId(sampleId); - sampleUpdate.setProjectId(project2inSpace2); - - assertUserFailureException(new IDelegatedAction() - { - @Override - public void execute() - { - v3api.updateSamples(systemSessionToken, Collections.singletonList(sampleUpdate)); - } - }, "Sample space must be the same as project space. " - + "Sample: /SPACE1/" + code + ", " - + "Project: /SPACE2/PROJECT2 " - + "(Context: [verify project for sample " + code + "])"); - } - - @Test - @Transactional(propagation = Propagation.NEVER) - public void testAssignSampleOfAnExperimentToProjectDifferentToTheExperimentProject() - { - String sampleCode = createUniqueCode("S"); - String expCode = createUniqueCode("E"); - IExperimentId experiment = createExperiments(systemSessionToken, project1inSpace1, expCode).get(0); - SamplePermId sample = createSamples(systemSessionToken, space1, null, experiment, sampleCode).get(0); - final SampleUpdate sampleUpdate = new SampleUpdate(); - sampleUpdate.setSampleId(sample); - sampleUpdate.setProjectId(project2inSpace1); - - assertUserFailureException(new IDelegatedAction() - { - @Override - public void execute() - { - v3api.updateSamples(systemSessionToken, Collections.singletonList(sampleUpdate)); - } - }, "Sample project must be the same as experiment project. " - + "Sample: /SPACE1/" + sampleCode + ", " - + "Project: /SPACE1/PROJECT2, " - + "Experiment: /SPACE1/PROJECT1/" + expCode + " " - + "(Context: [verify experiment for sample " + sampleCode + "])"); - - } - - @Test - @Transactional(propagation = Propagation.NEVER) - public void testAssignSharedSampleToProject() - { - String code = createUniqueCode("S"); - ISampleId sharedSample = createSamples(systemSessionToken, null, null, null, code).get(0); - final SampleUpdate sampleUpdate = new SampleUpdate(); - sampleUpdate.setSampleId(sharedSample); - sampleUpdate.setProjectId(project1inSpace1); - - assertUserFailureException(new IDelegatedAction() - { - @Override - public void execute() - { - v3api.updateSamples(systemSessionToken, Collections.singletonList(sampleUpdate)); - } - }, "Shared samples cannot be attached to projects. " - + "Sample: /" + code + ", " - + "Project: /SPACE1/PROJECT1 " - + "(Context: [verify project for sample " + code + "])"); - } - - @Test(priority = -1) - public void testSearchForSamplesWithProject() throws InterruptedException - { - - SampleSearchCriteria searchCriteria = new SampleSearchCriteria(); - searchCriteria.withProject(); - SampleFetchOptions fetchOptions = new SampleFetchOptions(); - fetchOptions.withProject(); - - SearchResult<Sample> result = v3api.searchSamples(systemSessionToken, searchCriteria, fetchOptions); - - assertEquals(result.getObjects().get(0).getIdentifier().getIdentifier(), "/SPACE1/PROJECT1/SAMPLE3"); - assertEquals(result.getObjects().get(0).getProject().getIdentifier().getIdentifier(), "/SPACE1/PROJECT1"); - assertEquals(result.getObjects().get(1).getIdentifier().getIdentifier(), "/SPACE1/PROJECT1/SAMPLE4"); - assertEquals(result.getObjects().get(1).getProject().getIdentifier().getIdentifier(), "/SPACE1/PROJECT1"); - assertEquals(result.getObjects().get(2).getIdentifier().getIdentifier(), "/SPACE2/PROJECT2/SAMPLE5"); - assertEquals(result.getObjects().get(2).getProject().getIdentifier().getIdentifier(), "/SPACE2/PROJECT2"); - assertEquals(result.getObjects().get(3).getIdentifier().getIdentifier(), "/SPACE2/PROJECT2/SAMPLE6"); - assertEquals(result.getObjects().get(3).getProject().getIdentifier().getIdentifier(), "/SPACE2/PROJECT2"); - assertEquals(result.getTotalCount(), 4); - } - - @Test(priority = -1) - public void testSearchForSamplesWithCodeAndWithProject() - { - SampleSearchCriteria searchCriteria = new SampleSearchCriteria(); - searchCriteria.withCode().thatEndsWith("3"); - searchCriteria.withProject(); - SampleFetchOptions fetchOptions = new SampleFetchOptions(); - fetchOptions.withProject(); - - SearchResult<Sample> result = v3api.searchSamples(systemSessionToken, searchCriteria, fetchOptions); - - assertEquals(result.getObjects().get(0).getIdentifier().getIdentifier(), "/SPACE1/PROJECT1/SAMPLE3"); - assertEquals(result.getObjects().get(0).getProject().getIdentifier().getIdentifier(), "/SPACE1/PROJECT1"); - assertEquals(result.getTotalCount(), 1); - } - - @Test(priority = -1) - public void testSearchForSamplesWithProjectWithSpaceWithCode() - { - SampleSearchCriteria searchCriteria = new SampleSearchCriteria(); - searchCriteria.withProject().withSpace().withCode().thatEquals("SPACE1"); - SampleFetchOptions fetchOptions = new SampleFetchOptions(); - fetchOptions.withProject(); - - SearchResult<Sample> result = v3api.searchSamples(systemSessionToken, searchCriteria, fetchOptions); - - assertEquals(result.getObjects().get(0).getIdentifier().getIdentifier(), "/SPACE1/PROJECT1/SAMPLE3"); - assertEquals(result.getObjects().get(0).getProject().getIdentifier().getIdentifier(), "/SPACE1/PROJECT1"); - assertEquals(result.getObjects().get(1).getIdentifier().getIdentifier(), "/SPACE1/PROJECT1/SAMPLE4"); - assertEquals(result.getObjects().get(1).getProject().getIdentifier().getIdentifier(), "/SPACE1/PROJECT1"); - assertEquals(result.getTotalCount(), 2); - } - - @Test(priority = -1) - public void testSearchForSamplesWithProjectWithPermId() - { - SampleSearchCriteria searchCriteria = new SampleSearchCriteria(); - searchCriteria.withProject().withPermId().thatEquals(project2inSpace2.getPermId()); - SampleFetchOptions fetchOptions = new SampleFetchOptions(); - fetchOptions.withProject(); - - SearchResult<Sample> result = v3api.searchSamples(systemSessionToken, searchCriteria, fetchOptions); - - assertEquals(result.getObjects().get(0).getIdentifier().getIdentifier(), "/SPACE2/PROJECT2/SAMPLE5"); - assertEquals(result.getObjects().get(0).getProject().getIdentifier().getIdentifier(), "/SPACE2/PROJECT2"); - assertEquals(result.getObjects().get(1).getIdentifier().getIdentifier(), "/SPACE2/PROJECT2/SAMPLE6"); - assertEquals(result.getObjects().get(1).getProject().getIdentifier().getIdentifier(), "/SPACE2/PROJECT2"); - assertEquals(result.getTotalCount(), 2); - } - - @Test(priority = -1) - public void testSearchForSamplesWithoutProjects() - { - SampleSearchCriteria searchCriteria = new SampleSearchCriteria(); - searchCriteria.withCode().thatStartsWith("SAMP"); - searchCriteria.withoutProject(); - SampleFetchOptions fetchOptions = new SampleFetchOptions(); - fetchOptions.withProject(); - - SearchResult<Sample> result = v3api.searchSamples(systemSessionToken, searchCriteria, fetchOptions); - - assertEquals(result.getObjects().get(0).getIdentifier().getIdentifier(), "/SPACE1/SAMPLE1"); - assertEquals(result.getObjects().get(0).getProject(), null); - assertEquals(result.getObjects().get(1).getIdentifier().getIdentifier(), "/SPACE1/SAMPLE2"); - assertEquals(result.getObjects().get(1).getProject(), null); - assertEquals(result.getTotalCount(), 2); - } - - private void assertUserFailureException(IDelegatedAction action, String expectedExceptionMessage) - { - try - { - action.execute(); - fail("UserFailureException expected"); - } catch (UserFailureException ex) - { - assertEquals(ex.getMessage(), expectedExceptionMessage); - } - } - - private void assertModification(IModificationDateHolder modificationDateHolder, IModifierHolder modifierHolder, - Date date, String modifier) - { - assertNotOlder(modificationDateHolder.getModificationDate(), date); - assertEquals(modifierHolder.getModifier().getUserId(), modifier); - } - - private void assertNotOlder(Date actualDate, Date referenceDate) - { - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); - String renderedReferenceDate = format.format(referenceDate.getTime()); - String renderedActualDate = format.format(actualDate); - assertEquals(renderedReferenceDate.compareTo(renderedActualDate) <= 0, true, - renderedActualDate + " > " + renderedReferenceDate); - } - - private Date sleep() - { - Date now = daoFactory.getTransactionTimestamp(); - return now; - } - - private List<SpacePermId> createSpaces(String sessionToken, String...spaceCodes) - { - List<SpaceCreation> newSpaces = new ArrayList<SpaceCreation>(); - for (String spaceCode : spaceCodes) - { - SpaceCreation space = new SpaceCreation(); - space.setCode(spaceCode); - newSpaces.add(space); - } - return v3api.createSpaces(sessionToken, newSpaces); - } - - private List<ProjectPermId> createProjects(String sessionToken, ISpaceId spaceId, String...projectCodes) - { - List<ProjectCreation> newProjects = new ArrayList<ProjectCreation>(); - for (String projectCode : projectCodes) - { - ProjectCreation project = new ProjectCreation(); - project.setSpaceId(spaceId); - project.setCode(projectCode); - newProjects.add(project); - } - return v3api.createProjects(sessionToken, newProjects); - } - - private List<SamplePermId> createSamples(String sessionToken, ISpaceId spaceOrNull, - IProjectId projectOrNull, IExperimentId experimentOrNull, String...codes) - { - List<SampleCreation> newSamples = new ArrayList<SampleCreation>(); - for (String code : codes) - { - SampleCreation sample = new SampleCreation(); - sample.setTypeId(ENTITY_TYPE_UNKNOWN); - sample.setSpaceId(spaceOrNull); - sample.setProjectId(projectOrNull); - sample.setExperimentId(experimentOrNull); - sample.setCode(code); - newSamples.add(sample); - } - return v3api.createSamples(sessionToken, newSamples); - } - - private List<ExperimentPermId> createExperiments(String sessionToken, IProjectId project, String...codes) - { - List<ExperimentCreation> newExperiments = new ArrayList<ExperimentCreation>(); - for (String code : codes) - { - ExperimentCreation experiment = new ExperimentCreation(); - experiment.setCode(code); - experiment.setTypeId(ENTITY_TYPE_UNKNOWN); - experiment.setProjectId(project); - newExperiments.add(experiment); - } - return v3api.createExperiments(sessionToken, newExperiments); - } - - private String createUniqueCode(String prefix) - { - return prefix + "-" + System.currentTimeMillis(); - } - - private void waitAtLeastASecond() - { - try - { - Thread.sleep(1100); - } catch (InterruptedException ex) - { - // silently ignored - } - } -*/ + /* + * private static final String SYSTEM_USER = "system"; private static final SpacePermId HOME_SPACE_ID = new SpacePermId("DEFAULT"); private static + * final Logger operationLog = LogFactory.getLogger(LogCategory.OPERATION, ProjectSampleTest.class); private static final EntityTypePermId + * ENTITY_TYPE_UNKNOWN = new EntityTypePermId("UNKNOWN"); + * @Autowired protected IApplicationServerApi v3api; private ISpaceId space1; private ISpaceId space2; private ProjectPermId project1inSpace1; + * private ProjectPermId project2inSpace1; private ProjectPermId project1inSpace2; private ProjectPermId project2inSpace2; private ProjectPermId + * project1inHomeSpace; private String adminSessionToken; private String adminUser; + * @BeforeClass public void createData() { List<SpacePermId> spaces = createSpaces(systemSessionToken, "SPACE1", "SPACE2"); space1 = + * spaces.get(0); space2 = spaces.get(1); List<ProjectPermId> projects = createProjects(systemSessionToken, space1, "PROJECT1", "PROJECT2"); + * project1inSpace1 = projects.get(0); project2inSpace1 = projects.get(1); project1inSpace2 = createProjects(systemSessionToken, space2, + * "PROJECT1").get(0); project2inSpace2 = createProjects(systemSessionToken, space2, "PROJECT2").get(0); project1inHomeSpace = + * createProjects(systemSessionToken, HOME_SPACE_ID, "PROJECT1").get(0); createSamples(systemSessionToken, null, null, null, "SHARED1", + * "SHARED2"); createSamples(systemSessionToken, space1, null, null, "SAMPLE1", "SAMPLE2"); createSamples(systemSessionToken, space1, + * project1inSpace1, null, "SAMPLE3", "SAMPLE4"); createSamples(systemSessionToken, space2, project2inSpace2, null, "SAMPLE5", "SAMPLE6"); + * waitAtLeastASecond(); // to allow checks on modification time stamps UpdateUtils.waitUntilIndexUpdaterIsIdle(applicationContext, operationLog); + * SessionBuilder session = aSession().withInstanceRole(RoleCode.ADMIN); adminUser = session.getUserID(); adminSessionToken = create(session); + * commonServer.changeUserHomeSpace(adminSessionToken, new TechId(1)); // home space = DEFAULT } + * @Override + * @AfterTransaction + * @Test(enabled = false) public void cleanDatabase() { // super method deletes samples, experiments and data sets from the database } + * @Test public void testCreateASharedSampleWithASharedSampleAsComponent() { String sampleCode = createUniqueCode("S"); SampleCreation s1 = new + * SampleCreation(); s1.setCode(sampleCode); s1.setTypeId(ENTITY_TYPE_UNKNOWN); SampleCreation s2 = new SampleCreation(); s2.setCode("A01"); + * s2.setTypeId(ENTITY_TYPE_UNKNOWN); s2.setContainerId(new SampleIdentifier(null, null, sampleCode)); List<SamplePermId> sampleIds = + * v3api.createSamples(systemSessionToken, Arrays.asList(s1, s2)); Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, + * sampleIds, new SampleFetchOptions()); assertEquals(samples.get(sampleIds.get(0)).getIdentifier().getIdentifier(), "/" + sampleCode); + * assertEquals(samples.get(sampleIds.get(1)).getIdentifier().getIdentifier(), "/" + sampleCode + ":A01"); } + * @Test public void testCreateASharedSampleWithASpaceSampleAsComponent() { String sampleCode = createUniqueCode("S"); SampleCreation s1 = new + * SampleCreation(); s1.setCode(sampleCode); s1.setTypeId(ENTITY_TYPE_UNKNOWN); SampleCreation s2 = new SampleCreation(); s2.setCode("A01"); + * s2.setTypeId(ENTITY_TYPE_UNKNOWN); s2.setSpaceId(space1); s2.setContainerId(new SampleIdentifier(null, null, sampleCode)); List<SamplePermId> + * sampleIds = v3api.createSamples(systemSessionToken, Arrays.asList(s1, s2)); Map<ISampleId, Sample> samples = + * v3api.mapSamples(systemSessionToken, sampleIds, new SampleFetchOptions()); + * assertEquals(samples.get(sampleIds.get(0)).getIdentifier().getIdentifier(), "/" + sampleCode); + * assertEquals(samples.get(sampleIds.get(1)).getIdentifier().getIdentifier(), "/SPACE1/" + sampleCode + ":A01"); } + * @Test public void testCreateASharedSampleWithAProjectSampleAsComponent() { String projectCode = createUniqueCode("P"); + * createProjects(systemSessionToken, space1, projectCode); String sampleCode = createUniqueCode("S"); SampleCreation s1 = new SampleCreation(); + * s1.setCode(sampleCode); s1.setTypeId(ENTITY_TYPE_UNKNOWN); SampleCreation s2 = new SampleCreation(); s2.setCode("A01"); + * s2.setTypeId(ENTITY_TYPE_UNKNOWN); s2.setSpaceId(space1); s2.setProjectId(new ProjectIdentifier("SPACE1", projectCode)); s2.setContainerId(new + * SampleIdentifier(null, null, sampleCode)); List<SamplePermId> sampleIds = v3api.createSamples(systemSessionToken, Arrays.asList(s1, s2)); + * Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, sampleIds, new SampleFetchOptions()); + * assertEquals(samples.get(sampleIds.get(0)).getIdentifier().getIdentifier(), "/" + sampleCode); + * assertEquals(samples.get(sampleIds.get(1)).getIdentifier().getIdentifier(), "/SPACE1/" + projectCode + "/" + sampleCode + ":A01"); } + * @Test public void testCreateASharedSampleWithAProjectExperimentSampleAsComponent() { String projectCode = createUniqueCode("P"); ProjectPermId + * project = createProjects(systemSessionToken, space1, projectCode).get(0); String experimentCode = createUniqueCode("E"); + * createExperiments(systemSessionToken, project, experimentCode); String sampleCode = createUniqueCode("S"); SampleCreation s1 = new + * SampleCreation(); s1.setCode(sampleCode); s1.setTypeId(ENTITY_TYPE_UNKNOWN); SampleCreation s2 = new SampleCreation(); s2.setCode("A01"); + * s2.setTypeId(ENTITY_TYPE_UNKNOWN); s2.setSpaceId(space1); s2.setProjectId(new ProjectIdentifier("SPACE1", projectCode)); s2.setExperimentId(new + * ExperimentIdentifier("SPACE1", projectCode, experimentCode)); s2.setContainerId(new SampleIdentifier(null, null, sampleCode)); + * List<SamplePermId> sampleIds = v3api.createSamples(systemSessionToken, Arrays.asList(s1, s2)); Map<ISampleId, Sample> samples = + * v3api.mapSamples(systemSessionToken, sampleIds, new SampleFetchOptions()); + * assertEquals(samples.get(sampleIds.get(0)).getIdentifier().getIdentifier(), "/" + sampleCode); + * assertEquals(samples.get(sampleIds.get(1)).getIdentifier().getIdentifier(), "/SPACE1/" + projectCode + "/" + sampleCode + ":A01"); } + * @Test public void testCreateASharedSampleWithAnExperimentSampleAsComponent() { String projectCode = createUniqueCode("P"); ProjectPermId + * project = createProjects(systemSessionToken, space1, projectCode).get(0); String experimentCode = createUniqueCode("E"); + * createExperiments(systemSessionToken, project, experimentCode); String sampleCode = createUniqueCode("S"); SampleCreation s1 = new + * SampleCreation(); s1.setCode(sampleCode); s1.setTypeId(ENTITY_TYPE_UNKNOWN); SampleCreation s2 = new SampleCreation(); s2.setCode("A01"); + * s2.setTypeId(ENTITY_TYPE_UNKNOWN); s2.setSpaceId(space1); s2.setExperimentId(new ExperimentIdentifier("SPACE1", projectCode, experimentCode)); + * s2.setContainerId(new SampleIdentifier(null, null, sampleCode)); List<SamplePermId> sampleIds = v3api.createSamples(systemSessionToken, + * Arrays.asList(s1, s2)); Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, sampleIds, new SampleFetchOptions()); + * assertEquals(samples.get(sampleIds.get(0)).getIdentifier().getIdentifier(), "/" + sampleCode); + * assertEquals(samples.get(sampleIds.get(1)).getIdentifier().getIdentifier(), "/SPACE1/" + sampleCode + ":A01"); } + * @Test public void testCreateSampleAndMapSamplesByPermId() { String sampleCode = createUniqueCode("S"); SampleCreation sampleCreation = new + * SampleCreation(); sampleCreation.setCode(sampleCode); sampleCreation.setTypeId(ENTITY_TYPE_UNKNOWN); sampleCreation.setSpaceId(space1); + * sampleCreation.setProjectId(project1inSpace1); List<SamplePermId> ids = v3api.createSamples(systemSessionToken, Arrays.asList(sampleCreation)); + * SampleFetchOptions fetchOptions = new SampleFetchOptions(); fetchOptions.withProject(); Map<ISampleId, Sample> samples = + * v3api.mapSamples(systemSessionToken, ids, fetchOptions); Sample sample = samples.get(ids.get(0)); + * assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE1/PROJECT1/" + sampleCode); + * assertEquals(sample.getProject().getIdentifier().getIdentifier(), "/SPACE1/PROJECT1"); } + * @Test public void testCreateThreeSamplesWithSameCodeInDifferentProjectOfSameSpaceAndMapSamplesByIdentifier() { String sampleCode = + * createUniqueCode("S"); SampleCreation s1 = new SampleCreation(); s1.setCode(sampleCode); s1.setTypeId(ENTITY_TYPE_UNKNOWN); + * s1.setSpaceId(space1); s1.setProjectId(project1inSpace1); SampleCreation s2 = new SampleCreation(); s2.setCode(sampleCode); + * s2.setTypeId(ENTITY_TYPE_UNKNOWN); s2.setSpaceId(space1); s2.setProjectId(project2inSpace1); SampleCreation s3 = new SampleCreation(); + * s3.setCode(sampleCode); s3.setTypeId(ENTITY_TYPE_UNKNOWN); s3.setSpaceId(space1); v3api.createSamples(systemSessionToken, Arrays.asList(s1, s2, + * s3)); SampleFetchOptions fetchOptions = new SampleFetchOptions(); fetchOptions.withProject(); List<ISampleId> ids = new ArrayList<>(); + * ids.add(new SampleIdentifier("/SPACE1/PROJECT1/" + sampleCode)); ids.add(new SampleIdentifier("/SPACE1/PROJECT2/" + sampleCode)); ids.add(new + * SampleIdentifier("/SPACE1/" + sampleCode)); Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, ids, fetchOptions); + * assertEquals(samples.get(ids.get(0)).getProject().getIdentifier().toString(), "/SPACE1/PROJECT1"); + * assertEquals(samples.get(ids.get(1)).getProject().getIdentifier().toString(), "/SPACE1/PROJECT2"); + * assertEquals(samples.get(ids.get(2)).getProject(), null); } + * @Test public void testCreateProjectSampleWithAProjectSampleComponentFromAnotherSpace() { String sampleCode = createUniqueCode("S"); + * SampleCreation s1 = new SampleCreation(); s1.setCode(sampleCode); s1.setTypeId(ENTITY_TYPE_UNKNOWN); s1.setSpaceId(space1); + * s1.setProjectId(project1inSpace1); SamplePermId s1PermId = v3api.createSamples(systemSessionToken, Arrays.asList(s1)).get(0); SampleCreation s2 + * = new SampleCreation(); s2.setCode("A01"); s2.setTypeId(ENTITY_TYPE_UNKNOWN); s2.setSpaceId(space2); s2.setProjectId(project1inSpace2); + * s2.setContainerId(s1PermId); v3api.createSamples(systemSessionToken, Arrays.asList(s2)); SampleFetchOptions fetchOptions = new + * SampleFetchOptions(); fetchOptions.withProject(); fetchOptions.withContainer(); List<ISampleId> ids = new ArrayList<>(); ids.add(new + * SampleIdentifier("/SPACE1/PROJECT1/" + sampleCode)); ids.add(new SampleIdentifier("/SPACE2/PROJECT1/" + sampleCode + ":A01")); Map<ISampleId, + * Sample> samples = v3api.mapSamples(systemSessionToken, ids, fetchOptions); + * assertEquals(samples.get(ids.get(0)).getProject().getIdentifier().toString(), "/SPACE1/PROJECT1"); + * assertEquals(samples.get(ids.get(1)).getProject().getIdentifier().toString(), "/SPACE2/PROJECT1"); } + * @Test public void testCreateProjectSampleWithComponentInHomeSpace() { String sampleCode = createUniqueCode("S"); SampleCreation s1 = new + * SampleCreation(); s1.setCode(sampleCode); s1.setTypeId(ENTITY_TYPE_UNKNOWN); s1.setSpaceId(HOME_SPACE_ID); + * s1.setProjectId(project1inHomeSpace); SamplePermId s1PermId = v3api.createSamples(systemSessionToken, Arrays.asList(s1)).get(0); SampleCreation + * s2 = new SampleCreation(); s2.setCode("A01"); s2.setTypeId(ENTITY_TYPE_UNKNOWN); s2.setSpaceId(HOME_SPACE_ID); + * s2.setProjectId(project1inHomeSpace); s2.setContainerId(s1PermId); v3api.createSamples(systemSessionToken, Arrays.asList(s2)); + * SampleFetchOptions fetchOptions = new SampleFetchOptions(); fetchOptions.withProject(); fetchOptions.withContainer(); List<ISampleId> ids = new + * ArrayList<>(); ids.add(new SampleIdentifier("//PROJECT1/" + sampleCode)); ids.add(new SampleIdentifier("//PROJECT1/" + sampleCode + ":A01")); + * Map<ISampleId, Sample> samples = v3api.mapSamples(adminSessionToken, ids, fetchOptions); + * assertEquals(samples.get(ids.get(0)).getProject().getIdentifier().toString(), "/DEFAULT/PROJECT1"); + * assertEquals(samples.get(ids.get(1)).getProject().getIdentifier().toString(), "/DEFAULT/PROJECT1"); } + * @Test public void testAssignSpaceSampleToAProject() { String sampleCode = createUniqueCode("S"); createSamples(systemSessionToken, space1, + * null, null, sampleCode); String projectCode = createUniqueCode("P"); ProjectPermId project = createProjects(systemSessionToken, space1, + * projectCode).get(0); SampleUpdate sampleUpdate = new SampleUpdate(); sampleUpdate.setSampleId(new SampleIdentifier("/SPACE1/" + sampleCode)); + * sampleUpdate.setProjectId(project); Date now = sleep(); v3api.updateSamples(adminSessionToken, Arrays.asList(sampleUpdate)); SampleFetchOptions + * fetchOptions = new SampleFetchOptions(); fetchOptions.withModifier(); fetchOptions.withSpace(); fetchOptions.withProject().withModifier(); + * SampleIdentifier newSampleIdentifier = new SampleIdentifier("/SPACE1/" + projectCode + "/" + sampleCode); Map<ISampleId, Sample> samples = + * v3api.mapSamples(systemSessionToken, Arrays.asList(newSampleIdentifier), fetchOptions); Sample sample = samples.get(newSampleIdentifier); + * assertModification(sample, sample, now, adminUser); assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode + "/" + + * sampleCode); Project sampleProject = sample.getProject(); assertEquals(sampleProject.getIdentifier().getIdentifier(), "/SPACE1/" + + * projectCode); assertModification(sampleProject, sampleProject, now, adminUser); } + * @Test public void testAssignHomeSpaceSampleToAProjectInHomeSpace() { String sampleCode = createUniqueCode("S"); + * createSamples(systemSessionToken, HOME_SPACE_ID, null, null, sampleCode); String projectCode = createUniqueCode("P"); ProjectPermId project = + * createProjects(systemSessionToken, HOME_SPACE_ID, projectCode).get(0); SampleUpdate sampleUpdate = new SampleUpdate(); + * sampleUpdate.setSampleId(new SampleIdentifier("//" + sampleCode)); sampleUpdate.setProjectId(project); Date now = sleep(); + * v3api.updateSamples(adminSessionToken, Arrays.asList(sampleUpdate)); SampleFetchOptions fetchOptions = new SampleFetchOptions(); + * fetchOptions.withModifier(); fetchOptions.withSpace(); fetchOptions.withProject().withModifier(); SampleIdentifier newSampleIdentifier = new + * SampleIdentifier("//" + projectCode + "/" + sampleCode); Map<ISampleId, Sample> samples = v3api.mapSamples(adminSessionToken, + * Arrays.asList(newSampleIdentifier), fetchOptions); Sample sample = samples.get(newSampleIdentifier); assertModification(sample, sample, now, + * adminUser); assertEquals(sample.getIdentifier().getIdentifier(), "/DEFAULT/" + projectCode + "/" + sampleCode); Project sampleProject = + * sample.getProject(); assertEquals(sampleProject.getIdentifier().getIdentifier(), "/DEFAULT/" + projectCode); assertModification(sampleProject, + * sampleProject, now, adminUser); } + * @Test public void testAssignProjectSampleToADifferentProjectInTheSameSpace() { String projectCode1 = createUniqueCode("P"); ProjectPermId + * project1 = createProjects(systemSessionToken, space1, projectCode1).get(0); String sampleCode = createUniqueCode("S"); SamplePermId spaceSample + * = createSamples(systemSessionToken, space1, project1, null, sampleCode).get(0); String projectCode2 = createUniqueCode("P"); ProjectPermId + * project2 = createProjects(systemSessionToken, space1, projectCode2).get(0); SampleUpdate sampleUpdate = new SampleUpdate(); + * sampleUpdate.setSampleId(new SampleIdentifier("/SPACE1/" + projectCode1 + "/" + sampleCode)); sampleUpdate.setProjectId(project2); Date now = + * sleep(); v3api.updateSamples(adminSessionToken, Arrays.asList(sampleUpdate)); SampleFetchOptions fetchOptions = new SampleFetchOptions(); + * fetchOptions.withModifier(); fetchOptions.withSpace(); fetchOptions.withProject().withModifier(); Map<ISampleId, Sample> samples = + * v3api.mapSamples(systemSessionToken, Arrays.asList(spaceSample), fetchOptions); Sample sample = samples.get(spaceSample); + * assertModification(sample, sample, now, adminUser); assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode2 + "/" + + * sampleCode); Project sampleProject = sample.getProject(); assertEquals(sampleProject.getIdentifier().getIdentifier(), "/SPACE1/" + + * projectCode2); assertModification(sampleProject, sampleProject, now, adminUser); ProjectFetchOptions projectFetchOptions = new + * ProjectFetchOptions(); projectFetchOptions.withModifier(); Map<IProjectId, Project> projects = v3api.mapProjects(systemSessionToken, + * Arrays.asList(project1), projectFetchOptions); assertModification(projects.get(project1), projects.get(project1), now, adminUser); } + * @Test public void testAssignProjectSampleWithComponentToAProjectInADifferentSpace() { String projectCode = createUniqueCode("P"); ProjectPermId + * project1 = createProjects(systemSessionToken, space1, projectCode).get(0); String sampleCode = createUniqueCode("S"); SampleCreation s1 = new + * SampleCreation(); s1.setCode(sampleCode); s1.setTypeId(ENTITY_TYPE_UNKNOWN); s1.setSpaceId(space1); s1.setProjectId(project1); SampleCreation + * s2 = new SampleCreation(); s2.setCode("A01"); s2.setTypeId(ENTITY_TYPE_UNKNOWN); s2.setSpaceId(space1); s2.setProjectId(project1); + * s2.setContainerId(new SampleIdentifier("/SPACE1/" + projectCode + "/" + sampleCode)); v3api.createSamples(systemSessionToken, Arrays.asList(s1, + * s2)); ProjectPermId project2 = createProjects(systemSessionToken, space2, projectCode).get(0); SampleUpdate sampleUpdate = new SampleUpdate(); + * sampleUpdate.setSampleId(new SampleIdentifier("/SPACE1/" + projectCode + "/" + sampleCode)); sampleUpdate.setSpaceId(space2); + * sampleUpdate.setProjectId(project2); Date now = sleep(); v3api.updateSamples(adminSessionToken, Arrays.asList(sampleUpdate)); + * SampleFetchOptions fetchOptions = new SampleFetchOptions(); fetchOptions.withModifier(); fetchOptions.withSpace(); + * fetchOptions.withProject().withModifier(); SampleIdentifier containerID = new SampleIdentifier("/SPACE2/" + projectCode + "/" + sampleCode); + * SampleIdentifier componentID = new SampleIdentifier("/SPACE1/" + projectCode + "/" + sampleCode + ":A01"); Map<ISampleId, Sample> samples = + * v3api.mapSamples(systemSessionToken, Arrays.asList(containerID, componentID), fetchOptions); Sample sample = samples.get(containerID); + * assertModification(sample, sample, now, adminUser); assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE2/" + projectCode + "/" + + * sampleCode); Project project = sample.getProject(); assertEquals(project.getIdentifier().getIdentifier(), "/SPACE2/" + projectCode); + * assertModification(project, project, now, adminUser); Sample component = samples.get(componentID); + * assertEquals(component.getModifier().getUserId(), SYSTEM_USER); assertEquals(component.getIdentifier().getIdentifier(), "/SPACE1/" + + * projectCode + "/" + sampleCode + ":A01"); Project componentProject = component.getProject(); + * assertEquals(componentProject.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode); assertModification(componentProject, + * componentProject, now, adminUser); } + * @Test public void testAssignProjectSampleToAProjectInADifferentSpace() { String projectCode = createUniqueCode("P"); ProjectPermId project1 = + * createProjects(systemSessionToken, space1, projectCode).get(0); String sampleCode = createUniqueCode("S"); SamplePermId spaceSample = + * createSamples(systemSessionToken, space1, project1, null, sampleCode).get(0); ProjectPermId project2 = createProjects(systemSessionToken, + * space2, projectCode).get(0); SampleUpdate sampleUpdate = new SampleUpdate(); sampleUpdate.setSampleId(spaceSample); + * sampleUpdate.setSpaceId(space2); sampleUpdate.setProjectId(project2); Date now = sleep(); v3api.updateSamples(adminSessionToken, + * Arrays.asList(sampleUpdate)); SampleFetchOptions fetchOptions = new SampleFetchOptions(); fetchOptions.withModifier(); + * fetchOptions.withSpace(); fetchOptions.withProject().withModifier(); Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, + * Arrays.asList(spaceSample), fetchOptions); Sample sample = samples.get(spaceSample); assertModification(sample, sample, now, adminUser); + * assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE2/" + projectCode + "/" + sampleCode); Project project = sample.getProject(); + * assertEquals(project.getIdentifier().getIdentifier(), "/SPACE2/" + projectCode); assertModification(project, project, now, adminUser); } + * @Test public void testAssignExperimentWithProjectSamplesToADifferentProject() { String projectCode1 = createUniqueCode("P"); String + * projectCode2 = projectCode1 + "A"; createProjects(systemSessionToken, space1, projectCode1, projectCode2); String experimentCode = + * createUniqueCode("E"); ProjectIdentifier project1 = new ProjectIdentifier("SPACE1", projectCode1); ExperimentPermId experiment = + * createExperiments(systemSessionToken, project1, experimentCode).get(0); String sampleCode = createUniqueCode("S"); SamplePermId sample = + * createSamples(systemSessionToken, space1, project1, experiment, sampleCode).get(0); ExperimentUpdate experimentUpdate = new ExperimentUpdate(); + * experimentUpdate.setExperimentId(experiment); experimentUpdate.setProjectId(new ProjectIdentifier("SPACE1", projectCode2)); Date now = sleep(); + * v3api.updateExperiments(adminSessionToken, Arrays.asList(experimentUpdate)); SampleFetchOptions fetchOptions = new SampleFetchOptions(); + * fetchOptions.withModifier(); fetchOptions.withSpace(); fetchOptions.withProject().withModifier(); Sample experimentSample = + * v3api.mapSamples(systemSessionToken, Arrays.asList(sample), fetchOptions).values().iterator().next(); assertModification(experimentSample, + * experimentSample, now, adminUser); assertEquals(experimentSample.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode2 + "/" + + * sampleCode); Project project = experimentSample.getProject(); assertEquals(project.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode2); + * assertModification(project, project, now, adminUser); ExperimentFetchOptions experimentFetchOptions = new ExperimentFetchOptions(); + * experimentFetchOptions.withModifier(); Experiment sampleExperiment = v3api.mapExperiments(systemSessionToken, Arrays.asList(experiment), + * experimentFetchOptions).values().iterator().next(); assertModification(sampleExperiment, sampleExperiment, now, adminUser); } + * @Test public void testDeleteExperimentWithProjectSamples() { String projectCode = createUniqueCode("P"); createProjects(systemSessionToken, + * space1, projectCode); String experimentCode = createUniqueCode("E"); ProjectIdentifier project = new ProjectIdentifier("SPACE1", projectCode); + * ExperimentPermId experiment = createExperiments(systemSessionToken, project, experimentCode).get(0); String sampleCode = createUniqueCode("S"); + * SamplePermId sample = createSamples(systemSessionToken, space1, project, experiment, sampleCode).get(0); ExperimentDeletionOptions + * deletionOptions = new ExperimentDeletionOptions(); deletionOptions.setReason("a test"); v3api.deleteExperiments(adminSessionToken, + * Arrays.asList(experiment), deletionOptions); assertEquals(v3api.mapSamples(systemSessionToken, Arrays.asList(sample), new + * SampleFetchOptions()).size(), 0); ExperimentFetchOptions experimentFetchOptions = new ExperimentFetchOptions(); + * experimentFetchOptions.withModifier(); assertEquals(v3api.mapExperiments(systemSessionToken, Arrays.asList(experiment), + * experimentFetchOptions).size(), 0); } + * @Test public void testUnassignProjectSampleFromProject() { String projectCode = createUniqueCode("P"); ProjectPermId project = + * createProjects(systemSessionToken, space1, projectCode).get(0); String sampleCode = createUniqueCode("S"); SamplePermId projectSample = + * createSamples(systemSessionToken, space1, project, null, sampleCode).get(0); SampleUpdate sampleUpdate = new SampleUpdate(); + * sampleUpdate.setSampleId(projectSample); sampleUpdate.setProjectId(null); Date now = sleep(); v3api.updateSamples(adminSessionToken, + * Arrays.asList(sampleUpdate)); SampleFetchOptions fetchOptions = new SampleFetchOptions(); fetchOptions.withModifier(); + * fetchOptions.withSpace(); fetchOptions.withProject().withModifier(); Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, + * Arrays.asList(projectSample), fetchOptions); Sample sample = samples.get(projectSample); assertModification(sample, sample, now, adminUser); + * assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE1/" + sampleCode); assertEquals(sample.getProject(), null); ProjectFetchOptions + * projectFetchOptions = new ProjectFetchOptions(); projectFetchOptions.withModifier(); Map<IProjectId, Project> projects = + * v3api.mapProjects(systemSessionToken, Arrays.asList(project), projectFetchOptions); Project previousProject = + * projects.values().iterator().next(); assertModification(previousProject, previousProject, now, adminUser); } + * @Test public void testUnassignProjectSampleFromProjectAndSpace() { String projectCode = createUniqueCode("P"); ProjectPermId project = + * createProjects(systemSessionToken, space1, projectCode).get(0); String sampleCode = createUniqueCode("S"); SamplePermId projectSample = + * createSamples(systemSessionToken, space1, project, null, sampleCode).get(0); SampleUpdate sampleUpdate = new SampleUpdate(); + * sampleUpdate.setSampleId(projectSample); sampleUpdate.setProjectId(null); sampleUpdate.setSpaceId(null); Date now = sleep(); + * v3api.updateSamples(adminSessionToken, Arrays.asList(sampleUpdate)); SampleFetchOptions fetchOptions = new SampleFetchOptions(); + * fetchOptions.withModifier(); fetchOptions.withSpace(); fetchOptions.withProject().withModifier(); Map<ISampleId, Sample> samples = + * v3api.mapSamples(systemSessionToken, Arrays.asList(projectSample), fetchOptions); Sample sample = samples.get(projectSample); + * assertModification(sample, sample, now, adminUser); assertEquals(sample.getIdentifier().getIdentifier(), "/" + sampleCode); + * assertEquals(sample.getProject(), null); ProjectFetchOptions projectFetchOptions = new ProjectFetchOptions(); + * projectFetchOptions.withModifier(); Map<IProjectId, Project> projects = v3api.mapProjects(systemSessionToken, Arrays.asList(project), + * projectFetchOptions); Project previousProject = projects.values().iterator().next(); assertModification(previousProject, previousProject, now, + * adminUser); } + * @Test public void testUnassignProjectExperimentSampleFromExperiment() { String projectCode = createUniqueCode("P"); ProjectPermId project = + * createProjects(systemSessionToken, space1, projectCode).get(0); String experimentCode = createUniqueCode("E"); ExperimentPermId experiment = + * createExperiments(systemSessionToken, project, experimentCode).get(0); String sampleCode = createUniqueCode("S"); SamplePermId projectSample = + * createSamples(systemSessionToken, space1, project, experiment, sampleCode).get(0); SampleUpdate sampleUpdate = new SampleUpdate(); + * sampleUpdate.setSampleId(projectSample); sampleUpdate.setExperimentId(null); Date now = sleep(); v3api.updateSamples(adminSessionToken, + * Arrays.asList(sampleUpdate)); SampleFetchOptions fetchOptions = new SampleFetchOptions(); fetchOptions.withModifier(); + * fetchOptions.withSpace(); fetchOptions.withProject().withModifier(); Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, + * Arrays.asList(projectSample), fetchOptions); Sample sample = samples.get(projectSample); assertModification(sample, sample, now, adminUser); + * assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode + "/" + sampleCode); Project sampleProject = sample.getProject(); + * assertEquals(sampleProject.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode); assertEquals(sampleProject.getModifier().getUserId(), + * SYSTEM_USER); ExperimentFetchOptions experimentFetchOptions = new ExperimentFetchOptions(); experimentFetchOptions.withModifier(); Experiment + * previousExperiment = v3api.mapExperiments(systemSessionToken, Arrays.asList(experiment), experimentFetchOptions).values().iterator().next(); + * assertModification(previousExperiment, previousExperiment, now, adminUser); } + * @Test public void testUpdateProjectSample() { String projectCode = createUniqueCode("P"); ProjectPermId project = + * createProjects(systemSessionToken, space1, projectCode).get(0); String sampleCode = createUniqueCode("S"); SamplePermId projectSample = + * createSamples(systemSessionToken, space1, project, null, sampleCode).get(0); SampleUpdate sampleUpdate = new SampleUpdate(); + * sampleUpdate.setSampleId(projectSample); Date now = sleep(); v3api.updateSamples(adminSessionToken, Arrays.asList(sampleUpdate)); + * SampleFetchOptions fetchOptions = new SampleFetchOptions(); fetchOptions.withModifier(); fetchOptions.withSpace(); + * fetchOptions.withProject().withModifier(); Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, Arrays.asList(projectSample), + * fetchOptions); Sample sample = samples.get(projectSample); assertModification(sample, sample, now, adminUser); + * assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode + "/" + sampleCode); + * assertEquals(sample.getProject().getIdentifier().getIdentifier(), "/SPACE1/" + projectCode); ProjectFetchOptions projectFetchOptions = new + * ProjectFetchOptions(); projectFetchOptions.withModifier(); Map<IProjectId, Project> projects = v3api.mapProjects(systemSessionToken, + * Arrays.asList(project), projectFetchOptions); Project sampleProject = projects.values().iterator().next(); + * assertEquals(sampleProject.getModifier().getUserId(), SYSTEM_USER); } + * @Test public void testAssignSpaceSampleToAnExperimentInTheSameSpace() { String projectCode = createUniqueCode("P"); ProjectPermId project = + * createProjects(systemSessionToken, space1, projectCode).get(0); String sampleCode = createUniqueCode("S"); SamplePermId projectSample = + * createSamples(systemSessionToken, space1, null, null, sampleCode).get(0); String experimentCode = createUniqueCode("E"); + * createExperiments(systemSessionToken, project, experimentCode); SampleUpdate sampleUpdate = new SampleUpdate(); + * sampleUpdate.setSampleId(projectSample); sampleUpdate.setExperimentId(new ExperimentIdentifier("SPACE1", projectCode, experimentCode)); Date + * now = sleep(); v3api.updateSamples(adminSessionToken, Arrays.asList(sampleUpdate)); SampleFetchOptions fetchOptions = new SampleFetchOptions(); + * fetchOptions.withModifier(); fetchOptions.withSpace(); fetchOptions.withProject().withModifier(); fetchOptions.withExperiment().withModifier(); + * Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, Arrays.asList(projectSample), fetchOptions); Sample sample = + * samples.get(projectSample); assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE1/" + sampleCode); assertModification(sample, sample, + * now, adminUser); assertEquals(sample.getProject(), null); Experiment experiment = sample.getExperiment(); + * assertEquals(experiment.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode + "/" + experimentCode); assertModification(experiment, + * experiment, now, adminUser); } + * @Test public void testAssignProjectSampleToAnExperimentInTheSameProject() { String projectCode = createUniqueCode("P"); ProjectPermId project = + * createProjects(systemSessionToken, space1, projectCode).get(0); String sampleCode = createUniqueCode("S"); SamplePermId projectSample = + * createSamples(systemSessionToken, space1, project, null, sampleCode).get(0); String experimentCode = createUniqueCode("E"); + * createExperiments(systemSessionToken, project, experimentCode); SampleUpdate sampleUpdate = new SampleUpdate(); + * sampleUpdate.setSampleId(projectSample); sampleUpdate.setExperimentId(new ExperimentIdentifier("SPACE1", projectCode, experimentCode)); Date + * now = sleep(); v3api.updateSamples(adminSessionToken, Arrays.asList(sampleUpdate)); SampleFetchOptions fetchOptions = new SampleFetchOptions(); + * fetchOptions.withModifier(); fetchOptions.withSpace(); fetchOptions.withProject().withModifier(); fetchOptions.withExperiment().withModifier(); + * Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, Arrays.asList(projectSample), fetchOptions); Sample sample = + * samples.get(projectSample); assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode + "/" + sampleCode); + * assertModification(sample, sample, now, adminUser); assertEquals(sample.getProject().getModifier().getUserId(), SYSTEM_USER); Experiment + * experiment = sample.getExperiment(); assertEquals(experiment.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode + "/" + experimentCode); + * assertModification(experiment, experiment, now, adminUser); } + * @Test public void testAssignProjectSampleWithExperimentToAnotherExperimentInTheSameProject() { String projectCode = createUniqueCode("P"); + * ProjectPermId project = createProjects(systemSessionToken, space1, projectCode).get(0); String experimentCode1 = createUniqueCode("E"); String + * experimentCode2 = experimentCode1 + "A"; createExperiments(systemSessionToken, project, experimentCode1, experimentCode2); String sampleCode = + * createUniqueCode("S"); SamplePermId projectSample = createSamples(systemSessionToken, space1, project, new ExperimentIdentifier("SPACE1", + * projectCode, experimentCode1), sampleCode).get(0); SampleUpdate sampleUpdate = new SampleUpdate(); sampleUpdate.setSampleId(projectSample); + * sampleUpdate.setExperimentId(new ExperimentIdentifier("SPACE1", projectCode, experimentCode2)); Date now = sleep(); + * v3api.updateSamples(adminSessionToken, Arrays.asList(sampleUpdate)); SampleFetchOptions fetchOptions = new SampleFetchOptions(); + * fetchOptions.withModifier(); fetchOptions.withSpace(); fetchOptions.withProject().withModifier(); fetchOptions.withExperiment().withModifier(); + * Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, Arrays.asList(projectSample), fetchOptions); Sample sample = + * samples.get(projectSample); assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode + "/" + sampleCode); + * assertModification(sample, sample, now, adminUser); assertEquals(sample.getProject().getModifier().getUserId(), SYSTEM_USER); Experiment + * experiment = sample.getExperiment(); assertEquals(experiment.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode + "/" + + * experimentCode2); assertModification(experiment, experiment, now, adminUser); ExperimentFetchOptions experimentFetchOptions = new + * ExperimentFetchOptions(); experimentFetchOptions.withModifier(); Experiment previousExperiment = v3api.mapExperiments(systemSessionToken, + * Arrays.asList(new ExperimentIdentifier("SPACE1", projectCode, experimentCode1)), experimentFetchOptions).values().iterator().next(); + * assertModification(previousExperiment, previousExperiment, now, adminUser); } + * @Test public void testAssignProjectSampleToAnExperimentInADifferentProjectOfTheSameSpace() { String projectCode1 = createUniqueCode("P"); + * ProjectPermId project1 = createProjects(systemSessionToken, space1, projectCode1).get(0); String sampleCode = createUniqueCode("S"); + * SamplePermId projectSample = createSamples(systemSessionToken, space1, project1, null, sampleCode).get(0); String experimentCode = + * createUniqueCode("E"); String projectCode2 = createUniqueCode("P"); ProjectPermId project2 = createProjects(systemSessionToken, space1, + * projectCode2).get(0); createExperiments(systemSessionToken, project2, experimentCode); SampleUpdate sampleUpdate = new SampleUpdate(); + * sampleUpdate.setSampleId(projectSample); sampleUpdate.setProjectId(new ProjectIdentifier("SPACE1", projectCode2)); + * sampleUpdate.setExperimentId(new ExperimentIdentifier("SPACE1", projectCode2, experimentCode)); Date now = sleep(); + * v3api.updateSamples(adminSessionToken, Arrays.asList(sampleUpdate)); SampleFetchOptions fetchOptions = new SampleFetchOptions(); + * fetchOptions.withModifier(); fetchOptions.withSpace(); fetchOptions.withProject().withModifier(); fetchOptions.withExperiment().withModifier(); + * Map<ISampleId, Sample> samples = v3api.mapSamples(systemSessionToken, Arrays.asList(projectSample), fetchOptions); Sample sample = + * samples.get(projectSample); assertEquals(sample.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode2 + "/" + sampleCode); + * assertModification(sample, sample, now, adminUser); assertModification(sample.getProject(), sample.getProject(), now, adminUser); Experiment + * experiment = sample.getExperiment(); assertEquals(experiment.getIdentifier().getIdentifier(), "/SPACE1/" + projectCode2 + "/" + + * experimentCode); assertModification(experiment, experiment, now, adminUser); } + * @Test public void testDeleteProjectSample() { String projectCode = createUniqueCode("P"); ProjectPermId project = + * createProjects(systemSessionToken, space1, projectCode).get(0); String sampleCode = createUniqueCode("S"); createSamples(systemSessionToken, + * space1, project, null, sampleCode); SampleDeletionOptions deletionOptions = new SampleDeletionOptions(); deletionOptions.setReason("test"); + * List<SampleIdentifier> sampleIds = Arrays.asList(new SampleIdentifier("/SPACE1/" + projectCode + "/" + sampleCode)); Date now = sleep(); + * v3api.deleteSamples(adminSessionToken, sampleIds, deletionOptions); assertEquals(v3api.mapSamples(systemSessionToken, sampleIds, new + * SampleFetchOptions()).size(), 0); ProjectFetchOptions projectFetchOptions = new ProjectFetchOptions(); projectFetchOptions.withModifier(); + * Project sampleProject = v3api.mapProjects(systemSessionToken, Arrays.asList(project), projectFetchOptions).values().iterator().next(); + * assertModification(sampleProject, sampleProject, now, adminUser); } + * @Test public void testDeleteProjectExperimentSample() { String projectCode = createUniqueCode("P"); ProjectPermId project = + * createProjects(systemSessionToken, space1, projectCode).get(0); String sampleCode = createUniqueCode("S"); String experimentCode = + * createUniqueCode("E"); ExperimentPermId experiment = createExperiments(systemSessionToken, project, experimentCode).get(0); SamplePermId sample + * = createSamples(systemSessionToken, space1, project, experiment, sampleCode).get(0); SampleDeletionOptions deletionOptions = new + * SampleDeletionOptions(); deletionOptions.setReason("test"); List<SamplePermId> sampleIds = Arrays.asList(sample); Date now = sleep(); + * v3api.deleteSamples(adminSessionToken, sampleIds, deletionOptions); assertEquals(v3api.mapSamples(systemSessionToken, sampleIds, new + * SampleFetchOptions()).size(), 0); ProjectFetchOptions projectFetchOptions = new ProjectFetchOptions(); projectFetchOptions.withModifier(); + * Project sampleProject = v3api.mapProjects(systemSessionToken, Arrays.asList(project), projectFetchOptions).values().iterator().next(); + * assertModification(sampleProject, sampleProject, now, adminUser); ExperimentFetchOptions experimentFetchOptions = new ExperimentFetchOptions(); + * experimentFetchOptions.withModifier(); Experiment sampleExperiment = v3api.mapExperiments(systemSessionToken, Arrays.asList(experiment), + * experimentFetchOptions).values().iterator().next(); assertModification(sampleExperiment, sampleExperiment, now, adminUser); } + * @Test + * @Transactional(propagation = Propagation.NEVER) public void testCreateWithProjectAndSpaceInconsistent() { final SampleCreation creation = new + * SampleCreation(); creation.setCode("SAMPLE_WITH_INCONSISTENT_PROJECT_AND_SPACE"); creation.setTypeId(ENTITY_TYPE_UNKNOWN); + * creation.setSpaceId(space1); creation.setProjectId(project1inSpace2); assertUserFailureException(new IDelegatedAction() { + * @Override public void execute() { v3api.createSamples(systemSessionToken, Collections.singletonList(creation)); } }, + * "Sample space must be the same as project space. " + "Sample: /SPACE1/SAMPLE_WITH_INCONSISTENT_PROJECT_AND_SPACE, " + + * "Project: /SPACE2/PROJECT1 " + "(Context: [verify project for sample SAMPLE_WITH_INCONSISTENT_PROJECT_AND_SPACE])"); } + * @Test + * @Transactional(propagation = Propagation.NEVER) public void testCreateWithProjectAndNoSpaceInconsistent() { final SampleCreation creation = new + * SampleCreation(); creation.setCode("SAMPLE_WITH_INCONSISTENT_PROJECT_AND_NOSPACE"); creation.setTypeId(ENTITY_TYPE_UNKNOWN); + * creation.setProjectId(project1inSpace1); assertUserFailureException(new IDelegatedAction() { + * @Override public void execute() { v3api.createSamples(systemSessionToken, Collections.singletonList(creation)); } }, + * "Shared samples cannot be attached to projects. " + "Sample: /SAMPLE_WITH_INCONSISTENT_PROJECT_AND_NOSPACE, " + "Project: /SPACE1/PROJECT1 " + + * "(Context: [verify project for sample SAMPLE_WITH_INCONSISTENT_PROJECT_AND_NOSPACE])"); } + * @Test + * @Transactional(propagation = Propagation.NEVER) public void testCreateWithProjectAndExperimentInconsistent() { final SampleCreation creation = + * new SampleCreation(); creation.setCode("SAMPLE_WITH_INCONSISTENT_PROJECT_AND_EXPERIMENT"); creation.setTypeId(ENTITY_TYPE_UNKNOWN); + * creation.setSpaceId(space1); creation.setProjectId(project2inSpace1); String expCode = createUniqueCode("E"); + * creation.setExperimentId(createExperiments(systemSessionToken, project1inSpace1, expCode).get(0)); assertUserFailureException(new + * IDelegatedAction() { + * @Override public void execute() { v3api.createSamples(systemSessionToken, Collections.singletonList(creation)); } }, + * "Sample project must be the same as experiment project. " + "Sample: /SPACE1/SAMPLE_WITH_INCONSISTENT_PROJECT_AND_EXPERIMENT, " + + * "Project: /SPACE1/PROJECT2, " + "Experiment: /SPACE1/PROJECT1/" + expCode + " " + + * "(Context: [verify experiment for sample SAMPLE_WITH_INCONSISTENT_PROJECT_AND_EXPERIMENT])"); } + * @Test + * @Transactional(propagation = Propagation.NEVER) public void testAssignSpaceSampleToProjectInDifferentSpace() { String code = + * createUniqueCode("S"); ISampleId sampleId = createSamples(systemSessionToken, space1, null, null, code).get(0); final SampleUpdate sampleUpdate + * = new SampleUpdate(); sampleUpdate.setSampleId(sampleId); sampleUpdate.setProjectId(project2inSpace2); assertUserFailureException(new + * IDelegatedAction() { + * @Override public void execute() { v3api.updateSamples(systemSessionToken, Collections.singletonList(sampleUpdate)); } }, + * "Sample space must be the same as project space. " + "Sample: /SPACE1/" + code + ", " + "Project: /SPACE2/PROJECT2 " + + * "(Context: [verify project for sample " + code + "])"); } + * @Test + * @Transactional(propagation = Propagation.NEVER) public void testAssignSampleOfAnExperimentToProjectDifferentToTheExperimentProject() { String + * sampleCode = createUniqueCode("S"); String expCode = createUniqueCode("E"); IExperimentId experiment = createExperiments(systemSessionToken, + * project1inSpace1, expCode).get(0); SamplePermId sample = createSamples(systemSessionToken, space1, null, experiment, sampleCode).get(0); final + * SampleUpdate sampleUpdate = new SampleUpdate(); sampleUpdate.setSampleId(sample); sampleUpdate.setProjectId(project2inSpace1); + * assertUserFailureException(new IDelegatedAction() { + * @Override public void execute() { v3api.updateSamples(systemSessionToken, Collections.singletonList(sampleUpdate)); } }, + * "Sample project must be the same as experiment project. " + "Sample: /SPACE1/" + sampleCode + ", " + "Project: /SPACE1/PROJECT2, " + + * "Experiment: /SPACE1/PROJECT1/" + expCode + " " + "(Context: [verify experiment for sample " + sampleCode + "])"); } + * @Test + * @Transactional(propagation = Propagation.NEVER) public void testAssignSharedSampleToProject() { String code = createUniqueCode("S"); ISampleId + * sharedSample = createSamples(systemSessionToken, null, null, null, code).get(0); final SampleUpdate sampleUpdate = new SampleUpdate(); + * sampleUpdate.setSampleId(sharedSample); sampleUpdate.setProjectId(project1inSpace1); assertUserFailureException(new IDelegatedAction() { + * @Override public void execute() { v3api.updateSamples(systemSessionToken, Collections.singletonList(sampleUpdate)); } }, + * "Shared samples cannot be attached to projects. " + "Sample: /" + code + ", " + "Project: /SPACE1/PROJECT1 " + + * "(Context: [verify project for sample " + code + "])"); } + * @Test(priority = -1) public void testSearchForSamplesWithProject() throws InterruptedException { SampleSearchCriteria searchCriteria = new + * SampleSearchCriteria(); searchCriteria.withProject(); SampleFetchOptions fetchOptions = new SampleFetchOptions(); fetchOptions.withProject(); + * SearchResult<Sample> result = v3api.searchSamples(systemSessionToken, searchCriteria, fetchOptions); + * assertEquals(result.getObjects().get(0).getIdentifier().getIdentifier(), "/SPACE1/PROJECT1/SAMPLE3"); + * assertEquals(result.getObjects().get(0).getProject().getIdentifier().getIdentifier(), "/SPACE1/PROJECT1"); + * assertEquals(result.getObjects().get(1).getIdentifier().getIdentifier(), "/SPACE1/PROJECT1/SAMPLE4"); + * assertEquals(result.getObjects().get(1).getProject().getIdentifier().getIdentifier(), "/SPACE1/PROJECT1"); + * assertEquals(result.getObjects().get(2).getIdentifier().getIdentifier(), "/SPACE2/PROJECT2/SAMPLE5"); + * assertEquals(result.getObjects().get(2).getProject().getIdentifier().getIdentifier(), "/SPACE2/PROJECT2"); + * assertEquals(result.getObjects().get(3).getIdentifier().getIdentifier(), "/SPACE2/PROJECT2/SAMPLE6"); + * assertEquals(result.getObjects().get(3).getProject().getIdentifier().getIdentifier(), "/SPACE2/PROJECT2"); assertEquals(result.getTotalCount(), + * 4); } + * @Test(priority = -1) public void testSearchForSamplesWithCodeAndWithProject() { SampleSearchCriteria searchCriteria = new + * SampleSearchCriteria(); searchCriteria.withCode().thatEndsWith("3"); searchCriteria.withProject(); SampleFetchOptions fetchOptions = new + * SampleFetchOptions(); fetchOptions.withProject(); SearchResult<Sample> result = v3api.searchSamples(systemSessionToken, searchCriteria, + * fetchOptions); assertEquals(result.getObjects().get(0).getIdentifier().getIdentifier(), "/SPACE1/PROJECT1/SAMPLE3"); + * assertEquals(result.getObjects().get(0).getProject().getIdentifier().getIdentifier(), "/SPACE1/PROJECT1"); assertEquals(result.getTotalCount(), + * 1); } + * @Test(priority = -1) public void testSearchForSamplesWithProjectWithSpaceWithCode() { SampleSearchCriteria searchCriteria = new + * SampleSearchCriteria(); searchCriteria.withProject().withSpace().withCode().thatEquals("SPACE1"); SampleFetchOptions fetchOptions = new + * SampleFetchOptions(); fetchOptions.withProject(); SearchResult<Sample> result = v3api.searchSamples(systemSessionToken, searchCriteria, + * fetchOptions); assertEquals(result.getObjects().get(0).getIdentifier().getIdentifier(), "/SPACE1/PROJECT1/SAMPLE3"); + * assertEquals(result.getObjects().get(0).getProject().getIdentifier().getIdentifier(), "/SPACE1/PROJECT1"); + * assertEquals(result.getObjects().get(1).getIdentifier().getIdentifier(), "/SPACE1/PROJECT1/SAMPLE4"); + * assertEquals(result.getObjects().get(1).getProject().getIdentifier().getIdentifier(), "/SPACE1/PROJECT1"); assertEquals(result.getTotalCount(), + * 2); } + * @Test(priority = -1) public void testSearchForSamplesWithProjectWithPermId() { SampleSearchCriteria searchCriteria = new + * SampleSearchCriteria(); searchCriteria.withProject().withPermId().thatEquals(project2inSpace2.getPermId()); SampleFetchOptions fetchOptions = + * new SampleFetchOptions(); fetchOptions.withProject(); SearchResult<Sample> result = v3api.searchSamples(systemSessionToken, searchCriteria, + * fetchOptions); assertEquals(result.getObjects().get(0).getIdentifier().getIdentifier(), "/SPACE2/PROJECT2/SAMPLE5"); + * assertEquals(result.getObjects().get(0).getProject().getIdentifier().getIdentifier(), "/SPACE2/PROJECT2"); + * assertEquals(result.getObjects().get(1).getIdentifier().getIdentifier(), "/SPACE2/PROJECT2/SAMPLE6"); + * assertEquals(result.getObjects().get(1).getProject().getIdentifier().getIdentifier(), "/SPACE2/PROJECT2"); assertEquals(result.getTotalCount(), + * 2); } + * @Test(priority = -1) public void testSearchForSamplesWithoutProjects() { SampleSearchCriteria searchCriteria = new SampleSearchCriteria(); + * searchCriteria.withCode().thatStartsWith("SAMP"); searchCriteria.withoutProject(); SampleFetchOptions fetchOptions = new SampleFetchOptions(); + * fetchOptions.withProject(); SearchResult<Sample> result = v3api.searchSamples(systemSessionToken, searchCriteria, fetchOptions); + * assertEquals(result.getObjects().get(0).getIdentifier().getIdentifier(), "/SPACE1/SAMPLE1"); + * assertEquals(result.getObjects().get(0).getProject(), null); assertEquals(result.getObjects().get(1).getIdentifier().getIdentifier(), + * "/SPACE1/SAMPLE2"); assertEquals(result.getObjects().get(1).getProject(), null); assertEquals(result.getTotalCount(), 2); } private void + * assertUserFailureException(IDelegatedAction action, String expectedExceptionMessage) { try { action.execute(); + * fail("UserFailureException expected"); } catch (UserFailureException ex) { assertEquals(ex.getMessage(), expectedExceptionMessage); } } private + * void assertModification(IModificationDateHolder modificationDateHolder, IModifierHolder modifierHolder, Date date, String modifier) { + * assertNotOlder(modificationDateHolder.getModificationDate(), date); assertEquals(modifierHolder.getModifier().getUserId(), modifier); } private + * void assertNotOlder(Date actualDate, Date referenceDate) { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); String + * renderedReferenceDate = format.format(referenceDate.getTime()); String renderedActualDate = format.format(actualDate); + * assertEquals(renderedReferenceDate.compareTo(renderedActualDate) <= 0, true, renderedActualDate + " > " + renderedReferenceDate); } private + * Date sleep() { Date now = daoFactory.getTransactionTimestamp(); return now; } private List<SpacePermId> createSpaces(String sessionToken, + * String...spaceCodes) { List<SpaceCreation> newSpaces = new ArrayList<SpaceCreation>(); for (String spaceCode : spaceCodes) { SpaceCreation + * space = new SpaceCreation(); space.setCode(spaceCode); newSpaces.add(space); } return v3api.createSpaces(sessionToken, newSpaces); } private + * List<ProjectPermId> createProjects(String sessionToken, ISpaceId spaceId, String...projectCodes) { List<ProjectCreation> newProjects = new + * ArrayList<ProjectCreation>(); for (String projectCode : projectCodes) { ProjectCreation project = new ProjectCreation(); + * project.setSpaceId(spaceId); project.setCode(projectCode); newProjects.add(project); } return v3api.createProjects(sessionToken, newProjects); + * } private List<SamplePermId> createSamples(String sessionToken, ISpaceId spaceOrNull, IProjectId projectOrNull, IExperimentId experimentOrNull, + * String...codes) { List<SampleCreation> newSamples = new ArrayList<SampleCreation>(); for (String code : codes) { SampleCreation sample = new + * SampleCreation(); sample.setTypeId(ENTITY_TYPE_UNKNOWN); sample.setSpaceId(spaceOrNull); sample.setProjectId(projectOrNull); + * sample.setExperimentId(experimentOrNull); sample.setCode(code); newSamples.add(sample); } return v3api.createSamples(sessionToken, newSamples); + * } private List<ExperimentPermId> createExperiments(String sessionToken, IProjectId project, String...codes) { List<ExperimentCreation> + * newExperiments = new ArrayList<ExperimentCreation>(); for (String code : codes) { ExperimentCreation experiment = new ExperimentCreation(); + * experiment.setCode(code); experiment.setTypeId(ENTITY_TYPE_UNKNOWN); experiment.setProjectId(project); newExperiments.add(experiment); } return + * v3api.createExperiments(sessionToken, newExperiments); } private String createUniqueCode(String prefix) { return prefix + "-" + + * System.currentTimeMillis(); } private void waitAtLeastASecond() { try { Thread.sleep(1100); } catch (InterruptedException ex) { // silently + * ignored } } + */ } diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchDataSetTypeTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchDataSetTypeTest.java index aed5fe80f7f6434bc00d43f220565eb4686f983d..cb526708b2d6a907235438f92a21658c335484be 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchDataSetTypeTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchDataSetTypeTest.java @@ -31,8 +31,6 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.property.PropertyAssignment; import ch.ethz.sis.openbis.generic.server.asapi.v3.helper.sort.CodeComparator; /** - * - * * @author Franz-Josef Elmer */ public class SearchDataSetTypeTest extends AbstractTest @@ -45,15 +43,17 @@ public class SearchDataSetTypeTest extends AbstractTest DataSetTypeFetchOptions fetchOptions = new DataSetTypeFetchOptions(); fetchOptions.withPropertyAssignments(); SearchResult<DataSetType> searchResult = v3api.searchDataSetTypes(sessionToken, searchCriteria, fetchOptions); - + List<DataSetType> types = searchResult.getObjects(); List<String> codes = extractCodes(types); Collections.sort(codes); - assertEquals(codes.toString(), "[CONTAINER_TYPE, DELETION_TEST, DELETION_TEST_CONTAINER, HCS_IMAGE, HCS_IMAGE_ANALYSIS_DATA, LINK_TYPE, REQUIRES_EXPERIMENT, UNKNOWN, VALIDATED_CONTAINER_TYPE, VALIDATED_IMPOSSIBLE_TO_UPDATE_TYPE, VALIDATED_NORMAL_TYPE]"); + assertEquals( + codes.toString(), + "[CONTAINER_TYPE, DELETION_TEST, DELETION_TEST_CONTAINER, HCS_IMAGE, HCS_IMAGE_ANALYSIS_DATA, LINK_TYPE, REQUIRES_EXPERIMENT, UNKNOWN, VALIDATED_CONTAINER_TYPE, VALIDATED_IMPOSSIBLE_TO_UPDATE_TYPE, VALIDATED_NORMAL_TYPE]"); assertEquals(types.get(0).getFetchOptions().hasPropertyAssignments(), true); v3api.logout(sessionToken); } - + @Test public void testSearchExactCode() { @@ -63,7 +63,7 @@ public class SearchDataSetTypeTest extends AbstractTest DataSetTypeFetchOptions fetchOptions = new DataSetTypeFetchOptions(); fetchOptions.withPropertyAssignments(); SearchResult<DataSetType> searchResult = v3api.searchDataSetTypes(sessionToken, searchCriteria, fetchOptions); - + List<DataSetType> types = searchResult.getObjects(); List<String> codes = extractCodes(types); Collections.sort(codes); @@ -71,7 +71,7 @@ public class SearchDataSetTypeTest extends AbstractTest assertEquals(types.get(0).getFetchOptions().hasPropertyAssignments(), true); v3api.logout(sessionToken); } - + @Test public void testSearchWithCodeThatStartsWithD() { @@ -79,9 +79,9 @@ public class SearchDataSetTypeTest extends AbstractTest EntityTypeSearchCriteria searchCriteria = new EntityTypeSearchCriteria(); searchCriteria.withCode().thatStartsWith("D"); DataSetTypeFetchOptions fetchOptions = new DataSetTypeFetchOptions(); - + SearchResult<DataSetType> searchResult = v3api.searchDataSetTypes(sessionToken, searchCriteria, fetchOptions); - + List<DataSetType> types = searchResult.getObjects(); List<String> codes = extractCodes(types); Collections.sort(codes); @@ -98,9 +98,9 @@ public class SearchDataSetTypeTest extends AbstractTest searchCriteria.withCode().thatStartsWith("D"); DataSetTypeFetchOptions fetchOptions = new DataSetTypeFetchOptions(); fetchOptions.withPropertyAssignments().sortBy().code().desc(); - + SearchResult<DataSetType> searchResult = v3api.searchDataSetTypes(sessionToken, searchCriteria, fetchOptions); - + List<DataSetType> types = searchResult.getObjects(); Collections.sort(types, new CodeComparator<DataSetType>()); List<String> codes = extractCodes(types); @@ -110,5 +110,5 @@ public class SearchDataSetTypeTest extends AbstractTest assertOrder(propertyAssignments, "ORGANISM", "DESCRIPTION", "BACTERIUM"); v3api.logout(sessionToken); } - + } diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchExperimentTypeTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchExperimentTypeTest.java index 6d2fe244a1f88afa984e84f3b07e7a39d2acdf32..9891d1225838a7772935785308eff7a2afbb6f43 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchExperimentTypeTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchExperimentTypeTest.java @@ -31,8 +31,6 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.property.PropertyAssignment; import ch.ethz.sis.openbis.generic.server.asapi.v3.helper.sort.CodeComparator; /** - * - * * @author Franz-Josef Elmer */ public class SearchExperimentTypeTest extends AbstractTest @@ -45,7 +43,7 @@ public class SearchExperimentTypeTest extends AbstractTest ExperimentTypeFetchOptions fetchOptions = new ExperimentTypeFetchOptions(); fetchOptions.withPropertyAssignments(); SearchResult<ExperimentType> searchResult = v3api.searchExperimentTypes(sessionToken, searchCriteria, fetchOptions); - + List<ExperimentType> types = searchResult.getObjects(); List<String> codes = extractCodes(types); Collections.sort(codes); @@ -53,7 +51,7 @@ public class SearchExperimentTypeTest extends AbstractTest assertEquals(types.get(0).getFetchOptions().hasPropertyAssignments(), true); v3api.logout(sessionToken); } - + @Test public void testSearchExactCode() { @@ -63,7 +61,7 @@ public class SearchExperimentTypeTest extends AbstractTest ExperimentTypeFetchOptions fetchOptions = new ExperimentTypeFetchOptions(); fetchOptions.withPropertyAssignments(); SearchResult<ExperimentType> searchResult = v3api.searchExperimentTypes(sessionToken, searchCriteria, fetchOptions); - + List<ExperimentType> types = searchResult.getObjects(); List<String> codes = extractCodes(types); Collections.sort(codes); @@ -71,7 +69,7 @@ public class SearchExperimentTypeTest extends AbstractTest assertEquals(types.get(0).getFetchOptions().hasPropertyAssignments(), true); v3api.logout(sessionToken); } - + @Test public void testSearchWithCodeThatStartsWithD() { @@ -79,9 +77,9 @@ public class SearchExperimentTypeTest extends AbstractTest EntityTypeSearchCriteria searchCriteria = new EntityTypeSearchCriteria(); searchCriteria.withCode().thatStartsWith("D"); ExperimentTypeFetchOptions fetchOptions = new ExperimentTypeFetchOptions(); - + SearchResult<ExperimentType> searchResult = v3api.searchExperimentTypes(sessionToken, searchCriteria, fetchOptions); - + List<ExperimentType> types = searchResult.getObjects(); List<String> codes = extractCodes(types); Collections.sort(codes); @@ -98,9 +96,9 @@ public class SearchExperimentTypeTest extends AbstractTest searchCriteria.withCode().thatStartsWith("D"); ExperimentTypeFetchOptions fetchOptions = new ExperimentTypeFetchOptions(); fetchOptions.withPropertyAssignments().sortBy().code().desc(); - + SearchResult<ExperimentType> searchResult = v3api.searchExperimentTypes(sessionToken, searchCriteria, fetchOptions); - + List<ExperimentType> types = searchResult.getObjects(); Collections.sort(types, new CodeComparator<ExperimentType>()); List<String> codes = extractCodes(types); @@ -110,5 +108,5 @@ public class SearchExperimentTypeTest extends AbstractTest assertOrder(propertyAssignments, "ORGANISM", "DESCRIPTION", "BACTERIUM"); v3api.logout(sessionToken); } - + } diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchMaterialTypeTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchMaterialTypeTest.java index 1124a4e54d6b5d2913800136f950db2fc4e01c11..1a47898e493698ae2526840d4285f5942c8da331 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchMaterialTypeTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchMaterialTypeTest.java @@ -31,8 +31,6 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.property.PropertyAssignment; import ch.ethz.sis.openbis.generic.server.asapi.v3.helper.sort.CodeComparator; /** - * - * * @author Franz-Josef Elmer */ public class SearchMaterialTypeTest extends AbstractTest @@ -45,7 +43,7 @@ public class SearchMaterialTypeTest extends AbstractTest MaterialTypeFetchOptions fetchOptions = new MaterialTypeFetchOptions(); fetchOptions.withPropertyAssignments(); SearchResult<MaterialType> searchResult = v3api.searchMaterialTypes(sessionToken, searchCriteria, fetchOptions); - + List<MaterialType> types = searchResult.getObjects(); List<String> codes = extractCodes(types); Collections.sort(codes); @@ -53,7 +51,7 @@ public class SearchMaterialTypeTest extends AbstractTest assertEquals(types.get(0).getFetchOptions().hasPropertyAssignments(), true); v3api.logout(sessionToken); } - + @Test public void testSearchExactCode() { @@ -63,7 +61,7 @@ public class SearchMaterialTypeTest extends AbstractTest MaterialTypeFetchOptions fetchOptions = new MaterialTypeFetchOptions(); fetchOptions.withPropertyAssignments(); SearchResult<MaterialType> searchResult = v3api.searchMaterialTypes(sessionToken, searchCriteria, fetchOptions); - + List<MaterialType> types = searchResult.getObjects(); List<String> codes = extractCodes(types); Collections.sort(codes); @@ -71,7 +69,7 @@ public class SearchMaterialTypeTest extends AbstractTest assertEquals(types.get(0).getFetchOptions().hasPropertyAssignments(), true); v3api.logout(sessionToken); } - + @Test public void testSearchWithCodeThatStartsWithB() { @@ -79,9 +77,9 @@ public class SearchMaterialTypeTest extends AbstractTest EntityTypeSearchCriteria searchCriteria = new EntityTypeSearchCriteria(); searchCriteria.withCode().thatStartsWith("B"); MaterialTypeFetchOptions fetchOptions = new MaterialTypeFetchOptions(); - + SearchResult<MaterialType> searchResult = v3api.searchMaterialTypes(sessionToken, searchCriteria, fetchOptions); - + List<MaterialType> types = searchResult.getObjects(); List<String> codes = extractCodes(types); Collections.sort(codes); @@ -98,9 +96,9 @@ public class SearchMaterialTypeTest extends AbstractTest searchCriteria.withCode().thatStartsWith("B"); MaterialTypeFetchOptions fetchOptions = new MaterialTypeFetchOptions(); fetchOptions.withPropertyAssignments().sortBy().label().desc(); - + SearchResult<MaterialType> searchResult = v3api.searchMaterialTypes(sessionToken, searchCriteria, fetchOptions); - + List<MaterialType> types = searchResult.getObjects(); Collections.sort(types, new CodeComparator<MaterialType>()); List<String> codes = extractCodes(types); @@ -110,5 +108,5 @@ public class SearchMaterialTypeTest extends AbstractTest assertOrder(propertyAssignments, "ORGANISM", "DESCRIPTION"); v3api.logout(sessionToken); } - + } diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchSampleTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchSampleTest.java index ab5655e9d311b856b88ea73b58de39564c656e45..293b4ed999650c05f22b6ff79edc16b13efe04f8 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchSampleTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchSampleTest.java @@ -969,6 +969,7 @@ public class SearchSampleTest extends AbstractSampleTest } final String LISTED_ID = "/CISD/C1"; + final String UNLISTED_ID = "/CISD/CL1:A01"; @Test @@ -980,12 +981,11 @@ public class SearchSampleTest extends AbstractSampleTest SampleSearchCriteria criteria = new SampleSearchCriteria(); criteria.withId().thatEquals(new SampleIdentifier(UNLISTED_ID)); - - + List<Sample> samples = search(sessionToken, criteria, fo); - + assertEquals(samples.size(), 1); - + assertSampleIdentifiersInOrder(samples, UNLISTED_ID); final SampleTypeSearchCriteria withType = criteria.withType(); @@ -1008,9 +1008,9 @@ public class SearchSampleTest extends AbstractSampleTest final SampleTypeSearchCriteria withType = criteria.withType(); List<Sample> samples = search(sessionToken, criteria, fo); - + assertEquals(samples.size(), 1); - + assertEquals(samples.get(0).getIdentifier().getIdentifier(), LISTED_ID); withType.withListable().thatEquals(true); diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchSampleTypeTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchSampleTypeTest.java index 80c1276e5c228d1e5ab81b25b2d65360c6dd6511..e41d7f5307cdbd20858b4741f14a69168af3a6ee 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchSampleTypeTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchSampleTypeTest.java @@ -31,8 +31,6 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.sample.fetchoptions.SampleTypeFe import ch.ethz.sis.openbis.generic.server.asapi.v3.helper.sort.CodeComparator; /** - * - * * @author Franz-Josef Elmer */ public class SearchSampleTypeTest extends AbstractTest @@ -45,15 +43,17 @@ public class SearchSampleTypeTest extends AbstractTest SampleTypeFetchOptions fetchOptions = new SampleTypeFetchOptions(); fetchOptions.withPropertyAssignments(); SearchResult<SampleType> searchResult = v3api.searchSampleTypes(sessionToken, searchCriteria, fetchOptions); - + List<SampleType> types = searchResult.getObjects(); List<String> codes = extractCodes(types); Collections.sort(codes); - assertEquals(codes.toString(), "[CELL_PLATE, CONTROL_LAYOUT, DELETION_TEST, DILUTION_PLATE, DYNAMIC_PLATE, IMPOSSIBLE, IMPOSSIBLE_TO_UPDATE, MASTER_PLATE, NORMAL, REINFECT_PLATE, VALIDATE_CHILDREN, WELL]"); + assertEquals( + codes.toString(), + "[CELL_PLATE, CONTROL_LAYOUT, DELETION_TEST, DILUTION_PLATE, DYNAMIC_PLATE, IMPOSSIBLE, IMPOSSIBLE_TO_UPDATE, MASTER_PLATE, NORMAL, REINFECT_PLATE, VALIDATE_CHILDREN, WELL]"); assertEquals(types.get(0).getFetchOptions().hasPropertyAssignments(), true); v3api.logout(sessionToken); } - + @Test public void testSearchExactCode() { @@ -63,7 +63,7 @@ public class SearchSampleTypeTest extends AbstractTest SampleTypeFetchOptions fetchOptions = new SampleTypeFetchOptions(); fetchOptions.withPropertyAssignments(); SearchResult<SampleType> searchResult = v3api.searchSampleTypes(sessionToken, searchCriteria, fetchOptions); - + List<SampleType> types = searchResult.getObjects(); List<String> codes = extractCodes(types); Collections.sort(codes); @@ -71,7 +71,7 @@ public class SearchSampleTypeTest extends AbstractTest assertEquals(types.get(0).getFetchOptions().hasPropertyAssignments(), true); v3api.logout(sessionToken); } - + @Test public void testSearchWithCodeThatStartsWithD() { @@ -79,9 +79,9 @@ public class SearchSampleTypeTest extends AbstractTest EntityTypeSearchCriteria searchCriteria = new EntityTypeSearchCriteria(); searchCriteria.withCode().thatStartsWith("D"); SampleTypeFetchOptions fetchOptions = new SampleTypeFetchOptions(); - + SearchResult<SampleType> searchResult = v3api.searchSampleTypes(sessionToken, searchCriteria, fetchOptions); - + List<SampleType> types = searchResult.getObjects(); List<String> codes = extractCodes(types); Collections.sort(codes); @@ -98,9 +98,9 @@ public class SearchSampleTypeTest extends AbstractTest searchCriteria.withCode().thatStartsWith("D"); SampleTypeFetchOptions fetchOptions = new SampleTypeFetchOptions(); fetchOptions.withPropertyAssignments().sortBy().label().desc(); - + SearchResult<SampleType> searchResult = v3api.searchSampleTypes(sessionToken, searchCriteria, fetchOptions); - + List<SampleType> types = searchResult.getObjects(); Collections.sort(types, new CodeComparator<SampleType>()); List<String> codes = extractCodes(types); @@ -110,5 +110,5 @@ public class SearchSampleTypeTest extends AbstractTest assertOrder(propertyAssignments, "BACTERIUM", "ORGANISM", "DESCRIPTION"); v3api.logout(sessionToken); } - + } diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchServiceTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchServiceTest.java index c35e60fec7a1f7dbc5338ea1e5dde4f4988db3e5..846778e5ad02c25d2b4a62fe6efb490bdf768e4a 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchServiceTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchServiceTest.java @@ -38,37 +38,37 @@ public class SearchServiceTest extends AbstractTest CustomASServiceSearchCriteria searchCriteria = new CustomASServiceSearchCriteria(); searchCriteria.withCode().thatEquals("simple-service"); - SearchResult<CustomASService> result = v3api.searchCustomASServices(sessionToken, searchCriteria, + SearchResult<CustomASService> result = v3api.searchCustomASServices(sessionToken, searchCriteria, new CustomASServiceFetchOptions()); assertEquals(result.getTotalCount(), 1); } - + @Test public void testSearchAllServicesSortedPage2() { CustomASServiceFetchOptions fetchOptions = new CustomASServiceFetchOptions(); fetchOptions.from(2).count(1).sortBy(); - SearchResult<CustomASService> result = v3api.searchCustomASServices(systemSessionToken, - new CustomASServiceSearchCriteria(), + SearchResult<CustomASService> result = v3api.searchCustomASServices(systemSessionToken, + new CustomASServiceSearchCriteria(), fetchOptions); - + assertEquals(result.getObjects().toString(), "[CustomASService code: service3]"); assertEquals(result.getTotalCount(), 4); } - + @Test public void testSearchServiceByCode() { String sessionToken = v3api.login(TEST_USER, PASSWORD); CustomASServiceSearchCriteria searchCriteria = new CustomASServiceSearchCriteria(); searchCriteria.withCode().thatStartsWith("simple"); - - SearchResult<CustomASService> result = v3api.searchCustomASServices(sessionToken, searchCriteria, new + + SearchResult<CustomASService> result = v3api.searchCustomASServices(sessionToken, searchCriteria, new CustomASServiceFetchOptions()); - + assertEquals(result.getObjects().toString(), "[CustomASService code: simple-service]"); assertEquals(result.getTotalCount(), 1); } - + } \ No newline at end of file diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/UpdateExperimentTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/UpdateExperimentTest.java index d383409b6af8a3ddbd9f585f2bc4dd651b6e95eb..da0eb6eff2b0708bf94c74a8fe9ced3850618f8b 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/UpdateExperimentTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/UpdateExperimentTest.java @@ -123,41 +123,22 @@ public class UpdateExperimentTest extends AbstractExperimentTest Experiment experiment = experiments.get(0); assertEquals(experiment.getIdentifier().getIdentifier(), "/CISD/NOE/TEST_EXPERIMENT"); } - - /* - @Test(groups = "project-samples") - public void testMovingExperimentWithProjectSamplesToADifferentProject() - { - String sessionToken = v3api.login(TEST_USER, PASSWORD); - SampleCreation sampleCreation = new SampleCreation(); - sampleCreation.setCode("PROJECT-SAMPLE-IN-EXPERIMENT"); - ExperimentIdentifier experimentId = new ExperimentIdentifier("CISD", "NEMO", "EXP1"); - sampleCreation.setExperimentId(experimentId); - sampleCreation.setSpaceId(new SpacePermId("CISD")); - sampleCreation.setProjectId(new ProjectIdentifier("/CISD/NEMO")); - sampleCreation.setTypeId(new EntityTypePermId("CELL_PLATE")); - v3api.createSamples(sessionToken, Arrays.asList(sampleCreation)); - ExperimentUpdate experimentUpdate = new ExperimentUpdate(); - experimentUpdate.setExperimentId(experimentId); - ProjectIdentifier projectId = new ProjectIdentifier("/CISD/NOE"); - experimentUpdate.setProjectId(projectId); - - v3api.updateExperiments(sessionToken, Arrays.asList(experimentUpdate)); - - ExperimentFetchOptions fetchOptions = new ExperimentFetchOptions(); - fetchOptions.withProject(); - fetchOptions.withSamples().withProject(); - Map<IExperimentId, Experiment> map = v3api.mapExperiments(sessionToken, - Arrays.asList(new ExperimentIdentifier("CISD", "NOE", "EXP1")), fetchOptions); - List<Experiment> experiments = new ArrayList<Experiment>(map.values()); - List<Sample> samples = experiments.get(0).getSamples(); - assertEquals(experiments.get(0).getProject().getCode(), "NOE"); - assertEquals(samples.get(0).getProject().getCode(), "NOE"); - AssertionUtil.assertCollectionSize(samples, 1); - AssertionUtil.assertCollectionSize(experiments, 1); - } -*/ + /* + * @Test(groups = "project-samples") public void testMovingExperimentWithProjectSamplesToADifferentProject() { String sessionToken = + * v3api.login(TEST_USER, PASSWORD); SampleCreation sampleCreation = new SampleCreation(); sampleCreation.setCode("PROJECT-SAMPLE-IN-EXPERIMENT"); + * ExperimentIdentifier experimentId = new ExperimentIdentifier("CISD", "NEMO", "EXP1"); sampleCreation.setExperimentId(experimentId); + * sampleCreation.setSpaceId(new SpacePermId("CISD")); sampleCreation.setProjectId(new ProjectIdentifier("/CISD/NEMO")); + * sampleCreation.setTypeId(new EntityTypePermId("CELL_PLATE")); v3api.createSamples(sessionToken, Arrays.asList(sampleCreation)); + * ExperimentUpdate experimentUpdate = new ExperimentUpdate(); experimentUpdate.setExperimentId(experimentId); ProjectIdentifier projectId = new + * ProjectIdentifier("/CISD/NOE"); experimentUpdate.setProjectId(projectId); v3api.updateExperiments(sessionToken, + * Arrays.asList(experimentUpdate)); ExperimentFetchOptions fetchOptions = new ExperimentFetchOptions(); fetchOptions.withProject(); + * fetchOptions.withSamples().withProject(); Map<IExperimentId, Experiment> map = v3api.mapExperiments(sessionToken, Arrays.asList(new + * ExperimentIdentifier("CISD", "NOE", "EXP1")), fetchOptions); List<Experiment> experiments = new ArrayList<Experiment>(map.values()); + * List<Sample> samples = experiments.get(0).getSamples(); assertEquals(experiments.get(0).getProject().getCode(), "NOE"); + * assertEquals(samples.get(0).getProject().getCode(), "NOE"); AssertionUtil.assertCollectionSize(samples, 1); + * AssertionUtil.assertCollectionSize(experiments, 1); } + */ @Test public void testUpdateWithProjectNull() { diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/Change.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/Change.java index 1d4bb18b8cd04b97caad587db8db62324ad2466a..861ee7bca2290d202bcfac3e11bcdd2f8a22b250 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/Change.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/Change.java @@ -7,7 +7,7 @@ class Change implements Comparable<Change> public final Date time; public final String userId; - + public final String value; public final boolean isRemoval; @@ -25,7 +25,7 @@ class Change implements Comparable<Change> this.attachmentContent = attachmentContent; this.isRemoval = isRemoval; } - + @Override public int compareTo(Change other) { diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/DataSetDeletionTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/DataSetDeletionTest.java index 74969716b7d88a534fa0915ada96be6be2c6ccf5..6be95567bcb4df09bd9ab2016082ede5e5141e4b 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/DataSetDeletionTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/DataSetDeletionTest.java @@ -103,8 +103,8 @@ public class DataSetDeletionTest extends DeletionTest delete(project); delete(space); - assertHistory(dataset.getPermId(), "OWNED", experimentSet(experiment.getPermId()), - sampleSet(spaceSample.getPermId()), + assertHistory(dataset.getPermId(), "OWNED", experimentSet(experiment.getPermId()), + sampleSet(spaceSample.getPermId()), sampleSet(experimentSample.getPermId()), experimentSet(experiment.getPermId())); } diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/DeletionTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/DeletionTest.java index da6d96f0c1d1d3b3d9c529cb872633fb84562947..e0edca482626dc6e92484ac6d5543ba10a65091b 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/DeletionTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/DeletionTest.java @@ -100,86 +100,86 @@ public abstract class DeletionTest extends AbstractTest private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); - public Set<String> attachmentSet(String...values) + public Set<String> attachmentSet(String... values) { return attachmentSetFor(TEST_USER, values); } - - public Set<String> attachmentSetFor(String userId, String...values) + + public Set<String> attachmentSetFor(String userId, String... values) { return entitySet("ATTACHMENT", userId, values); } - - public Set<String> unknownSet(String...values) + + public Set<String> unknownSet(String... values) { return unknownSetFor(TEST_USER, values); } - - public Set<String> unknownSetFor(String userId, String...values) + + public Set<String> unknownSetFor(String userId, String... values) { return entitySet("UNKNOWN", userId, values); } - - public Set<String> spaceSet(String...values) + + public Set<String> spaceSet(String... values) { return spaceSetFor(TEST_USER, values); } - - public Set<String> spaceSetFor(String userId, String...values) + + public Set<String> spaceSetFor(String userId, String... values) { return entitySet("SPACE", userId, values); } - - public Set<String> projectSet(String...values) + + public Set<String> projectSet(String... values) { return projectSetFor(TEST_USER, values); } - - public Set<String> projectSetFor(String userId, String...values) + + public Set<String> projectSetFor(String userId, String... values) { return entitySet("PROJECT", userId, values); } - - public Set<String> experimentSet(String...values) + + public Set<String> experimentSet(String... values) { return experimentSetFor(TEST_USER, values); } - - public Set<String> experimentSetFor(String userId, String...values) + + public Set<String> experimentSetFor(String userId, String... values) { return entitySet("EXPERIMENT", userId, values); } - public Set<String> sampleSet(String...values) + public Set<String> sampleSet(String... values) { return sampleSetFor(TEST_USER, values); } - - public Set<String> sampleSetFor(String userId, String...values) + + public Set<String> sampleSetFor(String userId, String... values) { return entitySet("SAMPLE", userId, values); } - - public Set<String> dataSetSet(String...values) + + public Set<String> dataSetSet(String... values) { return dataSetSetFor(TEST_USER, values); } - - public Set<String> dataSetSetFor(String userId, String...values) + + public Set<String> dataSetSetFor(String userId, String... values) { return entitySet("DATA_SET", userId, values); } - - public Set<String> propertiesSet(String...values) + + public Set<String> propertiesSet(String... values) { return set("PROPERTY", null, TEST_USER, values); } - + private Set<String> entitySet(String entityType, String userId, String... values) { return set("RELATIONSHIP", entityType, userId, values); } - + private Set<String> set(String type, String entityTypeOrNull, String userId, String... values) { Set<String> result = new HashSet<>(); @@ -189,7 +189,7 @@ public abstract class DeletionTest extends AbstractTest } return result; } - + public Set<String> set(String... values) { return new HashSet<String>(Arrays.asList(values)); @@ -320,7 +320,7 @@ public abstract class DeletionTest extends AbstractTest return false; } } - + public void assertAttachment(String permId, Set<String> attachments) throws Exception { IModificationFilter filter = new IModificationFilter() @@ -355,7 +355,7 @@ public abstract class DeletionTest extends AbstractTest @Override public boolean accept(Modification modification) { - return modification.type.equals(AttributeEntry.ATTRIBUTE) + return modification.type.equals(AttributeEntry.ATTRIBUTE) && modification.key.equals("REGISTRATION_TIMESTAMP") == false; } @@ -451,14 +451,14 @@ public abstract class DeletionTest extends AbstractTest if (expectedList.equals(actualValues) == false) { - + Assert.assertEquals(render(actualValues), render(expectedList), - filter.getDescription() + " of entity " + permId + " has wrong value history. Expected <" - + render(expectedList) + ">, actual <" + render(actualValues) + ">. Raw changes: " + filter.getDescription() + " of entity " + permId + " has wrong value history. Expected <" + + render(expectedList) + ">, actual <" + render(actualValues) + ">. Raw changes: " + builder); } } - + private String render(List<Set<String>> values) { StringBuilder builder = new StringBuilder(); @@ -483,14 +483,15 @@ public abstract class DeletionTest extends AbstractTest { return currentTime == null ? change.time == null : currentTime.equals(change.time); } - + private static interface IModificationFilter { public String getDescription(); + public boolean accept(Modification modification); - + } - + private static interface IChangeRenderer { public String render(Change change); @@ -502,12 +503,12 @@ public abstract class DeletionTest extends AbstractTest Query query = session.createQuery("SELECT e FROM EventPE e WHERE :permId IN e.identifiersInternal").setParameter("permId", permId); EventPE event = (EventPE) query.uniqueResult(); String attachmentContent = getAttachmentContent(event); - + JsonNode tree = new ObjectMapper().reader().readTree(event.getContent()); - + List<Modification> allMods = IteratorUtils.toList(IteratorUtils.transformedIterator(tree.get(permId).elements(), new JsonNodeToModificationTransformer())); - + List<Modification> mods = new ArrayList<>(); for (Modification mod : allMods) { @@ -516,7 +517,7 @@ public abstract class DeletionTest extends AbstractTest mods.add(mod); } } - + List<Change> changes = new ArrayList<>(); for (Modification mod : mods) { @@ -527,7 +528,7 @@ public abstract class DeletionTest extends AbstractTest changes.add(new Change(mod.validUntil, mod.key, mod.userId, value, attachmentContent, true)); } } - + Collections.sort(changes); return changes; @@ -573,7 +574,7 @@ public abstract class DeletionTest extends AbstractTest m.validUntil = asDate(node.get("validUntil")); return m; } - + private Date asDate(JsonNode node) { String textValue = asString(node); @@ -585,7 +586,7 @@ public abstract class DeletionTest extends AbstractTest throw CheckedExceptionTunnel.wrapIfNecessary(ex); } } - + private String asString(JsonNode node) { if (node == null) @@ -599,13 +600,13 @@ public abstract class DeletionTest extends AbstractTest private static class Modification { public String userId; - + public String type; - + public String key; public String value; - + public String entityType; public Date validFrom; diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/ExperimentDeletionTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/ExperimentDeletionTest.java index 711fd5e2e3cc1955e7c988990c0b7db207080782..907fa7edadd359cf7ea7f5628b7e915fe5e9d8be 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/ExperimentDeletionTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/ExperimentDeletionTest.java @@ -25,7 +25,7 @@ public class ExperimentDeletionTest extends DeletionTest SpacePermId space = createSpace("SPACE"); ProjectPermId project = createProject(space, "PROJECT1"); ExperimentPermId exp = createExperiment(project, "EXPERIMENT"); - + AttachmentCreation attachment1 = new AttachmentCreation(); attachment1.setTitle("A1"); attachment1.setDescription("hello A"); @@ -35,21 +35,21 @@ public class ExperimentDeletionTest extends DeletionTest attachment2.setFileName("hi.txt"); attachment2.setContent("hi world!".getBytes()); addAttachment(exp, attachment1, attachment2); - + newTx(); - + delete(exp); delete(project); delete(space); - assertAttachment("experiment/" + exp.getPermId() + "/hello.txt(1)", + assertAttachment("experiment/" + exp.getPermId() + "/hello.txt(1)", set("OWNED = ATTACHMENT:" + exp + "[EXPERIMENT](user:test) <hello world!>")); - assertAttachment("experiment/" + exp.getPermId() + "/hi.txt(1)", + assertAttachment("experiment/" + exp.getPermId() + "/hi.txt(1)", set("OWNED = ATTACHMENT:" + exp + "[EXPERIMENT](user:test) <hi world!>")); assertHistory(exp.getPermId(), "OWNER", attachmentSet("experiment/" + exp.getPermId() + "/hello.txt(1)", "experiment/" + exp.getPermId() + "/hi.txt(1)")); } - + @Test @Rollback(false) public void testAttributes() throws Exception @@ -87,7 +87,7 @@ public class ExperimentDeletionTest extends DeletionTest ProjectPermId project2 = createProject(space2, "PROJECT2"); ExperimentPermId experiment = createExperiment(project1, "EXPERIMENT"); - + newTx(); ExperimentUpdate update = new ExperimentUpdate(); @@ -101,7 +101,7 @@ public class ExperimentDeletionTest extends DeletionTest delete(space1); delete(space2); - assertHistory(experiment.getPermId(), "OWNED", projectSet(project1.getPermId()), + assertHistory(experiment.getPermId(), "OWNED", projectSet(project1.getPermId()), projectSet(project2.getPermId())); } @@ -151,7 +151,7 @@ public class ExperimentDeletionTest extends DeletionTest delete(project); delete(space); - assertHistory(experiment.getPermId(), "OWNER", + assertHistory(experiment.getPermId(), "OWNER", unknownSet(dataset1.getPermId(), dataset2.getPermId()), unknownSet(dataset2.getPermId()), set()); diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/ProjectDeletionTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/ProjectDeletionTest.java index 5bd50f794b7cdb1ceb57f14a43903c044049e476..f6241c7b17434968ddcef13894328c68b47af03c 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/ProjectDeletionTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/ProjectDeletionTest.java @@ -23,7 +23,7 @@ public class ProjectDeletionTest extends DeletionTest { SpacePermId space = createSpace("SPACE"); ProjectPermId project = createProject(space, "PROJECT3"); - + AttachmentCreation attachment1 = new AttachmentCreation(); attachment1.setTitle("A1"); attachment1.setDescription("hello A"); @@ -41,15 +41,15 @@ public class ProjectDeletionTest extends DeletionTest projectUpdate.getAttachments().remove(new AttachmentFileName("hello.txt")); v3api.updateProjects(sessionToken, Arrays.asList(projectUpdate)); - assertAttachment("project/" + project.getPermId() + "/hello.txt(1)", + assertAttachment("project/" + project.getPermId() + "/hello.txt(1)", set("OWNED = ATTACHMENT:" + project + "[PROJECT](user:test) <hello world!>")); - + newTx(); - + delete(project); delete(space); } - + @Test @Rollback(false) public void deleteProjectWithAttachments() throws Exception @@ -66,20 +66,20 @@ public class ProjectDeletionTest extends DeletionTest attachment2.setFileName("hi.txt"); attachment2.setContent("hi world!".getBytes()); addAttachment(project, attachment1, attachment2); - + newTx(); - + delete(project); delete(space); - assertAttachment("project/" + project.getPermId() + "/hello.txt(1)", + assertAttachment("project/" + project.getPermId() + "/hello.txt(1)", set("OWNED = ATTACHMENT:" + project + "[PROJECT](user:test) <hello world!>")); - assertAttachment("project/" + project.getPermId() + "/hi.txt(1)", + assertAttachment("project/" + project.getPermId() + "/hi.txt(1)", set("OWNED = ATTACHMENT:" + project + "[PROJECT](user:test) <hi world!>")); assertHistory(project.getPermId(), "OWNER", attachmentSet("project/" + project.getPermId() + "/hello.txt(1)", "project/" + project.getPermId() + "/hi.txt(1)")); } - + @Test @Rollback(false) public void testAttributes() throws Exception @@ -152,7 +152,7 @@ public class ProjectDeletionTest extends DeletionTest delete(project2); delete(space); - assertHistory(project1.getPermId(), "OWNER", + assertHistory(project1.getPermId(), "OWNER", experimentSet(experiment1.getPermId(), experiment2.getPermId()), set()); } } diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/SampleDeletionTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/SampleDeletionTest.java index ee13327312fb92bb92e4fb45549bc53370e6cfdf..83fe7e333a8292113d1d28250a335767dc40368d 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/SampleDeletionTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/deletion/SampleDeletionTest.java @@ -22,7 +22,7 @@ public class SampleDeletionTest extends DeletionTest { SpacePermId space = createSpace("SPACE"); SamplePermId sample = createSample(null, space, "SAMPLE"); - + AttachmentCreation attachment1 = new AttachmentCreation(); attachment1.setTitle("A1"); attachment1.setDescription("hello A"); @@ -32,15 +32,15 @@ public class SampleDeletionTest extends DeletionTest attachment2.setFileName("hi.txt"); attachment2.setContent("hi world!".getBytes()); addAttachment(sample, attachment1, attachment2); - + newTx(); - + delete(sample); delete(space); - assertAttachment("sample/" + sample.getPermId() + "/hello.txt(1)", + assertAttachment("sample/" + sample.getPermId() + "/hello.txt(1)", set("OWNED = ATTACHMENT:" + sample + "[SAMPLE](user:test) <hello world!>")); - assertAttachment("sample/" + sample.getPermId() + "/hi.txt(1)", + assertAttachment("sample/" + sample.getPermId() + "/hi.txt(1)", set("OWNED = ATTACHMENT:" + sample + "[SAMPLE](user:test) <hi world!>")); assertHistory(sample.getPermId(), "OWNER", attachmentSet("sample/" + sample.getPermId() + "/hello.txt(1)", "sample/" + sample.getPermId() + "/hi.txt(1)")); @@ -51,7 +51,7 @@ public class SampleDeletionTest extends DeletionTest public void deleteSharedSampleWithAttachments() throws Exception { SamplePermId sample = createSample(null, null, "SAMPLE"); - + AttachmentCreation attachment1 = new AttachmentCreation(); attachment1.setTitle("A1"); attachment1.setDescription("hello A"); @@ -61,19 +61,19 @@ public class SampleDeletionTest extends DeletionTest attachment2.setFileName("hi.txt"); attachment2.setContent("hi world!".getBytes()); addAttachment(sample, attachment1, attachment2); - + newTx(); - + delete(sample); - - assertAttachment("sample/" + sample.getPermId() + "/hello.txt(1)", + + assertAttachment("sample/" + sample.getPermId() + "/hello.txt(1)", set("OWNED = ATTACHMENT:" + sample + "[SAMPLE](user:test) <hello world!>")); - assertAttachment("sample/" + sample.getPermId() + "/hi.txt(1)", + assertAttachment("sample/" + sample.getPermId() + "/hi.txt(1)", set("OWNED = ATTACHMENT:" + sample + "[SAMPLE](user:test) <hi world!>")); assertHistory(sample.getPermId(), "OWNER", attachmentSet("sample/" + sample.getPermId() + "/hello.txt(1)", "sample/" + sample.getPermId() + "/hi.txt(1)")); } - + @Test @Rollback(false) public void testAttributes() throws Exception @@ -84,10 +84,10 @@ public class SampleDeletionTest extends DeletionTest newTx(); Date before = new Date(); - + delete(sample); delete(space); - + HashMap<String, String> expectations = new HashMap<String, String>(); expectations.put("CODE", "SPACE_SAMPLE"); expectations.put("ENTITY_TYPE", "DELETION_TEST"); @@ -96,7 +96,6 @@ public class SampleDeletionTest extends DeletionTest assertRegistrationTimestampAttribute(sample.getPermId(), after, before); } - @Test @Rollback(false) public void changeSpace() throws Exception @@ -118,7 +117,7 @@ public class SampleDeletionTest extends DeletionTest delete(sample); delete(space1, space2); - assertHistory(sample.getPermId(), "OWNED", spaceSet(space1.getPermId()), + assertHistory(sample.getPermId(), "OWNED", spaceSet(space1.getPermId()), spaceSetFor(SYSTEM_USER, space2.getPermId())); } @@ -150,7 +149,7 @@ public class SampleDeletionTest extends DeletionTest delete(project1, project2); delete(space1, space2); - assertHistory(sample.getPermId(), "OWNED", experimentSet(experiment1.getPermId()), + assertHistory(sample.getPermId(), "OWNED", experimentSet(experiment1.getPermId()), experimentSet(experiment2.getPermId())); } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/OpenbisClientTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/OpenbisClientTest.java index e470a2746a337d1bd4bfcd9c79301101c8f4db9c..0a799deee0253dc01255f3acaf3c9e56d9582024 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/OpenbisClientTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/OpenbisClientTest.java @@ -123,7 +123,7 @@ public class OpenbisClientTest final String propertyTypeCode = "IS_VALID"; final String propertyValue = "true"; final Collection<Long> alreadyTracked = Arrays.asList(new Long[] - { 986L, 987L }); + { 986L, 987L }); final TrackingSampleCriteria newSampleCriteria = new TrackingSampleCriteria(sampleTypeCode, propertyTypeCode, propertyValue, @@ -135,8 +135,7 @@ public class OpenbisClientTest } /** - * Helper class encapsulating methods used for producing readable information about entities - * returned by {@link ITrackingServer} methods. + * Helper class encapsulating methods used for producing readable information about entities returned by {@link ITrackingServer} methods. * * @author Piotr Buczek */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/console/LexerTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/console/LexerTest.java index a97d765ffe682f7f66d023cb70c68f4e67847140..e60ec66794018745cdfa5805528fd8b103f7ad4f 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/console/LexerTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/console/LexerTest.java @@ -20,8 +20,6 @@ import org.testng.AssertJUnit; import org.testng.annotations.Test; /** - * - * * @author Franz-Josef Elmer */ public class LexerTest extends AssertJUnit @@ -41,7 +39,7 @@ public class LexerTest extends AssertJUnit check("[a, b, hello 'world']", "a b \"hello 'world'\""); check("[a=hello world]", "a=\"hello world\""); } - + private void check(String expectedTokens, String input) { assertEquals(expectedTokens, Lexer.extractTokens(input).toString()); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/DummyAuthenticationTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/DummyAuthenticationTest.java index bf584aaa5366e9f4142b04dba45d4a85e80c26f1..0cc2f44e5bfd77e18ffb3888fed3e8f6b0b70d3a 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/DummyAuthenticationTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/DummyAuthenticationTest.java @@ -21,10 +21,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.Abstract import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.WaitForAllActiveCallbacksFinish; /** - * A shorter version of {@link AuthenticationTest} that just logins to the application. It is - * supposed to be run at the beginning of each suite (except the first one that should start with - * full {@link AuthenticationTest}) to do all the GWT initialization and make the next test work - * faster. + * A shorter version of {@link AuthenticationTest} that just logins to the application. It is supposed to be run at the beginning of each suite + * (except the first one that should start with full {@link AuthenticationTest}) to do all the GWT initialization and make the next test work faster. * * @author Piotr Buczek */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SearchCommand.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SearchCommand.java index 6dbeba3f113f2bfb4bc1a21faa6263da6033019d..10e3996b6983a204d0b34dd4697c2f4b9bf0d711 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SearchCommand.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SearchCommand.java @@ -26,8 +26,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.Abstract import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestUtil; /** - * A {@link AbstractDefaultTestCommand} extension which triggers a search just after a login has - * been performed with specified parameters. + * A {@link AbstractDefaultTestCommand} extension which triggers a search just after a login has been performed with specified parameters. * * @author Christian Ribeaud */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/VocabularyRegistrationTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/VocabularyRegistrationTest.java index 22f7c6fd628dc42b4daa6bb3ee9c8bd286a2714e..8ceec7f9ab506664d6ad3ca06ffd62f7ec0b721b 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/VocabularyRegistrationTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/VocabularyRegistrationTest.java @@ -36,7 +36,7 @@ public class VocabularyRegistrationTest extends AbstractGWTTestCase private static final String DESCRIPTION = "Color"; private static final String[] TERMS = - { "RED:01", "BLACK", "Y.E.L.L.O.W" }; + { "RED:01", "BLACK", "Y.E.L.L.O.W" }; public final void testRegisterVocabulary() { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/OpenViewCommand.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/OpenViewCommand.java index e2f26b5833330b76de400a581aa1c1071ae62563..1e852bf628dae99337c5f8a97c27a1a8a68b89e5 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/OpenViewCommand.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/OpenViewCommand.java @@ -20,8 +20,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.Client; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.AbstractDefaultTestCommand; /** - * {@link AbstractDefaultTestCommand} extension that does nothing. It should be used if we want to - * make sure that all callbacks will finish without failure. + * {@link AbstractDefaultTestCommand} extension that does nothing. It should be used if we want to make sure that all callbacks will finish without + * failure. * * @author Piotr Buczek */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/InvokeActionMenu.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/InvokeActionMenu.java index 95587392bd65e0682e7eb808b13fe798974dd5e4..236dd53fc9947fbb24ef7d2bc9be1c756ed742bc 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/InvokeActionMenu.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/InvokeActionMenu.java @@ -22,8 +22,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.Abstract import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestUtil; /** - * A {@link AbstractDefaultTestCommand} extension for invoking an action attached to - * {@link ActionMenu} (e.g. opening a tab). + * A {@link AbstractDefaultTestCommand} extension for invoking an action attached to {@link ActionMenu} (e.g. opening a tab). * * @author Izabela Adamczyk * @author Piotr Buczek diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/CheckAuthorizationGroupTable.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/CheckAuthorizationGroupTable.java index 9e473dcabc4966a621cf8eec90746cb4a2a95323..7702869a51ad59f1f717f9fba6b95a4ba3fbc937 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/CheckAuthorizationGroupTable.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/CheckAuthorizationGroupTable.java @@ -21,8 +21,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.Abstract import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.CheckTableCommand; /** - * A {@link AbstractDefaultTestCommand} extension to check whether a list of authorization groups - * has been loaded. + * A {@link AbstractDefaultTestCommand} extension to check whether a list of authorization groups has been loaded. * * @author Izabela Adamczyk */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/CheckPersonTable.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/CheckPersonTable.java index cd09f7f71abbffaf71720834cf4a02c445d267d9..9e7a35e86a499a19d84209cfdff2dc8b10f9804e 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/CheckPersonTable.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/CheckPersonTable.java @@ -22,8 +22,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.CheckTab import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AuthorizationGroup; /** - * A {@link AbstractDefaultTestCommand} extension to check whether a list of persons has been - * loaded. + * A {@link AbstractDefaultTestCommand} extension to check whether a list of persons has been loaded. * * @author Piotr Buczek */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/CheckRoleAssignmentTable.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/CheckRoleAssignmentTable.java index 5a73404ad21add6b78b85c5142b1fe60e007b256..49cb456eb4c65221f583c4993f22945d8bb784c8 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/CheckRoleAssignmentTable.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/CheckRoleAssignmentTable.java @@ -21,8 +21,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.Abstract import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.CheckTableCommand; /** - * A {@link AbstractDefaultTestCommand} extension to check whether a list of persons has been - * loaded. + * A {@link AbstractDefaultTestCommand} extension to check whether a list of persons has been loaded. * * @author Piotr Buczek */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/OpenAddPersonDialog.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/OpenAddPersonDialog.java index cb5a3030075cee087a2a843416dc0d7f4c7b51d4..28e8f9402909a83d1dbc34bdbb5aea90a51f4896 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/OpenAddPersonDialog.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/OpenAddPersonDialog.java @@ -24,8 +24,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestU import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AuthorizationGroup; /** - * A {@link AbstractDefaultTestCommand} extension opening a dialog allowing to add a person to the - * authorization group. + * A {@link AbstractDefaultTestCommand} extension opening a dialog allowing to add a person to the authorization group. * * @author Izabela Adamczyk */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/RemovePerson.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/RemovePerson.java index 724ab61ec6a7a2319710fc3b12d1bc4c13e1d713..92488bfba3c34f26fdc03280e7ae296641b0133d 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/RemovePerson.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/RemovePerson.java @@ -29,8 +29,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AuthorizationGroup; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Person; /** - * A {@link AbstractDefaultTestCommand} extension for deleting an authorization group with given - * code. + * A {@link AbstractDefaultTestCommand} extension for deleting an authorization group with given code. * * @author Izabela Adamczyk */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/ShowAuthorizationGroup.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/ShowAuthorizationGroup.java index de5ff57f52085278aaa5f5927448b51c13d244e7..107a382ca6b049a6e339fd235ce192e62a4aef3c 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/ShowAuthorizationGroup.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/ShowAuthorizationGroup.java @@ -28,8 +28,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestU import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AuthorizationGroup; /** - * A {@link AbstractDefaultTestCommand} extension for showing an authorization group with given - * code. + * A {@link AbstractDefaultTestCommand} extension for showing an authorization group with given code. * * @author Izabela Adamczyk */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/ShowDataSet.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/ShowDataSet.java index 5d374468faa0957b109fe822b0457504dab13614..57c22145490cd75cc79e82824acd474217fd5a77 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/ShowDataSet.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/ShowDataSet.java @@ -27,9 +27,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestU import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AbstractExternalData; /** - * A {@link AbstractDefaultTestCommand} extension for showing detail view of a data set with given - * code. View is displayed because of simulation of a click on show details button in a toolbar of a - * data set search results browser. + * A {@link AbstractDefaultTestCommand} extension for showing detail view of a data set with given code. View is displayed because of simulation of a + * click on show details button in a toolbar of a data set search results browser. * * @author Piotr Buczek */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/ShowDataSetEditor.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/ShowDataSetEditor.java index 0c1686ec68e4ac6df5353e596f0ebc7e1f6e70be..8270c4dff777b0ba329147ee854cae75fc9b9260 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/ShowDataSetEditor.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/ShowDataSetEditor.java @@ -27,8 +27,7 @@ import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.dat */ /** - * A {@link AbstractDefaultTestCommand} extension for showing edit view of a data set that assuming - * that opening its detail view was triggered before. + * A {@link AbstractDefaultTestCommand} extension for showing edit view of a data set that assuming that opening its detail view was triggered before. * * @author Piotr Buczek */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/CheckExperimentTable.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/CheckExperimentTable.java index 21c6a9d9c7f2317e8f6e1de307c4ac35b1b7884a..61bc431357016e94566e01595c429035da9f2a44 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/CheckExperimentTable.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/CheckExperimentTable.java @@ -20,8 +20,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.Abstract import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.CheckTableCommand; /** - * A {@link AbstractDefaultTestCommand} extension to check whether a list of experiments has been - * loaded. + * A {@link AbstractDefaultTestCommand} extension to check whether a list of experiments has been loaded. * * @author Izabela Adamczyk */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ShowExperiment.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ShowExperiment.java index 74f3bf37420be84ed18c2021f76b4757e194623d..8a1d4aaa45818de6dec16c3f1ba5fb76a9f005c1 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ShowExperiment.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ShowExperiment.java @@ -27,8 +27,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestU import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; /** - * A {@link AbstractDefaultTestCommand} extension for showing details view of an experiment with - * given code. + * A {@link AbstractDefaultTestCommand} extension for showing details view of an experiment with given code. * * @author Franz-Josef Elmer */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/filter/OpenFilterSettingsCommand.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/filter/OpenFilterSettingsCommand.java index 3104346dd9ac15337d0f41da766c9336e53fdda0..d2e910bc96ef8c55b6409b54feaf78e48db12847 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/filter/OpenFilterSettingsCommand.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/filter/OpenFilterSettingsCommand.java @@ -22,9 +22,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.CheckTab import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestUtil; /** - * After the data from table with given id are loaded, the settings dialog is opened and filters tab - * selected. The command activates loading data with callback id: - * <code> FilterGrid.createGridId(gridDisplayId)</code>. + * After the data from table with given id are loaded, the settings dialog is opened and filters tab selected. The command activates loading data with + * callback id: <code> FilterGrid.createGridId(gridDisplayId)</code>. * * @author Izabela Adamczyk */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/CheckMaterialTable.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/CheckMaterialTable.java index dc31ca8d301a7823e54e790ee366d0181bc4cd59..66e91cfe6bd035bd55cda7521a183a08591f4e36 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/CheckMaterialTable.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/CheckMaterialTable.java @@ -20,8 +20,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.Abstract import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.CheckTableCommand; /** - * A {@link AbstractDefaultTestCommand} extension to check whether a list of materials has been - * loaded. + * A {@link AbstractDefaultTestCommand} extension to check whether a list of materials has been loaded. * * @author Izabela Adamczyk */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/CheckProjectTable.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/CheckProjectTable.java index 123c19d685db1da4c7ac874ed4c7443d1e17ba07..648026ec4181bbb041ebfaf7a5391e140bc9f90d 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/CheckProjectTable.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/CheckProjectTable.java @@ -20,8 +20,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.Abstract import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.CheckTableCommand; /** - * A {@link AbstractDefaultTestCommand} extension to check whether a list of projects has been - * loaded. + * A {@link AbstractDefaultTestCommand} extension to check whether a list of projects has been loaded. * * @author Izabela Adamczyk */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/FillProjectRegistrationForm.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/FillProjectRegistrationForm.java index f21685a22f3ca95fb749df0c5deb5ed492807299..208ea5d7840af6584e69ddc1e6ddc7e5b4fff768 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/FillProjectRegistrationForm.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/FillProjectRegistrationForm.java @@ -25,8 +25,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.Abstract import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestUtil; /** - * A {@link AbstractDefaultTestCommand} extension for filling - * {@link AbstractProjectEditRegisterForm}. + * A {@link AbstractDefaultTestCommand} extension for filling {@link AbstractProjectEditRegisterForm}. * * @author Izabela Adamczyk */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/CheckPropertyTypeAssignmentTable.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/CheckPropertyTypeAssignmentTable.java index e72bf9a396bc28794fa222cb3bdd5c18134587cb..b09b061ef768abc49f3b43a935a31a70cc71f067 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/CheckPropertyTypeAssignmentTable.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/CheckPropertyTypeAssignmentTable.java @@ -20,8 +20,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.Abstract import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.CheckTableCommand; /** - * A {@link AbstractDefaultTestCommand} extension to check whether a list of property type - * assignments has been loaded. + * A {@link AbstractDefaultTestCommand} extension to check whether a list of property type assignments has been loaded. * * @author Izabela Adamczyk */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/CheckPropertyTypeTable.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/CheckPropertyTypeTable.java index 389c87cac04f024eafee50373c82102f4b4c9f36..7737bb34d89722a49986a5c0d889b6cfe7044d79 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/CheckPropertyTypeTable.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/CheckPropertyTypeTable.java @@ -20,8 +20,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.Abstract import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.CheckTableCommand; /** - * A {@link AbstractDefaultTestCommand} extension to check whether a list of property types has been - * loaded. + * A {@link AbstractDefaultTestCommand} extension to check whether a list of property types has been loaded. * * @author Izabela Adamczyk */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/ExportSamplesTestCommand.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/ExportSamplesTestCommand.java index d3b4e6a7d69740679e2a92debe53e485dc830126..64d0f4dcecdbc5db44462f48ada23afa54628b06 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/ExportSamplesTestCommand.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/ExportSamplesTestCommand.java @@ -31,10 +31,10 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; /** * System tests for the server side of sample export.<BR> - * We wait for the listing operation to complete and then initiate 2 subsequent server calls to get - * the exported table (when preparation is finished it triggers getting the content).<BR> - * It's hard to have complete tests of the client side due to the fact, that the final response is - * received from the servlet and is opened in a new browser window which is hard to access. + * We wait for the listing operation to complete and then initiate 2 subsequent server calls to get the exported table (when preparation is finished + * it triggers getting the content).<BR> + * It's hard to have complete tests of the client side due to the fact, that the final response is received from the servlet and is opened in a new + * browser window which is hard to access. * * @author Tomasz Pylak */ @@ -105,8 +105,8 @@ public class ExportSamplesTestCommand extends AbstractDefaultTestCommand } /** - * A command is executed when export preparation operation and saving the result operation have - * successfully completed. The result is compared with the specified expected content. + * A command is executed when export preparation operation and saving the result operation have successfully completed. The result is compared + * with the specified expected content. */ public ITestCommand createCheckExportCommand(String expectedHeader, String expectedFirstLineOrNull, int expectedTotalLines) diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/ShowSample.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/ShowSample.java index 056405aff1b4da1ac12574c340b3e960c10752bf..29789db15aff6060fafc098d939c064c32642af3 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/ShowSample.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/ShowSample.java @@ -27,8 +27,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestU import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; /** - * A {@link AbstractDefaultTestCommand} extension for showing details view of a sample with given - * code. + * A {@link AbstractDefaultTestCommand} extension for showing details view of a sample with given code. * * @author Franz-Josef Elmer */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/util/GridTestUtils.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/util/GridTestUtils.java index 5cfa781126e87e6266228bbcf3413b8f02487c27..f7e6d95971669b33f1cdd13fde154403e912eb0f 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/util/GridTestUtils.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/util/GridTestUtils.java @@ -49,8 +49,7 @@ public class GridTestUtils } /** - * Fires a double click event on a first row which contains given value in a column with a - * specified id. + * Fires a double click event on a first row which contains given value in a column with a specified id. */ public static <T extends ModelData> void fireDoubleClick(final Grid<T> table, String columnId, String columnValue) @@ -60,8 +59,7 @@ public class GridTestUtils } /** - * Fires a single click event on a first row which contains given value in a column with a - * specified id. + * Fires a single click event on a first row which contains given value in a column with a specified id. */ public static <T extends ModelData> void fireSingleClick(final Grid<T> table, String columnId, String columnValue) @@ -71,8 +69,7 @@ public class GridTestUtils } /** - * Fires a selection of a first row in given table which contains given value in a column with a - * specified id. + * Fires a selection of a first row in given table which contains given value in a column with a specified id. */ public static <T extends ModelData> void fireSelectRow(final Grid<T> table, String columnId, String columnValue) diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/AbstractDefaultTestCommand.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/AbstractDefaultTestCommand.java index 83ce5dbb3338eadc8c3171537ee4fdb50d320a07..95aa9d90462da9ba8d80515e063c100a7695ce1f 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/AbstractDefaultTestCommand.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/AbstractDefaultTestCommand.java @@ -21,8 +21,8 @@ import junit.framework.Assert; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; /** - * Abstract super class of all test commands which are executed if there are no active callbacks - * (all callbacks were detected by {@link RemoteConsole}). + * Abstract super class of all test commands which are executed if there are no active callbacks (all callbacks were detected by {@link RemoteConsole} + * ). * * @author Franz-Josef Elmer * @author Piotr Buczek diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/AbstractGWTTestCase.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/AbstractGWTTestCase.java index 492d46f0ea883cfb65c2fe0441474bec5957625c..5d443e942d7ed03433f8e3a47d88905b0838ea12 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/AbstractGWTTestCase.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/AbstractGWTTestCase.java @@ -59,8 +59,8 @@ public abstract class AbstractGWTTestCase extends GWTTestCase } /** - * Delays test termination until the specified timeout (in milliseconds). Wrapper of - * {@link #delayTestFinish(int)}. Will be used in {@link RemoteConsole}. + * Delays test termination until the specified timeout (in milliseconds). Wrapper of {@link #delayTestFinish(int)}. Will be used in + * {@link RemoteConsole}. */ void delayTestTermination(final int timeoutMillis) { @@ -111,8 +111,7 @@ public abstract class AbstractGWTTestCase extends GWTTestCase } /** - * Starts the tests. Sets the timeout after which the test is terminated to - * {@value #DEFAULT_TIMEOUT}. + * Starts the tests. Sets the timeout after which the test is terminated to {@value #DEFAULT_TIMEOUT}. */ protected void launchTest() { @@ -189,8 +188,7 @@ public abstract class AbstractGWTTestCase extends GWTTestCase } /** - * Returns a command that executes specified <var>preprocessingAction</var> before preparing the - * specified <var>command</var>. + * Returns a command that executes specified <var>preprocessingAction</var> before preparing the specified <var>command</var>. */ protected ITestCommand createCommandWrapper(final ITestCommand command, final IDelegatedAction preprocessingAction) diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/AbstractProperty.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/AbstractProperty.java index cff00732d79116c7cc68d94cdf304b92ab4676cd..a969e843599e578deeb761ab02580be607796af8 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/AbstractProperty.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/AbstractProperty.java @@ -25,8 +25,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityProperty; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityProperty; /** - * Abstract superclass of a generic {@link IProperty} which implements convenient property value - * expectations. It uses a fluent API approach for its methods to prepare expectations. + * Abstract superclass of a generic {@link IProperty} which implements convenient property value expectations. It uses a fluent API approach for its + * methods to prepare expectations. * * @author Franz-Josef Elmer */ @@ -106,8 +106,7 @@ public abstract class AbstractProperty<C extends IPropertyChecker<?>> implements } /** - * Sets assertion that the property value is of type {@link ICodeHolder} with a code equals the - * specified code. + * Sets assertion that the property value is of type {@link ICodeHolder} with a code equals the specified code. */ public C asCode(final String expectedCode) { @@ -122,8 +121,7 @@ public abstract class AbstractProperty<C extends IPropertyChecker<?>> implements } /** - * Sets assertion that the property value is of type {@link IDeletionProvider} with no - * {@link Deletion} object. + * Sets assertion that the property value is of type {@link IDeletionProvider} with no {@link Deletion} object. */ public C asValidEntity() { @@ -139,8 +137,7 @@ public abstract class AbstractProperty<C extends IPropertyChecker<?>> implements } /** - * Sets assertion that the property value is of type {@link IDeletionProvider} with an - * {@link Deletion} object. + * Sets assertion that the property value is of type {@link IDeletionProvider} with an {@link Deletion} object. */ public C asDeletedEntity() { @@ -156,8 +153,7 @@ public abstract class AbstractProperty<C extends IPropertyChecker<?>> implements } /** - * Sets assertion that the property value is of type {@link EntityProperty} with a value equals - * the specified string. + * Sets assertion that the property value is of type {@link EntityProperty} with a value equals the specified string. */ public C asProperty(final String expectedValue) { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/CheckTableCommand.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/CheckTableCommand.java index 0bb7b5547c35e2587ea1590541513b3e0849143a..8a7bfbeac05effacef982ab0f5252149ffaf84e0 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/CheckTableCommand.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/CheckTableCommand.java @@ -29,8 +29,8 @@ import com.extjs.gxt.ui.client.widget.grid.Grid; import ch.systemsx.cisd.openbis.generic.shared.basic.Row; /** - * Command for checking the content (i.e. <code>ListStore</code>) of a table (i.e. <code>Grid</code> - * ). It uses a fluent API approach for its methods to prepare expectations. + * Command for checking the content (i.e. <code>ListStore</code>) of a table (i.e. <code>Grid</code> ). It uses a fluent API approach for its methods + * to prepare expectations. * * @author Franz-Josef Elmer */ @@ -140,8 +140,7 @@ public class CheckTableCommand extends AbstractDefaultTestCommand } /** - * Prepares this with the expectation upon the number of table columns, including hidden - * columns. + * Prepares this with the expectation upon the number of table columns, including hidden columns. */ public CheckTableCommand expectedColumnsNumber(final int expectedNumberOfColumns) { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/GWTTestUtil.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/GWTTestUtil.java index 4d72ff0bc44975efb989382c7427892ecb57044f..3fc5260c96ca964b4985bd537bd97e39c26b5a19 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/GWTTestUtil.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/GWTTestUtil.java @@ -116,8 +116,7 @@ public final class GWTTestUtil } /** - * Simulates click on the {@link CheckBox} with specified id (modifies check box value and fires - * {@link Events#Change} event). + * Simulates click on the {@link CheckBox} with specified id (modifies check box value and fires {@link Events#Change} event). * * @throws AssertionError if not found, isn't a CheckBox or is not enabled. */ @@ -148,8 +147,7 @@ public final class GWTTestUtil } /** - * sets value of a property field with id specified by given {@link PropertyField} (handles both - * simple and comboBox fields) + * sets value of a property field with id specified by given {@link PropertyField} (handles both simple and comboBox fields) */ public final static void setPropertyFieldValue(PropertyField property) { @@ -157,8 +155,8 @@ public final class GWTTestUtil } /** - * sets value of a property field with id specified by given {@link PropertyField} and - * <var>formIdPrefix</var> (handles both simple and comboBox fields) + * sets value of a property field with id specified by given {@link PropertyField} and <var>formIdPrefix</var> (handles both simple and comboBox + * fields) */ public final static void setPropertyFieldValue(String formIdPrefix, PropertyField property) { @@ -383,8 +381,7 @@ public final class GWTTestUtil /** * Tries to find the widget with id that matches given <var>id</var>. * - * @param id a regular expression of an id (usually exactly an id string but it may contain some - * regular expression wildcards inside) + * @param id a regular expression of an id (usually exactly an id string but it may contain some regular expression wildcards inside) * @return <code>null</code> if not found. */ public static Widget tryToFindByID(final String id) @@ -395,8 +392,8 @@ public final class GWTTestUtil } /** - * Traverses root panel tree with the specified widget handler. Traversal is stopped when - * {@link IWidgetHandler#handle(Widget)} returns <code>true</code>. + * Traverses root panel tree with the specified widget handler. Traversal is stopped when {@link IWidgetHandler#handle(Widget)} returns + * <code>true</code>. */ public static void traverseRootPanel(final IWidgetHandler<Widget> handler) { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/IMessageValidator.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/IMessageValidator.java index 178a593c35f134525cef0c38b423ef2344800153..033addcd7a598e5dc5d958b5223f462032850f45 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/IMessageValidator.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/IMessageValidator.java @@ -17,8 +17,6 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.testframework; /** - * - * * @author Franz-Josef Elmer */ public interface IMessageValidator diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/IProperty.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/IProperty.java index ff6b1404e790c60757be38e4b0e1b5905fcb8625..f8ccfe4b7faf4bcc76b6c4ab9e9e6f2d07fb1de9 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/IProperty.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/IProperty.java @@ -16,11 +16,9 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.testframework; - /** - * Interface of an assertion preparation for a property checked by a - * {@link IPropertyChecker} of type <code>C</code>. - * It uses a fluent API approach for its methods to prepare expectations. + * Interface of an assertion preparation for a property checked by a {@link IPropertyChecker} of type <code>C</code>. It uses a fluent API approach + * for its methods to prepare expectations. * * @author Franz-Josef Elmer */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/IPropertyChecker.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/IPropertyChecker.java index 0b8f3d806e73a725c60dc983dc43dba93f261dcc..b214dd5d549247c7257565ce2eb4f0a4d760e199 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/IPropertyChecker.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/IPropertyChecker.java @@ -17,8 +17,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.testframework; /** - * Interface for preparing expectation on a property checking class. - * It uses a fluent API approach for its methods to prepare expectations. + * Interface for preparing expectation on a property checking class. It uses a fluent API approach for its methods to prepare expectations. * * @author Franz-Josef Elmer */ @@ -28,10 +27,9 @@ public interface IPropertyChecker<C extends IPropertyChecker<?>> * Creates an expectation for the property of specified name. */ public IProperty<C> property(String name); - + /** - * Adds an expectation of a property with specified name and specified - * assertion object which checks the property value. + * Adds an expectation of a property with specified name and specified assertion object which checks the property value. * * @return this checker. */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/ITestCommand.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/ITestCommand.java index 01c8d0eb3fb7ae86a27449e8240c01584997e773..3d2cbabcb85df702463e64f1a56126dc1aa33f96 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/ITestCommand.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/ITestCommand.java @@ -21,8 +21,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; /** - * A command which will be executed after a successful invocation of - * {@link AsyncCallback#onSuccess(Object)}. + * A command which will be executed after a successful invocation of {@link AsyncCallback#onSuccess(Object)}. * * @author Franz-Josef Elmer * @author Piotr Buczek @@ -35,16 +34,14 @@ public interface ITestCommand public void execute(); /** - * @return <tt>true</tt> if the specified result should trigger this command in case of an - * invocation of {@link AsyncCallback#onSuccess(Object)}, otherwise <tt>false</tt> + * @return <tt>true</tt> if the specified result should trigger this command in case of an invocation of {@link AsyncCallback#onSuccess(Object)}, + * otherwise <tt>false</tt> */ public boolean isValidOnSucess(Object result); /** - * @return <tt>true</tt> if the specified <var>failureMessage</var> and <var>throwable</var> - * should trigger this command in case of an invocation of - * {@link AsyncCallback#onFailure(Throwable)} of specified <var>callback</var>, - * otherwise <tt>false</tt> + * @return <tt>true</tt> if the specified <var>failureMessage</var> and <var>throwable</var> should trigger this command in case of an invocation + * of {@link AsyncCallback#onFailure(Throwable)} of specified <var>callback</var>, otherwise <tt>false</tt> */ public boolean isValidOnFailure(AbstractAsyncCallback<?> callback, String failureMessage, Throwable throwable); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/PropertyCheckingManager.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/PropertyCheckingManager.java index 19a8768661bce42149fb40ca823c0c4f69974929..ed05009ec0cefa005003fd1144c8786429e14a56 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/PropertyCheckingManager.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/PropertyCheckingManager.java @@ -59,7 +59,7 @@ public class PropertyCheckingManager extends Assert * Checks the assertion for the specified properties. */ @SuppressWarnings( - { "unchecked", "rawtypes" }) + { "unchecked", "rawtypes" }) public void assertProperties(final Map<String, ?> actualProperties) { for (final Map.Entry<String, IValueAssertion> expectedProperty : expectedProperties diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/RemoteConsole.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/RemoteConsole.java index c11783c7595b1f87d17aae25be0e2c1b59bae2ef..41e8553385d5bd3c3906edc2ba44601476777d0a 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/RemoteConsole.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/RemoteConsole.java @@ -29,11 +29,10 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ICallbackL import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; /** - * A class which allows to execute a sequence of {@link ITestCommand} instances. The commands are - * executed in the order they have been added by {@link #prepare(ITestCommand)}. In order to be - * executed a command has to be valid for the kind of {@link AsyncCallback} invocation. With the - * method {@link #finish(int)} a timeout will be specified after which the test will be terminated - * independent whether all commands have been executed or not. In the later case the test fails. + * A class which allows to execute a sequence of {@link ITestCommand} instances. The commands are executed in the order they have been added by + * {@link #prepare(ITestCommand)}. In order to be executed a command has to be valid for the kind of {@link AsyncCallback} invocation. With the method + * {@link #finish(int)} a timeout will be specified after which the test will be terminated independent whether all commands have been executed or + * not. In the later case the test fails. * * @author Franz-Josef Elmer * @author Piotr Buczek @@ -69,8 +68,7 @@ public class RemoteConsole } /** - * Prepares the console with the specified command which will be executed if the specified - * condition is fulfilled. + * Prepares the console with the specified command which will be executed if the specified condition is fulfilled. */ public RemoteConsole prepare(final ITestCommand command) { @@ -154,10 +152,8 @@ public class RemoteConsole /** * Does necessary cleanup after the test has completed. * - * @param delayInMillisecondsOrZero The max duration the test was allowed to run. This is only - * used to construct an error message if the duration ran out before the test - * completed. In cases where it is known that the test completed properly, this can - * be set to 0. + * @param delayInMillisecondsOrZero The max duration the test was allowed to run. This is only used to construct an error message if the duration + * ran out before the test completed. In cases where it is known that the test completed properly, this can be set to 0. */ private void cleanupAfterTests(final int delayInMillisecondsOrZero) { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/TestUtil.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/TestUtil.java index a097809b3fcdd0d50616451faa744009e9526536..1d4c471e900f715aa83383901c7ad9bb13ba04fa 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/TestUtil.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/TestUtil.java @@ -46,9 +46,8 @@ public class TestUtil } /** - * Returns the specified object as a normalised string. Normalization includes trimming, - * conversion to lower case, stripping off <code><div></code> and <code><a></code> - * wrappers. + * Returns the specified object as a normalised string. Normalization includes trimming, conversion to lower case, stripping off + * <code><div></code> and <code><a></code> wrappers. * * @return {@link #NULL} if <code>objectOrNull == null</code> */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/WaitForAllActiveCallbacksFinish.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/WaitForAllActiveCallbacksFinish.java index 5547d1f1759a7afc6c58ece7b95fca38aef3b68b..aa284853847221e543ce73a2426bad55603aba98 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/WaitForAllActiveCallbacksFinish.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/WaitForAllActiveCallbacksFinish.java @@ -17,8 +17,8 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.testframework; /** - * {@link AbstractDefaultTestCommand} extension that does nothing. It should be used if we want to - * make sure that all callbacks will finish without failure. + * {@link AbstractDefaultTestCommand} extension that does nothing. It should be used if we want to make sure that all callbacks will finish without + * failure. * * @author Piotr Buczek */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/WidgetPicker.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/WidgetPicker.java index 3b76f349213e6cfff6b80f73a08bdeda5fac9c99..16423e61955e59777efb07db3455640d7c9a1515 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/WidgetPicker.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/WidgetPicker.java @@ -19,8 +19,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.testframework; import com.google.gwt.user.client.ui.Widget; /** - * Widget handler which picks the first widget having a specified ID. Allows to use regular - * expression wildcards. + * Widget handler which picks the first widget having a specified ID. Allows to use regular expression wildcards. * * @author Franz-Josef Elmer * @author Piotr Buczek @@ -32,8 +31,7 @@ public class WidgetPicker implements IWidgetHandler<Widget> private Widget pickedWidget; /** - * Creates an instance for the specified widget ID. Given <var>id</var> may contain regular - * expression wildcards. + * Creates an instance for the specified widget ID. Given <var>id</var> may contain regular expression wildcards. */ public WidgetPicker(final String id) { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/clientnonjs/HelpPageIdentifierTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/clientnonjs/HelpPageIdentifierTest.java index 0e2e57a45bc7117a1bae33aada92a45a330913f7..bc33aed36e479c297cdc115463d5da8c743c5521 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/clientnonjs/HelpPageIdentifierTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/clientnonjs/HelpPageIdentifierTest.java @@ -33,7 +33,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.help.HelpP * @author Piotr Buczek */ @Friend(toClasses = - { HelpPageIdentifier.class }) +{ HelpPageIdentifier.class }) public class HelpPageIdentifierTest extends AssertJUnit { @@ -43,7 +43,7 @@ public class HelpPageIdentifierTest extends AssertJUnit final HelpPageDomain baseDomain = HelpPageDomain.CHANGE_USER_SETTINGS; assertNull(baseDomain.getSuperDomainOrNull()); assertDomainPathsEquals(new HelpPageDomain[] - { HelpPageDomain.CHANGE_USER_SETTINGS }, baseDomain.getDomainPath()); + { HelpPageDomain.CHANGE_USER_SETTINGS }, baseDomain.getDomainPath()); } @Test @@ -52,7 +52,7 @@ public class HelpPageIdentifierTest extends AssertJUnit final HelpPageDomain subDomain = HelpPageDomain.USERS; assertNotNull(subDomain.getSuperDomainOrNull()); assertDomainPathsEquals(new HelpPageDomain[] - { HelpPageDomain.ADMINISTRATION, HelpPageDomain.AUTHORIZATION, HelpPageDomain.USERS }, + { HelpPageDomain.ADMINISTRATION, HelpPageDomain.AUTHORIZATION, HelpPageDomain.USERS }, subDomain.getDomainPath()); } @@ -73,13 +73,13 @@ public class HelpPageIdentifierTest extends AssertJUnit protected Object[][] getPageTitlesToTest() { return new Object[][] - { - { HelpPageDomain.CHANGE_USER_SETTINGS, HelpPageAction.ACTION, - "HELP__CHANGE_USER_SETTINGS__ACTION" }, - { HelpPageDomain.USERS, HelpPageAction.BROWSE, - "HELP__ADMINISTRATION__AUTHORIZATION__USERS__BROWSE" }, + { + { HelpPageDomain.CHANGE_USER_SETTINGS, HelpPageAction.ACTION, + "HELP__CHANGE_USER_SETTINGS__ACTION" }, + { HelpPageDomain.USERS, HelpPageAction.BROWSE, + "HELP__ADMINISTRATION__AUTHORIZATION__USERS__BROWSE" }, - }; + }; } @SuppressWarnings("deprecation") diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/clientnonjs/URLListEncoderTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/clientnonjs/URLListEncoderTest.java index 6af1c65b6b3397c5445917e3421075d9bb708340..5f0aed1016f04fc8872ffe3767f6c01b9021837b 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/clientnonjs/URLListEncoderTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/clientnonjs/URLListEncoderTest.java @@ -31,15 +31,15 @@ public class URLListEncoderTest extends AssertJUnit protected Object[][] getLists() { return new Object[][] - { + { { new String[] - { "a +:\"\\b", "bobo" } }, + { "a +:\"\\b", "bobo" } }, { new String[] - { "a ,,", ",, b" } }, + { "a ,,", ",, b" } }, { new String[] - { "a,,b ", " ", " c,d,e" } }, + { "a,,b ", " ", " c,d,e" } }, - }; + }; } @Test(dataProvider = "lists") diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/clientnonjs/ViewLocatorResolverRegistryTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/clientnonjs/ViewLocatorResolverRegistryTest.java index a6113809824d1e33e07576e3f54d7f03c147239b..e6197beaec3a4cfce279b21939b03140261a9223 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/clientnonjs/ViewLocatorResolverRegistryTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/clientnonjs/ViewLocatorResolverRegistryTest.java @@ -42,10 +42,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialIdentifier; /** - * A test of the ViewLocatorHandlerRegistry functionality from the Java side. The JavaScript side is - * tested by - * {@link ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.ViewLocatorResolverRegistryTest} - * . + * A test of the ViewLocatorHandlerRegistry functionality from the Java side. The JavaScript side is tested by + * {@link ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.ViewLocatorResolverRegistryTest} . * * @author Chandrasekhar Ramakrishnan */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientServiceTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientServiceTest.java index d2bd0d7d98ef0a6b77aa3549bff9d9f7510334b9..ea55ce95833e1ad2c31f7303b2307820fecde108 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientServiceTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientServiceTest.java @@ -520,7 +520,7 @@ public final class CommonClientServiceTest extends AbstractClientServiceTest { prepareGetSessionToken(this); allowing(httpSession).getAttribute(SessionConstants.OPENBIS_RESULT_SET_MANAGER); - will(returnValue(new CachedResultSetManager<String>(tableDataCache, + will(returnValue(new CachedResultSetManager<String>(tableDataCache, new TokenBasedResultSetKeyGenerator(), new ICustomColumnsProvider() { @Override @@ -534,7 +534,7 @@ public final class CommonClientServiceTest extends AbstractClientServiceTest one(commonServer).listExperimentExternalData(SESSION_TOKEN, experimentId, true); will(returnValue(Collections.singletonList(ds))); - + one(commonServer).listDataSetTypes(SESSION_TOKEN); will(returnValue(Arrays.asList(ds.getDataSetType()))); } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/WebClientConfigurationProviderTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/WebClientConfigurationProviderTest.java index 8201dcf642b1113e98106e8ad1d2fb625affd4ef..4657a6add1f9bd226811bb913f83767704001ba1 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/WebClientConfigurationProviderTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/WebClientConfigurationProviderTest.java @@ -25,8 +25,6 @@ import ch.systemsx.cisd.openbis.generic.shared.WebClientConfigurationProvider; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.WebClientConfiguration; /** - * - * * @author Franz-Josef Elmer */ public class WebClientConfigurationProviderTest extends AssertJUnit @@ -37,21 +35,20 @@ public class WebClientConfigurationProviderTest extends AssertJUnit WebClientConfigurationProvider provider = new WebClientConfigurationProvider(new Properties()); assertEquals(null, provider.getWebClientConfiguration().getPropertyOrNull("hello", "world")); } - + @Test public void testTechnologyProperties() { Properties properties = new Properties(); properties.setProperty(WebClientConfigurationProvider.TECHNOLOGIES, "t1, t2"); - properties.setProperty("t1.a" , "alpha1"); - properties.setProperty("t2.b" , "beta1"); - + properties.setProperty("t1.a", "alpha1"); + properties.setProperty("t2.b", "beta1"); + WebClientConfigurationProvider provider = new WebClientConfigurationProvider(properties); WebClientConfiguration webClientConfiguration = provider.getWebClientConfiguration(); - + assertEquals("alpha1", webClientConfiguration.getPropertyOrNull("t1", "a")); assertEquals(null, provider.getWebClientConfiguration().getPropertyOrNull("t2", "a")); } - - + } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/calculator/RowTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/calculator/RowTest.java index 972ba950711cdb67b1165b4739d8379f0e79414b..d7cf8ef687a403f8b92e5c67f071bff047a1e24f 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/calculator/RowTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/calculator/RowTest.java @@ -31,19 +31,18 @@ import org.testng.annotations.Test; */ public class RowTest extends AssertJUnit { - private static final List<Comparable<?>> EXAMPLE_ROW = Arrays.<Comparable<?>>asList("hello", new Double(42.5)); + private static final List<Comparable<?>> EXAMPLE_ROW = Arrays.<Comparable<?>> asList("hello", new Double(42.5)); private static final String COL1 = "col1"; private static final String COL2 = "col2"; - + private static final String PROPERTY_KEY = "key"; private static final String PROPERTY_VALUE = "value"; private static final String PROPERTY_VALUE2 = "value2"; - private Mockery context; private Row row; @@ -56,15 +55,15 @@ public class RowTest extends AssertJUnit context = new Mockery(); dataProvider = context.mock(ITableDataProvider.class); context.checking(new Expectations() - { { - allowing(dataProvider).getValue(COL1, EXAMPLE_ROW); - will(returnValue(EXAMPLE_ROW.get(0))); + { + allowing(dataProvider).getValue(COL1, EXAMPLE_ROW); + will(returnValue(EXAMPLE_ROW.get(0))); - allowing(dataProvider).getValue(COL2, EXAMPLE_ROW); - will(returnValue(EXAMPLE_ROW.get(1))); - } - }); + allowing(dataProvider).getValue(COL2, EXAMPLE_ROW); + will(returnValue(EXAMPLE_ROW.get(1))); + } + }); row = new Row(dataProvider); row.setRowData(EXAMPLE_ROW); @@ -117,7 +116,7 @@ public class RowTest extends AssertJUnit public void testColDefsWithNullArgument() { prepareColDefs(PROPERTY_VALUE, PROPERTY_VALUE2, 0); - + List<ColumnDefinition> defs = row.colDefs(null); assertEquals(2, defs.size()); @@ -198,7 +197,7 @@ public class RowTest extends AssertJUnit public void testColsGroupedByWithOneGroup() { prepareColDefs(PROPERTY_VALUE, PROPERTY_VALUE, 2); - + List<ColumnGroup> groups = row.colsGroupedBy(PROPERTY_KEY); assertEquals(1, groups.size()); @@ -235,7 +234,7 @@ public class RowTest extends AssertJUnit { prepareColDefs(propertyValueOfFirstDefinition, propertyValueOfSecondDefinition, 1); } - + private void prepareColDefs(final String propertyValueOfFirstDefinition, final String propertyValueOfSecondDefinition, final int numberOfTryToGetPropertyInvocations) { @@ -244,10 +243,10 @@ public class RowTest extends AssertJUnit { one(dataProvider).getAllColumnIDs(); will(returnValue(Arrays.asList(COL1, COL2))); - + exactly(numberOfTryToGetPropertyInvocations).of(dataProvider).tryToGetProperty(COL1, PROPERTY_KEY); will(returnValue(propertyValueOfFirstDefinition)); - + exactly(numberOfTryToGetPropertyInvocations).of(dataProvider).tryToGetProperty(COL2, PROPERTY_KEY); will(returnValue(propertyValueOfSecondDefinition)); } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/ScriptProviderTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/ScriptProviderTest.java index bed3ca927c562ec5c3b6a791aecebf0399ddec91..82018af27ccaa21273d83bb6ed82cfe2ac2ea9ca 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/ScriptProviderTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/ScriptProviderTest.java @@ -85,7 +85,7 @@ public class ScriptProviderTest extends AbstractProviderTest script.setName("my-" + kind + "-script"); script.setDescription("A script for " + kind); script.setEntityKind(kind == null ? null : new EntityKind[] - { kind }); + { kind }); script.setScript("do something with " + kind); script.setScriptType(ScriptType.DYNAMIC_PROPERTY); script.setPluginType(PluginType.JYTHON); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/FilterUtilsTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/FilterUtilsTest.java index 2b1fe000e4e4e533d5d39985780f940ed7f0f7e9..88d24e27edf034c3ccfd61a6dba4abac0f0a3b84 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/FilterUtilsTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/FilterUtilsTest.java @@ -38,6 +38,7 @@ public class FilterUtilsTest extends AssertJUnit private static final class MockDataProvider implements ITableDataProvider { private final String expectedColumnID; + private final List<List<? extends Comparable<?>>> rows; MockDataProvider(String expectedColumnID, List<? extends Comparable<?>>... rows) @@ -71,14 +72,14 @@ public class FilterUtilsTest extends AssertJUnit { return null; } - + @Override public String tryToGetProperty(String columnID, String key) { return null; } } - + private ITableDataProvider dataProvider; @SuppressWarnings("unchecked") diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/TSVRendererTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/TSVRendererTest.java index 70523e18874995ee3236478c972df2235f2417a2..d4f2365a143f3cf3636feac5cf9dd45ac76b25ff 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/TSVRendererTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/TSVRendererTest.java @@ -69,13 +69,13 @@ public class TSVRendererTest extends AssertJUnit will(returnValue(entities)); } }); - + String content = TSVRenderer.createTable(dataProvider, "#"); - + assertEquals("h0\th1#x\ty#a\tb#", content); context.assertIsSatisfied(); } - + @Test public void testRendererNoRows() { @@ -88,9 +88,9 @@ public class TSVRendererTest extends AssertJUnit will(returnValue(entities)); } }); - + String content = TSVRenderer.createTable(dataProvider, "\n"); - + assertEquals("h0\th1\n", content); context.assertIsSatisfied(); } @@ -98,13 +98,13 @@ public class TSVRendererTest extends AssertJUnit private void prepareGetAllColumnTitles(final String... titles) { context.checking(new Expectations() - { { - one(dataProvider).getAllColumnTitles(); - will(returnValue(Arrays.asList(titles))); - } - }); - + { + one(dataProvider).getAllColumnTitles(); + will(returnValue(Arrays.asList(titles))); + } + }); + } } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/XMLPropertyTransformerTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/XMLPropertyTransformerTest.java index 256df40f251cb30002828a075e1e32d9aa817c86..ed6dc6ffd63632d2af21258c8d6217f9b2a0fbfc 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/XMLPropertyTransformerTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/XMLPropertyTransformerTest.java @@ -48,7 +48,7 @@ public class XMLPropertyTransformerTest extends AssertJUnit sample.setProperties(Arrays.<IEntityProperty> asList(p1, p2, p3)); new XMLPropertyTransformer().transformXMLProperties(Arrays.asList(sample)); - + IEntityProperty transformed1 = sample.getProperties().get(0); assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><b>hello world</b>", transformed1.tryGetAsString()); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/CommonServerTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/CommonServerTest.java index 33e4662eac86eec3d4480e19cb6c294715f8677f..41d4a2848db6074f846d549c2ac258f03e9116df 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/CommonServerTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/CommonServerTest.java @@ -1729,7 +1729,7 @@ public final class CommonServerTest extends AbstractServerTestCase { one(commonBusinessObjectFactory).createDataSetTable(session); will(returnValue(dataSetTable)); - + one(daoFactory).getTransactionTimestamp(); will(returnValue(new Date())); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/DataStoreServiceRegistratorTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/DataStoreServiceRegistratorTest.java index 9da6c07c2e667bbca7e816c836c9ac7e2dd3f2f8..61d320afc6c377b0447ed37ab17556403eb17c18 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/DataStoreServiceRegistratorTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/DataStoreServiceRegistratorTest.java @@ -108,10 +108,10 @@ public class DataStoreServiceRegistratorTest extends AssertJUnit dataStore.setCode(DATASTORE_CODE); DatastoreServiceDescription r1 = DatastoreServiceDescription.reporting("R1", "r1", new String[] - { "A.*", "B" }, DATASTORE_CODE, ReportingPluginType.TABLE_MODEL); + { "A.*", "B" }, DATASTORE_CODE, ReportingPluginType.TABLE_MODEL); DatastoreServiceDescription p1 = DatastoreServiceDescription.processing("P1", "p1", new String[] - { "A.*", "C.*", "D" }, DATASTORE_CODE); + { "A.*", "C.*", "D" }, DATASTORE_CODE); context.checking(new Expectations() { { @@ -154,10 +154,10 @@ public class DataStoreServiceRegistratorTest extends AssertJUnit dataStore.setCode(DATASTORE_CODE); DatastoreServiceDescription r1 = DatastoreServiceDescription.reporting("R1", "r1", new String[] - { "A.*", "B" }, DATASTORE_CODE, ReportingPluginType.TABLE_MODEL); + { "A.*", "B" }, DATASTORE_CODE, ReportingPluginType.TABLE_MODEL); DatastoreServiceDescription p1 = DatastoreServiceDescription.processing("P1", "p1", new String[] - { "A.*", "C.*", "D" }, DATASTORE_CODE); + { "A.*", "C.*", "D" }, DATASTORE_CODE); context.checking(new Expectations() { { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/DatabaseLastModificationAdvisorTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/DatabaseLastModificationAdvisorTest.java index e20fff2e82471508aac849c6e5c16450e57918a7..90a151996cec1e5734abb87675038906efa14f9e 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/DatabaseLastModificationAdvisorTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/DatabaseLastModificationAdvisorTest.java @@ -107,13 +107,13 @@ public class DatabaseLastModificationAdvisorTest extends AssertJUnit private Method getCreateMethod() throws Exception { return ICommonServer.class.getMethod("registerDataSetType", new Class[] - { String.class, DataSetType.class }); + { String.class, DataSetType.class }); } private Method getUpdateMethod() throws Exception { return ICommonServer.class.getMethod("updateDataSet", new Class[] - { String.class, DataSetUpdatesDTO.class }); + { String.class, DataSetUpdatesDTO.class }); } private void waitForClockChange() diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/ETLServiceDatabaseTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/ETLServiceDatabaseTest.java index bac6f852838eb7ba3b505d2e04607eb666a063de..216efad596bf9c45b6df2dda8bae89f75677d569 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/ETLServiceDatabaseTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/ETLServiceDatabaseTest.java @@ -285,7 +285,7 @@ public class ETLServiceDatabaseTest extends AbstractDAOTest for (AbstractExternalData dataSetWithNewValue : dataSetsWithNewValue) { Date modificationDate = dataSetWithNewValue.getModificationDate(); - assertTrue("The modification date (" + modificationDate + ") should be current (" + now + ")", + assertTrue("The modification date (" + modificationDate + ") should be current (" + now + ")", modificationDate.compareTo(now) >= 0); String savedComment = EntityHelper.tryFindPropertyValue(dataSetWithNewValue, "COMMENT"); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/JythonEvaluatorPoolTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/JythonEvaluatorPoolTest.java index 9f74240f4a206f5e0f8d4695c5a3e6effac4d7ee..1bf0a4fbbf0390a38b1a507654bab7849a6c0263 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/JythonEvaluatorPoolTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/JythonEvaluatorPoolTest.java @@ -213,13 +213,13 @@ public class JythonEvaluatorPoolTest { return pool.getManagedPropertiesRunner(script).evaluate( new IAtomicEvaluation<IJythonEvaluator>() - { - @Override - public IJythonEvaluator evaluate(IJythonEvaluator evaluator) - { - return evaluator; - } - }); + { + @Override + public IJythonEvaluator evaluate(IJythonEvaluator evaluator) + { + return evaluator; + } + }); } }; } @@ -235,17 +235,17 @@ public class JythonEvaluatorPoolTest { return pool.getManagedPropertiesRunner(script).evaluate( new IAtomicEvaluation<Integer>() - { - @Override - public Integer evaluate(IJythonEvaluator evaluator) - { - Integer x = - (Integer) evaluator - .evalFunction("return_x_if_defined_else_0"); - evaluator.evalFunction("set_x", 3); - return x; - } - }); + { + @Override + public Integer evaluate(IJythonEvaluator evaluator) + { + Integer x = + (Integer) evaluator + .evalFunction("return_x_if_defined_else_0"); + evaluator.evalFunction("set_x", 3); + return x; + } + }); } }; } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/ServerInterfaceRegressionTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/ServerInterfaceRegressionTest.java index f9b18bbae72c392aa10eadb9d4763d85e342e386..53424e5cf4e2f0d8a3389dd846e4d715d88eeb3f 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/ServerInterfaceRegressionTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/ServerInterfaceRegressionTest.java @@ -37,7 +37,7 @@ public class ServerInterfaceRegressionTest extends AnnotationAppliedTestCase { List<String> exemptMethods = new ArrayList<String>(); exemptMethods.add("getDisabledText"); - + assertMandatoryMethodAnnotations(ICommonServer.class, CommonServer.class, "getLastModificationState: Transactional\n", exemptMethods); } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/DefaultAccessControllerTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/DefaultAccessControllerTest.java index 6d8b4b13c5d2b17b1f6e8e3b187b05caf92bb968..e4d24abc7a8753ca7a597f0983e053edeef8bb95 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/DefaultAccessControllerTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/DefaultAccessControllerTest.java @@ -90,7 +90,7 @@ public final class DefaultAccessControllerTest try { FileUtils.writeLines(capFile, - Arrays.asList("# Test overriding annotation", + Arrays.asList("# Test overriding annotation", "MY_CAP: SPACE_OBSERVER; ARG1 = SPACE_USER", "my_cap2: arg1 = space_user")); } catch (IOException ex) @@ -114,7 +114,7 @@ public final class DefaultAccessControllerTest { allowing(daoFactory).getProjectDAO(); will(returnValue(projectDAO)); - + allowing(projectDAO).tryGetByPermID("42"); will(returnValue(project)); } @@ -272,7 +272,7 @@ public final class DefaultAccessControllerTest { final IAuthSession session = AuthorizationTestUtil.createSession(); session.tryGetPerson().setRoleAssignments(createRoleAssignments()); - final Method method = MyInterface.class.getMethod("myMethodWithGardedArgument", + final Method method = MyInterface.class.getMethod("myMethodWithGardedArgument", String.class, String.class, String.class); assertNotNull(method); Argument<?>[] arguments = createArguments(method); @@ -290,19 +290,19 @@ public final class DefaultAccessControllerTest { final IAuthSession session = AuthorizationTestUtil.createSession(); session.tryGetPerson().setRoleAssignments(createRoleAssignments()); - final Method method = MyInterface.class.getMethod("myMethodWithGardedArgument", + final Method method = MyInterface.class.getMethod("myMethodWithGardedArgument", String.class, String.class, String.class); assertNotNull(method); Argument<?>[] arguments = createArguments(method); project.setId(1L); - + final Status authorized = accessController.isAuthorized(session, method, arguments); - + assertEquals("ERROR", authorized.toString()); assertEquals("person: john_doe, roles: [INSTANCE_OBSERVER, SPACE_USER], value: arg0", project.getDescription()); context.assertIsSatisfied(); } - + @Test public void testIsNotAuthorizedWithGardedArgumentWithDifferentRoles() throws Exception { @@ -320,7 +320,7 @@ public final class DefaultAccessControllerTest assertEquals(null, project.getDescription()); context.assertIsSatisfied(); } - + @Test public void testIsAuthorizedWithGardedArgumentWithRolesOverridden() throws Exception { @@ -330,9 +330,9 @@ public final class DefaultAccessControllerTest String.class, String.class); assertNotNull(method); Argument<?>[] arguments = createArguments(method); - + final Status authorized = accessController.isAuthorized(session, method, arguments); - + assertEquals("OK", authorized.toString()); assertEquals("person: john_doe, roles: [SPACE_USER], value: arg0", project.getDescription()); context.assertIsSatisfied(); @@ -347,14 +347,14 @@ public final class DefaultAccessControllerTest String.class, String.class); assertNotNull(method); Argument<?>[] arguments = createArguments(method); - + final Status authorized = accessController.isAuthorized(session, method, arguments); - + assertEquals("OK", authorized.toString()); assertEquals("person: john_doe, roles: [SPACE_USER], value: arg0", project.getDescription()); context.assertIsSatisfied(); } - + @Test public void testIsAuthorizedWithGardedArgumentWithRolesOverridden3() throws Exception { @@ -364,15 +364,15 @@ public final class DefaultAccessControllerTest String.class, String.class, String.class); assertNotNull(method); Argument<?>[] arguments = createArguments(method); - + final Status authorized = accessController.isAuthorized(session, method, arguments); - + assertEquals("ERROR: \"None of method roles '[SPACE_POWER_USER, SPACE_ADMIN, INSTANCE_ADMIN]' " + "could be found in roles of user 'John Doe'.\"", authorized.toString()); assertEquals(null, project.getDescription()); context.assertIsSatisfied(); } - + private Argument<?>[] createArguments(final Method method) { List<Argument<?>> arguments = new ArrayList<>(); @@ -414,38 +414,33 @@ public final class DefaultAccessControllerTest public void myMethodWithUngardedArgument(String sessionToken, String argument1); @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) - public void myMethodWithGardedArgument(String sessionToken, + public void myMethodWithGardedArgument(String sessionToken, @AuthorizationGuard(guardClass = MockPredicate.class) String argument1, @AuthorizationGuard(guardClass = MockPredicate.class) String argument2); @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) public void myMethodWithGardedArgumentWithDifferentRoles(String sessionToken, @AuthorizationGuard(guardClass = MockPredicate.class, - rolesAllowed = { RoleWithHierarchy.SPACE_ETL_SERVER }) - String argument1); - + rolesAllowed = { RoleWithHierarchy.SPACE_ETL_SERVER }) String argument1); + @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) @Capability("MY_CAP") public void myMethodWithGardedArgumentWithRolesOverridden(String sessionToken, @AuthorizationGuard(name = "ARG1", guardClass = MockPredicate.class, - rolesAllowed = { RoleWithHierarchy.SPACE_ETL_SERVER }) - String argument1); + rolesAllowed = { RoleWithHierarchy.SPACE_ETL_SERVER }) String argument1); @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) @Capability("MY_CAP2") public void myMethodWithGardedArgumentWithRolesOverridden2(String sessionToken, @AuthorizationGuard(name = "ARG1", guardClass = MockPredicate.class, - rolesAllowed = { RoleWithHierarchy.SPACE_ETL_SERVER }) - String argument1); + rolesAllowed = { RoleWithHierarchy.SPACE_ETL_SERVER }) String argument1); @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) public void myMethodWithGardedArgumentWithRolesOverridden3(String sessionToken, @AuthorizationGuard(name = "ARG1", guardClass = MockPredicate.class, - rolesAllowed = { RoleWithHierarchy.SPACE_POWER_USER }) - String argument1, + rolesAllowed = { RoleWithHierarchy.SPACE_POWER_USER }) String argument1, @AuthorizationGuard(name = "ARG2", guardClass = MockPredicate.class, - rolesAllowed = { RoleWithHierarchy.SPACE_USER }) - String argument2); + rolesAllowed = { RoleWithHierarchy.SPACE_USER }) String argument2); } /** @@ -464,7 +459,7 @@ public final class DefaultAccessControllerTest roles.add(roleWithIdentifier.getRole()); } Collections.sort(roles); - + String description = "person: " + person.getUserId() + ", roles: " + roles + ", value: " + valueOrNull; if (project.getDescription() != null) { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/CollectionPredicateTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/CollectionPredicateTest.java index dbe50eaddb091352b40e16a6f0513a2cf747c08e..e80f23ad8a2cb668c02f48ee4c90a9a251b81e40 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/CollectionPredicateTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/CollectionPredicateTest.java @@ -32,8 +32,6 @@ import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.IPredicat import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; /** - * - * * @author Franz-Josef Elmer */ public class CollectionPredicateTest extends AuthorizationTestCase @@ -60,14 +58,14 @@ public class CollectionPredicateTest extends AuthorizationTestCase { CollectionPredicate<String> arrayPredicate = new CollectionPredicate<String>(predicate); arrayPredicate.init(provider); - + List<String> emptyList = Collections.<String> emptyList(); Status status = arrayPredicate.evaluate(createPerson(), createRoles(true), emptyList); - + assertEquals(false, status.isError()); context.assertIsSatisfied(); } - + @Test public void testWithTwoElements() { @@ -85,13 +83,13 @@ public class CollectionPredicateTest extends AuthorizationTestCase will(returnValue(Status.OK)); } }); - + Status status = arrayPredicate.evaluate(person, roles, Arrays.asList("a", "b")); - + assertEquals(false, status.isError()); context.assertIsSatisfied(); } - + @Test public void testWithTwoElementsOneFailing() { @@ -109,9 +107,9 @@ public class CollectionPredicateTest extends AuthorizationTestCase will(returnValue(Status.createError())); } }); - + Status status = arrayPredicate.evaluate(person, roles, Arrays.asList("a", "b")); - + assertEquals(true, status.isError()); context.assertIsSatisfied(); } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/ExternalDataValidatorTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/ExternalDataValidatorTest.java index 671579db982242d01d770eb7a4e7324a1d8f7434..a6ba1920aba626163384b8cc9d564e417d696c05 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/ExternalDataValidatorTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/ExternalDataValidatorTest.java @@ -39,7 +39,7 @@ public class ExternalDataValidatorTest extends AuthorizationTestCase "http://someURL", null, new ManagedPropertyEvaluatorFactory(null, new TestJythonEvaluatorPool()))); return data; } - + private PhysicalDataSet createDataForSample(SpacePE space) { PhysicalDataSet data = new PhysicalDataSet(); @@ -63,7 +63,7 @@ public class ExternalDataValidatorTest extends AuthorizationTestCase PersonPE person = createPersonWithRoleAssignments(); assertEquals(true, validator.isValid(person, createDataForSample(createAnotherSpace()))); } - + @Test public void testIsValidWithDataInTheRightDatabaseInstance() { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/GroupValidatorTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/GroupValidatorTest.java index 9094c157d8dbe3ed65ec0732e9d39a631d0f4fc1..d04561f8db541158948d1c58fcacc9f56c90c8d4 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/GroupValidatorTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/authorization/validator/GroupValidatorTest.java @@ -16,7 +16,6 @@ package ch.systemsx.cisd.openbis.generic.server.authorization.validator; - import org.testng.annotations.Test; import ch.systemsx.cisd.openbis.generic.server.authorization.AuthorizationTestCase; @@ -44,7 +43,7 @@ public final class GroupValidatorTest extends AuthorizationTestCase { assertEquals("Unspecified person", e.getMessage()); } - + context.assertIsSatisfied(); } @@ -55,7 +54,7 @@ public final class GroupValidatorTest extends AuthorizationTestCase final PersonPE personPE = createPerson(); final SpacePE groupPE = createSpace(); final Space space = SpaceTranslator.translate(groupPE); - + assertFalse(groupValidator.isValid(personPE, space)); context.assertIsSatisfied(); @@ -71,7 +70,7 @@ public final class GroupValidatorTest extends AuthorizationTestCase assertTrue(groupValidator.isValid(personPE, space)); context.assertIsSatisfied(); } - + @Test public final void testIsValidWithMatchingRoleAssignmentOnDatabaseinstanceLevel() { @@ -82,5 +81,5 @@ public final class GroupValidatorTest extends AuthorizationTestCase assertTrue(groupValidator.isValid(personPE, space)); context.assertIsSatisfied(); } - + } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/PropertiesBatchEvaluationErrorsTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/PropertiesBatchEvaluationErrorsTest.java index 0a8b061937cf03581e4c2d699c0f713d9a499ea2..edefe6c736284c4d57406a333b0ae955cf960014 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/PropertiesBatchEvaluationErrorsTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/PropertiesBatchEvaluationErrorsTest.java @@ -45,7 +45,6 @@ public class PropertiesBatchEvaluationErrorsTest extends AssertJUnit private ScriptPE script; - @BeforeMethod public void setUp() { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataBOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataBOTest.java index e2fb8a95ede11d05fcb2b125c9aea2185cb6414c..70ea85e901aa99b16003869d6438eb479743efe5 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataBOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/DataBOTest.java @@ -472,12 +472,12 @@ public class DataBOTest extends AbstractBOTest { assertEquals("Unknown data set code '" + COMPONENT_CODE + "'", e.getMessage()); } - DataPE data = dataBO.getData(); - - assertSame(experiment, data.getExperiment()); - assertEquals(null, data.tryGetSample()); - assertSame(true, data.isMeasured()); - assertSame(dataStore, data.getDataStore()); + DataPE data = dataBO.getData(); + + assertSame(experiment, data.getExperiment()); + assertEquals(null, data.tryGetSample()); + assertSame(true, data.isMeasured()); + assertSame(dataStore, data.getDataStore()); context.assertIsSatisfied(); } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ExperimentBOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ExperimentBOTest.java index e83c9101c8b62477d448f35806479828b732be92..fa6731952dffc5a036c42a513673654f6301c5cb 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ExperimentBOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ExperimentBOTest.java @@ -229,8 +229,7 @@ public final class ExperimentBOTest extends AbstractBOTest final ProjectPE project = createProject(groupCode, projectCode); final ExperimentTypePE type = createExperimentType(expTypeCode); final ExperimentPE experiment = createExperiment(project, expCode, type); - TimeIntervalChecker timeIntervalChecker - = new TimeIntervalChecker(daoFactory.getTransactionTimestamp()); + TimeIntervalChecker timeIntervalChecker = new TimeIntervalChecker(daoFactory.getTransactionTimestamp()); prepareAnyDaoCreation(); context.checking(new Expectations() diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/PropertyValidatorTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/PropertyValidatorTest.java index c556f96dd633264ecc8a6bd474166c63382bdaa8..111c513b96fffd58fb97d1a0da3ceb59655669a5 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/PropertyValidatorTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/PropertyValidatorTest.java @@ -108,35 +108,35 @@ public final class PropertyValidatorTest extends AbstractBOTest private final static Object[][] getNonWorkingValues() { return new Object[][] - { - { createTimestampPropertyType(), DateFormatUtils.format(new Date(), "yyyy") }, - { createIntegerPropertyType(), "a" }, - { createIntegerPropertyType(), "1.1" }, - { createRealPropertyType(), "b" }, - { createBooleanPropertyType(), "BOB" }, }; + { + { createTimestampPropertyType(), DateFormatUtils.format(new Date(), "yyyy") }, + { createIntegerPropertyType(), "a" }, + { createIntegerPropertyType(), "1.1" }, + { createRealPropertyType(), "b" }, + { createBooleanPropertyType(), "BOB" }, }; } @DataProvider private final static Object[][] getWorkingValues() { return new Object[][] - { - { createVarcharPropertyType(), "" }, - { createVarcharPropertyType(), "varchar" }, - { - createTimestampPropertyType(), - DateFormatUtils.format(new Date(), - SupportedDatePattern.CANONICAL_DATE_PATTERN.getPattern()) }, - { - createTimestampPropertyType(), - DateFormatUtils.format(new Date(), - SupportedDatePattern.US_DATE_TIME_24_PATTERN.getPattern()) }, - { createIntegerPropertyType(), "1" }, - { createRealPropertyType(), "1" }, - { createRealPropertyType(), "1.1" }, - { createBooleanPropertyType(), "yes" }, - { createBooleanPropertyType(), "1" }, - { createBooleanPropertyType(), "true" } }; + { + { createVarcharPropertyType(), "" }, + { createVarcharPropertyType(), "varchar" }, + { + createTimestampPropertyType(), + DateFormatUtils.format(new Date(), + SupportedDatePattern.CANONICAL_DATE_PATTERN.getPattern()) }, + { + createTimestampPropertyType(), + DateFormatUtils.format(new Date(), + SupportedDatePattern.US_DATE_TIME_24_PATTERN.getPattern()) }, + { createIntegerPropertyType(), "1" }, + { createRealPropertyType(), "1" }, + { createRealPropertyType(), "1.1" }, + { createBooleanPropertyType(), "yes" }, + { createBooleanPropertyType(), "1" }, + { createBooleanPropertyType(), "true" } }; } @Test diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleBOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleBOTest.java index f8e6d4aa9233e67d6dc9bfe60a783c277a8c1b93..4c640c4560efa2482ef7be53d87c4b3958635710 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleBOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SampleBOTest.java @@ -432,7 +432,6 @@ public final class SampleBOTest extends AbstractBOTest allowing(dataDAO).hasDataSet(with(sample)); will(returnValue(false)); - one(relationshipService).shareSample(with(any(IAuthSession.class)), with(any(SamplePE.class))); } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SearchDomainSearcherTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SearchDomainSearcherTest.java index 6e80885bc517a37fda0b84649026930bc1e1da91..c101a2f0856e12d7f24ff65979ec0b301bbd01c0 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SearchDomainSearcherTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/SearchDomainSearcherTest.java @@ -143,27 +143,27 @@ public class SearchDomainSearcherTest extends AbstractBOTest assertEquals("E1", results.get(0).getEntity().getPermId()); assertEquals("Search Domain: test-db, Score: [Score: 11.5, bit score: 5.75, evalue: 12.5], Result location: " + "[Experiment type: UNKNOWN-E, perm id: E1, code: CODE-E1, property type: S, alignment in sequence: [42-45], " - + "alignment in query: [7-10], number of mismatches: 0, total number of gaps: 0]", + + "alignment in query: [7-10], number of mismatches: 0, total number of gaps: 0]", results.get(0).getSearchResult().toString()); assertEquals("S2", results.get(1).getEntity().getPermId()); assertEquals("Search Domain: test-db, Score: [Score: 10.5, bit score: 5.25, evalue: 11.5], Result location: " + "[Sample type: TYPE, perm id: S2, code: CODE-S2, property type: OLIGO, alignment in sequence: [42-45], " - + "alignment in query: [7-10], number of mismatches: 0, total number of gaps: 0]", + + "alignment in query: [7-10], number of mismatches: 0, total number of gaps: 0]", results.get(1).getSearchResult().toString()); assertEquals("S1", results.get(2).getEntity().getPermId()); assertEquals("Search Domain: test-db, Score: [Score: 9.5, bit score: 4.75, evalue: 10.5], Result location: " + "[Sample type: TYPE, perm id: S1, code: CODE-S1, property type: OLIGO, alignment in sequence: [42-45], " - + "alignment in query: [7-10], number of mismatches: 0, total number of gaps: 0]", + + "alignment in query: [7-10], number of mismatches: 0, total number of gaps: 0]", results.get(2).getSearchResult().toString()); assertEquals("DS1", results.get(3).getEntity().getPermId()); assertEquals("Search Domain: test-db, Score: [Score: 0.5, bit score: 0.25, evalue: 1.5], Result location: " + "[Data set type: UNKNOWN, perm id: DS1, code: DS1, property type: SEQ, alignment in sequence: [42-45], " - + "alignment in query: [7-10], number of mismatches: 0, total number of gaps: 0]", + + "alignment in query: [7-10], number of mismatches: 0, total number of gaps: 0]", results.get(3).getSearchResult().toString()); assertEquals(4, results.size()); context.assertIsSatisfied(); } - + @Test public void testSearchForDataSetsWithSequences() { @@ -259,7 +259,7 @@ public class SearchDomainSearcherTest extends AbstractBOTest } }); } - + private void prepareSearchForEntityPropertiesWithSequences(final DataStorePE dataStore, final IDataStoreService service, final double initialScore, final String... foundLocations) { @@ -355,7 +355,7 @@ public class SearchDomainSearcherTest extends AbstractBOTest data.setFileFormatType(fileFormatType); return data; } - + private SamplePE createSample(String permID) { SamplePE sample = new SamplePE(); @@ -372,7 +372,7 @@ public class SearchDomainSearcherTest extends AbstractBOTest sample.setSampleType(sampleType); return sample; } - + private ExperimentPE createExperiment(String permID) { ExperimentPE experiment = new ExperimentPE(); @@ -402,7 +402,7 @@ public class SearchDomainSearcherTest extends AbstractBOTest } return permIds; } - + private ISearchDomainResultScore createScore(double score) { BlastScore blastScore = new BlastScore(); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/TrashBOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/TrashBOTest.java index 1f45068e04f846bc97ecfc75bfa9a3e63124226e..9b731df54ff03969f9f5962d8caea1a472d40a3c 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/TrashBOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/TrashBOTest.java @@ -74,6 +74,7 @@ public final class TrashBOTest extends AbstractBOTest private static String EXAMPLE_REASON = "example reason"; private static Long COMPONENT_CONTAINER_RELATIONSHIP_ID = 1001L; + private static Long CHILDREN_PARENT_RELATIONSHIP_ID = 1002L; private static TechId EXAMPLE_ID = new TechId(1L); @@ -117,10 +118,10 @@ public final class TrashBOTest extends AbstractBOTest type = new RelationshipTypePE(); type.setId(CHILDREN_PARENT_RELATIONSHIP_ID); will(returnValue(type)); - + allowing(boFactory).createSampleLister(session); will(returnValue(sampleLister)); - + allowing(boFactory).createDatasetLister(session); will(returnValue(datasetLister)); } @@ -238,7 +239,7 @@ public final class TrashBOTest extends AbstractBOTest context.assertIsSatisfied(); } - + private void prepareEntityGraph(EntityGraphGenerator g) { g.assertConsistency(); @@ -297,7 +298,7 @@ public final class TrashBOTest extends AbstractBOTest } }); } - + private void prepareListDataSetIdsByExperimentIds(final EntityGraphGenerator g) { final AbstractMockHandler<List<TechId>> handler = new AbstractMockHandler<List<TechId>>() @@ -318,7 +319,7 @@ public final class TrashBOTest extends AbstractBOTest } }); } - + private void prepareListDataSetIdsBySampleIds(final EntityGraphGenerator g) { final AbstractMockHandler<Collection<TechId>> handler = new AbstractMockHandler<Collection<TechId>>() @@ -339,29 +340,29 @@ public final class TrashBOTest extends AbstractBOTest } }); } - + private void prepareGetByTechId(final EntityGraphGenerator g) { final AbstractMockHandler<TechId> handler = new AbstractMockHandler<TechId>() + { + @Override + public Object invoke(Invocation invocation) throws Throwable { - @Override - public Object invoke(Invocation invocation) throws Throwable + DataSetNode dataSetNode = g.getDataSets().get(argument.getId()); + ExternalDataPE dataSet = Utils.createData(dataSetNode); + print("getByTechId(" + argument + ") = " + dataSet); + return dataSet; + } + }; + context.checking(new Expectations() { - DataSetNode dataSetNode = g.getDataSets().get(argument.getId()); - ExternalDataPE dataSet = Utils.createData(dataSetNode); - print("getByTechId(" + argument + ") = " + dataSet); - return dataSet; - } - }; - context.checking(new Expectations() { - { - allowing(dataDAO).getByTechId(with(handler)); - will(handler); - } - }); + allowing(dataDAO).getByTechId(with(handler)); + will(handler); + } + }); } - + private void prepareFindChildrenOrComponentIds(final EntityGraphGenerator g) { class FindChildrenIdsMockHandler @@ -478,84 +479,84 @@ public final class TrashBOTest extends AbstractBOTest } }); } - + private void prepareListExperimentsByIds(final EntityGraphGenerator g) { final AbstractMockHandler<Collection<Long>> handler = new AbstractMockHandler<Collection<Long>>() - { - @Override - public Object invoke(Invocation invocation) throws Throwable { - List<ExperimentPE> experiments = new ArrayList<ExperimentPE>(); - Map<Long, ExperimentNode> experimentNodes = g.getExperiments(); - for (Long id : argument) - { - ExperimentNode experimentNode = experimentNodes.get(id); - experiments.add(Utils.createExperimentPE(experimentNode)); - } - print("listByExperimentIds(" + argument + ") = " + experiments); - return experiments; - } - }; - context.checking(new Expectations() + @Override + public Object invoke(Invocation invocation) throws Throwable { + List<ExperimentPE> experiments = new ArrayList<ExperimentPE>(); + Map<Long, ExperimentNode> experimentNodes = g.getExperiments(); + for (Long id : argument) { - allowing(experimentDAO).listByIDs(with(handler)); - will(handler); + ExperimentNode experimentNode = experimentNodes.get(id); + experiments.add(Utils.createExperimentPE(experimentNode)); } - }); + print("listByExperimentIds(" + argument + ") = " + experiments); + return experiments; + } + }; + context.checking(new Expectations() + { + { + allowing(experimentDAO).listByIDs(with(handler)); + will(handler); + } + }); } - + private void prepareListByDataSetIds(final EntityGraphGenerator g) { final AbstractMockHandler<Collection<Long>> handler = new AbstractMockHandler<Collection<Long>>() - { - @Override - public Object invoke(Invocation invocation) throws Throwable { - List<AbstractExternalData> dataSets = new ArrayList<AbstractExternalData>(); - Map<Long, DataSetNode> dataSetNodes = g.getDataSets(); - for (Long id : argument) - { - DataSetNode dataSetNode = dataSetNodes.get(id); - dataSets.add(Utils.createExternalData(dataSetNode)); - } - print("listByDataSetIds(" + argument + ") = " + dataSets); - return dataSets; - } - }; - context.checking(new Expectations() + @Override + public Object invoke(Invocation invocation) throws Throwable { + List<AbstractExternalData> dataSets = new ArrayList<AbstractExternalData>(); + Map<Long, DataSetNode> dataSetNodes = g.getDataSets(); + for (Long id : argument) { - allowing(datasetLister).listByDatasetIds(with(handler), with(TrashBO.DATA_SET_FETCH_OPTIONS)); - will(handler); + DataSetNode dataSetNode = dataSetNodes.get(id); + dataSets.add(Utils.createExternalData(dataSetNode)); } - }); + print("listByDataSetIds(" + argument + ") = " + dataSets); + return dataSets; + } + }; + context.checking(new Expectations() + { + { + allowing(datasetLister).listByDatasetIds(with(handler), with(TrashBO.DATA_SET_FETCH_OPTIONS)); + will(handler); + } + }); } private void prepareListDataSetContainerIds(final EntityGraphGenerator g) { final AbstractMockHandler<Collection<Long>> handler = new AbstractMockHandler<Collection<Long>>() + { + @Override + public Object invoke(Invocation invocation) throws Throwable { - @Override - public Object invoke(Invocation invocation) throws Throwable + Map<Long, Set<Long>> idsMap = g.getContainerDataSetIdsMap( + TechId.createList(new ArrayList<Long>(argument))); + print("listContainerIds(" + argument + ") = " + idsMap); + return idsMap; + } + }; + context.checking(new Expectations() { - Map<Long, Set<Long>> idsMap = g.getContainerDataSetIdsMap( - TechId.createList(new ArrayList<Long>(argument))); - print("listContainerIds(" + argument + ") = " + idsMap); - return idsMap; - } - }; - context.checking(new Expectations() { - { - allowing(datasetLister).listContainerIds(with(handler)); - will(handler); - } - }); + allowing(datasetLister).listContainerIds(with(handler)); + will(handler); + } + }); } - + private void prepareListDataSetComponentIds(final EntityGraphGenerator g) { final AbstractMockHandler<Collection<Long>> handler = new AbstractMockHandler<Collection<Long>>() @@ -577,12 +578,13 @@ public final class TrashBOTest extends AbstractBOTest } }); } - + private void prepareGetDataSetsAndNonDeletableDataSets(final EntityGraphGenerator g) { class DataSetTableMockHandler extends BaseMatcher<List<TechId>> { private List<DataPE> dataSets = new ArrayList<DataPE>(); + private List<ExternalDataPE> nonDeletableDataSets = new ArrayList<ExternalDataPE>(); @Override @@ -614,7 +616,7 @@ public final class TrashBOTest extends AbstractBOTest } return true; } - + } final DataSetTableMockHandler handler = new DataSetTableMockHandler(); @@ -635,7 +637,7 @@ public final class TrashBOTest extends AbstractBOTest } }); } - + private static abstract class AbstractMockHandler<T> extends BaseMatcher<T> implements Action { protected T argument; @@ -654,12 +656,12 @@ public final class TrashBOTest extends AbstractBOTest return true; } } - - private List<TechId> asIds(IIdHolder...entities) + + private List<TechId> asIds(IIdHolder... entities) { return TechId.createList(Arrays.asList(entities)); } - + private static final void print(Object message) { String methodName = null; @@ -673,5 +675,5 @@ public final class TrashBOTest extends AbstractBOTest } System.out.println(methodName + ": " + message); } - + } \ No newline at end of file diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/EntityPropertiesEnricherTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/EntityPropertiesEnricherTest.java index 804a4d9ab38a69ec5f39fd947cfb4aacdbd116dc..3d051bc351e8174479aaa42bcf27e76ce7919a44 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/EntityPropertiesEnricherTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/EntityPropertiesEnricherTest.java @@ -79,7 +79,7 @@ public class EntityPropertiesEnricherTest extends AssertJUnit propertyType.setId(PROPERTY_TYPE_ID); propertyType.setDataType(new DataType(DataTypeCode.CONTROLLEDVOCABULARY)); will(returnValue(new PropertyType[] - { propertyType })); + { propertyType })); allowing(resolver).get(ENTITY_ID); will(returnValue(holder)); @@ -114,7 +114,7 @@ public class EntityPropertiesEnricherTest extends AssertJUnit codeRecord.id = VOCABULARY_ID; codeRecord.code = "http://my.url.org/?q=${term}"; will(returnValue(new CodeRecord[] - { codeRecord })); + { codeRecord })); one(setQuery).getEntityPropertyVocabularyTermValues(entityIDs); VocabularyTermRecord termRecord = new VocabularyTermRecord(); @@ -152,7 +152,7 @@ public class EntityPropertiesEnricherTest extends AssertJUnit codeRecord.id = VOCABULARY_ID; codeRecord.code = "http://my.url.org/?q=$term$"; will(returnValue(new CodeRecord[] - { codeRecord })); + { codeRecord })); one(setQuery).getEntityPropertyVocabularyTermValues(entityIDs); VocabularyTermRecord termRecord = new VocabularyTermRecord(); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/SecondaryEntityListingQueryTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/SecondaryEntityListingQueryTest.java index d7aa311ad986ff99f0fb9859e11dd37795bdaf51..79f5b55ca59888aea51acf1d13702db6200120e2 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/SecondaryEntityListingQueryTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/common/entity/SecondaryEntityListingQueryTest.java @@ -47,10 +47,10 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.SampleRelationshipPE; * @author Tomasz Pylak */ @Friend(toClasses = - { ExperimentProjectSpaceCodeRecord.class, ISecondaryEntityListingQuery.class, - SecondaryEntityDAO.class }) +{ ExperimentProjectSpaceCodeRecord.class, ISecondaryEntityListingQuery.class, + SecondaryEntityDAO.class }) @Test(groups = - { "db", "misc" }) +{ "db", "misc" }) public class SecondaryEntityListingQueryTest extends AbstractDAOTest { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/DatasetListingQueryTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/DatasetListingQueryTest.java index 90b9ee8a9ffbf43bf43da49eb227f300e8f087e3..bbb2ab1d257f3aeece2a2cfefb6b70d79b6c2908 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/DatasetListingQueryTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/datasetlister/DatasetListingQueryTest.java @@ -149,11 +149,11 @@ public class DatasetListingQueryTest extends AbstractDAOTest { ExperimentPE experiment1 = getExperiment(dbInstance.getCode(), "CISD", "NEMO", "EXP-TEST-1", daoFactory); - + Long relationshipTypeId = RelationshipUtils.getParentChildRelationshipType(daoFactory.getRelationshipTypeDAO()).getId(); List<DatasetRecord> datasets = asList(query.getDataSetsForExperimentAndDescendents(experiment1.getId(), relationshipTypeId)); - + for (DatasetRecord record : datasets) { assertTrue(record.is_post_registered != null); @@ -171,7 +171,7 @@ public class DatasetListingQueryTest extends AbstractDAOTest { assertTrue(record.is_post_registered != null); } - } + } @Test public void testQueryUsingSelectAllExternalDatasReturnsNotNullPostRegistered() @@ -181,7 +181,7 @@ public class DatasetListingQueryTest extends AbstractDAOTest { assertTrue(record.is_post_registered != null); } - } + } @Test public void testQueryUsingSelectAllExternalDatasReturnsCorrectPostRegistered() @@ -189,14 +189,16 @@ public class DatasetListingQueryTest extends AbstractDAOTest List<DatasetRecord> datasets = asList(query.getDatasetsByDataStoreId(1)); for (DatasetRecord record : datasets) { - if(record.code.equals("COMPONENT_1A")) { + if (record.code.equals("COMPONENT_1A")) + { assertTrue(record.is_post_registered == false); } - else { + else + { assertTrue(record.is_post_registered == true); } } - } + } @Test public void testDatasetsForSample() diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/DataSetNode.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/DataSetNode.java index 51a7311d1180dda76f3a7188208e16538311bd54..f21517c0e33d0098da9057fd7623dc9cde61f987 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/DataSetNode.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/DataSetNode.java @@ -19,11 +19,10 @@ package ch.systemsx.cisd.openbis.generic.server.business.bo.entitygraph; import java.util.ArrayList; import java.util.List; - public final class DataSetNode extends EntityNode { private boolean deletable = true; - + ExperimentNode experiment; SampleNode sample; @@ -40,7 +39,7 @@ public final class DataSetNode extends EntityNode { super("DS", id); } - + public boolean isDeletable() { return deletable; @@ -50,12 +49,12 @@ public final class DataSetNode extends EntityNode { return experiment; } - + public SampleNode getSample() { return sample; } - + public List<DataSetNode> getChildren() { return children; @@ -65,23 +64,23 @@ public final class DataSetNode extends EntityNode { return parents; } - + public List<DataSetNode> getComponents() { return components; } - + public List<DataSetNode> getContainers() { return containers; } - + public DataSetNode nonDeletable() { deletable = false; return this; } - + void hasComponents(DataSetNode... someComponentDataSets) { for (DataSetNode componentDataSet : someComponentDataSets) @@ -99,8 +98,8 @@ public final class DataSetNode extends EntityNode childDataSet.parents.add(this); } } - - void hasParents(DataSetNode...someParentDataSets) + + void hasParents(DataSetNode... someParentDataSets) { for (DataSetNode parentDataSet : someParentDataSets) { @@ -108,7 +107,7 @@ public final class DataSetNode extends EntityNode parentDataSet.children.add(this); } } - + @Override public String toString() { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/EntityGraphGenerator.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/EntityGraphGenerator.java index 7419487dcc015cb2f443c2675dffd775275acf4b..c15f73725d73299cb39d2cfdcd04dd695f3f3f1d 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/EntityGraphGenerator.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/EntityGraphGenerator.java @@ -31,19 +31,31 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; public final class EntityGraphGenerator { - private static enum Kind { E, S, DS} - + private static enum Kind + { + E, S, DS + } + private static final class EntityDescription { private static final Pattern EXPERIMENT_PATTERN = Pattern.compile("(/S\\d+/P\\d+/)?E\\d+"); + private static final Pattern SAMPLE_PATTERN = Pattern.compile("(/(S\\d+/(P\\d+/)?)?)?S\\d+"); + private static final Pattern DATA_SET_PATTERN = Pattern.compile("DS\\d+"); + Kind kind; + boolean shared; + String space; + String project; + int id; + String type; + EntityDescription(String description) { int indexOfBracket = description.indexOf('['); @@ -58,7 +70,7 @@ public final class EntityGraphGenerator throw new IllegalArgumentException("Missing ']' at the end of " + description); } identifier = description.substring(0, indexOfBracket); - type = description.substring(indexOfBracket + 1, description.length() - 1); + type = description.substring(indexOfBracket + 1, description.length() - 1); } String[] elements = identifier.split("/"); if (EXPERIMENT_PATTERN.matcher(identifier).matches()) @@ -91,12 +103,12 @@ public final class EntityGraphGenerator id = Integer.parseInt(elements[elements.length - 1].substring(kind.name().length())); } } - + private static interface IEntitiesProvider<T extends EntityNode> { public Collection<? extends EntityNode> getEntities(T entityNode); } - + private class Parser { private void parse(List<String> parts) @@ -116,7 +128,7 @@ public final class EntityGraphGenerator handle(ds, rest); } } - + private void handle(ExperimentNode experiment, List<String> parts) { experiment.has(getSamples("samples", parts)); @@ -136,7 +148,7 @@ public final class EntityGraphGenerator dataSet.hasParents(getDataSets("parents", parts)); dataSet.hasComponents(getDataSets("components", parts)); } - + private SampleNode[] getSamples(String name, List<String> parts) { List<SampleNode> sampleNodes = new ArrayList<SampleNode>(); @@ -147,7 +159,7 @@ public final class EntityGraphGenerator } return sampleNodes.toArray(new SampleNode[descriptions.size()]); } - + private DataSetNode[] getDataSets(String name, List<String> parts) { List<DataSetNode> dataSetNodes = new ArrayList<DataSetNode>(); @@ -160,7 +172,7 @@ public final class EntityGraphGenerator } return dataSetNodes.toArray(new DataSetNode[descriptions.size()]); } - + private List<EntityDescription> getDescriptions(String name, Kind kind, List<String> parts) { String descriptionsConcatenated = getValue(name, parts); @@ -181,7 +193,7 @@ public final class EntityGraphGenerator } return result; } - + private String getValue(String name, List<String> parts) { for (String part : parts) @@ -195,13 +207,13 @@ public final class EntityGraphGenerator return null; } } - + private final Map<Long, ExperimentNode> experiments = new TreeMap<Long, ExperimentNode>(); private final Map<Long, SampleNode> samples = new TreeMap<Long, SampleNode>(); private final Map<Long, DataSetNode> dataSets = new TreeMap<Long, DataSetNode>(); - + public void parse(String definition) { Parser parser = new Parser(); @@ -239,12 +251,12 @@ public final class EntityGraphGenerator SampleNode sample = dataSetNode.getSample(); if (experiment == null && sample == null) { - throw new IllegalStateException("Data set " + dataSetNode.getCode() + throw new IllegalStateException("Data set " + dataSetNode.getCode() + " should belong to an experiment or a sample."); } if (sample != null && sample.getExperiment() != experiment) { - throw new IllegalStateException("Data set " + dataSetNode.getCode() + throw new IllegalStateException("Data set " + dataSetNode.getCode() + " should belong to the same experiment as the sample."); } } @@ -260,7 +272,7 @@ public final class EntityGraphGenerator } return experimentNode; } - + private ExperimentNode createExperiment(EntityDescription entityDescription) { ExperimentNode experimentNode = e(entityDescription.id); @@ -279,7 +291,7 @@ public final class EntityGraphGenerator } return sampleNode; } - + private SampleNode createSample(EntityDescription entityDescription) { SampleNode sampleNode = s(entityDescription.id); @@ -314,7 +326,7 @@ public final class EntityGraphGenerator { return dataSets; } - + public List<TechId> getSampleIdsByExperimentIds(Collection<TechId> experimentIds) { return getRelatedIds(experimentIds, experiments, new EntityGraphGenerator.IEntitiesProvider<ExperimentNode>() @@ -342,13 +354,13 @@ public final class EntityGraphGenerator public List<TechId> getDataSetIdsByExperimentIds(Collection<TechId> experimentIds) { return getRelatedIds(experimentIds, experiments, new EntityGraphGenerator.IEntitiesProvider<ExperimentNode>() + { + @Override + public Collection<? extends EntityNode> getEntities(ExperimentNode experiment) { - @Override - public Collection<? extends EntityNode> getEntities(ExperimentNode experiment) - { - return experiment.getDataSets(); - } - }); + return experiment.getDataSets(); + } + }); } public List<TechId> getDataSetIdsBySampleIds(Collection<TechId> experimentIds) @@ -386,7 +398,7 @@ public final class EntityGraphGenerator } }); } - + public Map<Long, Set<Long>> getContainerDataSetIdsMap(Collection<TechId> dataSetIds) { return getRelatedIdsMap(dataSetIds, dataSets, new EntityGraphGenerator.IEntitiesProvider<DataSetNode>() @@ -402,15 +414,15 @@ public final class EntityGraphGenerator public Map<Long, Set<Long>> getComponentDataSetIdsMap(Collection<TechId> dataSetIds) { return getRelatedIdsMap(dataSetIds, dataSets, new EntityGraphGenerator.IEntitiesProvider<DataSetNode>() - { - @Override - public Collection<? extends EntityNode> getEntities(DataSetNode dataSet) { - return dataSet.getComponents(); - } - }); + @Override + public Collection<? extends EntityNode> getEntities(DataSetNode dataSet) + { + return dataSet.getComponents(); + } + }); } - + public Map<Long, Set<Long>> getParentsDataSetIdsMap(Collection<TechId> dataSetIds) { return getRelatedIdsMap(dataSetIds, dataSets, new EntityGraphGenerator.IEntitiesProvider<DataSetNode>() @@ -432,7 +444,7 @@ public final class EntityGraphGenerator appendTo(builder, "#Data Sets", dataSets); return builder.toString(); } - + private void appendTo(StringBuilder builder, String name, Map<Long, ? extends EntityNode> nodes) { if (nodes.isEmpty()) @@ -446,7 +458,7 @@ public final class EntityGraphGenerator } } - private <T extends EntityNode> List<TechId> getRelatedIds(Collection<TechId> entityIds, Map<Long, T> entities, + private <T extends EntityNode> List<TechId> getRelatedIds(Collection<TechId> entityIds, Map<Long, T> entities, EntityGraphGenerator.IEntitiesProvider<T> provider) { List<TechId> ids = new ArrayList<TechId>(); @@ -460,8 +472,8 @@ public final class EntityGraphGenerator } return ids; } - - private <T extends EntityNode> Map<Long, Set<Long>> getRelatedIdsMap(Collection<TechId> entityIds, Map<Long, T> entities, + + private <T extends EntityNode> Map<Long, Set<Long>> getRelatedIdsMap(Collection<TechId> entityIds, Map<Long, T> entities, EntityGraphGenerator.IEntitiesProvider<T> provider) { Map<Long, Set<Long>> idsMap = new LinkedHashMap<Long, Set<Long>>(); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/EntityNode.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/EntityNode.java index a90b4922dc50a23e378e5f6e4d1f9e5cbeac3757..490cc8338f571d39304713c0e8c90e784a760f2c 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/EntityNode.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/EntityNode.java @@ -23,7 +23,7 @@ public class EntityNode implements IIdHolder, Comparable<EntityNode> private final long id; private final String code; - + private String type; EntityNode(String codePrefix, long id) @@ -42,7 +42,7 @@ public class EntityNode implements IIdHolder, Comparable<EntityNode> { return code; } - + public String getIdentifier() { return getCode(); @@ -52,7 +52,7 @@ public class EntityNode implements IIdHolder, Comparable<EntityNode> { return type; } - + public String getIdentifierAndType() { return getCodeAndType(); @@ -78,11 +78,11 @@ public class EntityNode implements IIdHolder, Comparable<EntityNode> { return this.getCode().compareTo(that.getCode()); } - + @Override public String toString() { return getIdentifierAndType(); } - + } \ No newline at end of file diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/ExperimentNode.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/ExperimentNode.java index 573e3d096c1374a35c2def59dc9a6dbb44240b8a..59daae0d664c2b3e6d3344e03edc65d87401766d 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/ExperimentNode.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/ExperimentNode.java @@ -24,16 +24,16 @@ public final class ExperimentNode extends EntityNode private final List<SampleNode> samples = new ArrayList<SampleNode>(); private final List<DataSetNode> dataSets = new ArrayList<DataSetNode>(); - + private String space; - + private String project; ExperimentNode(long id) { super("E", id); } - + public String getSpace() { return space; @@ -58,12 +58,12 @@ public final class ExperimentNode extends EntityNode { return samples; } - + public List<DataSetNode> getDataSets() { return dataSets; } - + void has(SampleNode... someSamples) { for (SampleNode sample : someSamples) @@ -81,7 +81,7 @@ public final class ExperimentNode extends EntityNode dataSets.add(dataSet); } } - + @Override public String getIdentifier() { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/SampleNode.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/SampleNode.java index d08074b82b770b33450a846641667c1edf1c8f37..0ed3034275de92bc30fb14ac8a0c6623592825e5 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/SampleNode.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/SampleNode.java @@ -22,21 +22,28 @@ import java.util.List; public final class SampleNode extends EntityNode { private final List<SampleNode> components = new ArrayList<SampleNode>(); + private final List<SampleNode> parents = new ArrayList<SampleNode>(); + private final List<SampleNode> children = new ArrayList<SampleNode>(); + private final List<DataSetNode> dataSets = new ArrayList<DataSetNode>(); private boolean shared; + private String space; + private String project; + private ExperimentNode experiment; + private SampleNode container; SampleNode(long id) { super("S", id); } - + public boolean isShared() { return shared; @@ -76,7 +83,7 @@ public final class SampleNode extends EntityNode { this.experiment = experiment; } - + public SampleNode getContainer() { return container; @@ -86,7 +93,7 @@ public final class SampleNode extends EntityNode { this.container = container; } - + public List<SampleNode> getComponents() { return components; @@ -96,17 +103,17 @@ public final class SampleNode extends EntityNode { return parents; } - + public List<SampleNode> getChildren() { return children; } - + public List<DataSetNode> getDataSets() { return dataSets; } - + void hasComponents(SampleNode... someComponentSamples) { for (SampleNode componentSample : someComponentSamples) @@ -115,7 +122,7 @@ public final class SampleNode extends EntityNode componentSample.container = this; } } - + void hasChildren(SampleNode... someChildSamples) { for (SampleNode childSample : someChildSamples) @@ -124,7 +131,7 @@ public final class SampleNode extends EntityNode childSample.parents.add(this); } } - + void has(DataSetNode... someDataSets) { for (DataSetNode dataSet : someDataSets) @@ -137,7 +144,7 @@ public final class SampleNode extends EntityNode dataSets.add(dataSet); } } - + @Override public String getIdentifier() { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/Utils.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/Utils.java index 525abd23f8d45fc73df80f4f5785f7966802b6a9..228906a3527f666aedcdba6a3049b541f1d74b2a 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/Utils.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/entitygraph/Utils.java @@ -32,8 +32,6 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.ExperimentIdentifi import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.ExperimentIdentifierFactory; /** - * - * * @author Franz-Josef Elmer */ public class Utils @@ -52,7 +50,7 @@ public class Utils sample.setContainer(createSample(sampleNode.getContainer())); return sample; } - + public static ExternalDataPE createData(DataSetNode dataSetNode) { ExternalDataPE data = new ExternalDataPE(); @@ -135,7 +133,7 @@ public class Utils experiment.setIdentifier(experimentNode.getCode()); return experiment; } - + public static ExperimentPE createExperimentPE(ExperimentNode experimentNode) { if (experimentNode == null) @@ -159,7 +157,7 @@ public class Utils experiment.setProject(project); return experiment; } - + static final void appendTo(StringBuilder builder, String label, List<? extends EntityNode> entityNodes) { if (entityNodes.isEmpty()) diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/fetchoptions/samplelister/SampleListerTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/fetchoptions/samplelister/SampleListerTest.java index 4441778e1de6ec35080bc05bb413fbbcf646d739..f4c38598a475860ed033590a9368d016e413911b 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/fetchoptions/samplelister/SampleListerTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/fetchoptions/samplelister/SampleListerTest.java @@ -112,7 +112,7 @@ public class SampleListerTest extends AssertJUnit SampleRecord r101 = record(101); SampleRecord r102 = record(102); LongOpenHashSet sampleIdSet = new LongOpenHashSet(new long[] - { r101.s_id, r102.s_id }); + { r101.s_id, r102.s_id }); one(query).listSamplesByIds(sampleIdSet); will(returnValue(Arrays.asList(r101, r102))); @@ -123,7 +123,7 @@ public class SampleListerTest extends AssertJUnit will(returnValue(Arrays.asList(sampleMetaproject(102, 42)))); one(query).getMetaprojects(new LongOpenHashSet(new long[] - { 42 })); + { 42 })); will(returnValue(Arrays.asList(metaproject(42, "answer")))); atLeast(1).of(filter).isValid(user, sample(r101)); @@ -162,7 +162,7 @@ public class SampleListerTest extends AssertJUnit SampleRecord r101 = record(101); SampleRecord r102 = record(102); one(query).listSamplesByIds(new LongOpenHashSet(new long[] - { r1.s_id, r2.s_id, r3.s_id, r101.s_id, r102.s_id })); + { r1.s_id, r2.s_id, r3.s_id, r101.s_id, r102.s_id })); will(returnValue(Arrays.asList(r1, r2, r3, r101, r102))); atLeast(1).of(filter).isValid(user, sample(r1)); @@ -220,8 +220,8 @@ public class SampleListerTest extends AssertJUnit SampleRecord r401 = record(401); one(query).listSamplesByIds( new LongOpenHashSet(new long[] - { r1.s_id, r2.s_id, r3.s_id, r101.s_id, r102.s_id, r201.s_id, - r202.s_id, r301.s_id, r302.s_id, r401.s_id })); + { r1.s_id, r2.s_id, r3.s_id, r101.s_id, r102.s_id, r201.s_id, + r202.s_id, r301.s_id, r302.s_id, r401.s_id })); will(returnValue(Arrays.asList(r1, r2, r3, r101, r102, r201, r202, r301, r302, r401))); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/SampleSetListingQueryTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/SampleSetListingQueryTest.java index 0b8a7db395647201c561d6febc47c8f06ef65dad..f6b78c353c7f1a22e1b6bdf9f052a1734c6f00e5 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/SampleSetListingQueryTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/SampleSetListingQueryTest.java @@ -46,9 +46,9 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.PropertyType; * @author Bernd Rinn */ @Friend(toClasses = - { SampleRecord.class, ISampleListingQuery.class }) +{ SampleRecord.class, ISampleListingQuery.class }) @Test(groups = - { "db", "sample" }) +{ "db", "sample" }) public class SampleSetListingQueryTest extends AbstractDAOTest { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/AttachmentDAOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/AttachmentDAOTest.java index e231e9fbb282f3b7466bc42526bdd00a11bf3ab2..0895df858b2113b708f6b3844213436ecacf8e8d 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/AttachmentDAOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/AttachmentDAOTest.java @@ -33,7 +33,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPE; * @author Kaloyan Enimanev */ @Test(groups = - { "db" }) +{ "db" }) public final class AttachmentDAOTest extends AbstractDAOTest { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/AuthorizationGroupDAOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/AuthorizationGroupDAOTest.java index 7aa2f0d89d8f338e7d90b54bf7c4219624a2f9b7..d9af20c386bb63ddc89172f7a2b57cb8e5bee98d 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/AuthorizationGroupDAOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/AuthorizationGroupDAOTest.java @@ -30,7 +30,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.AuthorizationGroupPE; * @author Izabela Adamczyk */ @Test(groups = - { "db", "authorization_group" }) +{ "db", "authorization_group" }) public class AuthorizationGroupDAOTest extends AbstractDAOTest { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/CorePluginDAOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/CorePluginDAOTest.java index 19279af825fbe39463054418bc0cbdb88aa4afae..a77c427b2a7f61d13bc9cf44c69a92e7ae4b7d2a 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/CorePluginDAOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/CorePluginDAOTest.java @@ -32,7 +32,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.CorePluginPE; * @author Kaloyan Enimanev */ @Test(groups = - { "db", "slow" }) +{ "db", "slow" }) public final class CorePluginDAOTest extends AbstractDAOTest { @Test diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DataDAOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DataDAOTest.java index 5c3ab7b36fe211bff228503b510bd998ca37f80b..9315a229534f3acdccc32e5532bb6197d43e9e1e 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DataDAOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DataDAOTest.java @@ -303,14 +303,14 @@ public final class DataDAOTest extends AbstractDAOTest data.setStorageFormatVocabularyTerm(pickAStorageFormatVocabularyTerm()); data.setStatus(DataSetArchivingStatus.AVAILABLE); dataDAO.createDataSet(data, getSystemPerson()); - + ExternalDataPE externalData = dataDAO.tryToFindDataSetByCode(dataSetCode).tryAsExternalData(); int version = externalData.getVersion(); externalData.setShareId("share-43"); externalData.setSize(size); - + dataDAO.updateDataSet(externalData, getTestPerson()); - + ExternalDataPE dataSet = dataDAO.tryToFindDataSetByCode(dataSetCode).tryAsExternalData(); assertEquals(externalData.getCode(), dataSet.getCode()); assertEquals(externalData.getDataSetType(), dataSet.getDataSetType()); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DatabaseCreationUtil.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DatabaseCreationUtil.java index 961a9febf408b913786534830ee65d498341f9aa..5a39142741ef091379ddcd0d18ec888de0c80be3 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DatabaseCreationUtil.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DatabaseCreationUtil.java @@ -55,15 +55,15 @@ public final class DatabaseCreationUtil { final AbstractApplicationContext applicationContext = new ClassPathXmlApplicationContext(new String[] - { "dbConfigurationContext.xml" }, true); + { "dbConfigurationContext.xml" }, true); DatabaseCreationUtil.beanFactory = applicationContext; } return beanFactory; } /** - * Creates all files in <code>sourceTest/sql/postgresql</code> necessary to set up a database of - * the current version by dumping a database migrated from the specified version. + * Creates all files in <code>sourceTest/sql/postgresql</code> necessary to set up a database of the current version by dumping a database + * migrated from the specified version. */ private final static void createFilesFromADumpOfAMigratedDatabase(final String databaseVersion) throws Exception @@ -85,8 +85,7 @@ public final class DatabaseCreationUtil } /** - * Creates all files in <var>destinationDir</var> necessary to set up the database - * <var>databaseKind</var> in its current state. + * Creates all files in <var>destinationDir</var> necessary to set up the database <var>databaseKind</var> in its current state. */ private static final void createDumpForJava(final String databaseKind, final File destinationDir) throws IOException diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DeletionDAOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DeletionDAOTest.java index aa411ecab5706f4f103203e90a1cf66c7381f3eb..67c3a99770b38420da5ffb752601bb881013f3e3 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DeletionDAOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/DeletionDAOTest.java @@ -49,7 +49,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind; * @author Piotr Buczek */ @Test(groups = - { "db" }) +{ "db" }) public class DeletionDAOTest extends AbstractDAOTest { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/EntityOperationsLogDAOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/EntityOperationsLogDAOTest.java index 8d6b36d326276d443aee2f792fcc8c6764cb667d..63bb6de69809af1d1b390e6bf7364d73b53c1b39 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/EntityOperationsLogDAOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/EntityOperationsLogDAOTest.java @@ -33,7 +33,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.EntityOperationsLogEntryPE; * @author Chandrasekhar Ramakrishnan */ @Test(groups = - { "db" }) +{ "db" }) public final class EntityOperationsLogDAOTest extends AbstractDAOTest { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/EntityPropertyTypeDAOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/EntityPropertyTypeDAOTest.java index 8139a04376596d95a6667f2fcc622b174ab250f3..22f6bfd3abcb88f855ba314bd3627f7c6795f77e 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/EntityPropertyTypeDAOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/EntityPropertyTypeDAOTest.java @@ -44,7 +44,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind; * @author Izabela Adamczyk */ @Test(groups = - { "db", "property" }) +{ "db", "property" }) public class EntityPropertyTypeDAOTest extends AbstractDAOTest { @@ -172,19 +172,19 @@ public class EntityPropertyTypeDAOTest extends AbstractDAOTest private final static Object[][] entityKindsWithEntityTypeAndPropertyTypeMandatory() { return new Object[][] - { - { EntityKind.EXPERIMENT, "SIRNA_HCS", "DESCRIPTION" }, - { EntityKind.SAMPLE, "CONTROL_LAYOUT", "$PLATE_GEOMETRY" }, - { EntityKind.MATERIAL, "BACTERIUM", "DESCRIPTION" } }; + { + { EntityKind.EXPERIMENT, "SIRNA_HCS", "DESCRIPTION" }, + { EntityKind.SAMPLE, "CONTROL_LAYOUT", "$PLATE_GEOMETRY" }, + { EntityKind.MATERIAL, "BACTERIUM", "DESCRIPTION" } }; } @DataProvider private final static Object[][] entityKindsWithEntityTypeAndPropertyTypeNotAssigned() { return new Object[][] - { - { EntityKind.EXPERIMENT, "SIRNA_HCS", "IS_VALID" }, - { EntityKind.SAMPLE, "CONTROL_LAYOUT", "IS_VALID" }, - { EntityKind.MATERIAL, "BACTERIUM", "IS_VALID" }, }; + { + { EntityKind.EXPERIMENT, "SIRNA_HCS", "IS_VALID" }, + { EntityKind.SAMPLE, "CONTROL_LAYOUT", "IS_VALID" }, + { EntityKind.MATERIAL, "BACTERIUM", "IS_VALID" }, }; } } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/EntityResolverQueryTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/EntityResolverQueryTest.java index b2d645617b7c8b92866bacc431b799ab4c2d71a3..e99beecdd12d7454f82069e98690324563224f65 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/EntityResolverQueryTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/EntityResolverQueryTest.java @@ -30,7 +30,7 @@ import org.testng.annotations.Test; * @author Bernd Rinn */ @Test(groups = - { "db" }) +{ "db" }) public class EntityResolverQueryTest extends AbstractDAOTest { private IEntityResolverQuery query; diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/EventDAOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/EventDAOTest.java index 555db6c4402d5d53b79d4c1397209deaf111ecd8..3f7e9f7ebb1b384fd45297d67f73f8bbe0d94db9 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/EventDAOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/EventDAOTest.java @@ -40,7 +40,7 @@ import ch.systemsx.cisd.openbis.generic.shared.util.HibernateUtils; * @author Izabela Adamczyk */ @Test(groups = - { "db", "event" }) +{ "db", "event" }) public class EventDAOTest extends AbstractDAOTest { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/GridCustomColumnDAOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/GridCustomColumnDAOTest.java index 3054b3ae0f6129a45077bfca5353420fb9703016..15a1fd4326607cb0cbbf5f54a0ffa7b9e4ceeaa2 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/GridCustomColumnDAOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/GridCustomColumnDAOTest.java @@ -31,7 +31,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; * @author Tomasz Pylak */ @Test(groups = - { "db", "column" }) +{ "db", "column" }) public final class GridCustomColumnDAOTest extends AbstractDAOTest { public void testCreateAndListColumn() throws Exception diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/GridCustomFilterDAOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/GridCustomFilterDAOTest.java index 6ec4cf8ccea7974cd30ecc12c1ff538529ef3adf..d9eca3340e5d09c2293e64cd23296b4114fe8cc8 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/GridCustomFilterDAOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/GridCustomFilterDAOTest.java @@ -30,7 +30,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; * @author Izabela Adamczyk */ @Test(groups = - { "db", "filter" }) +{ "db", "filter" }) public final class GridCustomFilterDAOTest extends AbstractDAOTest { private static final boolean PUBLIC = true; diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/MetaprojectDAOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/MetaprojectDAOTest.java index 1da3f963328ec4b385fb1d876d7136b660ebeeb5..abafc69cf8e6074702fd150694beeece36ef19c1 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/MetaprojectDAOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/MetaprojectDAOTest.java @@ -195,7 +195,7 @@ public class MetaprojectDAOTest extends AbstractDAOTest Collection<MetaprojectAssignmentPE> assignments = daoFactory.getMetaprojectDAO().listMetaprojectAssignmentsForEntities( getTestPerson(), Arrays.asList(new IEntityInformationWithPropertiesHolder[] - { experiment1, experiment2 }), EntityKind.EXPERIMENT); + { experiment1, experiment2 }), EntityKind.EXPERIMENT); assertEquals(3, assignments.size()); for (MetaprojectAssignmentPE assignment : assignments) diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/PermIdDAOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/PermIdDAOTest.java index d88eea5dc917cb95264dcbc3a93148b648ad3937..1f7dbab25baf3a3a21d4ed6440b545d19f8fde63 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/PermIdDAOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/PermIdDAOTest.java @@ -28,7 +28,7 @@ import org.testng.annotations.Test; * @author Izabela Adamczyk */ @Test(groups = - { "db" }) +{ "db" }) public final class PermIdDAOTest extends AbstractDAOTest { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SqlDataMigrationTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SqlDataMigrationTest.java index efa34fbc2e56518c0a62fc5ed8ebdf75350f0a1c..39c659d098de6b08f8891c40b57dba1c3d7b2582 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SqlDataMigrationTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SqlDataMigrationTest.java @@ -59,7 +59,7 @@ public final class SqlDataMigrationTest } @Test(groups = - { "slow" }) + { "slow" }) /* runs unit tests written in SQL. The tests should check if the migration went fine. */ public final void testMigration() throws Exception { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SqlMigrationTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SqlMigrationTest.java index a24684bafe12eedb3ddd9727b589ea17afc5e25f..d4008aeaf2649971b59ab503fc58ef754a24c733 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SqlMigrationTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/SqlMigrationTest.java @@ -29,7 +29,7 @@ public class SqlMigrationTest extends SqlMigrationTestAbstract { @Test(groups = - { "slow" }) + { "slow" }) public void test_migration() throws Exception { testMigration(DatabaseVersionHolder.getDatabaseVersion()); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/LuceneQueryBuilderTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/LuceneQueryBuilderTest.java index 385392573737665f95c601bd1fe2f71ff07e4311..a0bb9a4b513da2a6a2cf652dc7a49f632ab04c3a 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/LuceneQueryBuilderTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/LuceneQueryBuilderTest.java @@ -32,7 +32,7 @@ public class LuceneQueryBuilderTest extends AssertJUnit protected Object[][] getQueriesToTestInBasicMode() { return new Object[][] - { + { { "abc", "(*abc*)" }, { "code:CP registrator:Joe", "(*code\\:CP*) (*registrator\\:Joe*)" }, { "ab#c OR d", "(*ab* AND *c*) OR (*d*)" } }; @@ -42,7 +42,7 @@ public class LuceneQueryBuilderTest extends AssertJUnit protected Object[][] getQueriesToTestInWildcardMode() { return new Object[][] - { + { { "abc", "abc" }, { "code:CP registrator:Joe", "code\\:CP registrator\\:Joe" }, { "*ab#c OR d", "*ab#c OR d" } }; diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/task/DataSetRegistrationSummaryTaskTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/task/DataSetRegistrationSummaryTaskTest.java index ec45da86a93ad6fffc171839d78d9fbb0f805ba5..722e71985999520d0b21b16e60562c5abb73040b 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/task/DataSetRegistrationSummaryTaskTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/task/DataSetRegistrationSummaryTaskTest.java @@ -347,7 +347,7 @@ public class DataSetRegistrationSummaryTaskTest extends AssertJUnit one(mailClient).sendEmailMessage(with(checker.getSubjectMatcher()), with(checker.getReportMatcher()), with((EMailAddress) null), with((EMailAddress) null), with(new EMailAddress[] - { new EMailAddress(address) })); + { new EMailAddress(address) })); } } }); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/task/MaterialExternalDBSyncTaskTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/task/MaterialExternalDBSyncTaskTest.java index a6336961efbf171028be00eb3e1ecb49e4b1d829..a2e7f986de6004f3fb614cb6da99c5ac39a2269b 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/task/MaterialExternalDBSyncTaskTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/task/MaterialExternalDBSyncTaskTest.java @@ -67,7 +67,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.SessionContextDTO; * @author Franz-Josef Elmer */ @Friend(toClasses = - { MaterialExternalDBSyncTask.class, MappingInfo.class }) +{ MaterialExternalDBSyncTask.class, MappingInfo.class }) public class MaterialExternalDBSyncTaskTest extends AbstractFileSystemTestCase { private static final String SESSION_TOKEN = "session-token"; diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/AnnotationAppliedTestCase.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/AnnotationAppliedTestCase.java index b78b7b0f56eab897261f4f9468d6b31935a9e07f..6d7f34d49d8a61d255a6ae3d173152987aa508f1 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/AnnotationAppliedTestCase.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/AnnotationAppliedTestCase.java @@ -30,16 +30,14 @@ import org.testng.AssertJUnit; import ch.systemsx.cisd.openbis.generic.server.authorization.annotation.RolesAllowed; /** - * Test case for test classes testing whether an interface and/or its implementation have all - * mandatory annotations. + * Test case for test classes testing whether an interface and/or its implementation have all mandatory annotations. * * @author Franz-Josef Elmer */ public class AnnotationAppliedTestCase extends AssertJUnit { /** - * Asserts that the specified class is an interface and all its methods have the annotations - * {@link RolesAllowed} and {@link Transactional}. + * Asserts that the specified class is an interface and all its methods have the annotations {@link RolesAllowed} and {@link Transactional}. */ protected void assertMandatoryMethodAnnotations(Class<?> interfaceClass, List<String> exemptMethods) { @@ -47,9 +45,8 @@ public class AnnotationAppliedTestCase extends AssertJUnit } /** - * Asserts that the specified interface class is an interface, the implementing class really - * implements that interface, and all interface methods or their implementations have the - * annotations {@link RolesAllowed} and {@link Transactional}. + * Asserts that the specified interface class is an interface, the implementing class really implements that interface, and all interface methods + * or their implementations have the annotations {@link RolesAllowed} and {@link Transactional}. */ protected void assertMandatoryMethodAnnotations(Class<?> interfaceClass, Class<?> implementingClass, List<String> exemptMethods) @@ -58,10 +55,8 @@ public class AnnotationAppliedTestCase extends AssertJUnit } /** - * Asserts that the specified interface class is an interface, the implementing class really - * implements that interface, and all interface methods or their implementations have the - * annotations {@link RolesAllowed} and {@link Transactional}. The specified exceptions are - * allowed. + * Asserts that the specified interface class is an interface, the implementing class really implements that interface, and all interface methods + * or their implementations have the annotations {@link RolesAllowed} and {@link Transactional}. The specified exceptions are allowed. */ protected void assertMandatoryMethodAnnotations(Class<?> interfaceClass, Class<?> implementingClass, String exceptions, List<String> exemptMethods) @@ -76,9 +71,8 @@ public class AnnotationAppliedTestCase extends AssertJUnit } /** - * Asserts that the specified interface class is an interface, the implementing class really - * implements that interface, and all interface methods or their implementations have the - * specified annotations. The specified exceptions are allowed. + * Asserts that the specified interface class is an interface, the implementing class really implements that interface, and all interface methods + * or their implementations have the specified annotations. The specified exceptions are allowed. */ protected void assertMandatoryMethodAnnotations( List<Class<? extends Annotation>> mandatoryAnnotations, Class<?> interfaceClass, @@ -103,10 +97,11 @@ public class AnnotationAppliedTestCase extends AssertJUnit }); for (Method interfaceMethod : declaredMethods) { - if(exemptMethods != null && exemptMethods.contains(interfaceMethod.getName())) { + if (exemptMethods != null && exemptMethods.contains(interfaceMethod.getName())) + { continue; } - + List<String> missingAnnotations = new ArrayList<String>(); for (Class<? extends Annotation> annotationClass : mandatoryAnnotations) { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/SimpleDateRendererTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/SimpleDateRendererTest.java index 50e4856adbede723899975216a05dc1d093f0141..100caf9537af40c9306e1672bd7dcc38e6e53ba5 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/SimpleDateRendererTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/SimpleDateRendererTest.java @@ -27,8 +27,8 @@ import org.testng.annotations.Test; import ch.systemsx.cisd.openbis.generic.shared.basic.SimpleDateRenderer; /** - * Tests of {@link SimpleDateRenderer}. The test is in the different package than the tested class - * to have access to TimeZone class (GWT does not support it). + * Tests of {@link SimpleDateRenderer}. The test is in the different package than the tested class to have access to TimeZone class (GWT does not + * support it). * * @author Tomasz Pylak */ @@ -38,10 +38,10 @@ public class SimpleDateRendererTest extends AssertJUnit private Object[][] getDates() { return new Object[][] - { - { toDate(1991, 12, 3, 3, 13, 59, "CET"), "1991-12-03 03:13:59 GMT+01:00" }, - { toDate(2008, 12, 6, 15, 35, 17, "CET"), "2008-12-06 15:35:17 GMT+01:00" }, - { toDate(2008, 7, 31, 1, 2, 3, "CET"), "2008-07-31 01:02:03 GMT+02:00" } }; + { + { toDate(1991, 12, 3, 3, 13, 59, "CET"), "1991-12-03 03:13:59 GMT+01:00" }, + { toDate(2008, 12, 6, 15, 35, 17, "CET"), "2008-12-06 15:35:17 GMT+01:00" }, + { toDate(2008, 7, 31, 1, 2, 3, "CET"), "2008-07-31 01:02:03 GMT+02:00" } }; } @Test(dataProvider = "dates") diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/TimeIntervalChecker.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/TimeIntervalChecker.java index 03b93da8d5b9e4680ecea7942278f82dd4316e52..1096191efd5d9d20d1ea7652c75cb594aa1e08ff 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/TimeIntervalChecker.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/TimeIntervalChecker.java @@ -22,11 +22,9 @@ import java.util.Date; import org.testng.AssertJUnit; /** - * Helper class to check that a time stamp is between now and a time in the past when an instance of - * this class has been created. + * Helper class to check that a time stamp is between now and a time in the past when an instance of this class has been created. * <p> - * This class is useful in tests where some productive code creates a time stamp which should be - * checked. + * This class is useful in tests where some productive code creates a time stamp which should be checked. * * @author Franz-Josef Elmer */ @@ -49,7 +47,7 @@ public class TimeIntervalChecker extends AssertJUnit { this(new Timestamp(System.currentTimeMillis() - shiftInMillisecond)); } - + /** * Creates an instance for the specified date object. */ @@ -59,8 +57,7 @@ public class TimeIntervalChecker extends AssertJUnit } /** - * Asserts that the specified date is after the time stamp of creation of this instance and - * before now. + * Asserts that the specified date is after the time stamp of creation of this instance and before now. */ public void assertDateInInterval(Date date) { @@ -71,7 +68,7 @@ public class TimeIntervalChecker extends AssertJUnit assertFalse("Actual date [" + date + "] is after now [" + now + "].", now.before(timestamp)); } - + private Timestamp asTimestamp(Date date) { return date instanceof Timestamp ? (Timestamp) date : new Timestamp(date.getTime()); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/DataSetInfoHelperTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/DataSetInfoHelperTest.java index 4866c47dc09fc21dba226bb7dc27f9f04ed0cb07..407777d67ccd7590b5610420d3d160d2fc6cda4e 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/DataSetInfoHelperTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/DataSetInfoHelperTest.java @@ -51,7 +51,7 @@ public class DataSetInfoHelperTest extends AssertJUnit String dataSetType = "dataSetTypeC"; String fileType = "fileTypeD"; String[] parents = - { "p1", "p2", "p3" }; + { "p1", "p2", "p3" }; DataSetUploadInfo info = new DataSetUploadInfo(sample, experiment, parents, dataSetType, fileType); checkInfo(info, sample, experiment, parents, dataSetType, fileType); @@ -110,7 +110,7 @@ public class DataSetInfoHelperTest extends AssertJUnit String sample = null; String experiment = "eB"; String[] parents = - { "p1", "p2", "p3" }; + { "p1", "p2", "p3" }; String dataSetType = "dsC"; String fileType = "ftD"; DataSetUploadInfo info = diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/INormalizer.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/INormalizer.java index 8da914289301aa8350a74950909d5c98ef4cff73..4edcd1c2fd0abb2a86e6536d6d664e9c4f8231a0 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/INormalizer.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/INormalizer.java @@ -17,8 +17,6 @@ package ch.systemsx.cisd.openbis.generic.shared; /** - * - * * @author Franz-Josef Elmer */ public interface INormalizer diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/ServletParamsParsingTestUtils.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/ServletParamsParsingTestUtils.java index acb3c05e0d1a05f32798648d49ba90d73881ba27..58573e023aa18002b5297f15d6a991f252d6b5f9 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/ServletParamsParsingTestUtils.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/ServletParamsParsingTestUtils.java @@ -85,7 +85,7 @@ public class ServletParamsParsingTestUtils extends AssertJUnit for (int i = 0; i < keyValuePairs.length / 2; i++) { paramsMap.put(keyValuePairs[i * 2], new String[] - { keyValuePairs[i * 2 + 1] }); + { keyValuePairs[i * 2 + 1] }); } } } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/TranslatorTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/TranslatorTest.java index 5c1f1eca44bb330211ccfde5ad70560db0d5e199..8b573fcb72b63b78abfebf2047bae1ba5aeafab0 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/TranslatorTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/TranslatorTest.java @@ -67,14 +67,14 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; public class TranslatorTest extends AssertJUnit { private static final IKeyExtractor<String, DataSet> KEY_EXTRACTOR = new IKeyExtractor<String, DataSet>() + { + @Override + public String getKey(DataSet e) { - @Override - public String getKey(DataSet e) - { - return e.getCode(); - } - }; - + return e.getCode(); + } + }; + private DataSetBuilder ds1; private DataSetBuilder ds2; @@ -133,13 +133,13 @@ public class TranslatorTest extends AssertJUnit new LinkDataSetBuilder(4).code("lds").type("L1").experiment(experiment) .sample(sample).registrationDate(new Date(123456789L)) .modificationDate(new Date(123459999L)).externalCode("EX_CODE").edms(edms); - + dsp1 = new DataSetBuilder(10).code("ds-p1").type("T2").experiment(experiment).getDataSet(); dsp2 = new DataSetBuilder(11).code("ds-p2").type("T2").experiment(experiment).getDataSet(); dsc1 = new ContainerDataSetBuilder(12).code("ds-c1").type("T3") - .experiment(experiment).component(dsp1).component(dsp2).getContainerDataSet(); + .experiment(experiment).component(dsp1).component(dsp2).getContainerDataSet(); dsc2 = new ContainerDataSetBuilder(13).code("ds-c2").type("T3") - .experiment(experiment).component(dsp1).component(dsp2).getContainerDataSet(); + .experiment(experiment).component(dsp1).component(dsp2).getContainerDataSet(); dsp1.addContainer(dsc1, 0); dsp1.addContainer(dsc2, 1); dsp2.addContainer(dsc1, 0); @@ -406,12 +406,12 @@ public class TranslatorTest extends AssertJUnit assertEquals("[ds2]", translated.getChildrenCodes().toString()); assertEquals("[ds1]", translated.getParentCodes().toString()); } - + @Test public void testTranslateCyclicGraphOfDataSets() { - List<DataSet> translatedDatasets = Translator.translate(Arrays.<AbstractExternalData>asList(dsc1, dsc2), EnumSet.noneOf(Connections.class)); - + List<DataSet> translatedDatasets = Translator.translate(Arrays.<AbstractExternalData> asList(dsc1, dsc2), EnumSet.noneOf(Connections.class)); + DataSet dsc1t = translatedDatasets.get(0); TableMap<String, DataSet> dsc1tc = new TableMap<String, DataSet>(dsc1t.getContainedDataSets(), KEY_EXTRACTOR); assertEquals(2, dsc1tc.keySet().size()); @@ -431,7 +431,7 @@ public class TranslatorTest extends AssertJUnit TableMap<String, DataSet> dsp2tc = new TableMap<String, DataSet>(dsp2t.getContainerDataSets(), KEY_EXTRACTOR); assertSame(dsc1t2, dsp2tc.getOrDie("ds-c1")); assertSame(dsc2t2, dsp2tc.getOrDie("ds-c2")); - + assertEquals(2, translatedDatasets.size()); } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/DataSetBuilder.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/DataSetBuilder.java index 9763184ee1ffc5c414ca0e74283679f20bf35af5..3b6e8ab1476a02ac14bb39bd86a5005dc17df603 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/DataSetBuilder.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/DataSetBuilder.java @@ -35,40 +35,40 @@ public class DataSetBuilder new EntityRegistrationDetails(new EntityRegistrationDetailsInitializer()); initializer.setRegistrationDetails(registrationDetails); } - + public DataSet getDataSet() { return new DataSet(initializer); } - + public DataSetBuilder code(String code) { initializer.setCode(code); return this; } - + public DataSetBuilder type(String type) { initializer.setDataSetTypeCode(type); return this; } - + public DataSetBuilder experiment(String experimentIdentifier) { initializer.setExperimentIdentifier(experimentIdentifier); return this; } - + public DataSetBuilder sample(String sampleIdentifier) { initializer.setSampleIdentifierOrNull(sampleIdentifier); return this; } - + public DataSetBuilder property(String key, String value) { initializer.getProperties().put(key, value); return this; } - + } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/DataSetTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/DataSetTest.java index eb6a1393d5be4a09d2e0f50847a82942a01ec3de..d7013b1700ebb3967d92e70b1d67c1f8657c4b61 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/DataSetTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/DataSetTest.java @@ -51,7 +51,7 @@ public class DataSetTest extends AssertJUnit } @Test(expectedExceptions = - { IllegalArgumentException.class }) + { IllegalArgumentException.class }) public void testInitialization() { DataSetInitializer initializer = new DataSetInitializer(); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/DataSetTypeTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/DataSetTypeTest.java index 6c92ced8b53085a5d3459a8d75fcfe1059b96aa0..92b3c7732a46bee55c4f2d4b2f8d289c7546f061 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/DataSetTypeTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/DataSetTypeTest.java @@ -63,7 +63,7 @@ public class DataSetTypeTest extends AssertJUnit } @Test(expectedExceptions = - { IllegalArgumentException.class }) + { IllegalArgumentException.class }) public void testInitialization() { DataSetTypeInitializer initializer = new DataSetTypeInitializer(); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/SampleBuilder.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/SampleBuilder.java index 20bb31e289c8451dc8a536b23f26bc53d445b4ac..fa9f964ddc5aa69184b114e51b12934792d9d920 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/SampleBuilder.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/SampleBuilder.java @@ -20,14 +20,12 @@ import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.EntityRegistrationDeta import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.Sample.SampleInitializer; /** - * - * * @author Franz-Josef Elmer */ public class SampleBuilder { private SampleInitializer initializer = new SampleInitializer(); - + public SampleBuilder(long id) { initializer.setId(id); @@ -35,46 +33,46 @@ public class SampleBuilder new EntityRegistrationDetailsInitializer(); initializer.setRegistrationDetails(new EntityRegistrationDetails(entityRegInitializer)); } - + public Sample getSample() { return new Sample(initializer); } - + public SampleBuilder code(String code) { initializer.setCode(code); return this; } - + public SampleBuilder type(String type) { initializer.setSampleTypeCode(type); return this; } - + public SampleBuilder typeID(long typeId) { initializer.setSampleTypeId(typeId); return this; } - + public SampleBuilder identifier(String identifier) { initializer.setIdentifier(identifier); return this; } - + public SampleBuilder permID(String permId) { initializer.setPermId(permId); return this; } - + public SampleBuilder experiment(String experimentIdentifier) { initializer.setExperimentIdentifierOrNull(experimentIdentifier); return this; } - + } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/SampleTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/SampleTest.java index e3625fb932a2fb496c5dbe46cd9066a68a3058af..e026ce4c863b91e2d29ccbd17270d5524adde371 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/SampleTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/SampleTest.java @@ -64,7 +64,7 @@ public class SampleTest extends AssertJUnit } @Test(expectedExceptions = - { IllegalArgumentException.class }) + { IllegalArgumentException.class }) public void testInitialization() { SampleInitializer initializer = new SampleInitializer(); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/filter/PropertiesBasedDataSetFilterTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/filter/PropertiesBasedDataSetFilterTest.java index d4a0ee46a4ed77b90d80eca42ed7bc1979ff3dc7..b44306b3bc3b4bb738b9020bd4b4d061ea7f97a7 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/filter/PropertiesBasedDataSetFilterTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/filter/PropertiesBasedDataSetFilterTest.java @@ -24,8 +24,6 @@ import org.testng.annotations.Test; import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.DataSetBuilder; /** - * - * * @author Franz-Josef Elmer */ public class PropertiesBasedDataSetFilterTest extends AssertJUnit @@ -34,19 +32,19 @@ public class PropertiesBasedDataSetFilterTest extends AssertJUnit public void testNoProperties() { IDataSetFilter filter = new PropertiesBasedDataSetFilter(new HashMap<String, String>()); - + DataSetBuilder builder = new DataSetBuilder().code("A").type("A").experiment("E"); assertEquals(true, filter.pass(builder.getDataSet())); assertEquals(true, filter.pass(builder.property("a", "alpha").getDataSet())); } - + @Test public void testWithProperties() { HashMap<String, String> properties = new HashMap<String, String>(); properties.put("a", "alpha"); PropertiesBasedDataSetFilter filter = new PropertiesBasedDataSetFilter(properties); - + DataSetBuilder builder = new DataSetBuilder().code("A").type("A").experiment("E"); assertEquals(false, filter.pass(builder.getDataSet())); assertEquals(true, filter.pass(builder.property("a", "alpha").getDataSet())); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/filter/TypeBasedDataSetFilterTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/filter/TypeBasedDataSetFilterTest.java index 6013c7180404619ba59eccb515921151f2dfc7ba..e9f5fb8d7b1c5209d2560f32b0f6acccfae2281d 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/filter/TypeBasedDataSetFilterTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/filter/TypeBasedDataSetFilterTest.java @@ -22,8 +22,6 @@ import org.testng.annotations.Test; import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.DataSetBuilder; /** - * - * * @author Franz-Josef Elmer */ public class TypeBasedDataSetFilterTest extends AssertJUnit diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/BasicURLEncoderTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/BasicURLEncoderTest.java index e2b2a5149245fc290c93569a905150d7c6d439c1..0b5172fa6653ba4acafe9d8bf844025e000eb341 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/BasicURLEncoderTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/BasicURLEncoderTest.java @@ -29,7 +29,7 @@ public class BasicURLEncoderTest extends AssertJUnit protected Object[][] getChars() { return new Object[][] - { + { /* original char, encoded */ { ' ', "+" }, /* Reserved characters: */ @@ -59,7 +59,7 @@ public class BasicURLEncoderTest extends AssertJUnit { ']', "%5D" }, { '`', "%60" }, - }; + }; } @Test(dataProvider = "chars") diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/ExpressionUtilTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/ExpressionUtilTest.java index 422aaa24aefa84574d4750677dcef9eec2831c03..61a4412fafff4638c63978365c0cfc740523e869 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/ExpressionUtilTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/ExpressionUtilTest.java @@ -58,14 +58,14 @@ public class ExpressionUtilTest extends AssertJUnit String expression = "${abc} ${def} ${abc} ${ghi}."; assertEquals("[abc, def, abc, ghi]", extractParameters(expression).toString()); } - + @Test public void testCreateDistinctParametersList() { assertEquals("[a, b, c]", createDistinctList("a", "b", "a", "c", "b").toString()); } - - private Collection<String> createDistinctList(String...strings) + + private Collection<String> createDistinctList(String... strings) { return ExpressionUtil.createDistinctParametersList(Arrays.asList(strings)); } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/Row.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/Row.java index caa444ddb01fe44633cbb2570fcab2d8cbb52fb2..591bd52e2d4fba4c10fdc1fcc819b812d63d3a4f 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/Row.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/Row.java @@ -23,8 +23,8 @@ import java.util.Map; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.CheckTableCommand; /** - * Class which contains all expected cell values to be checked by {@link CheckTableCommand}. It uses - * a fluent API approach for its methods to prepare expectations. + * Class which contains all expected cell values to be checked by {@link CheckTableCommand}. It uses a fluent API approach for its methods to prepare + * expectations. * * @author Franz-Josef Elmer */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/WebAppsPropertiesTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/WebAppsPropertiesTest.java index 2032666f6ec56d25bbfdc7b7b0c1a03785fa95b8..aa9c5ff6174b8232c623fb182fdb0aec364c08b1 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/WebAppsPropertiesTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/WebAppsPropertiesTest.java @@ -63,11 +63,11 @@ public class WebAppsPropertiesTest Assert.assertEquals("Web app 1", webApp.getLabel()); Assert.assertEquals(Integer.valueOf(100), webApp.getSorting()); Assert.assertTrue(Arrays.equals(new String[] - { "queries-menu", "experiment-details-view" }, webApp.getContexts())); + { "queries-menu", "experiment-details-view" }, webApp.getContexts())); Assert.assertTrue(Arrays.equals(new String[] - { "EXP1", "EXP2" }, webApp.getEntityTypes().get(EntityKind.EXPERIMENT))); + { "EXP1", "EXP2" }, webApp.getEntityTypes().get(EntityKind.EXPERIMENT))); Assert.assertTrue(Arrays.equals(new String[] - { "SAM1" }, webApp.getEntityTypes().get(EntityKind.SAMPLE))); + { "SAM1" }, webApp.getEntityTypes().get(EntityKind.SAMPLE))); Assert.assertTrue(Arrays.equals(new String[] {}, webApp.getEntityTypes().get(EntityKind.DATA_SET))); Assert.assertTrue(Arrays.equals(new String[] {}, diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/PrimitiveValueTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/PrimitiveValueTest.java index 188c295ce38677a0cb26395cdd05d33827679b12..c3d212a35ec9ea655f6859407778b4c9711c4f69 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/PrimitiveValueTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/PrimitiveValueTest.java @@ -20,7 +20,7 @@ public class PrimitiveValueTest extends AssertJUnit protected Object[][] getValues() { return new Object[][] - { + { /* NULL == NULL == "" */ { PrimitiveValue.NULL, PrimitiveValue.NULL, ExpectedResult.EQUAL }, { PrimitiveValue.NULL, new PrimitiveValue(""), ExpectedResult.EQUAL }, @@ -74,7 +74,7 @@ public class PrimitiveValueTest extends AssertJUnit { new PrimitiveValue(-10L), new PrimitiveValue(-5.0), ExpectedResult.LOWER }, { new PrimitiveValue(9.9), new PrimitiveValue(10L), ExpectedResult.LOWER }, - }; + }; } @Test(dataProvider = "values") diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/WebAppTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/WebAppTest.java index b27786c87099ff39b0439363cbc96e309df28f4c..7c2c27765aaf72c53e3fb0d8909dcae391a39ee5 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/WebAppTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/WebAppTest.java @@ -55,7 +55,7 @@ public class WebAppTest public void testMatchesContextWithExactMatchInContextsList() { WebApp webApp = new WebApp("webapp", null, null, new String[] - { "experiment-details-view" }, null); + { "experiment-details-view" }, null); for (WebAppContext context : WebAppContext.values()) { @@ -73,7 +73,7 @@ public class WebAppTest public void testMatchesContextWithRegexpMatchInContextsList() { WebApp webApp = new WebApp("webapp", null, null, new String[] - { ".*-details-view" }, null); + { ".*-details-view" }, null); for (WebAppContext context : WebAppContext.values()) { @@ -118,7 +118,7 @@ public class WebAppTest { Map<EntityKind, String[]> entityTypes = new HashMap<EntityKind, String[]>(); entityTypes.put(EntityKind.EXPERIMENT, new String[] - { "EXP0", "EXP1" }); + { "EXP0", "EXP1" }); WebApp webApp = new WebApp("webapp", null, null, null, entityTypes); for (EntityKind kind : EntityKind.values()) @@ -143,7 +143,7 @@ public class WebAppTest { Map<EntityKind, String[]> entityTypes = new HashMap<EntityKind, String[]>(); entityTypes.put(EntityKind.EXPERIMENT, new String[] - { "EXP0", "EXP.*" }); + { "EXP0", "EXP.*" }); WebApp webApp = new WebApp("webapp", null, null, null, entityTypes); for (EntityKind kind : EntityKind.values()) diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/builders/DataStoreBuilder.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/builders/DataStoreBuilder.java index 4c0c9eb24a20dacbef24775a1e4954041ba216a3..b3b4049b213123069c5531e27f7b0ed5663bf8fe 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/builders/DataStoreBuilder.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/builders/DataStoreBuilder.java @@ -26,12 +26,12 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataStore; public class DataStoreBuilder { private DataStore store = new DataStore(); - + public DataStoreBuilder(String dataStoreCode) { store.setCode(dataStoreCode); } - + public DataStoreBuilder hostUrl(String hostUrl) { store.setHostUrl(hostUrl); @@ -43,10 +43,10 @@ public class DataStoreBuilder store.setDownloadUrl(downloadUrl); return this; } - + public DataStore getStore() { return store; } - + } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/builders/PropertyBuilder.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/builders/PropertyBuilder.java index 3360ea6cbbcebcd5be8d28bd9c3f27f7c95b3663..ec4bd3660d0ecf26b1e1efb5b3c1a6d519bb0ed0 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/builders/PropertyBuilder.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/builders/PropertyBuilder.java @@ -58,8 +58,7 @@ public class PropertyBuilder private final ExtendedEntityProperty property = new ExtendedEntityProperty(); /** - * Creates an instance for specified property type code which also the simple code. Data type is - * {@link DataTypeCode#VARCHAR}. + * Creates an instance for specified property type code which also the simple code. Data type is {@link DataTypeCode#VARCHAR}. */ public PropertyBuilder(String key) { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/utils/GroupByMapTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/utils/GroupByMapTest.java index 47d51e7b8413517572fb0e8a043a4a8b5907b266..29fdbe6b264767393d41f6e769461cb9491412c5 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/utils/GroupByMapTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/basic/utils/GroupByMapTest.java @@ -45,7 +45,7 @@ public class GroupByMapTest extends AssertJUnit public void test() { List<Integer> list = Arrays.asList(new Integer[] - { 1, 100, 1, 5, 100, 100 }); + { 1, 100, 1, 5, 100, 100 }); GroupByMap<Integer, Integer> map = GroupByMap.create(list, createKeyExtractor()); assertNull(map.tryGet(9)); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/coreplugin/CorePluginsInjectorTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/coreplugin/CorePluginsInjectorTest.java index 28ffc66e0c5b413f1f63ec3964e5937a022a070a..06b4931267934d3aa98a04e9e978dda039ac5317 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/coreplugin/CorePluginsInjectorTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/coreplugin/CorePluginsInjectorTest.java @@ -104,7 +104,7 @@ public class CorePluginsInjectorTest extends AbstractFileSystemTestCase }; PluginType typeWebapps = new PluginType("webapps", "webapps"); injector = new CorePluginsInjector(ScannerType.DSS, new IPluginType[] - { type1, type2, type3, type4, type5, type6, typeWebapps }, logger); + { type1, type2, type3, type4, type5, type6, typeWebapps }, logger); corePluginsFolder = new File(workingDirectory, "core-plugins"); corePluginsFolder.mkdirs(); corePluginsFolderProperty = diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/dto/builders/AbstractEntityTypePEBuilder.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/dto/builders/AbstractEntityTypePEBuilder.java index 7b8f2e8112ea681bb0bee3793f6581cb44c45090..422849db80534e10aaf7987e7893a11cd0e3ab30 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/dto/builders/AbstractEntityTypePEBuilder.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/dto/builders/AbstractEntityTypePEBuilder.java @@ -32,6 +32,6 @@ abstract class AbstractEntityTypePEBuilder propertyType.setCode(propertyTypeCode); return assign(propertyType); } - + public abstract EntityTypePropertyTypePEBuilder assign(PropertyTypePE propertyType); } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/dto/builders/SamplePEBuilder.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/dto/builders/SamplePEBuilder.java index d90fa34f6c61c76a115eccd158f51047cbdb1eb7..f1c8dce02af8873eb908177046b8ba2c9cf0ef0c 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/dto/builders/SamplePEBuilder.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/dto/builders/SamplePEBuilder.java @@ -33,51 +33,51 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.SpacePE; public class SamplePEBuilder { private final SamplePE sample = new SamplePE(); - + public SamplePEBuilder() { } - + public SamplePEBuilder(long id) { sample.setId(id); } - + public SamplePE getSample() { return sample; } - + public SamplePEBuilder id(long id) { sample.setId(id); return this; } - + public SamplePEBuilder code(String code) { sample.setCode(code); return this; } - + public SamplePEBuilder space(SpacePE space) { sample.setSpace(space); return this; } - + public SamplePEBuilder permID(String permID) { sample.setPermId(permID); return this; } - + public SamplePEBuilder type(SampleTypePE type) { sample.setSampleType(type); return this; } - + public SamplePEBuilder property(String code, DataTypeCode dataType, String value) { SampleTypePEBuilder sampleTypeBuilder = new SampleTypePEBuilder().code("my-type"); @@ -87,7 +87,7 @@ public class SamplePEBuilder sampleTypeBuilder.assign(propertyType).getEntityTypePropertyType(); return property(etpt, value); } - + public SamplePEBuilder property(EntityTypePropertyTypePE etpt, String value) { SamplePropertyPE property = new SamplePropertyPE(); @@ -95,14 +95,11 @@ public class SamplePEBuilder property.setValue(value); return property(property); } - + public SamplePEBuilder property(SamplePropertyPE property) { sample.addProperty(property); return this; } - - - - + } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/JythonManagedPropertyEvaluatorTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/JythonManagedPropertyEvaluatorTest.java index 9bc6e4b70e0b8bada6d38ec74b6cfb88a143aa84..fb5b95fa596d89796b174ca407c98355b75c5250 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/JythonManagedPropertyEvaluatorTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/managed_property/JythonManagedPropertyEvaluatorTest.java @@ -234,7 +234,7 @@ public class JythonManagedPropertyEvaluatorTest extends AssertJUnit widgetFactory.createMultilineTextInputField("multi").setValue("multi\nline\ninput"); IManagedInputWidgetDescription action1w4 = widgetFactory.createComboBoxInputField("combo", new String[] - { "cv1", "cv2", "cv3" }).setValue("cv1"); + { "cv1", "cv2", "cv3" }).setValue("cv1"); action1.addInputWidgets(action1w1, action1w2, action1w3, action1w4); assertEquals(null, action1.getInputValue("t1")); assertEquals("v2", action1.getInputValue("t2")); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/parser/NewSampleParserObjectFactoryTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/parser/NewSampleParserObjectFactoryTest.java index bd98454124a5a7c78eef7eb452a54f8e2b2de8ab..dbb82fc0f57a3826a9d32392900d30c86049a7f0 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/parser/NewSampleParserObjectFactoryTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/parser/NewSampleParserObjectFactoryTest.java @@ -55,7 +55,7 @@ public final class NewSampleParserObjectFactoryTest private final static IPropertyMapper createPropertyMapper() { final String[] properties = new String[] - { "!toBeIgnored", "identifier", "container", "parent", "prop1", "prop2" }; + { "!toBeIgnored", "identifier", "container", "parent", "prop1", "prop2" }; final DefaultPropertyMapper propertyMapper = new DefaultPropertyMapper(properties, null); return propertyMapper; } @@ -63,7 +63,7 @@ public final class NewSampleParserObjectFactoryTest private final static IPropertyMapper createPropertyMapperWithoutIdentifier() { final String[] properties = new String[] - { "prop1", "prop2" }; + { "prop1", "prop2" }; final DefaultPropertyMapper propertyMapper = new DefaultPropertyMapper(properties, null); return propertyMapper; } @@ -97,29 +97,29 @@ public final class NewSampleParserObjectFactoryTest private final static Object[][] getLineTokensForAutoGeneratedCodes() { return new Object[][] - { - { new String[] - { "", "" }, 0 }, - { new String[] - { null, null }, 0 }, - { new String[] - { "1", "hello" }, 2 }, + { + { new String[] + { "", "" }, 0 }, + { new String[] + { null, null }, 0 }, + { new String[] + { "1", "hello" }, 2 }, }; -} + } @DataProvider private final static Object[][] getLineTokens() { return new Object[][] - { - { new String[] - { "", "", "", "", "", "" }, 0 }, - { new String[] - { "ignoreMe", "id1", "cont1", "par1", "1", "hello" }, 2 }, + { + { new String[] + { "", "", "", "", "", "" }, 0 }, + { new String[] + { "ignoreMe", "id1", "cont1", "par1", "1", "hello" }, 2 }, }; -} + } @Test(dataProvider = "getLineTokens") public final void testFailCreateObjectForAutoGeneratedCodesWithIdentifierSpecified( diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/parser/UpdatedSampleParserObjectFactoryTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/parser/UpdatedSampleParserObjectFactoryTest.java index f15efeb94e4c3d1f65dcc42edb81ae034468c359..c12f4f08b9c1121b78d430a1ab0a54e5a65d3aef 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/parser/UpdatedSampleParserObjectFactoryTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/parser/UpdatedSampleParserObjectFactoryTest.java @@ -60,7 +60,7 @@ public final class UpdatedSampleParserObjectFactoryTest private final static IPropertyMapper createPropertyMapper() { final String[] properties = new String[] - { Identifier.IDENTIFIER_COLUMN, NewSample.CONTAINER, PROPERTY_1, PROPERTY_2 }; + { Identifier.IDENTIFIER_COLUMN, NewSample.CONTAINER, PROPERTY_1, PROPERTY_2 }; final DefaultPropertyMapper propertyMapper = new DefaultPropertyMapper(properties, null); return propertyMapper; } @@ -69,19 +69,19 @@ public final class UpdatedSampleParserObjectFactoryTest private final static Object[][] getLineTokens() { return new Object[][] - { - { new String[] - { "", "", "", "" }, 0, 0 }, - { new String[] - { "id1", "cont1", "1", "hello" }, 2, 2 }, - { new String[] - { "id1", "", "1", "" }, 1, 1 }, - { new String[] - { "", "cont1", "", "hello" }, 1, 1 }, - { new String[] - { "id1", "cont1", "--DELETE--", "__DELETE__" }, 0, 2 }, - { new String[] - { "__DELETE__", "--DELETE--", "--DELETE--", "hello" }, 1, 2 } }; + { + { new String[] + { "", "", "", "" }, 0, 0 }, + { new String[] + { "id1", "cont1", "1", "hello" }, 2, 2 }, + { new String[] + { "id1", "", "1", "" }, 1, 1 }, + { new String[] + { "", "cont1", "", "hello" }, 1, 1 }, + { new String[] + { "id1", "cont1", "--DELETE--", "__DELETE__" }, 0, 2 }, + { new String[] + { "__DELETE__", "--DELETE--", "--DELETE--", "hello" }, 1, 2 } }; } @Test(dataProvider = "getLineTokens") diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/util/CacheManagerTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/util/CacheManagerTest.java index f58fb553850ca1bc6e01b004d41af4daaad97646..766a8041fd24b2fd2078758553ab367799e3a440 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/util/CacheManagerTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/util/CacheManagerTest.java @@ -43,23 +43,27 @@ import ch.systemsx.cisd.common.utilities.ITimeProvider; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.WebClientConfiguration; /** - * - * * @author Franz-Josef Elmer */ -@Friend(toClasses=CacheManager.class) +@Friend(toClasses = CacheManager.class) public class CacheManagerTest extends AbstractFileSystemTestCase { private static final String TECHNOLOGY = "test-technology"; + private static final String CACHE_VERSION = "42"; + private static final long DAY = 24 * 60 * 60 * 1000; - + private Mockery context; + private IFreeSpaceProvider freeSpaceProvider; + private WebClientConfiguration webClientConfiguration; + private File cacheFolder; + private ITimeProvider timeProvider; - + @BeforeMethod public void beforeMethod() { @@ -83,29 +87,29 @@ public class CacheManagerTest extends AbstractFileSystemTestCase // Otherwise one do not known which test failed. context.assertIsSatisfied(); } - + @Test public void testEmptyCache() { CacheManager cacheManager = createCacheManager(); - + Object data = cacheManager.tryToGetData(new Key("a")); - + assertEquals(null, data); checkCacheFolder(CACHE_VERSION); context.assertIsSatisfied(); } - + @Test public void testStoreDataButNotEnoughMemory() { prepareTimeProvider(1L, 2L, 3L); prepareFreeSpaceProvider(0L); CacheManager cacheManager = createCacheManager(); - + String data = "hello"; cacheManager.storeData(new Key("a"), data); - + assertEquals(null, cacheManager.tryToGetData(new Key("a"))); checkCacheFolder(CACHE_VERSION); context.assertIsSatisfied(); @@ -117,10 +121,10 @@ public class CacheManagerTest extends AbstractFileSystemTestCase prepareTimeProvider(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L); prepareFreeSpaceProvider(2048L, 2048L); CacheManager cacheManager = createCacheManager(); - + String data = "hello"; cacheManager.storeData(new Key("a"), data); - + assertEquals(data, cacheManager.tryToGetData(new Key("a"))); checkCacheFolder(CACHE_VERSION, "19700101010000007-1"); assertEquals(data, cacheManager.tryToGetData(new Key("a"))); @@ -128,76 +132,76 @@ public class CacheManagerTest extends AbstractFileSystemTestCase checkCacheFolder(CACHE_VERSION, "19700101010000010-2"); context.assertIsSatisfied(); } - + @Test public void testStoreShutdownAndRetrieveFromCache() { prepareTimeProvider(1L, 2L, 3L, 4L, 5L, 6L, 7L); prepareFreeSpaceProvider(2048L, 2048L); CacheManager cacheManager = createCacheManager(); - + String data = "hello"; cacheManager.storeData(new Key("a"), data); - + cacheManager = createCacheManager(); assertEquals(data, cacheManager.tryToGetData(new Key("a"))); assertEquals(null, cacheManager.tryToGetData(new Key("b"))); checkCacheFolder(CACHE_VERSION, "19700101010000007-0"); context.assertIsSatisfied(); } - + @Test public void testStoreShutdownAndTryToRetrieveFromCacheWithChangedCacheVersion() { prepareTimeProvider(1L, 2L, 3L, 4L); prepareFreeSpaceProvider(2048L, 2048L); CacheManager cacheManager = createCacheManager("1"); - + String data = "hello"; cacheManager.storeData(new Key("a"), data); - + cacheManager = createCacheManager("2"); assertEquals(null, cacheManager.tryToGetData(new Key("a"))); checkCacheFolder("2"); context.assertIsSatisfied(); } - + @Test public void testCleanUpForLargeFiles() { prepareTimeProvider(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L); prepareFreeSpaceProvider(2048L, 2048L, 0L, 2048L, 2048L); CacheManager cacheManager = createCacheManager(); - + String data1 = "hello"; cacheManager.storeData(new Key("a"), data1); String data2 = "hi"; cacheManager.storeData(new Key("b"), data2); - + assertEquals(null, cacheManager.tryToGetData(new Key("a"))); assertEquals(data2, cacheManager.tryToGetData(new Key("b"))); checkCacheFolder(CACHE_VERSION, "19700101010000011-1"); context.assertIsSatisfied(); } - + @Test public void testCleanUpForOldFiles() { prepareTimeProvider(1L, 2L, 3L, 4L, DAY + 5L, DAY + 6L, DAY + 7L, DAY + 8L, DAY + 9L, DAY + 10L, DAY + 11L); prepareFreeSpaceProvider(2048L, 2048L, 2048L, 2048L); CacheManager cacheManager = createCacheManager(); - + String data1 = "hello"; cacheManager.storeData(new Key("a"), data1); String data2 = "hi"; cacheManager.storeData(new Key("b"), data2); - + assertEquals(null, cacheManager.tryToGetData(new Key("a"))); assertEquals(data2, cacheManager.tryToGetData(new Key("b"))); checkCacheFolder(CACHE_VERSION, "19700102010000011-1"); context.assertIsSatisfied(); } - + private void checkCacheFolder(String cacheVersion, String... fileNames) { File versionFile = new File(cacheFolder, CacheManager.CACHE_VERSION_FILE_NAME); @@ -259,7 +263,7 @@ public class CacheManagerTest extends AbstractFileSystemTestCase } }); } - + private CacheManager createCacheManager() { return createCacheManager(CACHE_VERSION); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/util/EntityHelperTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/util/EntityHelperTest.java index b9ac343c65d0287bce76869649f6881033176c80..0c5d9942da4be5abe48c24f342dcdfbfb10cf470 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/util/EntityHelperTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/util/EntityHelperTest.java @@ -42,7 +42,7 @@ public class EntityHelperTest extends AssertJUnit assertEquals(1, properties.size()); assertEquals("A", properties.get(0).getPropertyCode()); } - + @Test public void testEqualEntities() { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/CheckDataSet.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/CheckDataSet.java index e41a350862f48bfbc64124d828c384364daaa0d0..e54a0f5da6d037491b144b67368f47a6313e4197 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/CheckDataSet.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/CheckDataSet.java @@ -25,8 +25,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetRelationshipRole; /** - * * {@link AbstractDefaultTestCommand} extension checking e.g. properties displayed in data set - * detail view. + * * {@link AbstractDefaultTestCommand} extension checking e.g. properties displayed in data set detail view. * * @author Piotr Buczek */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewerTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewerTest.java index ce7bb7e795fd885748deb2c26d7a016a74c4372f..1f2867552daf9175d1254de94399d2d30d190238 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewerTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewerTest.java @@ -70,7 +70,7 @@ public class GenericDataSetViewerTest extends AbstractGWTTestCase { final String parentCodes[] = {}; final String childCodes[] = - { "20081105092259000-9" }; + { "20081105092259000-9" }; prepareShowDataSet(PARENT_DATASET_CODE_WITH_SAMPLE); @@ -103,10 +103,10 @@ public class GenericDataSetViewerTest extends AbstractGWTTestCase public final void testShowExperimentDataSetWithParents() { final String parentCodes[] = - { "20081105092158673-1", "20081105092159111-1", "20081105092159222-2", - "20081105092159333-3" }; + { "20081105092158673-1", "20081105092159111-1", "20081105092159222-2", + "20081105092159333-3" }; final String childCodes[] = - { "20081105092259900-0", "20081105092259900-1" }; + { "20081105092259900-0", "20081105092259900-1" }; prepareShowDataSet(CHILD_DATASET_CODE); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentRegistrationTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentRegistrationTest.java index 47c5779edd6c69a7c6c4a8487a349b9a6991e63a..ccd00a4074a3a2463ca751b9c7510eec87f2356a 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentRegistrationTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentRegistrationTest.java @@ -36,7 +36,6 @@ import ch.systemsx.cisd.openbis.systemtest.plugin.generic.ExperimentRegistration /** * A {@link AbstractGWTTestCase} extension to test {@link GenericExperimentRegistrationForm}. * - * * @author Izabela Adamczyk * @see ExperimentRegistrationTest */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewerTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewerTest.java index c54f062bb2d03d8f4babf6ce62e949e1067e1c99..bd05e4e3089ca9b900bd5d87985f4ecc47c33f58 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewerTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewerTest.java @@ -125,9 +125,8 @@ public class GenericExperimentViewerTest extends AbstractGWTTestCase /** * Tests that authorization annotations of - * {@link ICommonServer#getExperimentInfo(String, ch.systemsx.cisd.openbis.generic.shared.dto.identifier.ExperimentIdentifier)} - * are obeyed. This is done by a direct invocation of - * {@link ICommonClientServiceAsync#getExperimentInfo(String,com.google.gwt.user.client.rpc.AsyncCallback)} + * {@link ICommonServer#getExperimentInfo(String, ch.systemsx.cisd.openbis.generic.shared.dto.identifier.ExperimentIdentifier)} are obeyed. This + * is done by a direct invocation of {@link ICommonClientServiceAsync#getExperimentInfo(String,com.google.gwt.user.client.rpc.AsyncCallback)} * because the normal GUI only list experiments which are accessible by the user. */ public final void testDirectInvocationOfGetExperimentInfoByAnUnauthorizedUser() diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationTest.java index 7475245ee0e798947bcdd369dc1fe65cec964eb5..5f917575d33d9ce86bd08145e0c973c06d9be1ad 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationTest.java @@ -90,8 +90,7 @@ public class GenericSampleRegistrationTest extends AbstractGWTTestCase } /** - * Tests that authorization annotations of {@link IGenericClientService#registerSample} are - * obeyed. + * Tests that authorization annotations of {@link IGenericClientService#registerSample} are obeyed. */ public final void testRegisterSampleByAnUnauthorizedUser() { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewerTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewerTest.java index 3d0b2cd1f8ae95536b29b7ee91f36665dd921c52..6397aef9a2302f1ee75fc7e7f7939ecb73801da7 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewerTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewerTest.java @@ -219,7 +219,7 @@ public class GenericSampleViewerTest extends AbstractGWTTestCase final String differentExperimentIdentifier = "/CISD/DEFAULT/EXP-REUSE"; assert differentExperimentIdentifier.equals(CELL_PLATE_EXAMPLE_EXPERIMENT_ID) == false; final String[] indirectlyConnectedDataSetLocations = - { "xml/result-9", "xml/result-10", "xml/result-11", "xml/result-12" }; + { "xml/result-9", "xml/result-10", "xml/result-11", "xml/result-12" }; for (String location : indirectlyConnectedDataSetLocations) { checkIndirectlyConnectedDataTable.expectedRow(new DataSetRow().valid().withSample("") diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/Property.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/Property.java index 268b2dc2b0e3288a28304fc986dbcb1fbca555d9..2c0bb379f24b141202ea0f02a7e684638a026001 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/Property.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/Property.java @@ -24,18 +24,17 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Person; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; /** - * Extends {@link AbstractProperty} with methods for {@link Person} and arrays of generated - * {@link Sample}. + * Extends {@link AbstractProperty} with methods for {@link Person} and arrays of generated {@link Sample}. * * @author Franz-Josef Elmer */ -public class Property extends AbstractProperty<CheckSample> +public class Property extends AbstractProperty<CheckSample> { public Property(String key, CheckSample checker) { super(key, checker); } - + public CheckSample asPerson(final String personAsString) { return by(new IValueAssertion<Person>() @@ -48,7 +47,7 @@ public class Property extends AbstractProperty<CheckSample> } }); } - + public CheckSample asGeneratedSamples(final String... samples) { return by(new IValueAssertion<Sample[]>() @@ -67,5 +66,5 @@ public class Property extends AbstractProperty<CheckSample> } }); } - + } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/remoteapitest/RemoteApiTestCase.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/remoteapitest/RemoteApiTestCase.java index df7fad3bb854aebed813cd0a3ef8b6704a36b596..c95ce5c86a6fb7e1ccc729ace471479e118c5809 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/remoteapitest/RemoteApiTestCase.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/remoteapitest/RemoteApiTestCase.java @@ -37,9 +37,8 @@ import ch.systemsx.cisd.openbis.generic.server.util.TestInitializer; import ch.systemsx.cisd.openbis.generic.shared.util.TestInstanceHostUtils; /** - * Test cases which have access to the public API services of a running, fully-fledged openBIS - * server. The tests do not see the server internals and thus they must employ black-box testing - * strategies. + * Test cases which have access to the public API services of a running, fully-fledged openBIS server. The tests do not see the server internals and + * thus they must employ black-box testing strategies. * * @author Kaloyan Enimanev */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AbstractDataSetAssignmentTestCase.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AbstractDataSetAssignmentTestCase.java index d20b983fa63285bb67e0cee0a798b05079aefe1e..4d04313cc8c4e7648874f3a47d1e8e573c3f41e3 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AbstractDataSetAssignmentTestCase.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AbstractDataSetAssignmentTestCase.java @@ -131,6 +131,7 @@ public abstract class AbstractDataSetAssignmentTestCase extends BaseTest return RolePermutator.getAcceptedPermutations(assignDataSetToExperimentRule, source, destination, instance); } + @DataProvider public Object[][] rolesNotAllowedToAssignDataSetToExperiment() { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AbstractEntityDeletionTestCase.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AbstractEntityDeletionTestCase.java index f97bda93c2fb17fd9251d5ff90260f56c03d5180..847f9e2ebaca713b067507958849b32286373bde 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AbstractEntityDeletionTestCase.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AbstractEntityDeletionTestCase.java @@ -51,10 +51,10 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest { EntityGraphGenerator g = parseAndCreateGraph( "E1, samples: S50, data sets: DS60 DS61\n" - + "E2, samples: S51\n" - + "E3\n" + + "E2, samples: S51\n" + + "E3\n" ); - + deleteExperiments(g.e(1), g.e(2), g.e(3)); assertEquals("", renderGraph(g)); @@ -63,7 +63,7 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest assertDeleted(g.ds(60), g.ds(61)); assertUnmodifiedAndUndeleted(g); } - + @Test public final void testTrashExperimentsWithDeepDependencies() { @@ -82,22 +82,22 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest assertDeleted(g.ds(60), g.ds(61), g.ds(70), g.ds(71)); assertUnmodifiedAndUndeleted(g); } - + @Test public final void testTrashExperimentWithSampleWhichIsAComponentOfASpaceSample() { EntityGraphGenerator g = parseAndCreateGraph("E1, samples: S2\n" + "S1, components: S2\n"); - + deleteExperiments(g.e(1)); - + assertEquals("", renderGraph(g)); assertModified(g.s(1)); assertDeleted(g.e(1)); assertDeleted(g.s(2)); assertUnmodifiedAndUndeleted(g); } - + @Test public void testTrashExperimentWithSampleWhichHasAChild() { @@ -105,14 +105,14 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest + "S1, children: S3\n"); deleteExperiments(g.e(1)); - + assertEquals("", renderGraph(g)); assertDeleted(g.e(1)); assertDeleted(g.s(1)); assertModified(g.s(3)); assertUnmodifiedAndUndeleted(g); } - + @Test @Rollback(false) public final void testTrashExperimentWithSampleAndDataSet() @@ -121,14 +121,14 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest + "S1, data sets: DS1\n", false); deleteExperiments(g.e(1)); - + assertEquals("", renderGraph(g)); assertDeleted(g.e(1)); assertDeleted(g.s(1)); assertDeleted(g.ds(1)); assertUnmodifiedAndUndeleted(g); } - + @Test public final void testTrashExperimentsWithSampleAndDataSetsAndNoExternalLinks() { @@ -136,16 +136,16 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest + "E2, data sets: DS2\n" + "S1, data sets: DS1\n" + "DS1, components: DS2\n"); - + deleteExperiments(g.e(1), g.e(2)); - + assertEquals("", renderGraph(g)); assertDeleted(g.e(1), g.e(2)); assertDeleted(g.s(1)); assertDeleted(g.ds(1), g.ds(2)); assertUnmodifiedAndUndeleted(g); } - + @Test public final void testTrashExperimentWithARelatedDataSetComponentWhichBelongsToAnExternalExperiment() { @@ -153,16 +153,16 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest + "E2, data sets: DS2\n" + "S1, data sets: DS1\n" + "DS1, components: DS2\n"); - + deleteExperiments(g.e(1)); - + assertEquals("E2, data sets: DS2\n", renderGraph(g)); assertDeleted(g.e(1)); assertDeleted(g.s(1)); assertDeleted(g.ds(1)); assertUnmodifiedAndUndeleted(g); } - + @Test @Rollback(true) public final void testTrashExperimentWithARelatedDataSetInAnExternalContainer() @@ -171,16 +171,16 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest + "E2, data sets: DS2\n" + "S1, data sets: DS1\n" + "DS1, components: DS2\n", false); - + failTrashExperiment(g.e(2), createExpectedErrorMessage(g.ds(2), g.ds(1), g.s(1))); - + assertEquals("E1, samples: S1, data sets: DS1\n" + "E2, data sets: DS2\n" + "S1, data sets: DS1\n" + "DS1, components: DS2\n", renderGraph(g)); assertUnmodifiedAndUndeleted(g); } - + @Test public void testTrashPublishedExperiment() { @@ -190,9 +190,9 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest + "DS2, components: DS6\n" + "DS3, components: DS4\n" + "DS5, parents: DS6\n"); - + deleteExperiments(g.e(2)); - + assertEquals("E1, data sets: DS3 DS4 DS5 DS6\n" + "DS3, components: DS4\n" + "DS5, parents: DS6\n", renderGraph(g)); @@ -200,7 +200,7 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest assertDeleted(g.ds(1), g.ds(2)); assertUnmodifiedAndUndeleted(g); } - + @Test public final void testTrashPublishedExperimentWithOrginalExperimentWithSamples() { @@ -210,9 +210,9 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest + "DS1, components: DS2\n" + "DS2, components: DS3\n" ); - + deleteExperiments(g.e(2)); - + assertEquals("E1, samples: S1, data sets: DS2 DS3\n" + "S1, data sets: DS2 DS3\n" + "DS2, components: DS3\n", renderGraph(g)); @@ -220,7 +220,7 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest assertDeleted(g.ds(1)); assertUnmodifiedAndUndeleted(g); } - + @Test @Rollback(true) public final void testTrashOrginalExperimentWithSample() @@ -230,9 +230,9 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest + "S1, data sets: DS2 DS3\n" + "DS1, components: DS2\n" + "DS2, components: DS3\n", false); - + failTrashExperiment(g.e(1), createExpectedErrorMessage(g.ds(2), g.ds(1), g.e(2))); - + assertEquals("E1, samples: S1, data sets: DS2 DS3\n" + "E2, data sets: DS1\n" + "S1, data sets: DS2 DS3\n" @@ -240,28 +240,27 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest + "DS2, components: DS3\n", renderGraph(g)); assertUnmodifiedAndUndeleted(g); } - + @Test public final void testTrashExperimentsWithContainerDataSetWithPhysicalDataSetFromAnotherExperiment() { EntityGraphGenerator g = parseAndCreateGraph("E1, data sets: DS1\n" + "E2, data sets: DS2\n" + "DS1, components: DS2\n"); - + deleteExperiments(g.e(1)); - + assertEquals("E2, data sets: DS2\n", renderGraph(g)); assertDeleted(g.e(1)); assertDeleted(g.ds(1)); assertUnmodifiedAndUndeleted(g); } - + @Test public final void testTrashSamplesAlreadyTrashed() { EntityGraphGenerator g = parseAndCreateGraph("S1\nS2\n"); - - + assertEquals("", renderGraph(g)); assertUnmodifiedAndUndeleted(g); } @@ -272,135 +271,135 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest EntityGraphGenerator g = parseAndCreateGraph("S1, components: S20\n" + "S3, data sets: DS60[NET]\n" + "S20, data sets: DS61[NET]\n"); - + deleteSamples(g.s(1), g.s(3)); - + assertEquals("", renderGraph(g)); assertDeleted(g.s(1), g.s(3), g.s(20)); assertDeleted(g.ds(60), g.ds(61)); assertUnmodifiedAndUndeleted(g); } - + @Test public final void testTrashSampleWithTwoLevelOfDependencies() { EntityGraphGenerator g = parseAndCreateGraph("S1, components: S2 S3, data sets: DS1[NET]\n" + "S2, data sets: DS2[NET]\n" + "S3, data sets: DS3[NET]\n"); - + deleteSamples(g.s(1)); - + assertEquals("", renderGraph(g)); assertDeleted(g.s(1), g.s(2), g.s(3)); assertDeleted(g.ds(1), g.ds(2), g.ds(3)); assertUnmodifiedAndUndeleted(g); } - + @Test public final void testTrashComponentSample() { EntityGraphGenerator g = parseAndCreateGraph("E1, samples: S2\n" + "S1, components: S2\n"); - + deleteSamples(g.s(2)); - + assertEquals("", renderGraph(g)); assertDeleted(g.s(2)); assertModified(g.e(1)); assertModified(g.s(1)); assertUnmodifiedAndUndeleted(g); } - + @Test public final void testTrashSampleWithAComponentWithAContainerDataSetWithAComponentDataSetOfFirstSample() { EntityGraphGenerator g = parseAndCreateGraph("S1, components: S2, data sets: DS2[NET]\n" + "S2, data sets: DS1[NECT]\n" + "DS1[NECT], components: DS2[NET]\n"); - + deleteSamples(g.s(1)); - + assertEquals("", renderGraph(g)); assertDeleted(g.s(1), g.s(2)); assertDeleted(g.ds(1), g.ds(2)); assertUnmodifiedAndUndeleted(g); } - + @Test public final void testTrashSampleWithAComponentWithAComponentDataSetOfAContainerDataSetOfFirstSample() { EntityGraphGenerator g = parseAndCreateGraph("S1, components: S2, data sets: DS1[NECT]\n" + "S2, data sets: DS2[NET]\n" + "DS1[NECT], components: DS2[NET]\n"); - + deleteSamples(g.s(1)); - + assertEquals("", renderGraph(g)); assertDeleted(g.s(1), g.s(2)); assertDeleted(g.ds(1), g.ds(2)); assertUnmodifiedAndUndeleted(g); } - + @Test public final void testTrashSampleWithAnExperimentSample() { EntityGraphGenerator g = parseAndCreateGraph("E1, samples: S2\n" + "S1, components: S2\n"); - + deleteSamples(g.s(1)); - + assertEquals("", renderGraph(g)); assertDeleted(g.s(1), g.s(2)); assertModified(g.e(1)); assertUnmodifiedAndUndeleted(g); } - + @Test public final void testTrashSampleWithAnExperimentSampleWithADataSet() { EntityGraphGenerator g = parseAndCreateGraph("E1, samples: S2, data sets: DS1\n" + "S1, components: S2\n" + "S2, data sets: DS1\n"); - + deleteSamples(g.s(1)); - + assertEquals("", renderGraph(g)); assertDeleted(g.s(1), g.s(2)); assertDeleted(g.ds(1)); assertModified(g.e(1)); assertUnmodifiedAndUndeleted(g); } - + @Test public final void testTrashExperimentSampleWithADataSet() { EntityGraphGenerator g = parseAndCreateGraph("E1, samples: S1, data sets: DS1\n" + "S1, data sets: DS1\n"); - + deleteSamples(g.s(1)); - + assertEquals("", renderGraph(g)); assertModified(g.e(1)); assertDeleted(g.s(1)); assertDeleted(g.ds(1)); assertUnmodifiedAndUndeleted(g); } - + @Test public final void testTrashExperimentSampleWhichIsAComponentOfASpaceSample() { EntityGraphGenerator g = parseAndCreateGraph("E1, samples: S2\n" + "S1, components: S2\n"); - + deleteSamples(g.s(2)); - + assertEquals("", renderGraph(g)); assertModified(g.e(1)); assertModified(g.s(1)); assertDeleted(g.s(2)); assertUnmodifiedAndUndeleted(g); } - + @Test @Rollback(true) public final void testTrashSampleWithComponentWithDataSetWithComponentOfAnotherSample() @@ -409,16 +408,16 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest + "S2, data sets: DS2[NET]\n" + "S3, data sets: DS1[NECT]\n" + "DS1[NECT], components: DS2[NET]\n", false); - + failTrashSample(g.s(1), createExpectedErrorMessage(g.ds(2), g.ds(1), g.s(3))); - + assertEquals("S1, components: S2\n" + "S2, data sets: DS2[NET]\n" + "S3, data sets: DS1[NECT]\n" + "DS1[NECT], components: DS2[NET]\n", renderGraph(g)); assertUnmodifiedAndUndeleted(g); } - + @Test @Rollback(true) public final void testTrashSampleWithComponentWithDataSetWithComponentOfAnotherExperiment() @@ -427,16 +426,16 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest + "S1, components: S2\n" + "S2, data sets: DS2[NET]\n" + "DS1, components: DS2[NET]\n", false); - + failTrashSample(g.s(1), createExpectedErrorMessage(g.ds(2), g.ds(1), g.e(1))); - + assertEquals("E1, data sets: DS1\n" + "S1, components: S2\n" + "S2, data sets: DS2[NET]\n" + "DS1, components: DS2[NET]\n", renderGraph(g)); assertUnmodifiedAndUndeleted(g); } - + @Test @Rollback(true) public void testTrashSampleWithDataSetWithDataSetComponentIndirectlyDependentOnOutsideContainer() @@ -446,9 +445,9 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest + "DS1[NECT], components: DS3[NET] DS4[NECT] DS5[NET]\n" + "DS2[NECT], components: DS4[NECT]\n" + "DS4[NECT], components: DS5[NET] DS6[NET]\n", false); - + failTrashSample(g.s(1), createExpectedErrorMessage(g.ds(4), g.ds(2), g.s(2))); - + assertEquals("S1, data sets: DS1[NECT] DS3[NET] DS4[NECT] DS5[NET] DS6[NET]\n" + "S2, data sets: DS2[NECT]\n" + "DS1[NECT], components: DS3[NET] DS4[NECT] DS5[NET]\n" @@ -456,20 +455,20 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest + "DS4[NECT], components: DS5[NET] DS6[NET]\n", renderGraph(g)); assertUnmodifiedAndUndeleted(g); } - + @Test @Rollback(true) public void testTrashSampleWithComponentsFromAnInvisibleSpace() { EntityGraphGenerator g = parseAndCreateGraph("/S1/S1, components: /S2/S2\n", false); - SessionBuilder sessionBuilder = aSession().withSpaceRole(RoleWithHierarchy.SPACE_ADMIN, + SessionBuilder sessionBuilder = aSession().withSpaceRole(RoleWithHierarchy.SPACE_ADMIN, entityGraphManager.getSample(g.s(1)).getSpace()); String userSessionToken = create(sessionBuilder); - + String userID = sessionBuilder.getUserID(); String sample = entityGraphManager.getSample(g.s(2)).getIdentifier(); failTrashSample(userSessionToken, g.s(1), createExpectedErrorMessage(userID, sample)); - + assertEquals("/S1/S1, components: /S2/S2\n", renderGraph(g)); assertUnmodifiedAndUndeleted(g); } @@ -480,54 +479,54 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest EntityGraphGenerator g = parseAndCreateGraph("S1, data sets: DS1[NECT] DS2[NECT] DS3[NET] DS4[NET] DS5[NET] DS6[NET]\n" + "DS1[NECT], components: DS5[NET]\n" + "DS2[NECT], components: DS6[NET]\n"); - + deleteDataSets(g.ds(1), g.ds(2), g.ds(3)); - + assertEquals("S1, data sets: DS4[NET]\n", renderGraph(g)); assertModified(g.s(1)); assertDeleted(g.ds(1), g.ds(2), g.ds(3), g.ds(5), g.ds(6)); assertUnmodifiedAndUndeleted(g); } - + @Test public final void testTrashDataSetAndComponentsBelongingToSameExperiment() { EntityGraphGenerator g = parseAndCreateGraph("E1, data sets: DS1 DS2\n" + "E2, data sets: DS3\n" + "DS1, components: DS2 DS3\n"); - + deleteDataSets(g.ds(1)); - + assertEquals("E2, data sets: DS3\n", renderGraph(g)); assertModified(g.e(1)); assertDeleted(g.ds(1), g.ds(2)); assertUnmodifiedAndUndeleted(g); } - + @Test public final void testTrashDataSetOfAContainerWhichBelongingToSameExperiment() { EntityGraphGenerator g = parseAndCreateGraph("E1, data sets: DS1 DS2\n" + "DS1, components: DS2\n"); - + deleteDataSets(g.ds(2)); - + assertEquals("E1, data sets: DS1\n", renderGraph(g)); assertModified(g.e(1)); assertModified(g.ds(1)); assertDeleted(g.ds(2)); assertUnmodifiedAndUndeleted(g); } - + @Test public final void testTrashDataSetOfAContainerWhichBelongingToSameExperimentButDifferentSample() { EntityGraphGenerator g = parseAndCreateGraph("E1, samples: S1, data sets: DS1 DS2\n" + "S1, data sets: DS2\n" + "DS1, components: DS2\n"); - + deleteDataSets(g.ds(2)); - + assertEquals("E1, samples: S1, data sets: DS1\n", renderGraph(g)); assertModified(g.e(1)); assertModified(g.s(1)); @@ -535,23 +534,23 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest assertDeleted(g.ds(2)); assertUnmodifiedAndUndeleted(g); } - + @Test public void testTrashDataSetsWithDataSetInAContainer() { EntityGraphGenerator g = parseAndCreateGraph("S1, data sets: DS1[NECT] DS2[NECT] DS3[NET]\n" + "DS1[NECT], components: DS2[NECT]\n" + "DS2[NECT], components: DS3[NET]\n"); - + deleteDataSets(g.ds(2)); - + assertEquals("S1, data sets: DS1[NECT]\n", renderGraph(g)); assertModified(g.s(1)); assertModified(g.ds(1)); assertDeleted(g.ds(2), g.ds(3)); assertUnmodifiedAndUndeleted(g); } - + @Test public void testTrashDataSetsWithDataSetComponentIndirectlyDependentOnOutsideContainer() { @@ -569,7 +568,7 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest assertDeleted(g.ds(1), g.ds(3)); assertUnmodifiedAndUndeleted(g); } - + private void failTrashExperiment(ExperimentNode experimentNode, String expectedErrorMessage) { try @@ -578,11 +577,11 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest fail("UserFailureException expected"); } catch (UserFailureException ex) { - assertEquals(expectedErrorMessage, - ex.getMessage()); + assertEquals(expectedErrorMessage, + ex.getMessage()); } } - + private void failTrashSample(SampleNode sampleNode, String expectedErrorMessage) { String userSessionToken = createAdminUser(); @@ -600,27 +599,26 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest assertEquals(expectedErrorMessage, ex.getMessage()); } } - + protected String createExpectedErrorMessage(SampleNode relatedSample, EntityNode outsiderNode) { String relation = outsiderNode instanceof ExperimentNode ? "belongs to" : "is a component of"; - return "The sample " + entityGraphManager.getSample(relatedSample).getIdentifier() + return "The sample " + entityGraphManager.getSample(relatedSample).getIdentifier() + " " + relation + " the " + render(outsiderNode) + " which is outside the deletion set."; } protected String createExpectedErrorMessage(EntityNode originalNode, EntityNode relatedEntity, EntityNode outsiderNode) { - return "The " + render(originalNode) - + " is a component of the " + render(relatedEntity) + return "The " + render(originalNode) + + " is a component of the " + render(relatedEntity) + " which belongs to the " + render(outsiderNode) + " which is outside the deletion set."; } - + protected String createExpectedErrorMessage(String userID, String... samples) { - return "Authorization failure: Can not delete samples " + Arrays.asList(samples) + return "Authorization failure: Can not delete samples " + Arrays.asList(samples) + " because user " + userID + " does not have enough privileges."; } - private String render(EntityNode entityNode) { @@ -641,8 +639,8 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest } return type + " " + identifier; } - - private void deleteExperiments(ExperimentNode...experimentNodes) + + private void deleteExperiments(ExperimentNode... experimentNodes) { List<String> experimentIdentifiers = new ArrayList<String>(); for (ExperimentNode experimentNode : experimentNodes) @@ -653,7 +651,7 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest flushAndClearHibernateSession(); } - private void deleteSamples(SampleNode...sampleNodes) + private void deleteSamples(SampleNode... sampleNodes) { deleteSamples(createAdminUser(), sampleNodes); } @@ -668,8 +666,8 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest deleteSamples(samplePermIds, userSessionToken); flushAndClearHibernateSession(); } - - private void deleteDataSets(DataSetNode...dataSetNodes) + + private void deleteDataSets(DataSetNode... dataSetNodes) { List<String> dataSetCodes = new ArrayList<String>(); for (DataSetNode dataSetNode : dataSetNodes) @@ -679,17 +677,17 @@ public abstract class AbstractEntityDeletionTestCase extends BaseTest deleteDataSets(dataSetCodes, createAdminUser()); flushAndClearHibernateSession(); } - + private String createAdminUser() { return create(aSession().withInstanceRole(RoleCode.ADMIN)); } - + /** * Trashes specified experiments for specified user session token. */ protected abstract void deleteExperiments(List<String> experimentIdentifiers, String userSessionToken); - + /** * Trashes specified samples for specified user session token. */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignDataSetToExperimentAndSampleTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignDataSetToExperimentAndSampleTest.java index f744a378d262cfa80890824c764bf817d38709d0..3d8e731af4b72704ff0f1ae82f3bff219feb813e 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignDataSetToExperimentAndSampleTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignDataSetToExperimentAndSampleTest.java @@ -38,7 +38,7 @@ public class AssignDataSetToExperimentAndSampleTest extends AbstractDataSetAssig AbstractExternalData dataSet = etlService.tryGetDataSet(systemSessionToken, dataSetCode); if (experimentIdentifierOrNull != null) { - Experiment experiment = etlService.tryGetExperiment(systemSessionToken, + Experiment experiment = etlService.tryGetExperiment(systemSessionToken, ExperimentIdentifierFactory.parse(experimentIdentifierOrNull)); perform(anUpdateOf(dataSet).toExperiment(experiment).as(userSessionToken)); } else diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignDataSetToExperimentAndSampleViaDropBoxAPITest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignDataSetToExperimentAndSampleViaDropBoxAPITest.java index be6a49b568984736e08c24428b33059db8e6abaa..0bc07232b464ac2850c6ac911c05fead499a946e 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignDataSetToExperimentAndSampleViaDropBoxAPITest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignDataSetToExperimentAndSampleViaDropBoxAPITest.java @@ -36,8 +36,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifier; import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifierFactory; /** - * Data set assignment tests for Drop Box API V1/V2 (that is, via {@link IServiceForDataStoreServer#performEntityOperations(String, - * ch.systemsx.cisd.openbis.generic.shared.dto.AtomicEntityOperationDetails)}). + * Data set assignment tests for Drop Box API V1/V2 (that is, via + * {@link IServiceForDataStoreServer#performEntityOperations(String, ch.systemsx.cisd.openbis.generic.shared.dto.AtomicEntityOperationDetails)}). * * @author Franz-Josef Elmer */ @@ -73,7 +73,7 @@ public class AssignDataSetToExperimentAndSampleViaDropBoxAPITest extends Abstrac AtomicEntityOperationDetailsBuilder builder = new AtomicEntityOperationDetailsBuilder(); etlService.performEntityOperations(userSessionToken, builder.dataSetUpdate(dataSetUpdate).getDetails()); } - + private DataSetBatchUpdatesDTO createUpdatesObject(String dataSetCode) { AbstractExternalData dataSet = etlService.tryGetDataSet(systemSessionToken, dataSetCode); @@ -93,7 +93,7 @@ public class AssignDataSetToExperimentAndSampleViaDropBoxAPITest extends Abstrac { dataSetUpdate.setSampleIdentifierOrNull(SampleIdentifierFactory.parse(sample)); } - dataSetUpdate.setProperties(Collections.<IEntityProperty>emptyList()); + dataSetUpdate.setProperties(Collections.<IEntityProperty> emptyList()); updateDetails.setPropertiesToUpdate(new HashSet<String>()); return dataSetUpdate; } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignExperimentToProjectTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignExperimentToProjectTest.java index 3f6f98ae2d2d46b846cb3627425834d8a4c4f3b5..77fe313cab21aff500427dd9fe9d872923d6a42f 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignExperimentToProjectTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignExperimentToProjectTest.java @@ -94,7 +94,7 @@ public class AssignExperimentToProjectTest extends BaseTest } @Test(dataProvider = "rolesNotAllowedToAssignExperimentToProject", expectedExceptions = - { AuthorizationFailureException.class }, groups = "authorization") + { AuthorizationFailureException.class }, groups = "authorization") public void assigningExperimentToProjectIsNotAllowedFor(RoleWithHierarchy sourceSpaceRole, RoleWithHierarchy destinationSpaceRole, RoleWithHierarchy instanceRole) throws Exception diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignProjectToSpaceTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignProjectToSpaceTest.java index e2b8cac271d1d36cad644a5ed95a31461467d6d3..dcb03701d6b38dc08c90963f4609d726ea3481c3 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignProjectToSpaceTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignProjectToSpaceTest.java @@ -90,7 +90,7 @@ public class AssignProjectToSpaceTest extends BaseTest } @Test(dataProvider = "rolesNotAllowedToAssignProjectToSpace", expectedExceptions = - { AuthorizationFailureException.class }, groups = "authorization") + { AuthorizationFailureException.class }, groups = "authorization") public void assigningProjectToSpaceIsNotAllowedFor(RoleWithHierarchy sourceSpaceRole, RoleWithHierarchy destinationSpaceRole, RoleWithHierarchy instanceRole) throws Exception diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignSampleToExperimentTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignSampleToExperimentTest.java index 5d00d24e0f60edba2f9b97b62c443c4590e8b53b..93be25ef514804048bc29b17454276e0ae980f7a 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignSampleToExperimentTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignSampleToExperimentTest.java @@ -32,24 +32,24 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifier; public class AssignSampleToExperimentTest extends AbstractAssignmentSampleToExperimentTestCase { @Override - protected void updateExperimentChangeSamples(String experimentIdentifier, List<String> samplePermIds, + protected void updateExperimentChangeSamples(String experimentIdentifier, List<String> samplePermIds, String userSessionToken) { - Experiment experiment = etlService.tryGetExperiment(systemSessionToken, + Experiment experiment = etlService.tryGetExperiment(systemSessionToken, ExperimentIdentifierFactory.parse(experimentIdentifier)); perform(anUpdateOf(experiment).withSamples(loadSamples(samplePermIds)).as(userSessionToken)); - + } - + @Override - protected void updateSampleChangeExperiment(String samplePermId, String experimentIdentifierOrNull, + protected void updateSampleChangeExperiment(String samplePermId, String experimentIdentifierOrNull, String userSessionToken) { SampleIdentifier sampleIdentifier = etlService.tryGetSampleIdentifier(systemSessionToken, samplePermId); Sample sample = etlService.tryGetSampleWithExperiment(systemSessionToken, sampleIdentifier); if (experimentIdentifierOrNull != null) { - Experiment experiment = etlService.tryGetExperiment(systemSessionToken, + Experiment experiment = etlService.tryGetExperiment(systemSessionToken, ExperimentIdentifierFactory.parse(experimentIdentifierOrNull)); perform(anUpdateOf(sample).toExperiment(experiment).as(userSessionToken)); } else diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignSampleToExperimentViaDropBoxAPITest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignSampleToExperimentViaDropBoxAPITest.java index b1f80d948285e583d2bf9d420a4e773bb3f50d9c..fbb0bb23ec631d45c6c016dd9d233047941e6109 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignSampleToExperimentViaDropBoxAPITest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignSampleToExperimentViaDropBoxAPITest.java @@ -42,7 +42,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifier; public class AssignSampleToExperimentViaDropBoxAPITest extends AbstractAssignmentSampleToExperimentTestCase { @Override - protected void updateExperimentChangeSamples(String experimentIdentifier, List<String> samplePermIds, + protected void updateExperimentChangeSamples(String experimentIdentifier, List<String> samplePermIds, String userSessionToken) { ExperimentIdentifier identifier = ExperimentIdentifierFactory.parse(experimentIdentifier); @@ -51,16 +51,16 @@ public class AssignSampleToExperimentViaDropBoxAPITest extends AbstractAssignmen experimentUpdate.setExperimentId(new TechId(experiment)); experimentUpdate.setProjectIdentifier(identifier); experimentUpdate.setVersion(experiment.getVersion()); - experimentUpdate.setProperties(Collections.<IEntityProperty>emptyList()); - experimentUpdate.setAttachments(Collections.<NewAttachment>emptyList()); + experimentUpdate.setProperties(Collections.<IEntityProperty> emptyList()); + experimentUpdate.setAttachments(Collections.<NewAttachment> emptyList()); Sample[] samples = loadSamples(samplePermIds); experimentUpdate.setSampleCodes(Code.extractCodesToArray(Arrays.asList(samples))); AtomicEntityOperationDetailsBuilder builder = new AtomicEntityOperationDetailsBuilder(); etlService.performEntityOperations(userSessionToken, builder.experimentUpdate(experimentUpdate).getDetails()); } - + @Override - protected void updateSampleChangeExperiment(String samplePermId, String experimentIdentifierOrNull, + protected void updateSampleChangeExperiment(String samplePermId, String experimentIdentifierOrNull, String userSessionToken) { SampleIdentifier sampleIdentifier = etlService.tryGetSampleIdentifier(systemSessionToken, samplePermId); @@ -82,5 +82,5 @@ public class AssignSampleToExperimentViaDropBoxAPITest extends AbstractAssignmen sampleIdentifier, containerIdentifier, null)); etlService.performEntityOperations(userSessionToken, builder.getDetails()); } - + } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignSampleToSpaceTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignSampleToSpaceTest.java index 7a3f1a1eb271d394b4243e45b02b1e95dc9fc579..0a3dc66e6dd8674db40811992b02e8ce9f7794c6 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignSampleToSpaceTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AssignSampleToSpaceTest.java @@ -204,7 +204,7 @@ public class AssignSampleToSpaceTest extends BaseTest } @Test(dataProvider = "rolesNotAllowedToAssignSampleToSpace", expectedExceptions = - { AuthorizationFailureException.class }, groups = "authorization") + { AuthorizationFailureException.class }, groups = "authorization") public void assigningSampleToAnotherSpaceIsNotAllowedFor(RoleWithHierarchy sourceSpaceRole, RoleWithHierarchy destinationSpaceRole, RoleWithHierarchy instanceRole) throws Exception @@ -235,7 +235,7 @@ public class AssignSampleToSpaceTest extends BaseTest } @Test(dataProvider = "rolesNotAllowedToAssignSharedSampleToSpace", expectedExceptions = - { AuthorizationFailureException.class }, groups = "authorization") + { AuthorizationFailureException.class }, groups = "authorization") public void assigningSharedSampleToSpaceIsNotAllowedFor(RoleWithHierarchy destinationSpaceRole, RoleWithHierarchy instanceRole) throws Exception { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AttachmentUploadTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AttachmentUploadTest.java index 1ee5e6358fab8831e69abac04a9aa059c0705625..a6520506bad7a202ec2954b545791b72b7f4e054 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AttachmentUploadTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AttachmentUploadTest.java @@ -36,14 +36,13 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Project; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRowWithObject; /** - * - * * @author Franz-Josef Elmer */ @Test(groups = "system test") public class AttachmentUploadTest extends SystemTestCase { private static final String FILE_CONTENT = "hello world"; + private static final String FILE_NAME = "hello.txt"; @Test @@ -70,33 +69,33 @@ public class AttachmentUploadTest extends SystemTestCase { SessionContext sessionContext = logIntoCommonClientService(); TechId experimentID = new TechId(2); - + uploadFile(FILE_NAME, FILE_CONTENT); commonClientService.addAttachment(experimentID, SESSION_KEY, AttachmentHolderKind.EXPERIMENT, new NewAttachment(FILE_NAME, "my file", "example file")); - + AttachmentWithContent attachmentWithContent = - genericServer.getExperimentFileAttachment(sessionContext.getSessionID(), experimentID, - FILE_NAME, 1); + genericServer.getExperimentFileAttachment(sessionContext.getSessionID(), experimentID, + FILE_NAME, 1); checkUploadedAttachment(experimentID, AttachmentHolderKind.EXPERIMENT, attachmentWithContent); } - + @Test public void testUploadSampleAttachment() { SessionContext sessionContext = logIntoCommonClientService(); TechId sampleID = new TechId(1); - + uploadFile(FILE_NAME, FILE_CONTENT); commonClientService.addAttachment(sampleID, SESSION_KEY, AttachmentHolderKind.SAMPLE, new NewAttachment(FILE_NAME, "my file", "example file")); - + AttachmentWithContent attachmentWithContent = - genericServer.getSampleFileAttachment(sessionContext.getSessionID(), sampleID, - FILE_NAME, 1); + genericServer.getSampleFileAttachment(sessionContext.getSessionID(), sampleID, + FILE_NAME, 1); checkUploadedAttachment(sampleID, AttachmentHolderKind.SAMPLE, attachmentWithContent); } - + private void checkUploadedAttachment(TechId holderID, AttachmentHolderKind holderKind, AttachmentWithContent attachmentWithContent) { @@ -108,17 +107,19 @@ public class AttachmentUploadTest extends SystemTestCase new DefaultResultSetConfig<String, TableModelRowWithObject<AttachmentVersions>>()); GridRowModels<TableModelRowWithObject<AttachmentVersions>> list = attachmentVersions.getResultSet().getList(); - for (GridRowModel<TableModelRowWithObject<AttachmentVersions>> tmrl : list) { - Attachment attachment = tmrl.getOriginalObject().getObjectOrNull().getVersions().get(0); - if (attachment.getFileName().equals(FILE_NAME)) { + for (GridRowModel<TableModelRowWithObject<AttachmentVersions>> tmrl : list) + { + Attachment attachment = tmrl.getOriginalObject().getObjectOrNull().getVersions().get(0); + if (attachment.getFileName().equals(FILE_NAME)) + { assertEquals("my file", attachment.getTitle()); assertEquals("example file", attachment.getDescription()); assertEquals(1, attachment.getVersion()); assertEquals(FILE_CONTENT, new String(attachmentWithContent.getContent())); - return; - } + return; + } } - - fail("Attachment with file name "+FILE_NAME+" was not found"); + + fail("Attachment with file name " + FILE_NAME + " was not found"); } } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AuthenticationSystemTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AuthenticationSystemTest.java index 9c8f5c9c2cdd96c8103e5d51111e700bce1ff662..81c2065e8b046fdcbfa2574e47cea2b580994c5d 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AuthenticationSystemTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/AuthenticationSystemTest.java @@ -28,8 +28,6 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.RoleAssignmentPE; import ch.systemsx.cisd.openbis.generic.shared.dto.SessionContextDTO; /** - * - * * @author Franz-Josef Elmer */ @Test(groups = "system test") @@ -47,7 +45,7 @@ public class AuthenticationSystemTest extends SystemTestCase assertEquals("No 'password' specified.", ex.getMessage()); } } - + @Test public void testTryToAuthenticateAsSystem() { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/EntityDeletionTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/EntityDeletionTest.java index 467002aa4a323d3fd7bd7c4b2fb0f52b9502224e..52ad4b53fd64092c813a52c5ced70ced072df1e7 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/EntityDeletionTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/EntityDeletionTest.java @@ -50,7 +50,7 @@ public class EntityDeletionTest extends AbstractEntityDeletionTestCase List<TechId> experimentIds = TechId.createList(commonServer.listExperiments(userSessionToken, identifiers)); commonServer.deleteExperiments(userSessionToken, experimentIds, "test", DeletionType.TRASH); } - + /** * Trashes specified samples for specified user session token. */ @@ -69,5 +69,5 @@ public class EntityDeletionTest extends AbstractEntityDeletionTestCase { commonServer.deleteDataSets(userSessionToken, dataSetCodes, "test", DeletionType.TRASH, true); } - + } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/EntityOperationTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/EntityOperationTest.java index 75299eb069e808d2855aef258b0ec7062c65563d..d09fbe594fc24040da0a84e1cb2acc4688d8db04 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/EntityOperationTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/EntityOperationTest.java @@ -660,7 +660,7 @@ public class EntityOperationTest extends SystemTestCase assertEquals("[COMMENT: my data]", dataSet.getProperties().toString()); assertEquals("/CISD/PLATE_WELLSEARCH:WELL-A01", dataSet.getSampleIdentifier()); } - + @Test public void testCreateDataSetForUnknownSample() { @@ -669,11 +669,11 @@ public class EntityOperationTest extends SystemTestCase AtomicEntityOperationDetails eo = new EntityOperationBuilder().dataSet( new DataSetBuilder().code(dataSetCode).type("HCS_IMAGE") - .store(new DataStoreBuilder("STANDARD").getStore()) - .fileFormat("XML").location("a/b/c").property("COMMENT", "my data") - .sample(new SampleBuilder().identifier("/CISD/A01").getSample()) - .getDataSet()).create(); - + .store(new DataStoreBuilder("STANDARD").getStore()) + .fileFormat("XML").location("a/b/c").property("COMMENT", "my data") + .sample(new SampleBuilder().identifier("/CISD/A01").getSample()) + .getDataSet()).create(); + try { etlService.performEntityOperations(sessionToken, eo); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/FilterSystemTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/FilterSystemTest.java index cffa26c2a65c199390a4d48dae9aeb3870ce4a84..154322c68803b6dfb7a25214494a1361945d2aa4 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/FilterSystemTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/FilterSystemTest.java @@ -143,8 +143,8 @@ public class FilterSystemTest extends SystemTestCase new HashSet<IColumnDefinition<TableModelRowWithObject<GridCustomFilter>>>(); String[] headerIds = - { "NAME", "DESCRIPTION", "EXPRESSION", "IS_PUBLIC", "REGISTRATOR", - "REGISTRATION_DATE", "MODIFICATION_DATE" }; + { "NAME", "DESCRIPTION", "EXPRESSION", "IS_PUBLIC", "REGISTRATOR", + "REGISTRATION_DATE", "MODIFICATION_DATE" }; for (int i = 0; i < headerIds.length; i++) { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/RegisterDataSetTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/RegisterDataSetTest.java index dbcbc0757885f1243f4fce9d8a2b26f4c7825647..53826844baea2e2dfb12554b203fcfb546c6712f 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/RegisterDataSetTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/RegisterDataSetTest.java @@ -44,14 +44,12 @@ import ch.systemsx.cisd.openbis.systemtest.base.BaseTest; import ch.systemsx.cisd.openbis.systemtest.base.builder.ExternalDataBuilder; /** - * - * * @author Franz-Josef Elmer */ public class RegisterDataSetTest extends BaseTest { private Sample sampleWithExperiment; - + private Sample spaceSampleWithoutExperiment; private Sample sharedSample; @@ -74,10 +72,10 @@ public class RegisterDataSetTest extends BaseTest public void testRegisterDataSetForAnExperiment() throws Exception { AbstractExternalData dataSet = create(aDataSet().inExperiment(experiment)); - + assertThat(dataSet, is(inExperiment(experiment))); } - + @Test public void testRegisterContainerWithNonExistingDataSetForAnExperimentFails() throws Exception { @@ -100,10 +98,10 @@ public class RegisterDataSetTest extends BaseTest List<String> componentDSCodes = new ArrayList<String>(); componentDSCodes.add(component1.getCode()); componentDSCodes.add(component2.getCode()); - + AbstractExternalData dataSet = create(aDataSet().asContainer().withComponents(component1.getCode(), component2.getCode()) .inExperiment(experiment)); - + assertThat(dataSet, is(inExperiment(experiment))); List<AbstractExternalData> components = dataSet.tryGetAsContainerDataSet().getContainedDataSets(); List<String> codes = Code.extractCodes(components); @@ -114,16 +112,16 @@ public class RegisterDataSetTest extends BaseTest assertThat(components.get(1), is(inExperiment(experiment))); assertThat(components.size(), equalTo(2)); } - + @Test public void testRegisterDataSetForADeletedExperiment() throws Exception { - commonServer.deleteExperiments(systemSessionToken, Arrays.asList(new TechId(experiment)), + commonServer.deleteExperiments(systemSessionToken, Arrays.asList(new TechId(experiment)), "t", DeletionType.TRASH); createWithExpectedError(aDataSet().inExperiment(experiment), "Unknown experiment '" + experiment.getIdentifier() + "'."); } - + @Test public void testRegisterDataSetAsContainerForADeletedDataSetFails() throws Exception { @@ -133,7 +131,8 @@ public class RegisterDataSetTest extends BaseTest commonServer.deleteDataSets(systemSessionToken, Arrays.asList(componentDataSet.getCode()), "t", DeletionType.TRASH, true); - try { + try + { create(aDataSet().asContainer().withComponents(componentDataSet.getCode()).inExperiment(experiment)); fail("UserFailureExcpetion expected"); } catch (UserFailureException ex) @@ -146,11 +145,11 @@ public class RegisterDataSetTest extends BaseTest public void testRegisterDataSetForASampleWithExperiment() throws Exception { AbstractExternalData dataSet = create(aDataSet().inSample(sampleWithExperiment)); - + assertThat(dataSet, is(inSample(sampleWithExperiment))); assertThat(dataSet, is(inExperiment(experiment))); } - + @Test public void testRegisterContainerDataSetForASampleWithExperiment() throws Exception { @@ -162,7 +161,7 @@ public class RegisterDataSetTest extends BaseTest AbstractExternalData dataSet = create(aDataSet().asContainer().withComponents(component1.getCode(), component2.getCode()) .inSample(sampleWithExperiment)); - + assertThat(dataSet, is(inSample(sampleWithExperiment))); assertThat(dataSet, is(inExperiment(experiment))); List<AbstractExternalData> components = dataSet.tryGetAsContainerDataSet().getContainedDataSets(); @@ -175,33 +174,33 @@ public class RegisterDataSetTest extends BaseTest assertThat(components.get(1), is(inExperiment(experiment))); assertThat(components.size(), equalTo(2)); } - + @Test public void testRegisterDataSetForADeletedSampleWithExperiment() throws Exception { - commonServer.deleteSamples(systemSessionToken, Arrays.asList(new TechId(sampleWithExperiment)), + commonServer.deleteSamples(systemSessionToken, Arrays.asList(new TechId(sampleWithExperiment)), "t", DeletionType.TRASH); - createWithExpectedError(aDataSet().inSample(sampleWithExperiment), + createWithExpectedError(aDataSet().inSample(sampleWithExperiment), "No sample could be found with given identifier '" + sampleWithExperiment.getIdentifier() + "'."); } @Test public void testRegisterDataSetForASampleWithDeletedExperiment() throws Exception { - commonServer.deleteExperiments(systemSessionToken, Arrays.asList(new TechId(experiment)), + commonServer.deleteExperiments(systemSessionToken, Arrays.asList(new TechId(experiment)), "t", DeletionType.TRASH); - createWithExpectedError(aDataSet().inSample(sampleWithExperiment), + createWithExpectedError(aDataSet().inSample(sampleWithExperiment), "No sample could be found with given identifier '" + sampleWithExperiment.getIdentifier() + "'."); } - + @Test public void testRegisterDataSetForASampleWithoutExperiment() throws Exception { AbstractExternalData dataSet = create(aDataSet().withType("NO-EXP-TYPE").inSample(spaceSampleWithoutExperiment)); - + assertThat(dataSet, is(inSample(spaceSampleWithoutExperiment))); } - + @Test public void testRegisterContainerDataSetAndItsComponentsForASampleWithoutExperiment() throws Exception { @@ -230,7 +229,7 @@ public class RegisterDataSetTest extends BaseTest AbstractExternalData componentDataSet = create(aDataSet().inSample(sampleWithExperiment)); AbstractExternalData dataSet = create(aDataSet().withType("NEXP-CONTAINER-TYPE") .asContainer().withComponent(componentDataSet).inSample(spaceSampleWithoutExperiment)); - + assertThat(dataSet, is(inSample(spaceSampleWithoutExperiment))); List<AbstractExternalData> components = dataSet.tryGetAsContainerDataSet().getContainedDataSets(); List<String> codes = Code.extractCodes(components); @@ -240,37 +239,37 @@ public class RegisterDataSetTest extends BaseTest assertThat(components.get(0), is(inExperiment(experiment))); assertThat(components.size(), equalTo(1)); } - + @Test public void testRegisterDataSetForASampleWithoutExperimentButWrongDataSetType() throws Exception { - createWithExpectedError(aDataSet().inSample(spaceSampleWithoutExperiment), - "Data set can not be registered because no experiment found for sample '" - + spaceSampleWithoutExperiment.getIdentifier() + "'."); + createWithExpectedError(aDataSet().inSample(spaceSampleWithoutExperiment), + "Data set can not be registered because no experiment found for sample '" + + spaceSampleWithoutExperiment.getIdentifier() + "'."); } @Test public void testRegisterDataSetForASharedSample() throws Exception { - createWithExpectedError(aDataSet().withType("NEXP-TYPE").inSample(sharedSample), - "Data set can not be registered because sample '" + sharedSample.getIdentifier() - + "' is a shared sample."); + createWithExpectedError(aDataSet().withType("NEXP-TYPE").inSample(sharedSample), + "Data set can not be registered because sample '" + sharedSample.getIdentifier() + + "' is a shared sample."); } - + @Test public void testRegisterDataSetForSampleWithoutExperimentViaPerformEntityOperation() throws Exception { NewExternalData newDataSet = aDataSet().withType("NO-EXP-TYPE2") .inSample(spaceSampleWithoutExperiment).get(); AtomicEntityOperationDetails operationDetails = new EntityOperationBuilder().dataSet(newDataSet).create(); - + AtomicEntityOperationResult operationResult = etlService.performEntityOperations(systemSessionToken, operationDetails); - + assertThat((int) operationResult.getDataSetsCreatedCount(), equalTo(1)); AbstractExternalData dataSet = etlService.tryGetDataSet(systemSessionToken, newDataSet.getCode()); assertThat(dataSet, is(inSample(spaceSampleWithoutExperiment))); } - + private void createWithExpectedError(ExternalDataBuilder dataSetBuilder, String expectedErrorMessage) { try @@ -282,6 +281,5 @@ public class RegisterDataSetTest extends BaseTest assertEquals(expectedErrorMessage, ex.getMessage()); } } - } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/SystemTestCase.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/SystemTestCase.java index 9c2f9407b498d88992e582cedcdb4414a6afb548..67d98c2f940e09f8cf5227eccd7866eefb87fec8 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/SystemTestCase.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/SystemTestCase.java @@ -82,7 +82,7 @@ import ch.systemsx.cisd.openbis.plugin.generic.shared.IGenericServer; public abstract class SystemTestCase extends AbstractTransactionalTestNGSpringContextTests { private static final String SOURCE_TEST_CORE_PLUGINS = "sourceTest/core-plugins"; - + protected static final String SESSION_KEY = "session-key"; protected ICommonServerForInternalUse commonServer; diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/TypedTableAssertions.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/TypedTableAssertions.java index 6f126b9c427e5c84db8ebdc1eefba123fc9d342f..a97234a134325754146e9021e351360f5a39edd8 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/TypedTableAssertions.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/TypedTableAssertions.java @@ -20,8 +20,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelColumnHeader; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRowWithObject; /** - * A utility class that can be used to simplify assertions in {@link TypedTableGrid}-related - * headless system tests. + * A utility class that can be used to simplify assertions in {@link TypedTableGrid}-related headless system tests. * * @author Kaloyan Enimanev */ @@ -29,8 +28,7 @@ public class TypedTableAssertions<T extends Serializable> extends AssertJUnit { /** - * a convenience method, that can be used as a static import to achieve a fluent-API like - * programming style. + * a convenience method, that can be used as a static import to achieve a fluent-API like programming style. */ public static <S extends Serializable> TypedTableAssertions<S> assertTable( TypedTableResultSet<S> tableResultSet) @@ -39,8 +37,7 @@ public class TypedTableAssertions<T extends Serializable> extends AssertJUnit } /** - * a convenience method, that can be used as a static import to achieve a fluent-API like - * programming style. + * a convenience method, that can be used as a static import to achieve a fluent-API like programming style. */ public static <S extends Serializable> TypedTableAssertions<S>.ColumnAssertions assertColumn( TypedTableResultSet<S> tableResultSet, String columnName) @@ -53,8 +50,7 @@ public class TypedTableAssertions<T extends Serializable> extends AssertJUnit private Map<String, TableModelColumnHeader> headers; /** - * the constructor is tentatively marked as "private" for now. We could make it public in the - * future if we decide it will suite our tests better. + * the constructor is tentatively marked as "private" for now. We could make it public in the future if we decide it will suite our tests better. * * @param tableResultSet the typed-table result set */ @@ -208,8 +204,7 @@ public class TypedTableAssertions<T extends Serializable> extends AssertJUnit } /** - * just a convenience method redirecting to the {@link #containsValue(String)} with a single - * parameter. + * just a convenience method redirecting to the {@link #containsValue(String)} with a single parameter. */ public void containsValues(String... values) { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UnassignSampleFromExperimentTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UnassignSampleFromExperimentTest.java index 827f840af8982cdce8da60150cb7e55ec5111ac3..866b235fd84e137489b3ce9430483c179d810fa2 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UnassignSampleFromExperimentTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UnassignSampleFromExperimentTest.java @@ -67,7 +67,7 @@ public class UnassignSampleFromExperimentTest extends BaseTest } @Test(expectedExceptions = - { UserFailureException.class }) + { UserFailureException.class }) public void unassigningFailsIfTheSampleHasDataSets() throws Exception { Sample sample = create(aSample().inExperiment(experiment)); @@ -199,7 +199,7 @@ public class UnassignSampleFromExperimentTest extends BaseTest } @Test(dataProvider = "rolesNotAllowedToUnassignSampleFromExperiment", expectedExceptions = - { AuthorizationFailureException.class }, groups = "authorization") + { AuthorizationFailureException.class }, groups = "authorization") public void unassigningIsNotAllowedFor(RoleWithHierarchy spaceRole, RoleWithHierarchy instanceRole) throws Exception { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UnassignSampleFromSpaceTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UnassignSampleFromSpaceTest.java index 03aef15ee9d39c2cde4bad5c4d1f536250dd1f3b..14175113471a6b68896678433e7e7f6642739aec 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UnassignSampleFromSpaceTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UnassignSampleFromSpaceTest.java @@ -78,7 +78,7 @@ public class UnassignSampleFromSpaceTest extends BaseTest } @Test(expectedExceptions = - { UserFailureException.class }) + { UserFailureException.class }) public void sampleWithDataSetCannotBeUnassignedFromSpace() throws Exception { Sample sample = create(aSample().inExperiment(experiment)); @@ -88,7 +88,7 @@ public class UnassignSampleFromSpaceTest extends BaseTest } @Test(expectedExceptions = - { UserFailureException.class }) + { UserFailureException.class }) public void childSampleCantBeUnassignedFromSpace() throws Exception { Sample parent = create(aSample().inExperiment(experiment)); @@ -122,7 +122,7 @@ public class UnassignSampleFromSpaceTest extends BaseTest } @Test(expectedExceptions = - { UserFailureException.class }) + { UserFailureException.class }) public void componentOfSpaceLevelSampleCantBeUnassignedFromSpace() throws Exception { Sample container = create(aSample().inExperiment(experiment)); @@ -174,7 +174,7 @@ public class UnassignSampleFromSpaceTest extends BaseTest } @Test(dataProvider = "rolesNotAllowedToUnassignSampleFromSpace", expectedExceptions = - { AuthorizationFailureException.class }, groups = "authorization") + { AuthorizationFailureException.class }, groups = "authorization") public void unassigningIsNotAllowedFor(RoleWithHierarchy spaceRole, RoleWithHierarchy instanceRole) throws Exception { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UpdateDataSetParentsTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UpdateDataSetParentsTest.java index 21868af0a5c48caea4f10546a2a5ec84ec9d3b8d..bb0b70cdd8866b76ea788533915b1901358634fd 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UpdateDataSetParentsTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UpdateDataSetParentsTest.java @@ -111,7 +111,7 @@ public class UpdateDataSetParentsTest extends BaseTest } @Test(expectedExceptions = - { UserFailureException.class }) + { UserFailureException.class }) public void dataSetCannotBeItsOwnParent() throws Exception { AbstractExternalData data = create(aDataSet().inSample(sample)); @@ -120,7 +120,7 @@ public class UpdateDataSetParentsTest extends BaseTest } @Test(expectedExceptions = - { UserFailureException.class }) + { UserFailureException.class }) public void dataSetCannotBeItsOwnGrandParent() throws Exception { AbstractExternalData parent = create(aDataSet().inSample(sample)); @@ -170,7 +170,7 @@ public class UpdateDataSetParentsTest extends BaseTest } @Test(dataProvider = "rolesNotAllowedToAddParentToDataSet", expectedExceptions = - { AuthorizationFailureException.class }, groups = "authorization") + { AuthorizationFailureException.class }, groups = "authorization") public void addingParentToDataSetNotIsAllowedFor(RoleWithHierarchy childSpaceRole, RoleWithHierarchy parentSpaceRole, RoleWithHierarchy instanceRole) throws Exception { @@ -203,7 +203,7 @@ public class UpdateDataSetParentsTest extends BaseTest } @Test(dataProvider = "rolesNotAllowedToRemoveParentFromDataSet", expectedExceptions = - { AuthorizationFailureException.class }, groups = "authorization") + { AuthorizationFailureException.class }, groups = "authorization") public void removingParentFromDataSetNotIsAllowedFor(RoleWithHierarchy childSpaceRole, RoleWithHierarchy parentSpaceRole, RoleWithHierarchy instanceRole) throws Exception { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UpdateDataSetTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UpdateDataSetTest.java index bf0a117e4dde2585b4fcec15b1575d0430773786..dbf31561d7a02dc16fb6aab0ab6e2132434cb89b 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UpdateDataSetTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UpdateDataSetTest.java @@ -19,35 +19,36 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.ExperimentIdentifi import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifierFactory; import ch.systemsx.cisd.openbis.systemtest.base.BaseTest; -public class UpdateDataSetTest extends BaseTest{ - +public class UpdateDataSetTest extends BaseTest +{ + Sample sample; - - @BeforeMethod - void createFixture() throws Exception - { - Space space = create(aSpace()); - Project project = create(aProject().inSpace(space)); - Experiment experiment = create(anExperiment().inProject(project)); - sample = create(aSample().inExperiment(experiment)); - } - - @Test - public void dataSetUpdateDoesntSetSampleToNull() { - AbstractExternalData dataSet = create(aDataSet().inSample(sample)); - DataSetBatchUpdatesDTO update = new DataSetBatchUpdatesDTO(); - update.setDatasetId(new TechId(dataSet)); - update.setDatasetCode(dataSet.getCode()); - update.setVersion(dataSet.getVersion()); - update.setDetails(new DataSetBatchUpdateDetails()); - update.setProperties(Collections.<IEntityProperty>emptyList()); - update.setSampleIdentifierOrNull(SampleIdentifierFactory.parse(dataSet.getSample())); - update.setExperimentIdentifierOrNull(ExperimentIdentifierFactory.parse(dataSet.getExperiment().getIdentifier())); - - etlService.performEntityOperations(systemSessionToken, new AtomicEntityOperationDetailsBuilder().dataSetUpdate(update).getDetails()); - - assertThat(dataSet, inSample(sample)); - assertThat(dataSet, inExperiment(sample.getExperiment())); - } + @BeforeMethod + void createFixture() throws Exception + { + Space space = create(aSpace()); + Project project = create(aProject().inSpace(space)); + Experiment experiment = create(anExperiment().inProject(project)); + sample = create(aSample().inExperiment(experiment)); + } + + @Test + public void dataSetUpdateDoesntSetSampleToNull() + { + AbstractExternalData dataSet = create(aDataSet().inSample(sample)); + DataSetBatchUpdatesDTO update = new DataSetBatchUpdatesDTO(); + update.setDatasetId(new TechId(dataSet)); + update.setDatasetCode(dataSet.getCode()); + update.setVersion(dataSet.getVersion()); + update.setDetails(new DataSetBatchUpdateDetails()); + update.setProperties(Collections.<IEntityProperty> emptyList()); + update.setSampleIdentifierOrNull(SampleIdentifierFactory.parse(dataSet.getSample())); + update.setExperimentIdentifierOrNull(ExperimentIdentifierFactory.parse(dataSet.getExperiment().getIdentifier())); + + etlService.performEntityOperations(systemSessionToken, new AtomicEntityOperationDetailsBuilder().dataSetUpdate(update).getDetails()); + + assertThat(dataSet, inSample(sample)); + assertThat(dataSet, inExperiment(sample.getExperiment())); + } } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UpdateSampleContainmentTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UpdateSampleContainmentTest.java index c45ee31b55964ef3e6dfdf640ce57eef167468f0..b9044fe163e5cb28fa0b39a3a28eec389e2e36b7 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UpdateSampleContainmentTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UpdateSampleContainmentTest.java @@ -75,7 +75,7 @@ public class UpdateSampleContainmentTest extends BaseTest } @Test(expectedExceptions = - { UserFailureException.class }) + { UserFailureException.class }) public void componentCantBeSharedSample() throws Exception { Sample container = create(aSample().inSpace(space)); @@ -109,7 +109,7 @@ public class UpdateSampleContainmentTest extends BaseTest } @Test(expectedExceptions = - { UserFailureException.class }) + { UserFailureException.class }) public void sampleCannotBeUpdatedToBeComponentOfComponentSample() throws Exception { Sample container = create(aSample().inSpace(space)); @@ -120,7 +120,7 @@ public class UpdateSampleContainmentTest extends BaseTest } @Test(expectedExceptions = - { UserFailureException.class }) + { UserFailureException.class }) public void sampleCanContainItself() throws Exception { Sample sample = create(aSample().inSpace(space)); @@ -155,7 +155,7 @@ public class UpdateSampleContainmentTest extends BaseTest } @Test(dataProvider = "rolesNotAllowedToSetContainerToSample", expectedExceptions = - { AuthorizationFailureException.class }, groups = "authorization") + { AuthorizationFailureException.class }, groups = "authorization") public void settingContainerToSampleIsNotAllowedFor(RoleWithHierarchy containerSpaceRole, RoleWithHierarchy componentSpaceRole, RoleWithHierarchy instanceRole) throws Exception { @@ -188,7 +188,7 @@ public class UpdateSampleContainmentTest extends BaseTest } @Test(dataProvider = "rolesNotAllowedToRemoveContainerFromSample", expectedExceptions = - { AuthorizationFailureException.class }, groups = "authorization") + { AuthorizationFailureException.class }, groups = "authorization") public void removingContainerFromSampleIsNotAllowedFor(RoleWithHierarchy containerSpaceRole, RoleWithHierarchy componentSpaceRole, RoleWithHierarchy instanceRole) throws Exception { @@ -237,7 +237,7 @@ public class UpdateSampleContainmentTest extends BaseTest rule(containerDomain, RoleWithHierarchy.SPACE_ETL_SERVER)), rule(componentDomain, RoleWithHierarchy.SPACE_POWER_USER) - ), + ), and(rule(componentDomain, RoleWithHierarchy.SPACE_USER), rule(instance, RoleWithHierarchy.INSTANCE_ETL_SERVER))); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UpdateSampleParentsTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UpdateSampleParentsTest.java index f06dedd27351b49722f13a25d86cf63dd2201efa..228e9f069f5404a7f80432deb0e5e60cfaed64b3 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UpdateSampleParentsTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/UpdateSampleParentsTest.java @@ -102,7 +102,7 @@ public class UpdateSampleParentsTest extends BaseTest } @Test(expectedExceptions = - { UserFailureException.class }) + { UserFailureException.class }) public void sampleCantBeItsOwnParent() throws Exception { Sample sample = create(aSample().inSpace(space)); @@ -111,7 +111,7 @@ public class UpdateSampleParentsTest extends BaseTest } @Test(expectedExceptions = - { UserFailureException.class }) + { UserFailureException.class }) public void sampleCantBeItsOwnGrandParent() throws Exception { Sample parent = create(aSample().inSpace(space)); @@ -133,7 +133,7 @@ public class UpdateSampleParentsTest extends BaseTest } @Test(expectedExceptions = - { UserFailureException.class }) + { UserFailureException.class }) public void childCannotBeShared() throws Exception { Sample parent = create(aSample().inSpace(space)); @@ -163,7 +163,7 @@ public class UpdateSampleParentsTest extends BaseTest } @Test(dataProvider = "rolesNotAllowedToAddParentToSample", expectedExceptions = - { AuthorizationFailureException.class }, groups = "authorization") + { AuthorizationFailureException.class }, groups = "authorization") public void addingParentToSampleIsNotAllowedFor(RoleWithHierarchy spaceRole, RoleWithHierarchy instanceRole) throws Exception { @@ -193,7 +193,7 @@ public class UpdateSampleParentsTest extends BaseTest } @Test(dataProvider = "rolesNotAllowedToAddParentToSample", expectedExceptions = - { AuthorizationFailureException.class }, groups = "authorization") + { AuthorizationFailureException.class }, groups = "authorization") public void addingParentToSampleInDifferentSpaceIsNotAllowedFor(RoleWithHierarchy spaceRole, RoleWithHierarchy instanceRole) throws Exception { @@ -224,7 +224,7 @@ public class UpdateSampleParentsTest extends BaseTest } @Test(dataProvider = "rolesNotAllowedToAddParentToSample", expectedExceptions = - { AuthorizationFailureException.class }, groups = "authorization") + { AuthorizationFailureException.class }, groups = "authorization") public void removingParentToSampleIsNotAllowedFor(RoleWithHierarchy spaceRole, RoleWithHierarchy instanceRole) throws Exception { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/common/json/JsonApiClient.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/common/json/JsonApiClient.java index be76ee7a6cedb873c27ee0d99d5e1ff098e1137e..5dd2530d3c40f0b325f43cc5ece3788094edfdb0 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/common/json/JsonApiClient.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/common/json/JsonApiClient.java @@ -36,37 +36,15 @@ public class JsonApiClient public JsonNode sendRequest(String json, Object... params) throws Exception { /* - String jsonWithParams = String.format(json, params); - - HttpClient client = new DefaultHttpClient(); - HttpPost post = new HttpPost(apiUrl); - - // add header - post.setHeader("User-Agent", USER_AGENT); - - post.setEntity(new StringEntity(jsonWithParams)); - - HttpResponse response = client.execute(post); - System.out.println(">>>>>"); - System.out.println("Sending 'POST' request to URL : " + apiUrl); - System.out.println("Post parameters : " + jsonWithParams.trim()); - System.out.println("Response Code : " + - response.getStatusLine().getStatusCode()); - - BufferedReader rd = new BufferedReader( - new InputStreamReader(response.getEntity().getContent())); - - StringBuffer result = new StringBuffer(); - String line = ""; - while ((line = rd.readLine()) != null) - { - result.append(line); - } - - System.out.println("Response : " + result.toString()); - System.out.println("<<<<<"); - return new ObjectMapper().readTree(result.toString()); - */ + * String jsonWithParams = String.format(json, params); HttpClient client = new DefaultHttpClient(); HttpPost post = new HttpPost(apiUrl); // + * add header post.setHeader("User-Agent", USER_AGENT); post.setEntity(new StringEntity(jsonWithParams)); HttpResponse response = + * client.execute(post); System.out.println(">>>>>"); System.out.println("Sending 'POST' request to URL : " + apiUrl); + * System.out.println("Post parameters : " + jsonWithParams.trim()); System.out.println("Response Code : " + + * response.getStatusLine().getStatusCode()); BufferedReader rd = new BufferedReader( new + * InputStreamReader(response.getEntity().getContent())); StringBuffer result = new StringBuffer(); String line = ""; while ((line = + * rd.readLine()) != null) { result.append(line); } System.out.println("Response : " + result.toString()); System.out.println("<<<<<"); return + * new ObjectMapper().readTree(result.toString()); + */ return null; } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/v1/GeneralInformationServiceTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/v1/GeneralInformationServiceTest.java index b9b790d1a5f7d845d747345b929a4effcb74560c..e6ef8d91fdb3069a5b3fc4c2a3a8d5ffce15a7eb 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/v1/GeneralInformationServiceTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/v1/GeneralInformationServiceTest.java @@ -2077,7 +2077,7 @@ public class GeneralInformationServiceTest extends SystemTestCase new MetaprojectTechIdId(metaProjects.get(1).getId()), "test"); assertEquals("[MaterialIdentifier [materialCode=AD3, " + "materialTypeIdentifier=MaterialTypeIdentifier [materialTypeCode=VIRUS]]]", mas - .getMaterials().toString()); + .getMaterials().toString()); assertEntities("[/CISD/NEMO/EXP11, /TEST-SPACE/TEST-PROJECT/EXP-SPACE-TEST]", mas.getExperiments()); assertEquals("[Sample[/TEST-SPACE/EV-TEST,VALIDATE_CHILDREN,{},parents=?,children=?]]", mas diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/authorization/CommonServerAuthorizationTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/authorization/CommonServerAuthorizationTest.java index a13810cd58dbf1dbce5b5242468df707be9266fc..91be8ea0ac72eca09391cd1341377761f4ca1435 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/authorization/CommonServerAuthorizationTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/authorization/CommonServerAuthorizationTest.java @@ -59,8 +59,8 @@ public class CommonServerAuthorizationTest extends BaseTest assertEquals("S2", space.getCode()); TechId ds3Id = new TechId(ds3.getId()); String user = create(aSession().withSpaceRole(RoleCode.ADMIN, space)); - - List<AbstractExternalData> children = commonServer.listDataSetRelationships(user, ds3Id,DataSetRelationshipRole.PARENT); + + List<AbstractExternalData> children = commonServer.listDataSetRelationships(user, ds3Id, DataSetRelationshipRole.PARENT); assertEquals("[" + ds2.getCode() + "]", Code.extractCodes(children).toString()); List<AbstractExternalData> parents = commonServer.listDataSetRelationships(user, ds3Id, DataSetRelationshipRole.CHILD); assertEquals("[" + ds5.getCode() + "]", Code.extractCodes(parents).toString()); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/authorization/ETLServiceAuthorizationTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/authorization/ETLServiceAuthorizationTest.java index a5c09442550feb0284a1fbf4538a0666163afac8..adea353f539ceb64f41e75b423c3a33811b831d4 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/authorization/ETLServiceAuthorizationTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/authorization/ETLServiceAuthorizationTest.java @@ -96,7 +96,7 @@ public class ETLServiceAuthorizationTest extends BaseTest } @Test(expectedExceptions = - { AuthorizationFailureException.class }) + { AuthorizationFailureException.class }) public void testListSamplesForObserverForAnotherSpace() { String sessionToken = @@ -129,7 +129,7 @@ public class ETLServiceAuthorizationTest extends BaseTest } @Test(expectedExceptions = - { AuthorizationFailureException.class }) + { AuthorizationFailureException.class }) public void testRegistrationOfSamplesForUnauthorizedUser() { String sessionToken = create(aSession().withInstanceRole(RoleWithHierarchy.INSTANCE_ADMIN)); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/authorization/PersonManagementTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/authorization/PersonManagementTest.java index ea6528c23c6f821bdcb919d12fead9a49ee438b8..b48e9255ac41210efeb1c463590a3b3cc620ae7a 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/authorization/PersonManagementTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/authorization/PersonManagementTest.java @@ -50,6 +50,7 @@ import ch.systemsx.cisd.openbis.util.LogRecordingUtils; public class PersonManagementTest extends BaseTest { private BufferedAppender logRecorder; + private int initialNumberOfActivePersons; @BeforeMethod diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/BaseTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/BaseTest.java index 60d27e7006a0b05eb0874be8a3ad3f9baaebce46..7d0e69149432a85f86d0b93467c05328dfbfa8fc 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/BaseTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/BaseTest.java @@ -510,7 +510,7 @@ public abstract class BaseTest extends AbstractTransactionalTestNGSpringContextT { return parseAndCreateGraph(graphDefinition, true); } - + protected EntityGraphGenerator parseAndCreateGraph(String graphDefinition, boolean startNewTransaction) { EntityGraphGenerator graphGenerator = entityGraphManager.parseAndCreateGraph(graphDefinition); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/RelationshipServiceStub.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/RelationshipServiceStub.java index f9d9ed13b301ae806369397ef7995c71b9460ffe..1eeb0e0e26fa07d3742131f5705e26f073a893b0 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/RelationshipServiceStub.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/RelationshipServiceStub.java @@ -130,13 +130,13 @@ public class RelationshipServiceStub implements IRelationshipService public void assignSampleToProject(IAuthSession session, SamplePE sample, ProjectPE project) { // TODO Auto-generated method stub - + } @Override public void unassignSampleFromProject(IAuthSession session, SamplePE sample) { // TODO Auto-generated method stub - + } } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/builder/Builder.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/builder/Builder.java index c58b8ce407bdd270366c3414882c8893a721483b..d6f1991a87089f851ffa2ff369583a17fb605c58 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/builder/Builder.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/builder/Builder.java @@ -42,6 +42,6 @@ public abstract class Builder<T> this.sessionToken = token; return this; } - + public abstract T create(); } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/builder/DataSetUpdateBuilder.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/builder/DataSetUpdateBuilder.java index 05562e991d118b4e0798863706dc1ec6b48de209..cc16956e0b2626848b826bf44594687822275469 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/builder/DataSetUpdateBuilder.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/builder/DataSetUpdateBuilder.java @@ -115,7 +115,7 @@ public class DataSetUpdateBuilder extends UpdateBuilder<DataSetUpdatesDTO> this.sampleIdentifier = null; return this; } - + public DataSetUpdateBuilder withContainer(AbstractExternalData dataSet) { this.containerCode = dataSet.getCode(); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/builder/ExternalDataBuilder.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/builder/ExternalDataBuilder.java index accaffc8ddbc97bb5727acb52e313e49567a12a2..6015bd0bc8373ed99b177bf213c2566e73b1cd42 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/builder/ExternalDataBuilder.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/builder/ExternalDataBuilder.java @@ -63,11 +63,11 @@ public class ExternalDataBuilder extends Builder<AbstractExternalData> private List<String> parentCodes; private List<String> componentCodes; - + private Map<String, String> properties; private String code; - + private String dataSetTypeCode; private boolean container; @@ -99,7 +99,7 @@ public class ExternalDataBuilder extends Builder<AbstractExternalData> } return this; } - + public ExternalDataBuilder inExperiment(Experiment experiment) { this.experimentIdentifier = new ExperimentIdentifier(experiment); @@ -131,7 +131,7 @@ public class ExternalDataBuilder extends Builder<AbstractExternalData> componentCodes.addAll(Arrays.asList(dataSetCodes)); return this; } - + public ExternalDataBuilder withComponent(AbstractExternalData data) { return this.withComponents(data.getCode()); @@ -142,7 +142,7 @@ public class ExternalDataBuilder extends Builder<AbstractExternalData> properties.put(propertyTypeCode, value); return this; } - + @Override public AbstractExternalData create() { @@ -216,7 +216,7 @@ public class ExternalDataBuilder extends Builder<AbstractExternalData> { if (properties.isEmpty() == false) { - Set<String> knownPropertyTypes = new HashSet<String>(); + Set<String> knownPropertyTypes = new HashSet<String>(); List<DataSetTypePropertyType> assignedPropertyTypes = type.getAssignedPropertyTypes(); for (DataSetTypePropertyType dtpt : assignedPropertyTypes) { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/builder/UpdateBuilder.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/builder/UpdateBuilder.java index 54cd93c58f3085a376992caba5f375612ceffefb..987bc4797c6faed07127674ffdf40bac86d6394c 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/builder/UpdateBuilder.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/base/builder/UpdateBuilder.java @@ -35,6 +35,6 @@ public abstract class UpdateBuilder<T> extends Builder<T> this.sessionToken = token; return this; } - + public abstract void perform(); } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/entitygraph/EntityGraphManager.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/entitygraph/EntityGraphManager.java index aa784dd92f0445c8f248f0ca99706b88cd8f2f14..44334e3ef052596d9088217006b4ced46b41acc0 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/entitygraph/EntityGraphManager.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/entitygraph/EntityGraphManager.java @@ -75,50 +75,54 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifierFa import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SpaceIdentifier; /** - * Helper class which creates a graph of entities of kind experiment, sample, and data set based on a - * textual description. A simple language defines the entities (experiments, samples, and data sets) and its relations. - * From the textual definition of the graph real entities are created in the database. The actual graph of - * entities as stored in the data base can be rendered in the same language used for parsing. This allows to - * checked expected changes after some (re-)assignment between the entities has been performed. It is also - * possible to checked whether the entities have been modified (i.e. modifier and modification date have been changed) - * or not. Here is an example: + * Helper class which creates a graph of entities of kind experiment, sample, and data set based on a textual description. A simple language defines + * the entities (experiments, samples, and data sets) and its relations. From the textual definition of the graph real entities are created in the + * database. The actual graph of entities as stored in the data base can be rendered in the same language used for parsing. This allows to checked + * expected changes after some (re-)assignment between the entities has been performed. It is also possible to checked whether the entities have been + * modified (i.e. modifier and modification date have been changed) or not. Here is an example: + * * <pre> - * EntityGraphGenerator g = entityGraphManager.parseAndCreateGraph("E1, data sets: DS4\n" - + "S1, data sets: DS1[NECT] DS2[NECT]\n" - + "S2\n" - + "S3, data sets: DS3[NET]\n" - + "DS1[NECT], components: DS2[NECT] DS3[NET]\n" - + "DS2[NECT], components: DS4"); - - reassignToSample(g.ds(1), g.s(2)); - - assertEquals("E1, data sets: DS4\n" - + "S2, data sets: DS1[NECT] DS2[NECT]\n" - + "S3, data sets: DS3[NET]\n" - + "DS1[NECT], components: DS2[NECT] DS3[NET]\n" - + "DS2[NECT], components: DS4\n", entityGraphManager.renderGraph(g)); - entityGraphManager.assertModified(g.s(1), g.s(2)); - entityGraphManager.assertModified(g.ds(1), g.ds(2)); - entityGraphManager.assertUnmodified(g); + * EntityGraphGenerator g = entityGraphManager.parseAndCreateGraph("E1, data sets: DS4\n" + * + "S1, data sets: DS1[NECT] DS2[NECT]\n" + * + "S2\n" + * + "S3, data sets: DS3[NET]\n" + * + "DS1[NECT], components: DS2[NECT] DS3[NET]\n" + * + "DS2[NECT], components: DS4"); + * + * reassignToSample(g.ds(1), g.s(2)); + * + * assertEquals("E1, data sets: DS4\n" + * + "S2, data sets: DS1[NECT] DS2[NECT]\n" + * + "S3, data sets: DS3[NET]\n" + * + "DS1[NECT], components: DS2[NECT] DS3[NET]\n" + * + "DS2[NECT], components: DS4\n", entityGraphManager.renderGraph(g)); + * entityGraphManager.assertModified(g.s(1), g.s(2)); + * entityGraphManager.assertModified(g.ds(1), g.ds(2)); + * entityGraphManager.assertUnmodified(g); * </pre> * - * * @author Franz-Josef Elmer */ public class EntityGraphManager { private final IServiceForDataStoreServer service; + private final ICommonServerForInternalUse commonService; + private final SessionFactory sessionFactory; + private final String sessionToken; - + private Space defaultSpace; + private Project defaultProject; + private ExperimentType defaultExperimentType; + private SampleType defaultSampleType; - + private EntityRepository repository; - + public EntityGraphManager(IServiceForDataStoreServer service, ICommonServerForInternalUse commonService, SessionFactory sessionFactory, String sessionToken) { @@ -127,7 +131,7 @@ public class EntityGraphManager this.sessionFactory = sessionFactory; this.sessionToken = sessionToken; } - + public EntityGraphGenerator parseAndCreateGraph(String graphDefinition) { EntityGraphGenerator g = new EntityGraphGenerator(); @@ -137,7 +141,7 @@ public class EntityGraphManager repository.gatherModifictaionInfos(); return g; } - + public void addToRepository(ExperimentNode experimentNode, Experiment experiment) { repository.put(experimentNode, experiment); @@ -152,7 +156,7 @@ public class EntityGraphManager { repository.assertDeleted(experimentNodes); } - + public void assertModified(SampleNode[] sampleNodes) { repository.assertModified(sampleNodes); @@ -162,7 +166,7 @@ public class EntityGraphManager { repository.assertDeleted(sampleNodes); } - + public void assertModified(DataSetNode[] dataSetNodes) { repository.assertModified(dataSetNodes); @@ -172,7 +176,7 @@ public class EntityGraphManager { repository.assertDeleted(dataSetNodes); } - + public void assertUnmodified(EntityGraphGenerator g) { repository.assertUnmodified(g); @@ -182,7 +186,7 @@ public class EntityGraphManager { repository.assertUndeleted(g); } - + public String getIdentifierOfDefaultProject() { return defaultProject.getIdentifier(); @@ -192,12 +196,12 @@ public class EntityGraphManager { return repository.getExperimentIdentifierOrNull(experimentNodeOrNull); } - + public Sample getSample(SampleNode sampleNode) { return repository.getSample(sampleNode); } - + public Sample tryGetSample(SampleNode sampleNode) { return repository.tryGetSample(sampleNode); @@ -207,12 +211,12 @@ public class EntityGraphManager { return repository.getSamplePermIdOrNull(sampleNodeOrNull); } - + public AbstractExternalData getDataSet(DataSetNode dataSetNode) { return repository.getDataSet(dataSetNode); } - + public AbstractExternalData tryGetDataSet(DataSetNode dataSetNode) { return repository.tryGetDataSet(dataSetNode); @@ -222,12 +226,12 @@ public class EntityGraphManager { return repository.getDataSetCodeOrNull(dataSetNodeOrNull); } - + public String renderGraph(EntityGraphGenerator g) { return renderGraph(g, false); } - + public String renderGraph(EntityGraphGenerator g, boolean showWhereIAm) { repository.refreshGraph(showWhereIAm); @@ -293,7 +297,7 @@ public class EntityGraphManager } return sampleNode.getIdentifierAndType(); } - + private String removeSolitaryNodes(String graphDefinition) { StringBuilder builder = new StringBuilder(); @@ -307,7 +311,7 @@ public class EntityGraphManager } return builder.toString(); } - + private void appendNodeTo(StringBuilder builder, String identifierAndType, StringBuilder builder2) { if (builder2.length() > 0) @@ -316,12 +320,12 @@ public class EntityGraphManager builder.append(builder2).append("\n"); } } - + private void render(StringBuilder builder, String name, Collection<? extends EntityNode> nodes) { render(builder, name, getIdentifiers(nodes)); } - + private List<String> getIdentifiers(Collection<? extends EntityNode> nodes) { List<String> identifiers = new ArrayList<String>(); @@ -336,7 +340,7 @@ public class EntityGraphManager } return identifiers; } - + private void render(StringBuilder builder, String name, List<String> identifiers) { if (identifiers.isEmpty()) @@ -349,7 +353,7 @@ public class EntityGraphManager builder.append(' ').append(identifier); } } - + private Space createSpace(String spaceCode) { SpaceIdentifier spaceIdentifier = new SpaceIdentifier(spaceCode); @@ -361,7 +365,7 @@ public class EntityGraphManager commonService.registerSpace(sessionToken, spaceCode, null); return service.tryGetSpace(sessionToken, spaceIdentifier); } - + private Project createProject(Space space, String projectCode) { ProjectIdentifier projectIdentifier = new ProjectIdentifier(space.getCode(), projectCode); @@ -370,11 +374,11 @@ public class EntityGraphManager { return project; } - commonService.registerProject(sessionToken, projectIdentifier, null, null, - Collections.<NewAttachment>emptyList()); + commonService.registerProject(sessionToken, projectIdentifier, null, null, + Collections.<NewAttachment> emptyList()); return commonService.getProjectInfo(sessionToken, projectIdentifier); } - + private ExperimentType createExperimentType(String typeCode) { for (ExperimentType experimentType : commonService.listExperimentTypes(sessionToken)) @@ -389,7 +393,7 @@ public class EntityGraphManager commonService.registerExperimentType(sessionToken, experimentType); return service.getExperimentType(sessionToken, typeCode); } - + private SampleType createSampleType(String typeCode) { for (SampleType sampleType : commonService.listSampleTypes(sessionToken)) @@ -405,7 +409,7 @@ public class EntityGraphManager commonService.registerSampleType(sessionToken, sampleType); return service.getSampleType(sessionToken, typeCode); } - + private DataSetType createDataSetType(String typeCode, DataSetKind dataSetKind) { for (DataSetType dataSetType : commonService.listDataSetTypes(sessionToken)) @@ -422,7 +426,7 @@ public class EntityGraphManager dataSetType = service.getDataSetType(sessionToken, typeCode).getDataSetType(); return dataSetType; } - + private Experiment createExperiment(ExperimentNode experimentNode, Project project) { try @@ -438,7 +442,7 @@ public class EntityGraphManager return service.tryGetExperiment(sessionToken, ExperimentIdentifierFactory.parse(identifier)); } catch (Exception ex) { - throw new RuntimeException("Error while creating experiment for node " + experimentNode.getCode() + throw new RuntimeException("Error while creating experiment for node " + experimentNode.getCode() + ": " + ex.getMessage(), ex); } } @@ -463,19 +467,19 @@ public class EntityGraphManager Sample containerSample = repository.tryGetSample(container); if (containerSample == null) { - throw new IllegalStateException("Sample " + container.getCode() - + " is specified as container of " + sampleNode.getCode() + throw new IllegalStateException("Sample " + container.getCode() + + " is specified as container of " + sampleNode.getCode() + " but hasn't yet created."); } sample.setContainerIdentifier(containerSample.getIdentifier()); } sample.setProperties(new IEntityProperty[0]); - sample.setAttachments(Collections.<NewAttachment>emptyList()); + sample.setAttachments(Collections.<NewAttachment> emptyList()); service.registerSample(sessionToken, sample, null); return service.tryGetSampleWithExperiment(sessionToken, SampleIdentifierFactory.parse(sample)); } catch (Exception ex) { - throw new RuntimeException("Error while creating sample for node " + sampleNode.getCode() + throw new RuntimeException("Error while creating sample for node " + sampleNode.getCode() + ": " + ex.getMessage(), ex); } } @@ -488,8 +492,8 @@ public class EntityGraphManager Sample parentSample = repository.tryGetSample(parent); if (parentSample == null) { - throw new IllegalStateException("Sample " + parent.getCode() - + " is specified as parent of " + sampleNode.getCode() + throw new IllegalStateException("Sample " + parent.getCode() + + " is specified as parent of " + sampleNode.getCode() + " but hasn't yet created."); } parentIdentifiers.add(parentSample.getIdentifier()); @@ -509,7 +513,7 @@ public class EntityGraphManager } return prefix + sampleNode.getCode() + generateUniqueId(); } - + private AbstractExternalData createDataSet(DataSetNode dataSetNode) { try @@ -548,7 +552,7 @@ public class EntityGraphManager return service.tryGetDataSet(sessionToken, dataSet.getCode()); } catch (Exception ex) { - throw new RuntimeException("Error while creating data set for node " + dataSetNode.getIdentifierAndType() + throw new RuntimeException("Error while creating data set for node " + dataSetNode.getIdentifierAndType() + ": " + ex.getMessage(), ex); } } @@ -574,8 +578,8 @@ public class EntityGraphManager AbstractExternalData parentDataSet = repository.tryGetDataSet(parent); if (parentDataSet == null) { - throw new IllegalStateException("Data set " + parent.getCode() - + " is specified as " + relationType + " of " + dataSetNode.getCode() + throw new IllegalStateException("Data set " + parent.getCode() + + " is specified as " + relationType + " of " + dataSetNode.getCode() + " but hasn't yet created."); } parentCodes.add(parentDataSet.getCode()); @@ -592,7 +596,7 @@ public class EntityGraphManager { return "-" + service.createPermId(sessionToken); } - + private void createGraph(EntityGraphGenerator g) { repository = new EntityRepository(); @@ -621,13 +625,13 @@ public class EntityGraphManager private void createSamples(Space space, EntityGraphGenerator g) { ArrayList<SampleNode> sampleNodes = new ArrayList<SampleNode>(g.getSamples().values()); -// Collections.reverse(sampleNodes); + // Collections.reverse(sampleNodes); for (SampleNode sampleNode : sampleNodes) { repository.put(sampleNode, createSample(sampleNode, space)); } } - + private void createExperiments(Project project, EntityGraphGenerator g) { for (ExperimentNode experimentNode : g.getExperiments().values()) @@ -635,34 +639,51 @@ public class EntityGraphManager repository.put(experimentNode, createExperiment(experimentNode, project)); } } - + private final class EntityRepository { private Map<Long, Experiment> experimentsNodeToDtoMap = new TreeMap<Long, Experiment>(); + private Map<Long, ModificationInfo> experimentModificationInfoByNodeId = new HashMap<Long, ModificationInfo>(); + private Set<ExperimentNode> modifiedExperimentNodes = new HashSet<ExperimentNode>(); + private Set<ExperimentNode> deletedExperimentNodes = new HashSet<ExperimentNode>(); - + private Map<Long, Sample> samplesNodeToDtoMap = new TreeMap<Long, Sample>(); + private Map<Long, SampleNode> samplesDtoToNodeMap = new TreeMap<Long, SampleNode>(); + private Map<Long, ModificationInfo> sampleModificationInfoByNodeId = new HashMap<Long, ModificationInfo>(); + private Set<SampleNode> modifiedSampleNodes = new HashSet<SampleNode>(); + private Set<SampleNode> deletedSampleNodes = new HashSet<SampleNode>(); private Map<Long, AbstractExternalData> dataSetsNodeToDtoMap = new TreeMap<Long, AbstractExternalData>(); + private Map<Long, DataSetNode> dataSetsDtoToNodeMap = new TreeMap<Long, DataSetNode>(); + private Map<Long, ModificationInfo> dataSetModificationInfoByNodeId = new HashMap<Long, ModificationInfo>(); + private Set<DataSetNode> modifiedDataSetNodes = new HashSet<DataSetNode>(); + private Set<DataSetNode> deletedDataSetNodes = new HashSet<DataSetNode>(); private Map<Long, Set<Long>> experimentSamplesMap = new HashMap<Long, Set<Long>>(); + private Map<Long, Set<Long>> childrenSamplesMap = new HashMap<Long, Set<Long>>(); + private Map<Long, Set<Long>> componentSamplesMap = new HashMap<Long, Set<Long>>(); + private Map<Long, Set<Long>> experimentDataSetsMap = new HashMap<Long, Set<Long>>(); + private Map<Long, Set<Long>> sampleDataSetsMap = new HashMap<Long, Set<Long>>(); + private Map<Long, Set<Long>> componentDataSetsMap = new HashMap<Long, Set<Long>>(); + private Map<Long, Set<Long>> parentDataSetsMap = new HashMap<Long, Set<Long>>(); - + public String renderNodeToDtoMapping() { StringBuilder builder = new StringBuilder(); @@ -680,8 +701,8 @@ public class EntityGraphManager } return builder.toString(); } - - private void render(StringBuilder builder, String prefix, Long id, + + private void render(StringBuilder builder, String prefix, Long id, CodeWithRegistrationAndModificationDate<?> entity) { builder.append(prefix).append(id).append(" -> ").append(entity.getCode()).append(" ("); @@ -693,12 +714,12 @@ public class EntityGraphManager builder.append(entity.getModifier().getUserId()).append(", "); builder.append(entity.getModificationDate()).append(")\n"); } - + public String getExperimentIdentifierOrNull(ExperimentNode experimentNodeOrNull) { return experimentNodeOrNull == null ? null : getExperiment(experimentNodeOrNull).getIdentifier(); } - + public Experiment getExperiment(ExperimentNode experimentNode) { Experiment experiment = tryGetExperiment(experimentNode); @@ -708,17 +729,17 @@ public class EntityGraphManager } return experiment; } - + public Experiment tryGetExperiment(ExperimentNode experimentNode) { return experimentsNodeToDtoMap.get(experimentNode.getId()); } - + public String getSamplePermIdOrNull(SampleNode sampleNodeOrNull) { return sampleNodeOrNull == null ? null : getSample(sampleNodeOrNull).getPermId(); } - + public Sample getSample(SampleNode sampleNode) { Sample sample = tryGetSample(sampleNode); @@ -728,17 +749,17 @@ public class EntityGraphManager } return sample; } - + public Sample tryGetSample(SampleNode sampleNode) { return samplesNodeToDtoMap.get(sampleNode.getId()); } - + public String getDataSetCodeOrNull(DataSetNode dataSetNodeOrNull) { return dataSetNodeOrNull == null ? null : getDataSet(dataSetNodeOrNull).getCode(); } - + public AbstractExternalData getDataSet(DataSetNode dataSetNode) { AbstractExternalData dataSet = tryGetDataSet(dataSetNode); @@ -748,12 +769,12 @@ public class EntityGraphManager } return dataSet; } - + public AbstractExternalData tryGetDataSet(DataSetNode dataSetNode) { return dataSetsNodeToDtoMap.get(dataSetNode.getId()); } - + void refreshGraph(boolean showWhereIAm) { refreshExperimentDtos(); @@ -770,8 +791,8 @@ public class EntityGraphManager private void refreshDataSetDtos() { - List<Entry<Long, AbstractExternalData>> nodeToDtoMapping - = new ArrayList<Entry<Long, AbstractExternalData>>(dataSetsNodeToDtoMap.entrySet()); + List<Entry<Long, AbstractExternalData>> nodeToDtoMapping = + new ArrayList<Entry<Long, AbstractExternalData>>(dataSetsNodeToDtoMap.entrySet()); dataSetsNodeToDtoMap.clear(); for (Entry<Long, AbstractExternalData> entry : nodeToDtoMapping) { @@ -904,7 +925,7 @@ public class EntityGraphManager } System.out.println("..."); } - + private void addToEntitiesMap(Map<Long, Set<Long>> entityToEntitiesMap, IIdHolder keyEntity, IIdHolder valueEntity) { if (keyEntity != null) @@ -919,7 +940,7 @@ public class EntityGraphManager entityIds.add(valueEntity.getId()); } } - + void gatherModifictaionInfos() { for (Entry<Long, Experiment> entry : experimentsNodeToDtoMap.entrySet()) @@ -935,63 +956,63 @@ public class EntityGraphManager dataSetModificationInfoByNodeId.put(entry.getKey(), new ModificationInfo(entry.getValue())); } } - + void put(ExperimentNode experimentNode, Experiment experiment) { experimentsNodeToDtoMap.put(experimentNode.getId(), experiment); } - - public void assertModified(ExperimentNode...experimentNodes) + + public void assertModified(ExperimentNode... experimentNodes) { - assertModificationInfo(true, experimentModificationInfoByNodeId, experimentsNodeToDtoMap, - Arrays.<EntityNode>asList(experimentNodes)); + assertModificationInfo(true, experimentModificationInfoByNodeId, experimentsNodeToDtoMap, + Arrays.<EntityNode> asList(experimentNodes)); modifiedExperimentNodes.addAll(Arrays.asList(experimentNodes)); } - - public void assertDeleted(ExperimentNode...experimentNodes) + + public void assertDeleted(ExperimentNode... experimentNodes) { - assertDeleted(experimentsNodeToDtoMap, Arrays.<EntityNode>asList(experimentNodes)); + assertDeleted(experimentsNodeToDtoMap, Arrays.<EntityNode> asList(experimentNodes)); deletedExperimentNodes.addAll(Arrays.asList(experimentNodes)); } - + void put(SampleNode sampleNode, Sample sample) { samplesNodeToDtoMap.put(sampleNode.getId(), sample); samplesDtoToNodeMap.put(sample.getId(), sampleNode); } - public void assertModified(SampleNode...sampleNodes) + public void assertModified(SampleNode... sampleNodes) { - assertModificationInfo(true, sampleModificationInfoByNodeId, samplesNodeToDtoMap, - Arrays.<EntityNode>asList(sampleNodes)); + assertModificationInfo(true, sampleModificationInfoByNodeId, samplesNodeToDtoMap, + Arrays.<EntityNode> asList(sampleNodes)); modifiedSampleNodes.addAll(Arrays.asList(sampleNodes)); } - - public void assertDeleted(SampleNode...sampleNodes) + + public void assertDeleted(SampleNode... sampleNodes) { - assertDeleted(samplesNodeToDtoMap, Arrays.<EntityNode>asList(sampleNodes)); + assertDeleted(samplesNodeToDtoMap, Arrays.<EntityNode> asList(sampleNodes)); deletedSampleNodes.addAll(Arrays.asList(sampleNodes)); } - + void put(DataSetNode dataSetNode, AbstractExternalData dataSet) { dataSetsNodeToDtoMap.put(dataSetNode.getId(), dataSet); dataSetsDtoToNodeMap.put(dataSet.getId(), dataSetNode); } - - public void assertModified(DataSetNode...dataSetNodes) + + public void assertModified(DataSetNode... dataSetNodes) { - assertModificationInfo(true, dataSetModificationInfoByNodeId, dataSetsNodeToDtoMap, - Arrays.<EntityNode>asList(dataSetNodes)); + assertModificationInfo(true, dataSetModificationInfoByNodeId, dataSetsNodeToDtoMap, + Arrays.<EntityNode> asList(dataSetNodes)); modifiedDataSetNodes.addAll(Arrays.asList(dataSetNodes)); } - - public void assertDeleted(DataSetNode...dataSetNodes) + + public void assertDeleted(DataSetNode... dataSetNodes) { - assertDeleted(dataSetsNodeToDtoMap, Arrays.<EntityNode>asList(dataSetNodes)); + assertDeleted(dataSetsNodeToDtoMap, Arrays.<EntityNode> asList(dataSetNodes)); deletedDataSetNodes.addAll(Arrays.asList(dataSetNodes)); } - + public void assertUnmodified(EntityGraphGenerator g) { Set<EntityNode> unmodifiedExperimentNodes = new HashSet<EntityNode>(g.getExperiments().values()); @@ -1004,7 +1025,7 @@ public class EntityGraphManager unmodifiedDataSetNodes.removeAll(modifiedDataSetNodes); assertModificationInfo(false, dataSetModificationInfoByNodeId, dataSetsNodeToDtoMap, unmodifiedDataSetNodes); } - + private void assertModificationInfo(boolean modified, Map<Long, ModificationInfo> previousInfos, Map<Long, ? extends CodeWithRegistrationAndModificationDate<?>> nodeToDtoMap, Collection<EntityNode> entityNodes) @@ -1029,22 +1050,22 @@ public class EntityGraphManager ModificationInfo current = new ModificationInfo(entity); if (modified) { - assertEquals(node.getCode() + " has unexpectedly still the old modifier: " + current.modifier, + assertEquals(node.getCode() + " has unexpectedly still the old modifier: " + current.modifier, false, current.modifier.equals(previous.modifier)); - assertEquals(node.getCode() + " has unexpectedly still the old modification date: " - + current.modificationDate + " > " + previous.modificationDate, + assertEquals(node.getCode() + " has unexpectedly still the old modification date: " + + current.modificationDate + " > " + previous.modificationDate, true, current.modificationDate.getTime() > previous.modificationDate.getTime()); } else { assertEquals(node.getCode() + " has unexpectedly a new modifier: ", previous.modifier, current.modifier); - assertEquals(node.getCode() + " has unexpectedly a new modification date:", + assertEquals(node.getCode() + " has unexpectedly a new modification date:", previous.modificationDate, current.modificationDate); } } } } - + private void assertDeleted(Map<Long, ? extends CodeWithRegistrationAndModificationDate<?>> nodeToDtoMap, Collection<EntityNode> entityNodes) { @@ -1056,7 +1077,7 @@ public class EntityGraphManager } } } - + public void assertUndeleted(EntityGraphGenerator g) { Set<EntityNode> undeletedExperimentNodes = new HashSet<EntityNode>(g.getExperiments().values()); @@ -1069,7 +1090,7 @@ public class EntityGraphManager undeletedDataSetNodes.removeAll(deletedDataSetNodes); assertUndeleted(dataSetsNodeToDtoMap, undeletedDataSetNodes); } - + private void assertUndeleted(Map<Long, ? extends CodeWithRegistrationAndModificationDate<?>> nodeToDtoMap, Collection<EntityNode> entityNodes) { @@ -1087,26 +1108,25 @@ public class EntityGraphManager fail("The following nodes have been deleted: " + deletedNodes); } } - Set<SampleNode> getSampleNodes(ExperimentNode experimentNode) { - return getEntityNodes(experimentSamplesMap, experimentsNodeToDtoMap.get(experimentNode.getId()), + return getEntityNodes(experimentSamplesMap, experimentsNodeToDtoMap.get(experimentNode.getId()), samplesDtoToNodeMap); } - + Set<SampleNode> getChildrenSampleNodes(SampleNode sampleNode) { - return getEntityNodes(childrenSamplesMap, samplesNodeToDtoMap.get(sampleNode.getId()), + return getEntityNodes(childrenSamplesMap, samplesNodeToDtoMap.get(sampleNode.getId()), samplesDtoToNodeMap); } - + Set<SampleNode> getComponentSampleNodes(SampleNode sampleNode) { - return getEntityNodes(componentSamplesMap, samplesNodeToDtoMap.get(sampleNode.getId()), + return getEntityNodes(componentSamplesMap, samplesNodeToDtoMap.get(sampleNode.getId()), samplesDtoToNodeMap); } - + Set<DataSetNode> getDataSetNodes(ExperimentNode experimentNode) { return getDataSetNodes(experimentDataSetsMap, experimentsNodeToDtoMap.get(experimentNode.getId())); @@ -1116,23 +1136,23 @@ public class EntityGraphManager { return getDataSetNodes(sampleDataSetsMap, samplesNodeToDtoMap.get(sampleNode.getId())); } - + Set<DataSetNode> getComponentDataSetNodes(DataSetNode containerDataSetNode) { return getDataSetNodes(componentDataSetsMap, dataSetsNodeToDtoMap.get(containerDataSetNode.getId())); } - + Set<DataSetNode> getParentDataSetNodes(DataSetNode childDataSetNode) { return getDataSetNodes(parentDataSetsMap, dataSetsNodeToDtoMap.get(childDataSetNode.getId())); } - + private Set<DataSetNode> getDataSetNodes(Map<Long, Set<Long>> idHolderDataSetsMap, IIdHolder idHolder) { return getEntityNodes(idHolderDataSetsMap, idHolder, dataSetsDtoToNodeMap); } - private <T extends EntityNode> Set<T> getEntityNodes(Map<Long, Set<Long>> idHolderEntitiesMap, IIdHolder idHolder, + private <T extends EntityNode> Set<T> getEntityNodes(Map<Long, Set<Long>> idHolderEntitiesMap, IIdHolder idHolder, Map<Long, T> dtoToNodeMap) { Set<T> result = new TreeSet<T>(); @@ -1150,10 +1170,11 @@ public class EntityGraphManager return result; } } - + private static final class ModificationInfo { private final String modifier; + private final Date modificationDate; ModificationInfo(CodeWithRegistrationAndModificationDate<?> entity) diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/MultiThreadOptimisticLockingTestCase.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/MultiThreadOptimisticLockingTestCase.java index be70605def9e1b059d755cec6553165b2c20a3aa..05fdf33cd27ae93179b1ffa6453ecfa67e0883ea 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/MultiThreadOptimisticLockingTestCase.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/MultiThreadOptimisticLockingTestCase.java @@ -33,6 +33,7 @@ import ch.systemsx.cisd.openbis.systemtest.PersistentSystemTestCase; public class MultiThreadOptimisticLockingTestCase extends PersistentSystemTestCase { static final String CREATING_ENTITIES = "creating entities"; + protected ToolBox toolBox; @BeforeMethod @@ -53,5 +54,5 @@ public class MultiThreadOptimisticLockingTestCase extends PersistentSystemTestCa throw new Error(m.getName() + "() : ", t); } } - + } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/MultiThreadProjectOptimisticLockingTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/MultiThreadProjectOptimisticLockingTest.java index b4539cd66b812e817921692dd61b1534604ffc13..090d2686d0d93ec9108f5d4ac2b6615287f7a9fd 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/MultiThreadProjectOptimisticLockingTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/MultiThreadProjectOptimisticLockingTest.java @@ -49,11 +49,9 @@ public class MultiThreadProjectOptimisticLockingTest extends MultiThreadOptimist private static final String CREATE_EXPERIMENTS_PHASE = "createExperiments"; /* - * This test registers three experiments for the same project. Two of them are registered by the - * main thread using performEntityOperations(). A second thread registers an experiment between - * the registration of the two other experiments. This is done by using a - * IServiceConversationProgressListener together with two message channels to coordinate the - * order of actions in both threads. + * This test registers three experiments for the same project. Two of them are registered by the main thread using performEntityOperations(). A + * second thread registers an experiment between the registration of the two other experiments. This is done by using a + * IServiceConversationProgressListener together with two message channels to coordinate the order of actions in both threads. */ @Test public void testRegisterExperimentsInTwoThreads() diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/MultiThreadSampleOptimisticLockingTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/MultiThreadSampleOptimisticLockingTest.java index d8bcd226f13539d1c0b09391ba87c0d123d63365..774fb1c6ecf01122313be53c25258ac1df8f5a31 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/MultiThreadSampleOptimisticLockingTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/MultiThreadSampleOptimisticLockingTest.java @@ -164,12 +164,8 @@ public class MultiThreadSampleOptimisticLockingTest extends MultiThreadOptimisti } /** - * This test is flaky. - * - * If the transaction of performEntityOperations() call in the new thread ends before - * the transaction of performEntityOperations() call in the main thread, the modifier of - * the sample will be "optimist" and the test fails. - * + * This test is flaky. If the transaction of performEntityOperations() call in the new thread ends before the transaction of + * performEntityOperations() call in the main thread, the modifier of the sample will be "optimist" and the test fails. */ @Test public void testRegisterDataSetsForSameSampleInTwoThreads() diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/ToolBox.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/ToolBox.java index 3f20d81a7965513c71a20ab06e29df9b0f28fdcf..4ca0b6b323ce23686a2f732dbeedbcf3dab71b09 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/ToolBox.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/optimistic_locking/ToolBox.java @@ -117,7 +117,7 @@ public class ToolBox private final IServiceForDataStoreServer etlService; private final IDAOFactory daoFactory; - + private final String systemSessionToken; public Space space1; @@ -129,7 +129,7 @@ public class ToolBox public Project project2; public ToolBox(ICommonServer commonServer, IGenericServer genericServer, - IServiceForDataStoreServer etlService, String systemSessionToken, + IServiceForDataStoreServer etlService, String systemSessionToken, ApplicationContext applicationContext) { this.commonServer = commonServer; @@ -138,7 +138,7 @@ public class ToolBox this.systemSessionToken = systemSessionToken; daoFactory = applicationContext.getBean(IDAOFactory.class); } - + TimeIntervalChecker createTimeIntervalChecker() { return new TimeIntervalChecker(daoFactory.getTransactionTimestamp()); @@ -226,14 +226,14 @@ public class ToolBox List<String> dataSetCodes = new ArrayList<String>(codes); commonServer.deleteDataSets(systemSessionToken, dataSetCodes, "cleanup", DeletionType.TRASH, true); } - + private List<TechId> listExperimentIds(Space space) { ExperimentType experimentType = new ExperimentTypeBuilder().code(EXPERIMENT_TYPE_CODE).getExperimentType(); SpaceIdentifier spaceIdentifier = new SpaceIdentifierFactory(space.getIdentifier()).createIdentifier(); return TechId.createList(commonServer.listExperiments(systemSessionToken, experimentType, spaceIdentifier)); } - + private List<TechId> listSampleIds(Space space) { ListSampleCriteria criteria = new ListSampleCriteria(); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/EntityValidationTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/EntityValidationTest.java index f519624bc5ee7c1ec4f5ff837678ad86af6ed627..6252997980e0c73cdb5c8e517c8c8c5b80d96e10 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/EntityValidationTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/EntityValidationTest.java @@ -77,7 +77,7 @@ public class EntityValidationTest extends GenericSystemTestCase private static final String IMPOSSIBLE_TO_UPDATE_TYPE = "IMPOSSIBLE_TO_UPDATE"; private static final int TEST_SCRIPT_ID = 8; - + @Autowired private IDAOFactory daoFactory; @@ -340,7 +340,7 @@ public class EntityValidationTest extends GenericSystemTestCase AbstractExternalData dataset = commonServer.getDataSetInfo(systemSessionToken, new TechId(26l)); - + DataSetUpdatesDTO updates = new DataSetUpdatesDTO(); updates.setDatasetId(new TechId(26)); updates.setVersion(dataset.getVersion()); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/FileFormatTypeHeadlessTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/FileFormatTypeHeadlessTest.java index ee26c6b541958b0bbedabb32465d805f5dc59b28..daed4cd77c38b2797ba6068680eb8d7a548d240e 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/FileFormatTypeHeadlessTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/FileFormatTypeHeadlessTest.java @@ -73,7 +73,6 @@ public class FileFormatTypeHeadlessTest extends SystemTestCase TypedTableResultSet<FileFormatType> tableResultSet = commonClientService.listFileTypes(criteria); - Row expectedRow = new Row().withCell("CODE", fft.getCode()).withCell("DESCRIPTION", fft.getDescription()); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/query/QuerySystemTestCase.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/query/QuerySystemTestCase.java index b666241c97505217c1a4a3030a6138576a8934d2..9829f4fd886711bafa7c622cea4b34cf92a11554 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/query/QuerySystemTestCase.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/query/QuerySystemTestCase.java @@ -22,19 +22,16 @@ import ch.systemsx.cisd.openbis.plugin.query.client.web.client.IQueryClientServi import ch.systemsx.cisd.openbis.systemtest.SystemTestCase; /** - * - * * @author Franz-Josef Elmer */ public class QuerySystemTestCase extends SystemTestCase { protected IQueryClientService queryClientService; - + @Autowired public final void setQueryClientService(IQueryClientService queryClientService) { this.queryClientService = queryClientService; } - } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/relationshipshistory/SampleToSampleRelationshipsHistoryTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/relationshipshistory/SampleToSampleRelationshipsHistoryTest.java index bcb03445a510b50d4cd383304fdf0062d54bba2b..661bb8bd9bcca3f1113f070addfcb0513c3afc93 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/relationshipshistory/SampleToSampleRelationshipsHistoryTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/relationshipshistory/SampleToSampleRelationshipsHistoryTest.java @@ -156,7 +156,7 @@ public class SampleToSampleRelationshipsHistoryTest extends AbstractRelationship updates.setExperimentIdentifierOrNull(child.getExperiment() == null ? null : ExperimentIdentifier.createIdentifier(child.getExperiment())); updates.setModifiedParentCodesOrNull(new String[] - { parent.getIdentifier() }); + { parent.getIdentifier() }); genericClientService.updateSample(updates); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/util/LogRecordingUtils.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/util/LogRecordingUtils.java index 60330dd40d433b3bdde1b0a97661d71f248fe207..04b73dcbb04a3502578ec12f8ebe24d94067a39f 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/util/LogRecordingUtils.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/util/LogRecordingUtils.java @@ -21,8 +21,7 @@ import org.apache.log4j.Level; import ch.systemsx.cisd.common.logging.BufferedAppender; /** - * Helper methods to create a log recorder which suppresses log entries from MonitoringPoolingDataSource - * and full text indexer. + * Helper methods to create a log recorder which suppresses log entries from MonitoringPoolingDataSource and full text indexer. * * @author Franz-Josef Elmer */ @@ -32,22 +31,22 @@ public class LogRecordingUtils { return suppress(new BufferedAppender()); } - + public static BufferedAppender createRecorder(Level logLevel) { return suppress(new BufferedAppender(logLevel)); } - + public static BufferedAppender createRecorder(String pattern, Level logLevel) { return suppress(new BufferedAppender(pattern, logLevel)); } - + public static BufferedAppender createRecorder(String pattern, Level logLevel, String loggerNameRegex) { return suppress(new BufferedAppender(pattern, logLevel, loggerNameRegex)); } - + private static BufferedAppender suppress(BufferedAppender logRecorder) { logRecorder.addRegexForLoggingEventsToBeDropped("OPERATION.*FullTextIndex.*");