From 9a790b943588f43f459f9b8013d5178f8a9c10fa Mon Sep 17 00:00:00 2001 From: fedoreno <fedoreno> Date: Wed, 27 Apr 2016 13:41:43 +0000 Subject: [PATCH] SSDM-3511: reformatted SVN: 36339 --- .../v3/ApplicationServerApiJsonServer.java | 5 +- .../asapi/v3/ApplicationServerApiServer.java | 7 +- .../server/asapi/v3/cache/SearchCache.java | 7 +- .../asapi/v3/executor/common/CodeMatcher.java | 2 - .../common/TechIdStringIdentifierRecord.java | 3 +- .../dataset/ISearchDataSetTypeExecutor.java | 2 - .../dataset/SearchDataSetTypeExecutor.java | 2 - .../AbstractSearchEntityTypeExecutor.java | 4 +- .../ISearchExperimentTypeExecutor.java | 2 - .../SearchExperimentTypeExecutor.java | 2 - .../IMapMaterialTechIdByIdExecutor.java | 3 - .../material/ISearchMaterialTypeExecutor.java | 2 - .../material/ListMaterialsTechIdByPermId.java | 4 +- .../v3/executor/material/MaterialQuery.java | 4 +- .../material/SearchMaterialTypeExecutor.java | 2 - .../material/SetMaterialTypeExecutor.java | 3 +- .../AbstractIdSearchMethodExecutor.java | 9 +- .../ExecuteCustomASServiceMethodExecutor.java | 2 - ...IExecuteCustomASServiceMethodExecutor.java | 2 - .../ISearchCustomASServiceMethodExecutor.java | 5 +- .../ISearchDataSetTypeMethodExecutor.java | 2 - .../ISearchExperimentTypeMethodExecutor.java | 5 +- .../ISearchMaterialTypeMethodExecutor.java | 2 - ...hObjectKindModificationMethodExecutor.java | 4 +- .../ISearchSampleTypeMethodExecutor.java | 2 - .../v3/executor/method/IServiceProvider.java | 2 - .../SearchCustomASServiceMethodExecutor.java | 3 +- .../SearchDataSetTypeSqlMethodExecutor.java | 8 +- ...SearchExperimentTypeSqlMethodExecutor.java | 8 +- .../SearchMaterialTypeSqlMethodExecutor.java | 8 +- .../SearchSampleTypeSqlMethodExecutor.java | 8 +- .../v3/executor/method/ServiceProvider.java | 16 +- .../IMapProjectTechIdByIdExecutor.java | 2 - .../ListProjectTechIdByIdentifier.java | 2 - .../project/ListProjectTechIdByPermId.java | 2 - .../v3/executor/project/ProjectQuery.java | 2 +- .../executor/sample/CreateSampleExecutor.java | 32 +- .../executor/sample/FullSampleIdentifier.java | 49 +- .../sample/IMapSampleTechIdByIdExecutor.java | 2 - .../sample/ISearchSampleTypeExecutor.java | 2 - .../sample/ISetSampleProjectExecutor.java | 2 - .../sample/IUpdateSampleProjectExecutor.java | 2 - .../sample/IVerifySampleProjectExecutor.java | 2 - .../sample/ListSampleTechIdByIdentifier.java | 10 +- .../sample/ListSampleTechIdByPermId.java | 2 - .../sample/SampleIdentifierParts.java | 12 +- .../sample/SearchSampleTypeExecutor.java | 2 - .../sample/SetSampleProjectExecutor.java | 6 +- .../executor/sample/UpdateSampleExecutor.java | 2 +- .../sample/UpdateSampleProjectExecutor.java | 11 +- .../executor/sample/VerifySampleExecutor.java | 4 +- .../space/IMapSpaceTechIdByIdExecutor.java | 2 - .../space/ListSpaceTechIdByPermId.java | 2 - .../UpdateTagDataSetsWithCacheExecutor.java | 3 +- .../tag/UpdateTagExperimentsExecutor.java | 3 +- .../common/AbstractListTechIdByPermId.java | 8 +- .../asapi/v3/helper/common/MapObjectById.java | 6 +- .../asapi/v3/helper/generators/Generator.java | 8 +- .../generators/UltimateJSEntityGenerator.java | 3 +- .../uglify/ECMAScriptEngineFactory.java | 31 +- .../v3/helper/generators/uglify/UglifyJS.java | 186 +- .../generators/uglify/UglifyOptions.java | 279 +- .../PropertyAssignmentComparatorFactory.java | 22 +- .../helper/service/IScriptRunnerFactory.java | 4 +- .../helper/service/IServiceScriptRunner.java | 2 - .../JythonBasedCustomASServiceExecutor.java | 6 +- .../attachment/AttachmentBaseRecord.java | 10 +- .../attachment/AttachmentContentRecord.java | 2 - .../AttachmentContentTranslator.java | 6 +- .../entity/attachment/AttachmentQuery.java | 28 +- .../attachment/AttachmentTranslator.java | 61 +- .../EntityAttachmentTranslator.java | 4 +- .../attachment/IAttachmentBaseTranslator.java | 2 - .../IAttachmentContentTranslator.java | 2 - .../ObjectToManyRelationTranslator.java | 2 +- .../DataSetPropertyAssignmentTranslator.java | 4 +- .../entity/dataset/DataSetQuery.java | 6 +- .../entity/dataset/DataSetTypeTranslator.java | 6 +- .../IDataSetPropertyAssignmentTranslator.java | 2 - .../ExperimentAttachmentTranslator.java | 2 - ...xperimentPropertyAssignmentTranslator.java | 4 +- .../entity/experiment/ExperimentQuery.java | 4 +- .../experiment/ExperimentTypeTranslator.java | 6 +- ...xperimentPropertyAssignmentTranslator.java | 2 - ...IMaterialPropertyAssignmentTranslator.java | 2 - .../MaterialPropertyAssignmentTranslator.java | 4 +- .../entity/material/MaterialQuery.java | 6 +- .../material/MaterialTypeTranslator.java | 6 +- .../IPropertyAssignmentTranslator.java | 2 - .../property/PropertyAssignmentRecord.java | 3 +- .../PropertyAssignmentTranslator.java | 3 - .../property/PropertyQueryGenerator.java | 2 +- .../entity/property/PropertyTypeQuery.java | 4 +- .../entity/property/PropertyTypeRecord.java | 6 +- .../sample/ISampleProjectTranslator.java | 2 - .../ISamplePropertyAssignmentTranslator.java | 2 - .../sample/SampleAttachmentTranslator.java | 2 - .../entity/sample/SampleBaseRecord.java | 2 +- .../sample/SampleProjectTranslator.java | 2 - .../SamplePropertyAssignmentTranslator.java | 4 +- .../translator/entity/sample/SampleQuery.java | 12 +- .../entity/sample/SampleTypeTranslator.java | 6 +- .../v3/translator/entity/tag/TagQuery.java | 2 +- .../entity/vocabulary/VocabularyQuery.java | 2 +- ...ractCompositeSearchCriteriaTranslator.java | 3 +- .../DataSetSearchCriteriaTranslator.java | 2 +- .../EntityTypeSearchCriteriaTranslator.java | 2 +- .../NumberFieldSearchCriteriaTranslator.java | 15 +- .../ProjectSearchCriteriaTranslator.java | 16 +- .../search/SpaceSearchCriteriaTranslator.java | 3 +- .../cisd/openbis/BuildAndEnvironmentInfo.java | 5 +- .../generic/client/cli/DataSetLister.java | 6 +- .../openbis/generic/client/cli/Login.java | 3 +- .../generic/client/console/ICommand.java | 2 - .../openbis/generic/client/console/Lexer.java | 9 +- .../generic/client/console/ScriptContext.java | 6 +- .../openbis/generic/client/console/Set.java | 2 - .../web/client/ICommonClientService.java | 2 +- .../web/client/ICommonClientServiceAsync.java | 7 +- .../IOnlineHelpResourceLocatorService.java | 21 +- .../application/AbstractAsyncCallback.java | 25 +- .../AbstractPluginViewContext.java | 6 +- .../AsyncCallbackWithProgressBar.java | 3 +- .../application/CallbackListenerAdapter.java | 3 +- .../application/DisposableTabContent.java | 3 +- .../client/application/GenericConstants.java | 2 +- .../client/application/ICallbackListener.java | 10 +- .../client/application/IPageController.java | 5 +- .../application/InfoBoxCallbackListener.java | 3 +- .../web/client/application/TabContent.java | 11 +- ...abaseModificationObserverWithCallback.java | 3 +- .../framework/AbstractTabItemFactory.java | 6 +- ...CompositeDatabaseModificationObserver.java | 3 +- ...eModificationObserverWithMainObserver.java | 5 +- .../DatabaseModificationAwareComponent.java | 7 +- .../DatabaseModificationAwareField.java | 4 +- .../DatabaseModificationAwareObject.java | 4 +- .../DatabaseModificationAwareWidget.java | 4 +- .../framework/DebugPanelManager.java | 4 +- .../framework/DispatcherHelper.java | 9 +- .../framework/DisplaySettingsManager.java | 2 +- .../application/framework/DummyComponent.java | 2 +- .../IComponentWithCloseConfirmation.java | 4 +- .../IDatabaseModificationObserver.java | 11 +- ...abaseModificationObserverWithCallback.java | 3 +- .../framework/IDisplayTypeIDGenerator.java | 2 +- .../LastModificationStateUpdater.java | 15 +- .../application/framework/LoginPage.java | 4 +- .../framework/WelcomePanelHelper.java | 13 +- .../application/help/HelpPageIdentifier.java | 6 +- .../locator/AbstractViewLocatorResolver.java | 8 +- .../AttachmentDownloadLocatorResolver.java | 4 +- .../locator/IViewLocatorResolver.java | 8 +- .../locator/MaterialCodeUtils.java | 17 +- .../locator/MaterialLocatorResolver.java | 4 +- .../locator/PermlinkLocatorResolver.java | 25 +- .../locator/ProjectLocatorResolver.java | 4 +- .../locator/SampleSearchLocatorResolver.java | 2 +- .../locator/SearchLocatorResolver.java | 6 +- .../locator/ViewLocatorResolverRegistry.java | 3 +- .../application/menu/AbstractActionMenu.java | 2 - .../menu/ITabActionMenuItemDefinition.java | 4 +- .../application/menu/modules/ModulesMenu.java | 8 +- .../application/model/BaseEntityModel.java | 3 +- .../application/model/DataSetTypeModel.java | 2 - .../application/model/EntityVisitModel.java | 4 +- .../model/ModelDataPropertyNames.java | 15 +- .../model/SimplifiedBaseModel.java | 3 +- .../model/SimplifiedBaseModelData.java | 11 +- .../plugin/ClientPluginAdapter.java | 3 +- .../plugin/IClientPluginFactory.java | 10 +- .../plugin/IClientPluginFactoryProvider.java | 3 +- .../IClientPluginFactoryUsingWildcards.java | 6 +- .../client/application/plugin/IModule.java | 16 +- .../plugin/IModuleInitializationObserver.java | 1 - .../ModuleInitializationController.java | 9 +- .../WildcardSupportingPluginFactoryMap.java | 3 +- .../application/renderer/LinkRenderer.java | 15 +- .../application/renderer/PersonRenderer.java | 6 +- .../renderer/PropertyTypeRenderer.java | 5 +- .../renderer/TimestampStringCellRenderer.java | 5 +- .../application/renderer/YesNoRenderer.java | 3 +- .../ui/AbstractViewerWithVerticalSplit.java | 7 +- .../ui/AuthorizationGroupGrid.java | 4 +- .../web/client/application/ui/CodesArea.java | 3 +- .../ui/ColumnSettingsConfigurer.java | 7 +- .../ui/GeneralImportComponent.java | 3 +- .../application/ui/LoginPanelAutofill.java | 9 +- .../ui/ModulesSectionsManager.java | 6 +- .../ui/PropertyValueRenderers.java | 6 +- .../application/ui/RoleAssignmentGrid.java | 4 +- .../application/ui/RowLayoutManager.java | 17 +- .../application/ui/SimpleModeHeader.java | 21 +- .../web/client/application/ui/SpaceGrid.java | 4 +- .../AggregationServiceLocatorResolver.java | 3 +- .../ui/attachment/AttachmentBrowser.java | 2 +- .../ui/data/AbstractExternalDataGrid.java | 5 +- .../ui/data/DataSetReportGenerator.java | 3 +- .../ui/data/DataSetTypeSelectionWidget.java | 6 +- .../ui/data/DataSetUploadForm.java | 3 +- .../DatastoreServiceDescriptionModel.java | 3 +- .../application/ui/deletion/DeletionGrid.java | 2 +- .../ui/experiment/ExperimentBrowserGrid.java | 3 +- .../experiment/ExperimentBrowserToolbar.java | 9 +- .../ExperimentTypeSelectionWidget.java | 6 +- .../ProjectSelectionTreeGridContainer.java | 8 +- .../application/ui/field/CheckBoxField.java | 7 +- .../ui/field/ExperimentChooserField.java | 6 +- .../application/ui/field/HyperlinkField.java | 4 +- .../ui/field/MultilineItemsField.java | 3 +- .../ui/field/MultilineVarcharField.java | 4 +- .../ui/field/SampleChooserButton.java | 3 +- .../ui/field/SampleChooserField.java | 3 +- .../field/VocabularyTermSelectionWidget.java | 6 +- .../client/application/ui/field/XmlField.java | 3 +- ...stractColumnSettingsDataModelProvider.java | 11 +- .../ui/grid/BrowserGridPagingToolBar.java | 3 +- .../application/ui/grid/ColumnListener.java | 9 +- .../ui/grid/ColumnSettingsDialog.java | 3 +- .../application/ui/grid/ColumnUtils.java | 5 +- .../ui/grid/DisposableEntityChooser.java | 3 +- .../application/ui/grid/ExtendedGridView.java | 5 +- .../grid/ICellListenerAndLinkGenerator.java | 3 +- .../ui/grid/ICriteriaProvider.java | 4 +- .../ui/grid/ListColumnFilterWidget.java | 3 +- .../ui/grid/PendingFetchManager.java | 6 +- .../ui/grid/entity/PropertyTypesCriteria.java | 4 +- .../entity/PropertyTypesCriteriaProvider.java | 3 +- .../grid/entity/PropertyTypesFilterUtil.java | 3 +- .../column/GridCustomColumnGrid.java | 4 +- .../expressions/common/GridColumnChooser.java | 5 +- .../common/GridColumnChooserDialog.java | 3 +- .../filter/GridCustomFilterGrid.java | 4 +- .../filter/IColumnFilterWidget.java | 10 +- .../listener/OpenEntityDetailsTabHelper.java | 9 +- .../managed_property/ManagedPropertyGrid.java | 12 +- .../ManagedPropertyGridActionDialog.java | 5 +- .../ui/material/MaterialBrowserGrid.java | 6 +- .../ui/material/MaterialBrowserToolbar.java | 6 +- .../material/MaterialTypeSelectionWidget.java | 12 +- .../application/ui/project/ProjectGrid.java | 4 +- .../AbstractSimplePropertyValueRenderer.java | 4 +- .../ObjectArrayPropertyValueRenderer.java | 3 +- .../application/ui/property/PropertyGrid.java | 5 +- ...EntityTypePropertyTypeSelectionWidget.java | 3 +- .../PropertyTypeAssignmentGrid.java | 44 +- .../ui/property_type/PropertyTypeGrid.java | 6 +- .../property_type/SectionSelectionWidget.java | 3 +- .../SampleBatchRegisterUpdatePanel.java | 3 +- .../ui/sample/SampleBrowserGrid.java | 79 +- .../ui/sample/SampleBrowserToolbar.java | 8 +- .../SampleListDeletionConfirmationDialog.java | 11 +- .../application/ui/script/ScriptGrid.java | 4 +- .../search/DetailedSearchCriteriaWidget.java | 12 +- .../search/DetailedSearchCriterionWidget.java | 7 +- .../DetailedSearchFieldsSelectionWidget.java | 6 +- .../ui/search/DetailedSearchWindow.java | 11 +- .../ui/vocabulary/VocabularyGrid.java | 2 +- ...actDataListDeletionConfirmationDialog.java | 17 +- ...stPermanentDeletionConfirmationDialog.java | 4 +- ...taListTrashDeletionConfirmationDialog.java | 3 +- .../ui/widget/AbstractRegistrationDialog.java | 3 +- .../ui/widget/ButtonWithLoadingMask.java | 4 +- .../ui/widget/CheckBoxGroupWithModel.java | 3 +- .../ui/widget/FormPanelWithSavePoint.java | 2 +- .../ui/widget/InlineHyperlink.java | 5 +- .../application/ui/widget/LabeledItem.java | 3 +- .../ui/widget/NotScrollableContainer.java | 4 +- .../application/ui/widget/SectionsPanel.java | 3 +- .../ui/widget/SimpleModelComboBox.java | 9 +- .../ui/wizard/IWizardDataModel.java | 4 +- .../application/ui/wizard/IWizardState.java | 3 +- .../ui/wizard/IWizardStateChangeListener.java | 3 +- .../client/application/ui/wizard/Wizard.java | 6 +- .../application/ui/wizard/WizardPage.java | 58 +- .../ui/wizard/WizardWorkflowModel.java | 22 +- .../application/util/BorderLayoutHelper.java | 3 +- .../util/CompositeMessageProvider.java | 4 +- .../web/client/application/util/DOMUtils.java | 6 +- .../util/DialogWithOnlineHelpUtils.java | 5 +- .../util/DictonaryBasedMessageProvider.java | 8 +- .../util/EntityDeletionConfirmationUtils.java | 115 +- .../web/client/application/util/GWTUtils.java | 29 +- .../application/util/IDelegatedAction.java | 3 +- .../util/IDelegatedActionWithResult.java | 3 +- .../application/util/IMessageProvider.java | 15 +- .../application/util/IResultUpdater.java | 4 +- .../application/util/ToolTipAction.java | 5 +- .../application/util/URLListEncoder.java | 3 +- .../client/application/util/WindowUtils.java | 6 +- .../application/util/lang/Entities.java | 664 ++-- .../application/util/lang/IntHashMap.java | 62 +- .../util/lang/StringEscapeUtils.java | 36 +- .../application/util/log/IProfilingTable.java | 10 +- .../application/util/log/ProfilingTable.java | 12 +- .../web/client/dto/ArchivingResult.java | 5 +- .../client/dto/AttachmentGridColumnIDs.java | 6 + .../dto/AuthorizationGroupGridColumnIDs.java | 3 + .../dto/CustomGridColumnGridColumnIDs.java | 8 +- .../client/dto/DataSetUploadParameters.java | 10 +- .../client/dto/DefaultResultSetConfig.java | 3 +- .../web/client/dto/DeletionGridColumnIDs.java | 2 +- ...splayedCriteriaOrSelectedEntityHolder.java | 2 +- .../DisplayedOrSelectedDatasetCriteria.java | 3 +- .../DisplayedOrSelectedIdHolderCriteria.java | 2 +- .../dto/EntityPropertyUpdatesResult.java | 3 +- .../dto/FileFormatTypeGridColumnIDs.java | 4 +- .../client/web/client/dto/GridFilters.java | 9 +- .../client/web/client/dto/GridRowModels.java | 8 +- .../web/client/dto/IResultSetConfig.java | 7 +- .../client/web/client/dto/IUpdateResult.java | 3 +- .../dto/ListEntityDisplayCriteriaKind.java | 3 +- .../client/dto/PropertyTypeGridColumnIDs.java | 12 + .../client/dto/RelatedDataSetCriteria.java | 3 +- .../client/web/client/dto/ResultSet.java | 2 +- .../web/client/dto/ResultSetFetchConfig.java | 15 +- .../client/dto/ResultSetWithEntityTypes.java | 3 +- .../dto/RoleAssignmentGridColumnIDs.java | 4 + .../web/client/dto/SampleChildrenInfo.java | 13 +- .../client/web/client/dto/SessionContext.java | 10 +- .../web/client/dto/SpaceGridColumnIDs.java | 3 - .../web/client/dto/TableExportCriteria.java | 3 +- .../exception/UserFailureException.java | 5 +- .../web/server/AbstractClientService.java | 2 +- .../server/AbstractOriginalDataProvider.java | 2 +- ...actOriginalDataProviderWithoutHeaders.java | 3 +- ...entServiceExceptionTranslatingAdvisor.java | 3 +- .../server/CommonClientServiceServlet.java | 7 +- .../server/FileTemplateServiceServlet.java | 26 +- .../web/server/HelpRedirectServlet.java | 12 +- .../web/server/IBasicTableDataProvider.java | 5 +- .../StringHtmlEscapingPointcutAdvisor.java | 10 +- .../server/calculator/ColumnDefinition.java | 9 +- .../web/server/calculator/ColumnGroup.java | 7 +- .../calculator/GridExpressionUtils.java | 3 +- .../server/calculator/ITableDataProvider.java | 4 +- .../web/server/queue/ConsumerQueue.java | 186 +- .../client/web/server/queue/ConsumerTask.java | 21 +- .../AbstractCommonTableModelProvider.java | 3 +- .../AbstractExternalDataProvider.java | 2 +- .../resultset/AbstractTableModelProvider.java | 7 +- .../web/server/resultset/ColumnSortUtils.java | 2 +- .../server/resultset/IColumnCalculator.java | 5 +- .../resultset/IOriginalDataProvider.java | 5 +- .../web/server/resultset/IResultSet.java | 3 +- .../server/resultset/IResultSetManager.java | 13 +- .../server/resultset/ITableModelProvider.java | 3 +- .../web/server/resultset/TableData.java | 2 +- .../web/server/resultset/TableDataCache.java | 12 +- .../SearchableEntityTranslator.java | 5 +- .../UserFailureExceptionTranslator.java | 13 +- .../client/web/server/util/HttpUtils.java | 1 - .../client/web/server/util/OSKind.java | 3 +- .../client/web/server/util/TSVRenderer.java | 3 +- .../server/util/XMLPropertyTransformer.java | 2 +- .../generic/server/AbstractCommonServer.java | 4 +- .../generic/server/AbstractServer.java | 4 +- .../openbis/generic/server/CacheFilter.java | 5 +- .../openbis/generic/server/CommonServer.java | 27 +- .../generic/server/CommonServiceProvider.java | 2 +- .../generic/server/CommonServiceServer.java | 5 +- .../server/ETLEntityOperationChecker.java | 3 +- .../generic/server/ETLServiceServer.java | 7 +- .../server/GenericHttpSessionListener.java | 6 +- .../server/ICommonServerForInternalUse.java | 6 +- .../server/IDataStoreServiceRegistrator.java | 7 +- .../server/IETLEntityOperationChecker.java | 54 +- .../generic/server/NameServerServlet.java | 8 +- .../generic/server/NewExternalDataDAG.java | 3 +- .../generic/server/OpenBisSessionManager.java | 6 +- .../server/OpenbisCrossOriginFilter.java | 3 +- .../generic/server/SampleGroupingDAG.java | 3 +- .../openbis/generic/server/SearchHelper.java | 3 +- .../ServerExceptionTranslatingAdvisor.java | 14 +- ...erviceConversationServerManagerServer.java | 6 +- .../server/ServiceForDataStoreServer.java | 3390 ----------------- 376 files changed, 1861 insertions(+), 5515 deletions(-) diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/ApplicationServerApiJsonServer.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/ApplicationServerApiJsonServer.java index c26d00ea5d0..8bfb8f81cce 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/ApplicationServerApiJsonServer.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/ApplicationServerApiJsonServer.java @@ -54,11 +54,12 @@ public class ApplicationServerApiJsonServer extends AbstractApiJsonServiceExport } @RequestMapping( - { IApplicationServerApi.JSON_SERVICE_URL, "/openbis" + IApplicationServerApi.JSON_SERVICE_URL }) + { IApplicationServerApi.JSON_SERVICE_URL, "/openbis" + IApplicationServerApi.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/ethz/sis/openbis/generic/server/asapi/v3/ApplicationServerApiServer.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/ApplicationServerApiServer.java index 345f989c747..ea44e5e9845 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/ApplicationServerApiServer.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/ApplicationServerApiServer.java @@ -47,10 +47,11 @@ public class ApplicationServerApiServer extends AbstractApiServiceExporter } @RequestMapping( - { IApplicationServerApi.SERVICE_URL, "/openbis" + IApplicationServerApi.SERVICE_URL, "/openbis/openbis" + IApplicationServerApi.SERVICE_URL }) + { IApplicationServerApi.SERVICE_URL, "/openbis" + IApplicationServerApi.SERVICE_URL, "/openbis/openbis" + IApplicationServerApi.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/ethz/sis/openbis/generic/server/asapi/v3/cache/SearchCache.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/cache/SearchCache.java index 1edbe874d12..ae1eeacf1df 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/cache/SearchCache.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/cache/SearchCache.java @@ -38,19 +38,18 @@ public class SearchCache<CRITERIA, FETCH_OPTIONS, OBJECT> implements ISearchCach @Autowired private CacheManager cacheManager; - + private RuntimeCache<SearchCacheKey<CRITERIA, FETCH_OPTIONS>, SearchCacheEntry<OBJECT>> runtimeCache; - + public SearchCache() { } - + public SearchCache(RuntimeCache<SearchCacheKey<CRITERIA, FETCH_OPTIONS>, SearchCacheEntry<OBJECT>> runtimeCache) { this.runtimeCache = runtimeCache; } - @Override public SearchCacheEntry<OBJECT> get(SearchCacheKey<CRITERIA, FETCH_OPTIONS> key) { diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/common/CodeMatcher.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/common/CodeMatcher.java index a5fde3d894b..4f604d208f8 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/common/CodeMatcher.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/common/CodeMatcher.java @@ -19,8 +19,6 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common; import ch.systemsx.cisd.openbis.generic.shared.basic.ICodeHolder; /** - * - * * @author Franz-Josef Elmer */ public class CodeMatcher<OBJECT extends ICodeHolder> extends StringFieldMatcher<OBJECT> diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/common/TechIdStringIdentifierRecord.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/common/TechIdStringIdentifierRecord.java index 29a089c6000..7581b2ed02e 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/common/TechIdStringIdentifierRecord.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/common/TechIdStringIdentifierRecord.java @@ -17,12 +17,11 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common; /** - * - * * @author Franz-Josef Elmer */ public class TechIdStringIdentifierRecord { public Long id; + public String identifier; } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/dataset/ISearchDataSetTypeExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/dataset/ISearchDataSetTypeExecutor.java index b4f1c23b3e5..e7599652aa9 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/dataset/ISearchDataSetTypeExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/dataset/ISearchDataSetTypeExecutor.java @@ -21,8 +21,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.ISearchObject import ch.systemsx.cisd.openbis.generic.shared.dto.DataSetTypePE; /** - * - * * @author Franz-Josef Elmer */ public interface ISearchDataSetTypeExecutor extends ISearchObjectExecutor<EntityTypeSearchCriteria, DataSetTypePE> diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/dataset/SearchDataSetTypeExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/dataset/SearchDataSetTypeExecutor.java index c22c3e287d2..f8d741726bc 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/dataset/SearchDataSetTypeExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/dataset/SearchDataSetTypeExecutor.java @@ -23,8 +23,6 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.DataSetTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind; /** - * - * * @author Franz-Josef Elmer */ @Component diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/entity/AbstractSearchEntityTypeExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/entity/AbstractSearchEntityTypeExecutor.java index 67fe390d44e..6f8719b904e 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/entity/AbstractSearchEntityTypeExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/entity/AbstractSearchEntityTypeExecutor.java @@ -29,8 +29,6 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.EntityTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind; /** - * - * * @author Franz-Josef Elmer */ public abstract class AbstractSearchEntityTypeExecutor<ENTITY_TYPE_PE extends EntityTypePE> @@ -42,7 +40,7 @@ public abstract class AbstractSearchEntityTypeExecutor<ENTITY_TYPE_PE extends En { this.entityKind = entityKind; } - + @Override protected List<ENTITY_TYPE_PE> listAll() { diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/experiment/ISearchExperimentTypeExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/experiment/ISearchExperimentTypeExecutor.java index a08df6eee62..7c132f26a5f 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/experiment/ISearchExperimentTypeExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/experiment/ISearchExperimentTypeExecutor.java @@ -21,8 +21,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.ISearchObject import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentTypePE; /** - * - * * @author Franz-Josef Elmer */ public interface ISearchExperimentTypeExecutor extends ISearchObjectExecutor<EntityTypeSearchCriteria, ExperimentTypePE> diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/experiment/SearchExperimentTypeExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/experiment/SearchExperimentTypeExecutor.java index 74d330cc0cf..21822b810c2 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/experiment/SearchExperimentTypeExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/experiment/SearchExperimentTypeExecutor.java @@ -23,8 +23,6 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind; /** - * - * * @author Franz-Josef Elmer */ @Component diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/IMapMaterialTechIdByIdExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/IMapMaterialTechIdByIdExecutor.java index 1c56992f131..ef72d4a2a98 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/IMapMaterialTechIdByIdExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/IMapMaterialTechIdByIdExecutor.java @@ -19,10 +19,7 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.executor.material; import ch.ethz.sis.openbis.generic.asapi.v3.dto.material.id.IMaterialId; import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.IMapObjectByIdExecutor; - /** - * - * * @author Franz-Josef Elmer */ public interface IMapMaterialTechIdByIdExecutor extends IMapObjectByIdExecutor<IMaterialId, Long> diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/ISearchMaterialTypeExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/ISearchMaterialTypeExecutor.java index 39709d2411a..132021372af 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/ISearchMaterialTypeExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/ISearchMaterialTypeExecutor.java @@ -21,8 +21,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.ISearchObject import ch.systemsx.cisd.openbis.generic.shared.dto.MaterialTypePE; /** - * - * * @author Franz-Josef Elmer */ public interface ISearchMaterialTypeExecutor extends ISearchObjectExecutor<EntityTypeSearchCriteria, MaterialTypePE> diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/ListMaterialsTechIdByPermId.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/ListMaterialsTechIdByPermId.java index ea1e90a62f3..4354dcd1f43 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/ListMaterialsTechIdByPermId.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/ListMaterialsTechIdByPermId.java @@ -31,11 +31,9 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.helper.common.AbstractListTec import ch.systemsx.cisd.openbis.generic.shared.basic.CodeConverter; /** - * - * * @author Franz-Josef Elmer */ -public class ListMaterialsTechIdByPermId extends AbstractListTechIdById<MaterialPermId> +public class ListMaterialsTechIdByPermId extends AbstractListTechIdById<MaterialPermId> { @Override diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/MaterialQuery.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/MaterialQuery.java index 7319159f6e4..ebcdec029fa 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/MaterialQuery.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/MaterialQuery.java @@ -26,15 +26,13 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.common.Obje import ch.systemsx.cisd.common.db.mapper.StringArrayMapper; /** - * - * * @author Franz-Josef Elmer */ public interface MaterialQuery extends ObjectQuery { @Select(sql = "select m.id, m.code as identifier from materials m join material_types t on m.maty_id = t.id " + "where t.code = ?{1} and m.code = any(?{2})", parameterBindings = - { TypeMapper.class, StringArrayMapper.class }, fetchSize = FETCH_SIZE) + { TypeMapper.class, StringArrayMapper.class }, fetchSize = FETCH_SIZE) public List<TechIdStringIdentifierRecord> listMaterialTechIdsByCodes(String typeCode, String[] codes); } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/SearchMaterialTypeExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/SearchMaterialTypeExecutor.java index 38c9f19dff5..99d1f380dba 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/SearchMaterialTypeExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/SearchMaterialTypeExecutor.java @@ -23,8 +23,6 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.MaterialTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind; /** - * - * * @author Franz-Josef Elmer */ @Component diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/SetMaterialTypeExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/SetMaterialTypeExecutor.java index e3c2380ab57..04ca9be036a 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/SetMaterialTypeExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/SetMaterialTypeExecutor.java @@ -37,7 +37,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind; * @author Jakub Straszewski */ @Component -public class SetMaterialTypeExecutor extends AbstractSetEntityToOneRelationExecutor<MaterialCreation, MaterialPE, IEntityTypeId, EntityTypePE> implements +public class SetMaterialTypeExecutor extends AbstractSetEntityToOneRelationExecutor<MaterialCreation, MaterialPE, IEntityTypeId, EntityTypePE> + implements ISetMaterialTypeExecutor { diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/AbstractIdSearchMethodExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/AbstractIdSearchMethodExecutor.java index 8d13621c735..7510f985d21 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/AbstractIdSearchMethodExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/AbstractIdSearchMethodExecutor.java @@ -26,12 +26,9 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.ISearchObject import ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder; /** - * - * * @author Franz-Josef Elmer */ -public abstract class AbstractIdSearchMethodExecutor<OBJECT, OBJECT_PE extends IIdHolder, - CRITERIA extends AbstractSearchCriteria, FETCH_OPTIONS extends FetchOptions<OBJECT>> +public abstract class AbstractIdSearchMethodExecutor<OBJECT, OBJECT_PE extends IIdHolder, CRITERIA extends AbstractSearchCriteria, FETCH_OPTIONS extends FetchOptions<OBJECT>> extends AbstractSearchMethodExecutor<OBJECT, Long, CRITERIA, FETCH_OPTIONS> { @@ -53,7 +50,7 @@ public abstract class AbstractIdSearchMethodExecutor<OBJECT, OBJECT_PE extends I } }; } - + protected abstract List<OBJECT_PE> searchPEs(IOperationContext context, CRITERIA criteria); - + } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ExecuteCustomASServiceMethodExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ExecuteCustomASServiceMethodExecutor.java index 70af7b3e1e7..0110debb85f 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ExecuteCustomASServiceMethodExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ExecuteCustomASServiceMethodExecutor.java @@ -28,8 +28,6 @@ import ch.ethz.sis.openbis.generic.asapi.v3.plugin.service.ICustomASServiceExecu import ch.ethz.sis.openbis.generic.asapi.v3.plugin.service.context.CustomASServiceContext; /** - * - * * @author Franz-Josef Elmer */ @Component diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/IExecuteCustomASServiceMethodExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/IExecuteCustomASServiceMethodExecutor.java index d6f4983ce1f..60064e2e1f1 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/IExecuteCustomASServiceMethodExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/IExecuteCustomASServiceMethodExecutor.java @@ -20,8 +20,6 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.service.CustomASServiceExecution import ch.ethz.sis.openbis.generic.asapi.v3.dto.service.id.ICustomASServiceId; /** - * - * * @author Franz-Josef Elmer */ public interface IExecuteCustomASServiceMethodExecutor diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchCustomASServiceMethodExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchCustomASServiceMethodExecutor.java index a12a2f639c1..76fb6349ac5 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchCustomASServiceMethodExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchCustomASServiceMethodExecutor.java @@ -21,11 +21,10 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.service.fetchoptions.CustomASSer import ch.ethz.sis.openbis.generic.asapi.v3.dto.service.search.CustomASServiceSearchCriteria; /** - * - * * @author Franz-Josef Elmer */ -public interface ISearchCustomASServiceMethodExecutor extends ISearchMethodExecutor<CustomASService, CustomASServiceSearchCriteria, CustomASServiceFetchOptions> +public interface ISearchCustomASServiceMethodExecutor extends + ISearchMethodExecutor<CustomASService, CustomASServiceSearchCriteria, CustomASServiceFetchOptions> { } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchDataSetTypeMethodExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchDataSetTypeMethodExecutor.java index 17d4c98f595..4b9c65b6f33 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchDataSetTypeMethodExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchDataSetTypeMethodExecutor.java @@ -21,8 +21,6 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.dataset.fetchoptions.DataSetType import ch.ethz.sis.openbis.generic.asapi.v3.dto.entitytype.search.EntityTypeSearchCriteria; /** - * - * * @author Franz-Josef Elmer */ public interface ISearchDataSetTypeMethodExecutor extends ISearchMethodExecutor<DataSetType, EntityTypeSearchCriteria, DataSetTypeFetchOptions> diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchExperimentTypeMethodExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchExperimentTypeMethodExecutor.java index aa6c97c6f2d..bc12472af21 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchExperimentTypeMethodExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchExperimentTypeMethodExecutor.java @@ -21,11 +21,10 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.experiment.ExperimentType; import ch.ethz.sis.openbis.generic.asapi.v3.dto.experiment.fetchoptions.ExperimentTypeFetchOptions; /** - * - * * @author Franz-Josef Elmer */ -public interface ISearchExperimentTypeMethodExecutor extends ISearchMethodExecutor<ExperimentType, EntityTypeSearchCriteria, ExperimentTypeFetchOptions> +public interface ISearchExperimentTypeMethodExecutor extends + ISearchMethodExecutor<ExperimentType, EntityTypeSearchCriteria, ExperimentTypeFetchOptions> { } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchMaterialTypeMethodExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchMaterialTypeMethodExecutor.java index 82f5db89a7c..fb8295b948e 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchMaterialTypeMethodExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchMaterialTypeMethodExecutor.java @@ -21,8 +21,6 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.material.MaterialType; import ch.ethz.sis.openbis.generic.asapi.v3.dto.material.fetchoptions.MaterialTypeFetchOptions; /** - * - * * @author Franz-Josef Elmer */ public interface ISearchMaterialTypeMethodExecutor extends ISearchMethodExecutor<MaterialType, EntityTypeSearchCriteria, MaterialTypeFetchOptions> diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchObjectKindModificationMethodExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchObjectKindModificationMethodExecutor.java index 95ced8a73da..1f07bf1bba8 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchObjectKindModificationMethodExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchObjectKindModificationMethodExecutor.java @@ -21,11 +21,9 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.objectkindmodification.fetchopti import ch.ethz.sis.openbis.generic.asapi.v3.dto.objectkindmodification.search.ObjectKindModificationSearchCriteria; /** - * - * * @author Franz-Josef Elmer */ -public interface ISearchObjectKindModificationMethodExecutor +public interface ISearchObjectKindModificationMethodExecutor extends ISearchMethodExecutor<ObjectKindModification, ObjectKindModificationSearchCriteria, ObjectKindModificationFetchOptions> { diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchSampleTypeMethodExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchSampleTypeMethodExecutor.java index 0041b545e00..e4a19ca7b20 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchSampleTypeMethodExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ISearchSampleTypeMethodExecutor.java @@ -21,8 +21,6 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.sample.SampleType; import ch.ethz.sis.openbis.generic.asapi.v3.dto.sample.fetchoptions.SampleTypeFetchOptions; /** - * - * * @author Franz-Josef Elmer */ public interface ISearchSampleTypeMethodExecutor extends ISearchMethodExecutor<SampleType, EntityTypeSearchCriteria, SampleTypeFetchOptions> diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/IServiceProvider.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/IServiceProvider.java index 10c155e522e..dd74832a8c0 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/IServiceProvider.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/IServiceProvider.java @@ -22,8 +22,6 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.service.CustomASService; import ch.ethz.sis.openbis.generic.asapi.v3.plugin.service.ICustomASServiceExecutor; /** - * - * * @author Franz-Josef Elmer */ public interface IServiceProvider diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/SearchCustomASServiceMethodExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/SearchCustomASServiceMethodExecutor.java index e233252cf30..204d45077cf 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/SearchCustomASServiceMethodExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/SearchCustomASServiceMethodExecutor.java @@ -52,7 +52,8 @@ public class SearchCustomASServiceMethodExecutor extends AbstractSearchObjectMan private IOpenBisSessionManager sessionManager; @Override - public SearchResult<CustomASService> search(String sessionToken, CustomASServiceSearchCriteria searchCriteria, CustomASServiceFetchOptions fetchOptions) + public SearchResult<CustomASService> search(String sessionToken, CustomASServiceSearchCriteria searchCriteria, + CustomASServiceFetchOptions fetchOptions) { List<CustomASService> services = search(new OperationContext(sessionManager.getSession(sessionToken)), searchCriteria); List<CustomASService> filtered = new ArrayList<>(new SortAndPage().sortAndPage(services, fetchOptions)); diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/SearchDataSetTypeSqlMethodExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/SearchDataSetTypeSqlMethodExecutor.java index 05700b0a7db..4bd6768d191 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/SearchDataSetTypeSqlMethodExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/SearchDataSetTypeSqlMethodExecutor.java @@ -31,19 +31,19 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.dataset.IDa import ch.systemsx.cisd.openbis.generic.shared.dto.DataSetTypePE; /** - * * @author Franz-Josef Elmer */ @Component -public class SearchDataSetTypeSqlMethodExecutor extends AbstractIdSearchMethodExecutor<DataSetType, DataSetTypePE, EntityTypeSearchCriteria, DataSetTypeFetchOptions> +public class SearchDataSetTypeSqlMethodExecutor extends + AbstractIdSearchMethodExecutor<DataSetType, DataSetTypePE, EntityTypeSearchCriteria, DataSetTypeFetchOptions> implements ISearchDataSetTypeMethodExecutor { @Autowired private ISearchDataSetTypeExecutor searchExecutor; - + @Autowired private IDataSetTypeTranslator translator; - + @Override protected List<DataSetTypePE> searchPEs(IOperationContext context, EntityTypeSearchCriteria criteria) { diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/SearchExperimentTypeSqlMethodExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/SearchExperimentTypeSqlMethodExecutor.java index ce45d6a1a50..f24d74cbb30 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/SearchExperimentTypeSqlMethodExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/SearchExperimentTypeSqlMethodExecutor.java @@ -31,19 +31,19 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.experiment. import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentTypePE; /** - * * @author Franz-Josef Elmer */ @Component -public class SearchExperimentTypeSqlMethodExecutor extends AbstractIdSearchMethodExecutor<ExperimentType, ExperimentTypePE, EntityTypeSearchCriteria, ExperimentTypeFetchOptions> +public class SearchExperimentTypeSqlMethodExecutor extends + AbstractIdSearchMethodExecutor<ExperimentType, ExperimentTypePE, EntityTypeSearchCriteria, ExperimentTypeFetchOptions> implements ISearchExperimentTypeMethodExecutor { @Autowired private ISearchExperimentTypeExecutor searchExecutor; - + @Autowired private IExperimentTypeTranslator translator; - + @Override protected List<ExperimentTypePE> searchPEs(IOperationContext context, EntityTypeSearchCriteria criteria) { diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/SearchMaterialTypeSqlMethodExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/SearchMaterialTypeSqlMethodExecutor.java index f33cc4c8859..856b6f191e2 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/SearchMaterialTypeSqlMethodExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/SearchMaterialTypeSqlMethodExecutor.java @@ -31,19 +31,19 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.material.IM import ch.systemsx.cisd.openbis.generic.shared.dto.MaterialTypePE; /** - * * @author Franz-Josef Elmer */ @Component -public class SearchMaterialTypeSqlMethodExecutor extends AbstractIdSearchMethodExecutor<MaterialType, MaterialTypePE, EntityTypeSearchCriteria, MaterialTypeFetchOptions> +public class SearchMaterialTypeSqlMethodExecutor extends + AbstractIdSearchMethodExecutor<MaterialType, MaterialTypePE, EntityTypeSearchCriteria, MaterialTypeFetchOptions> implements ISearchMaterialTypeMethodExecutor { @Autowired private ISearchMaterialTypeExecutor searchExecutor; - + @Autowired private IMaterialTypeTranslator translator; - + @Override protected List<MaterialTypePE> searchPEs(IOperationContext context, EntityTypeSearchCriteria criteria) { diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/SearchSampleTypeSqlMethodExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/SearchSampleTypeSqlMethodExecutor.java index cca225ff5be..e0bbecd57cd 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/SearchSampleTypeSqlMethodExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/SearchSampleTypeSqlMethodExecutor.java @@ -31,19 +31,19 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.sample.ISam import ch.systemsx.cisd.openbis.generic.shared.dto.SampleTypePE; /** - * * @author Franz-Josef Elmer */ @Component -public class SearchSampleTypeSqlMethodExecutor extends AbstractIdSearchMethodExecutor<SampleType, SampleTypePE, EntityTypeSearchCriteria, SampleTypeFetchOptions> +public class SearchSampleTypeSqlMethodExecutor extends + AbstractIdSearchMethodExecutor<SampleType, SampleTypePE, EntityTypeSearchCriteria, SampleTypeFetchOptions> implements ISearchSampleTypeMethodExecutor { @Autowired private ISearchSampleTypeExecutor searchExecutor; - + @Autowired private ISampleTypeTranslator translator; - + @Override protected List<SampleTypePE> searchPEs(IOperationContext context, EntityTypeSearchCriteria criteria) { diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ServiceProvider.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ServiceProvider.java index 3abc01b724a..130d936f14b 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ServiceProvider.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/method/ServiceProvider.java @@ -38,21 +38,23 @@ import ch.systemsx.cisd.common.reflection.ClassUtils; import ch.systemsx.cisd.common.spring.ExposablePropertyPlaceholderConfigurer; /** - * - * * @author Franz-Josef Elmer */ @Component public class ServiceProvider implements InitializingBean, IServiceProvider { public static final String SERVICES_PROPERTY_KEY = "services"; + public static final String CLASS_KEY = "class"; + public static final String LABEL_KEY = "label"; + public static final String DESCRIPTION_KEY = "description"; - + private List<CustomASService> services; + private Map<String, ICustomASServiceExecutor> executors = new HashMap<String, ICustomASServiceExecutor>(); - + @Resource(name = ExposablePropertyPlaceholderConfigurer.PROPERTY_CONFIGURER_BEAN_NAME) protected ExposablePropertyPlaceholderConfigurer configurer; @@ -79,17 +81,17 @@ public class ServiceProvider implements InitializingBean, IServiceProvider } services = Collections.unmodifiableList(list); } - + @Override public List<CustomASService> getCustomASServices() { return services; } - + @Override public ICustomASServiceExecutor tryGetCustomASServiceExecutor(String code) { return executors.get(code); } - + } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/project/IMapProjectTechIdByIdExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/project/IMapProjectTechIdByIdExecutor.java index 79e9d649f5c..411591f3d6a 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/project/IMapProjectTechIdByIdExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/project/IMapProjectTechIdByIdExecutor.java @@ -20,8 +20,6 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.project.id.IProjectId; import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.IMapObjectByIdExecutor; /** - * - * * @author Franz-Josef Elmer */ public interface IMapProjectTechIdByIdExecutor extends IMapObjectByIdExecutor<IProjectId, Long> diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/project/ListProjectTechIdByIdentifier.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/project/ListProjectTechIdByIdentifier.java index 32d3887cbcf..78a165dfe59 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/project/ListProjectTechIdByIdentifier.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/project/ListProjectTechIdByIdentifier.java @@ -32,8 +32,6 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.CodeConverter; import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.ProjectIdentifierFactory; /** - * - * * @author Franz-Josef Elmer */ public class ListProjectTechIdByIdentifier extends AbstractListTechIdById<ProjectIdentifier> diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/project/ListProjectTechIdByPermId.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/project/ListProjectTechIdByPermId.java index 0024ddcc78a..e98d1ee7494 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/project/ListProjectTechIdByPermId.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/project/ListProjectTechIdByPermId.java @@ -25,8 +25,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.TechIdStringI import ch.ethz.sis.openbis.generic.server.asapi.v3.helper.common.AbstractListTechIdByPermId; /** - * - * * @author Franz-Josef Elmer */ public class ListProjectTechIdByPermId extends AbstractListTechIdByPermId<ProjectPermId> diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/project/ProjectQuery.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/project/ProjectQuery.java index d4addd3735d..47b636659f4 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/project/ProjectQuery.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/project/ProjectQuery.java @@ -36,6 +36,6 @@ public interface ProjectQuery extends ObjectQuery @Select(sql = "select p.id, p.code as identifier from projects p join spaces s on p.space_id = s.id " + "where s.code = ?{1} and p.code = any(?{2})", parameterBindings = - { TypeMapper.class, StringArrayMapper.class }, fetchSize = FETCH_SIZE) + { TypeMapper.class, StringArrayMapper.class }, fetchSize = FETCH_SIZE) public List<TechIdStringIdentifierRecord> listProjectTechIdsByCodes(String spaceCode, String[] codes); } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/CreateSampleExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/CreateSampleExecutor.java index 6715ba12a9b..6aab3193741 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/CreateSampleExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/CreateSampleExecutor.java @@ -85,7 +85,7 @@ public class CreateSampleExecutor extends AbstractCreateEntityExecutor<SampleCre @Autowired private ISetSampleSpaceExecutor setSampleSpaceExecutor; - + @Autowired private ISetSampleProjectExecutor setSampleProjectExecutor; @@ -106,7 +106,7 @@ public class CreateSampleExecutor extends AbstractCreateEntityExecutor<SampleCre @Autowired private IVerifySampleExecutor verifySampleExecutor; - + @Resource(name = ExposablePropertyPlaceholderConfigurer.PROPERTY_CONFIGURER_BEAN_NAME) private ExposablePropertyPlaceholderConfigurer configurer; @@ -122,7 +122,7 @@ public class CreateSampleExecutor extends AbstractCreateEntityExecutor<SampleCre } Map<IEntityTypeId, EntityTypePE> types = mapEntityTypeByIdExecutor.map(context, EntityKind.SAMPLE, typeIds); - + Properties serviceProperties = configurer.getResolvedProps(); boolean createContinuousSampleCodes = PropertyUtils.getBoolean(serviceProperties, Constants.CREATE_CONTINUOUS_SAMPLES_CODES_KEY, false); @@ -144,9 +144,11 @@ public class CreateSampleExecutor extends AbstractCreateEntityExecutor<SampleCre if (StringUtils.isEmpty(creation.getCode()) && (type.isAutoGeneratedCode() || creation.isAutoGeneratedCode())) { Integer codesForPrefix = numCodesByPrefix.get(type.getGeneratedCodePrefix()); - if(codesForPrefix == null) { + if (codesForPrefix == null) + { codesForPrefix = 1; - } else { + } else + { codesForPrefix++; } numCodesByPrefix.put(type.getGeneratedCodePrefix(), codesForPrefix); @@ -172,8 +174,9 @@ public class CreateSampleExecutor extends AbstractCreateEntityExecutor<SampleCre for (SampleCreation creation : creations) { SamplePE sample = new SamplePE(); - //Create code if is not present - if(StringUtils.isEmpty(creation.getCode())) { + // Create code if is not present + if (StringUtils.isEmpty(creation.getCode())) + { SampleTypePE type = (SampleTypePE) types.get(creation.getTypeId()); creation.setCode(codesByPrefix.get(type.getGeneratedCodePrefix()).removeFirst()); } @@ -190,15 +193,20 @@ public class CreateSampleExecutor extends AbstractCreateEntityExecutor<SampleCre private void checkData(IOperationContext context, SampleCreation creation, SampleTypePE type) { - if(creation.getTypeId() == null) { + if (creation.getTypeId() == null) + { throw new UserFailureException("Type id cannot be null."); - } else if(type == null) { + } else if (type == null) + { throw new ObjectNotFoundException(creation.getTypeId()); - } else if (false == StringUtils.isEmpty(creation.getCode()) && (type.isAutoGeneratedCode() || creation.isAutoGeneratedCode())) { + } else if (false == StringUtils.isEmpty(creation.getCode()) && (type.isAutoGeneratedCode() || creation.isAutoGeneratedCode())) + { throw new UserFailureException("Code should be empty when auto generated code is selected."); - } else if(StringUtils.isEmpty(creation.getCode()) && false == type.isAutoGeneratedCode() && false == creation.isAutoGeneratedCode()) { + } else if (StringUtils.isEmpty(creation.getCode()) && false == type.isAutoGeneratedCode() && false == creation.isAutoGeneratedCode()) + { throw new UserFailureException("Code cannot be empty for a non auto generated code."); - } else { + } else + { SampleIdentifierFactory.assertValidCode(creation.getCode()); } } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/FullSampleIdentifier.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/FullSampleIdentifier.java index 9758a0bdfe2..d764874d317 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/FullSampleIdentifier.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/FullSampleIdentifier.java @@ -26,20 +26,22 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.sample.id.SampleIdentifier; import ch.systemsx.cisd.openbis.generic.shared.basic.CodeConverter; /** - * Helper class which parses a sample identifier string. - * It offers human readable errors for incorrect inputs. + * Helper class which parses a sample identifier string. It offers human readable errors for incorrect inputs. * * @author Franz-Josef Elmer */ public class FullSampleIdentifier { private static final String CODE_CHAR_PATTERN = "a-zA-Z0-9_\\-\\."; + private static final String CODE_CHARS = "[" + CODE_CHAR_PATTERN + "]+"; + private static final String CODE_PATTERN = "^" + CODE_CHARS + "$"; - + private SampleIdentifierParts sampleIdentifierParts; + private String sampleCode; - + public FullSampleIdentifier(String sampleIdentifier, String homeSpaceCodeOrNull) { String[] parts = extractParts(sampleIdentifier); @@ -65,26 +67,27 @@ public class FullSampleIdentifier { spaceCode = homeSpaceCodeOrNull; } - + List<String> splittedCode = splitCode(code, sampleIdentifier); if (splittedCode.size() == 2) { containerCode = splittedCode.get(0); plainSampleCode = splittedCode.get(1); - } else { + } else + { plainSampleCode = splittedCode.get(0); } - - //Code format validation + + // Code format validation verifyCodePattern(spaceCode, "Space code"); verifyCodePattern(projectCode, "Project code"); verifyCodePattern(containerCode, "Container sample code"); verifyCodePattern(plainSampleCode, containerCode == null ? "Sample code" : "Sample subcode"); - + sampleCode = CodeConverter.tryToDatabase(plainSampleCode); - sampleIdentifierParts = new SampleIdentifierParts(CodeConverter.tryToDatabase(spaceCode), + sampleIdentifierParts = new SampleIdentifierParts(CodeConverter.tryToDatabase(spaceCode), CodeConverter.tryToDatabase(projectCode), CodeConverter.tryToDatabase(containerCode)); - + } private List<String> splitCode(String code, String sampleIdentifier) @@ -92,7 +95,7 @@ public class FullSampleIdentifier String delim = ":"; StringTokenizer tokenizer = new StringTokenizer(code, delim, true); int numberOfDelims = 0; - List<String> tokens = new ArrayList<>(); + List<String> tokens = new ArrayList<>(); while (tokenizer.hasMoreTokens()) { String token = tokenizer.nextToken(); @@ -106,7 +109,7 @@ public class FullSampleIdentifier } if (numberOfDelims > 1) { - throw new IllegalArgumentException("Sample code can not contain more than one '" + delim + "': " + throw new IllegalArgumentException("Sample code can not contain more than one '" + delim + "': " + sampleIdentifier); } if (numberOfDelims != tokens.size() - 1) @@ -126,9 +129,9 @@ public class FullSampleIdentifier { throw new IllegalArgumentException("Sample identifier has to start with a '/': " + sampleIdentifier); } - + String[] parts = sampleIdentifier.split("/"); - + if (parts.length == 0) { throw new IllegalArgumentException("Sample identifier don't contain any codes: " + sampleIdentifier); @@ -154,8 +157,8 @@ public class FullSampleIdentifier throw new IllegalArgumentException(partName + " containing other characters than letters, numbers, " + "'_', '-' and '.': " + code); } - } - + } + public SampleIdentifierParts getParts() { return sampleIdentifierParts; @@ -170,12 +173,12 @@ public class FullSampleIdentifier public String toString() { // TODO: project samples -// return new SampleIdentifier(sampleIdentifierParts.getSpaceCodeOrNull(), -// sampleIdentifierParts.getProjectCodeOrNull(), sampleIdentifierParts.getContainerCodeOrNull(), -// sampleCode).toString(); - return new SampleIdentifier(sampleIdentifierParts.getSpaceCodeOrNull(), - sampleIdentifierParts.getContainerCodeOrNull(), + // return new SampleIdentifier(sampleIdentifierParts.getSpaceCodeOrNull(), + // sampleIdentifierParts.getProjectCodeOrNull(), sampleIdentifierParts.getContainerCodeOrNull(), + // sampleCode).toString(); + return new SampleIdentifier(sampleIdentifierParts.getSpaceCodeOrNull(), + sampleIdentifierParts.getContainerCodeOrNull(), sampleCode).toString(); } - + } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/IMapSampleTechIdByIdExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/IMapSampleTechIdByIdExecutor.java index 0df2cd39b1a..bda5d1b2310 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/IMapSampleTechIdByIdExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/IMapSampleTechIdByIdExecutor.java @@ -20,8 +20,6 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.sample.id.ISampleId; import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.IMapObjectByIdExecutor; /** - * - * * @author Franz-Josef Elmer */ public interface IMapSampleTechIdByIdExecutor extends IMapObjectByIdExecutor<ISampleId, Long> diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/ISearchSampleTypeExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/ISearchSampleTypeExecutor.java index a54929725e3..f9014c5efc9 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/ISearchSampleTypeExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/ISearchSampleTypeExecutor.java @@ -21,8 +21,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.ISearchObject import ch.systemsx.cisd.openbis.generic.shared.dto.SampleTypePE; /** - * - * * @author Franz-Josef Elmer */ public interface ISearchSampleTypeExecutor extends ISearchObjectExecutor<EntityTypeSearchCriteria, SampleTypePE> diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/ISetSampleProjectExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/ISetSampleProjectExecutor.java index 9dfdd9686c4..95e7fccd0c7 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/ISetSampleProjectExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/ISetSampleProjectExecutor.java @@ -21,8 +21,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.entity.ISetEntityRel import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE; /** - * - * * @author Franz-Josef Elmer */ public interface ISetSampleProjectExecutor extends ISetEntityRelationsExecutor<SampleCreation, SamplePE> diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/IUpdateSampleProjectExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/IUpdateSampleProjectExecutor.java index 02c5ed5596a..4104f13088c 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/IUpdateSampleProjectExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/IUpdateSampleProjectExecutor.java @@ -21,8 +21,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.entity.IUpdateEntity import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE; /** - * - * * @author Franz-Josef Elmer */ public interface IUpdateSampleProjectExecutor extends IUpdateEntityRelationsExecutor<SampleUpdate, SamplePE> diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/IVerifySampleProjectExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/IVerifySampleProjectExecutor.java index 29599632577..e65a4078953 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/IVerifySampleProjectExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/IVerifySampleProjectExecutor.java @@ -22,8 +22,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.IOperationContext; import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE; /** - * - * * @author Franz-Josef Elmer */ public interface IVerifySampleProjectExecutor diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/ListSampleTechIdByIdentifier.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/ListSampleTechIdByIdentifier.java index 98354b02c6c..b6e07f3c478 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/ListSampleTechIdByIdentifier.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/ListSampleTechIdByIdentifier.java @@ -40,7 +40,7 @@ import ch.systemsx.cisd.base.exceptions.CheckedExceptionTunnel; public class ListSampleTechIdByIdentifier extends AbstractListTechIdById<SampleIdentifier> { public static final String CONTAINER_SHORTCUT_ALLOWED_ATTRIBUTE = "container-shortcut-allowed"; - + private String homeSpaceCodeOrNull; public ListSampleTechIdByIdentifier(String homeSpaceCodeOrNull) @@ -74,7 +74,7 @@ public class ListSampleTechIdByIdentifier extends AbstractListTechIdById<SampleI } return result; } - + private boolean getContainerShortcutAllowed(IOperationContext context) { Object value = context.getAttribute(CONTAINER_SHORTCUT_ALLOWED_ATTRIBUTE); @@ -101,7 +101,7 @@ public class ListSampleTechIdByIdentifier extends AbstractListTechIdById<SampleI return groupedIdentifiers; } - private List<TechIdStringIdentifierRecord> list(final SampleQuery query, final SampleIdentifierParts key, + private List<TechIdStringIdentifierRecord> list(final SampleQuery query, final SampleIdentifierParts key, final Collection<String> codes, boolean containerShortcutAllowed) { final String[] codesArray = codes.toArray(new String[codes.size()]); @@ -174,8 +174,8 @@ public class ListSampleTechIdByIdentifier extends AbstractListTechIdById<SampleI return query.listProjectSampleTechIdsByContainerCodeAndCodes(spaceCode, projectCode, containerCode, codesArray); } - private List<TechIdStringIdentifierRecord> listWithoutContainerOrWithSomeContainerAndUniqueCode(SampleQuery query, - String[] codes, IListAction listWithoutContainer, IListAction listWithSomeContainer, + private List<TechIdStringIdentifierRecord> listWithoutContainerOrWithSomeContainerAndUniqueCode(SampleQuery query, + String[] codes, IListAction listWithoutContainer, IListAction listWithSomeContainer, boolean containerShortcutAllowed) { try diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/ListSampleTechIdByPermId.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/ListSampleTechIdByPermId.java index e24d468a195..abadb1805a3 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/ListSampleTechIdByPermId.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/ListSampleTechIdByPermId.java @@ -25,8 +25,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.TechIdStringI import ch.ethz.sis.openbis.generic.server.asapi.v3.helper.common.AbstractListTechIdByPermId; /** - * - * * @author Franz-Josef Elmer */ public class ListSampleTechIdByPermId extends AbstractListTechIdByPermId<SamplePermId> diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/SampleIdentifierParts.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/SampleIdentifierParts.java index d9cc5e9605e..8a32bbe44f7 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/SampleIdentifierParts.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/SampleIdentifierParts.java @@ -19,7 +19,9 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.executor.sample; public final class SampleIdentifierParts { private String spaceCodeOrNull; + private String projectCodeOrNull; + private String containerCodeOrNull; SampleIdentifierParts(String spaceCodeOrNull, String projectCodeOrNull, String containerCodeOrNull) @@ -56,23 +58,23 @@ public final class SampleIdentifierParts return false; } SampleIdentifierParts key = (SampleIdentifierParts) obj; - return isEqual(spaceCodeOrNull, key.spaceCodeOrNull) + return isEqual(spaceCodeOrNull, key.spaceCodeOrNull) && isEqual(projectCodeOrNull, key.projectCodeOrNull) && isEqual(containerCodeOrNull, key.containerCodeOrNull); } - + private boolean isEqual(String str1, String str2) { return str1 == null ? str1 == str2 : str1.equals(str2); } - + @Override public int hashCode() { - return 37 * (37 * calcHashCode(spaceCodeOrNull) + calcHashCode(projectCodeOrNull)) + return 37 * (37 * calcHashCode(spaceCodeOrNull) + calcHashCode(projectCodeOrNull)) + calcHashCode(containerCodeOrNull); } - + private int calcHashCode(String str) { return str == null ? 0 : str.hashCode(); diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/SearchSampleTypeExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/SearchSampleTypeExecutor.java index 96e861a5406..082344b117d 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/SearchSampleTypeExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/SearchSampleTypeExecutor.java @@ -23,8 +23,6 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.SampleTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind; /** - * - * * @author Franz-Josef Elmer */ @Component diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/SetSampleProjectExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/SetSampleProjectExecutor.java index 2b4a205f752..ab0301fd3a6 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/SetSampleProjectExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/SetSampleProjectExecutor.java @@ -33,13 +33,11 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.ProjectPE; import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE; /** - * - * * @author Franz-Josef Elmer */ @Component public class SetSampleProjectExecutor extends AbstractSetEntityToOneRelationExecutor<SampleCreation, SamplePE, IProjectId, ProjectPE> - implements ISetSampleProjectExecutor + implements ISetSampleProjectExecutor { @Autowired private IMapProjectByIdExecutor mapProjectByIdExecutor; @@ -48,7 +46,7 @@ public class SetSampleProjectExecutor extends AbstractSetEntityToOneRelationExec protected IProjectId getRelatedId(SampleCreation creation) { // TODO: project samples -// return creation.getProjectId(); + // return creation.getProjectId(); return null; } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/UpdateSampleExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/UpdateSampleExecutor.java index a2bb9e9e93d..b936fbaa957 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/UpdateSampleExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/UpdateSampleExecutor.java @@ -60,7 +60,7 @@ public class UpdateSampleExecutor extends AbstractUpdateEntityExecutor<SampleUpd @Autowired private IUpdateSampleProjectExecutor updateSampleProjectExecutor; - + @Autowired private IUpdateSampleExperimentExecutor updateSampleExperimentExecutor; diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/UpdateSampleProjectExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/UpdateSampleProjectExecutor.java index 9d7bfb418aa..f30227d07ba 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/UpdateSampleProjectExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/UpdateSampleProjectExecutor.java @@ -35,12 +35,10 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.ProjectPE; import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE; /** - * - * * @author Franz-Josef Elmer */ @Component -public class UpdateSampleProjectExecutor extends AbstractUpdateEntityToOneRelationExecutor<SampleUpdate, SamplePE, IProjectId, ProjectPE> +public class UpdateSampleProjectExecutor extends AbstractUpdateEntityToOneRelationExecutor<SampleUpdate, SamplePE, IProjectId, ProjectPE> implements IUpdateSampleProjectExecutor { @Autowired @@ -52,30 +50,26 @@ public class UpdateSampleProjectExecutor extends AbstractUpdateEntityToOneRelati return new ProjectIdentifier(related.getIdentifier()); } - @Override protected ProjectPE getCurrentlyRelated(SamplePE entity) { return entity.getProject(); } - @Override protected FieldUpdateValue<IProjectId> getRelatedUpdate(SampleUpdate update) { // TODO: project samples -// return update.getProjectId(); + // return update.getProjectId(); return null; } - @Override protected Map<IProjectId, ProjectPE> map(IOperationContext context, List<IProjectId> relatedIds) { return mapProjectByIdExecutor.map(context, relatedIds); } - @Override protected void check(IOperationContext context, SamplePE entity, IProjectId relatedId, ProjectPE related) { @@ -85,7 +79,6 @@ public class UpdateSampleProjectExecutor extends AbstractUpdateEntityToOneRelati } } - @Override protected void update(IOperationContext context, SamplePE entity, ProjectPE related) { diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/VerifySampleExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/VerifySampleExecutor.java index 1492caf97a3..82ebd97c8c3 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/VerifySampleExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/VerifySampleExecutor.java @@ -40,7 +40,7 @@ public class VerifySampleExecutor implements IVerifySampleExecutor @Autowired private IVerifySampleExperimentExecutor verifySampleExperimentExecutor; - + @Autowired private IVerifySampleContainerExecutor verifySampleContainerExecutor; @@ -53,7 +53,7 @@ public class VerifySampleExecutor implements IVerifySampleExecutor verifyEntityPropertyExecutor.verify(context, samples); verifySampleExperimentExecutor.verify(context, samples); // TODO: project samples -// verifySampleProjectExecutor.verify(context, samples); + // verifySampleProjectExecutor.verify(context, samples); verifySampleContainerExecutor.verify(context, samples); verifySampleParentsExecutor.verify(context, samples); } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/space/IMapSpaceTechIdByIdExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/space/IMapSpaceTechIdByIdExecutor.java index ae9507651ba..832bae0d59e 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/space/IMapSpaceTechIdByIdExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/space/IMapSpaceTechIdByIdExecutor.java @@ -20,8 +20,6 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.space.id.ISpaceId; import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.IMapObjectByIdExecutor; /** - * - * * @author Franz-Josef Elmer */ public interface IMapSpaceTechIdByIdExecutor extends IMapObjectByIdExecutor<ISpaceId, Long> diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/space/ListSpaceTechIdByPermId.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/space/ListSpaceTechIdByPermId.java index 80f2bf67a2d..12bc77bcc74 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/space/ListSpaceTechIdByPermId.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/space/ListSpaceTechIdByPermId.java @@ -25,8 +25,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.TechIdStringI import ch.ethz.sis.openbis.generic.server.asapi.v3.helper.common.AbstractListTechIdByPermId; /** - * - * * @author Franz-Josef Elmer */ public class ListSpaceTechIdByPermId extends AbstractListTechIdByPermId<SpacePermId> diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/tag/UpdateTagDataSetsWithCacheExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/tag/UpdateTagDataSetsWithCacheExecutor.java index 52fdce7a2bc..a9f8ce597d4 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/tag/UpdateTagDataSetsWithCacheExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/tag/UpdateTagDataSetsWithCacheExecutor.java @@ -32,7 +32,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.MetaprojectPE; * @author pkupczyk */ @Component -public class UpdateTagDataSetsWithCacheExecutor extends UpdateTagEntitiesWithCacheExecutor<IDataSetId, DataPE> implements IUpdateTagDataSetsWithCacheExecutor +public class UpdateTagDataSetsWithCacheExecutor extends UpdateTagEntitiesWithCacheExecutor<IDataSetId, DataPE> implements + IUpdateTagDataSetsWithCacheExecutor { @Override diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/tag/UpdateTagExperimentsExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/tag/UpdateTagExperimentsExecutor.java index f81b9ccd443..7c58a8de904 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/tag/UpdateTagExperimentsExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/tag/UpdateTagExperimentsExecutor.java @@ -35,7 +35,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.MetaprojectPE; * @author pkupczyk */ @Component -public class UpdateTagExperimentsExecutor extends AbstractUpdateEntityMultipleRelationsExecutor<TagUpdate, MetaprojectPE, IExperimentId, ExperimentPE> +public class UpdateTagExperimentsExecutor extends + AbstractUpdateEntityMultipleRelationsExecutor<TagUpdate, MetaprojectPE, IExperimentId, ExperimentPE> implements IUpdateTagExperimentsExecutor { diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/common/AbstractListTechIdByPermId.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/common/AbstractListTechIdByPermId.java index c321c3b13f8..fc366eee7a8 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/common/AbstractListTechIdByPermId.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/common/AbstractListTechIdByPermId.java @@ -26,8 +26,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.IOperationContext; import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.TechIdStringIdentifierRecord; /** - * - * * @author Franz-Josef Elmer */ public abstract class AbstractListTechIdByPermId<ID extends ObjectPermId> extends AbstractListTechIdById<ID> @@ -40,7 +38,7 @@ public abstract class AbstractListTechIdByPermId<ID extends ObjectPermId> extend for (ID permId : ids) { permIds.add(permId.getPermId()); - } + } String[] permIdsAsArray = permIds.toArray(new String[permIds.size()]); Map<Long, ID> result = new HashMap<>(); List<TechIdStringIdentifierRecord> queryTechIds = queryTechIds(permIdsAsArray); @@ -50,9 +48,9 @@ public abstract class AbstractListTechIdByPermId<ID extends ObjectPermId> extend } return result; } - + protected abstract List<TechIdStringIdentifierRecord> queryTechIds(String[] permIds); - + protected abstract ID createPermId(String permIdAsString); } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/common/MapObjectById.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/common/MapObjectById.java index 11bf245bcd8..84d6e5498ab 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/common/MapObjectById.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/common/MapObjectById.java @@ -59,7 +59,7 @@ public class MapObjectById<ID, OBJECT> return idClassToIdListMap; } - private Map mapByIds(IOperationContext context, List<IListObjectById<? extends ID, OBJECT>> listers, + private Map mapByIds(IOperationContext context, List<IListObjectById<? extends ID, OBJECT>> listers, Map<Class, List> idClassToIdListMap) { final Map idToObject = new HashMap(); @@ -67,7 +67,7 @@ public class MapObjectById<ID, OBJECT> for (Class idClass : idClassToIdListMap.keySet()) { List idList = idClassToIdListMap.get(idClass); - IListObjectById listerForIdClass = findLister(listers, idClass, idList); + IListObjectById listerForIdClass = findLister(listers, idClass, idList); List objects = listerForIdClass.listByIds(context, idList); if (objects != null) { @@ -94,7 +94,7 @@ public class MapObjectById<ID, OBJECT> throw new UnsupportedObjectIdException((IObjectId) idList.iterator().next()); } - public Map<ID, OBJECT> map(IOperationContext context, List<IListObjectById<? extends ID, OBJECT>> listers, + public Map<ID, OBJECT> map(IOperationContext context, List<IListObjectById<? extends ID, OBJECT>> listers, Collection<? extends ID> ids) { Map<Class, List> idClassToIdListMap = groupIdsByClass(ids); diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/generators/Generator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/generators/Generator.java index 5f7797f98c0..67ccc0535b7 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/generators/Generator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/generators/Generator.java @@ -151,7 +151,7 @@ public class Generator extends AbstractGenerator addModificationDate(gen); gen.setToStringMethod("\"SampleType \" + code"); - gen.addPluralFetchedField("List<PropertyAssignment>", List.class.getName(), "propertyAssignments", + gen.addPluralFetchedField("List<PropertyAssignment>", List.class.getName(), "propertyAssignments", "Property assigments", PropertyAssignmentFetchOptions.class); return gen; @@ -224,7 +224,7 @@ public class Generator extends AbstractGenerator addModificationDate(gen); gen.setToStringMethod("\"ExperimentType \" + code"); - gen.addPluralFetchedField("List<PropertyAssignment>", List.class.getName(), "propertyAssignments", + gen.addPluralFetchedField("List<PropertyAssignment>", List.class.getName(), "propertyAssignments", "Property assigments", PropertyAssignmentFetchOptions.class); // TODO add validation script @@ -287,7 +287,7 @@ public class Generator extends AbstractGenerator addModificationDate(gen); gen.setToStringMethod("\"DataSetType \" + code"); - gen.addPluralFetchedField("List<PropertyAssignment>", List.class.getName(), "propertyAssignments", + gen.addPluralFetchedField("List<PropertyAssignment>", List.class.getName(), "propertyAssignments", "Property assigments", PropertyAssignmentFetchOptions.class); // TODO add validation script @@ -548,7 +548,7 @@ public class Generator extends AbstractGenerator addModificationDate(gen); gen.setToStringMethod("\"MaterialType \" + code"); - gen.addPluralFetchedField("List<PropertyAssignment>", List.class.getName(), "propertyAssignments", + gen.addPluralFetchedField("List<PropertyAssignment>", List.class.getName(), "propertyAssignments", "Property assigments", PropertyAssignmentFetchOptions.class); return gen; diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/generators/UltimateJSEntityGenerator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/generators/UltimateJSEntityGenerator.java index 9debfc430b5..6cc1d7803b1 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/generators/UltimateJSEntityGenerator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/generators/UltimateJSEntityGenerator.java @@ -97,8 +97,7 @@ public class UltimateJSEntityGenerator .replaceAll("==", "===") .replaceAll("!=", "!==") // Remove Comments - .replaceAll("(?:/\\*(?:[^*]|(?:\\*+[^*/]))*\\*+/)|(?://.*)", "") - ; + .replaceAll("(?:/\\*(?:[^*]|(?:\\*+[^*/]))*\\*+/)|(?://.*)", ""); } private static final void whriteStringAsFile(String filePath, String string) throws IOException diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/generators/uglify/ECMAScriptEngineFactory.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/generators/uglify/ECMAScriptEngineFactory.java index 362b0bc7bbc..9054480007b 100755 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/generators/uglify/ECMAScriptEngineFactory.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/generators/uglify/ECMAScriptEngineFactory.java @@ -3,19 +3,22 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.helper.generators.uglify; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; -public class ECMAScriptEngineFactory { - - public static ScriptEngine getECMAScriptEngine(){ - ScriptEngine engine = null; - ScriptEngineManager manager = new ScriptEngineManager(); - - engine = manager.getEngineByExtension("js"); - - if(engine == null){ - throw new RuntimeException("the java version do not install ECMAScipt engine, must be above java 1.6"); - } - - return engine; - } +public class ECMAScriptEngineFactory +{ + + public static ScriptEngine getECMAScriptEngine() + { + ScriptEngine engine = null; + ScriptEngineManager manager = new ScriptEngineManager(); + + engine = manager.getEngineByExtension("js"); + + if (engine == null) + { + throw new RuntimeException("the java version do not install ECMAScipt engine, must be above java 1.6"); + } + + return engine; + } } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/generators/uglify/UglifyJS.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/generators/uglify/UglifyJS.java index c98c48e6464..c539476fdb0 100755 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/generators/uglify/UglifyJS.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/generators/uglify/UglifyJS.java @@ -9,95 +9,101 @@ import java.net.URL; import javax.script.ScriptEngine; import javax.script.ScriptException; -public class UglifyJS { - - public static void main(String[] args) { - - new UglifyJS().exec(args); - } - - public Reader getResourceReader(String url) { - - Reader reader = null; - - try { - //TODO jar包内资æºåŠ è½½æœ‰é€šå¸¸ä¸‰ç§æ–¹å¼ï¼Œä½†æµ‹è¯•ä¸å‘çŽ°åªæœ‰ç¬¬ä¸€ç§æ–¹å¼æ‰æ‰¾åˆ°äº†èµ„æº - if(reader == null) { - reader = new InputStreamReader(getClass().getClassLoader().getResourceAsStream(url)); - } - - /* - if (reader == null) { - reader = new InputStreamReader(getClass().getResourceAsStream("../"+url)); - } - - if (reader == null) { - reader = new InputStreamReader(getClass().getResourceAsStream("/"+url)); - } - */ - } catch (Exception e) { - e.printStackTrace(); - } - - return reader; - } - - public void exec(String[] args) { - - ScriptEngine engine = ECMAScriptEngineFactory.getECMAScriptEngine(); - engine.put("uglify_args", args); - engine.put("uglify_no_output", false); - run(engine); - - try { - engine.eval("uglify();"); - } catch (ScriptException e) { - e.printStackTrace(); - } - } - - - private void run(ScriptEngine engine) { - try { - - Reader parsejsReader = getResourceReader("ch/ethz/sis/openbis/generic/shared/api/v3/dto/generators/uglify/javascript/parse-js.js"); - Reader processjsReader = getResourceReader("ch/ethz/sis/openbis/generic/shared/api/v3/dto/generators/uglify/javascript/process.js"); - Reader sysjsReader = getResourceReader("ch/ethz/sis/openbis/generic/shared/api/v3/dto/generators/uglify/javascript/adapter/sys.js"); - Reader jsonjsReader = getResourceReader("ch/ethz/sis/openbis/generic/shared/api/v3/dto/generators/uglify/javascript/adapter/JSON.js"); - Reader arrayjsReader = getResourceReader("ch/ethz/sis/openbis/generic/shared/api/v3/dto/generators/uglify/javascript/adapter/Array.js"); - Reader uglifyjsReader = getResourceReader("ch/ethz/sis/openbis/generic/shared/api/v3/dto/generators/uglify/javascript/uglifyjs.js"); - - engine.eval(arrayjsReader); - engine.eval(sysjsReader); - engine.eval(parsejsReader); - engine.eval(processjsReader); - engine.eval(jsonjsReader); - engine.eval(uglifyjsReader); - - } catch (ScriptException e) { - e.printStackTrace(); - } - - } - - public String uglify(String[] args){ - ScriptEngine engine = ECMAScriptEngineFactory.getECMAScriptEngine(); - engine.put("uglify_args", args); - engine.put("uglify_no_output", true); - run(engine); - - String result = null; - - try { - result = (String)engine.eval("uglify();"); - } catch (ScriptException e) { - e.printStackTrace(); - } - - return result; - } - - - +public class UglifyJS +{ + + public static void main(String[] args) + { + + new UglifyJS().exec(args); + } + + public Reader getResourceReader(String url) + { + + Reader reader = null; + + try + { + // TODO jar包内资æºåŠ è½½æœ‰é€šå¸¸ä¸‰ç§æ–¹å¼ï¼Œä½†æµ‹è¯•ä¸å‘çŽ°åªæœ‰ç¬¬ä¸€ç§æ–¹å¼æ‰æ‰¾åˆ°äº†èµ„æº + if (reader == null) + { + reader = new InputStreamReader(getClass().getClassLoader().getResourceAsStream(url)); + } + + /* + * if (reader == null) { reader = new InputStreamReader(getClass().getResourceAsStream("../"+url)); } if (reader == null) { reader = new + * InputStreamReader(getClass().getResourceAsStream("/"+url)); } + */ + } catch (Exception e) + { + e.printStackTrace(); + } + + return reader; + } + + public void exec(String[] args) + { + + ScriptEngine engine = ECMAScriptEngineFactory.getECMAScriptEngine(); + engine.put("uglify_args", args); + engine.put("uglify_no_output", false); + run(engine); + + try + { + engine.eval("uglify();"); + } catch (ScriptException e) + { + e.printStackTrace(); + } + } + + private void run(ScriptEngine engine) + { + try + { + + Reader parsejsReader = getResourceReader("ch/ethz/sis/openbis/generic/shared/api/v3/dto/generators/uglify/javascript/parse-js.js"); + Reader processjsReader = getResourceReader("ch/ethz/sis/openbis/generic/shared/api/v3/dto/generators/uglify/javascript/process.js"); + Reader sysjsReader = getResourceReader("ch/ethz/sis/openbis/generic/shared/api/v3/dto/generators/uglify/javascript/adapter/sys.js"); + Reader jsonjsReader = getResourceReader("ch/ethz/sis/openbis/generic/shared/api/v3/dto/generators/uglify/javascript/adapter/JSON.js"); + Reader arrayjsReader = getResourceReader("ch/ethz/sis/openbis/generic/shared/api/v3/dto/generators/uglify/javascript/adapter/Array.js"); + Reader uglifyjsReader = getResourceReader("ch/ethz/sis/openbis/generic/shared/api/v3/dto/generators/uglify/javascript/uglifyjs.js"); + + engine.eval(arrayjsReader); + engine.eval(sysjsReader); + engine.eval(parsejsReader); + engine.eval(processjsReader); + engine.eval(jsonjsReader); + engine.eval(uglifyjsReader); + + } catch (ScriptException e) + { + e.printStackTrace(); + } + + } + + public String uglify(String[] args) + { + ScriptEngine engine = ECMAScriptEngineFactory.getECMAScriptEngine(); + engine.put("uglify_args", args); + engine.put("uglify_no_output", true); + run(engine); + + String result = null; + + try + { + result = (String) engine.eval("uglify();"); + } catch (ScriptException e) + { + e.printStackTrace(); + } + + return result; + } } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/generators/uglify/UglifyOptions.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/generators/uglify/UglifyOptions.java index 4716b7762b4..c7c9bb5bc08 100755 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/generators/uglify/UglifyOptions.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/generators/uglify/UglifyOptions.java @@ -2,130 +2,159 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.helper.generators.uglify; import java.util.ArrayList; -public class UglifyOptions { - //-v or --verbose — output some notes on STDERR (for now just how long each operation takes). - public boolean verbose; - - //-b or --beautify — output indented code; when passed, additional options control the beautifier: - public boolean beautify; - - //-i N or --indent N — indentation level (number of spaces) - public Integer indent; - - // -q or --quote-keys — quote keys in literal objects (by default, only keys that cannot be identifier names will be quotes). - public boolean quoteKeys; - - public boolean ascii; - - //-nm or --no-mangle — don't mangle variable names - public boolean noMangle; - - //-ns or --no-squeeze — don't call ast_squeeze() (which does various optimizations that result in smaller, less readable code). - public boolean noSqueeze; - - //-mt or --mangle-toplevel — mangle names in the toplevel scope too (by default we don't do this). - public boolean mangleToplevel; - - //--no-seqs — when ast_squeeze() is called (thus, unless you pass --no-squeeze) it will reduce consecutive statements in blocks into a sequence. For example, "a = 10; b = 20; foo();" will be written as "a=10,b=20,foo();". In various occasions, this allows us to discard the block brackets (since the block becomes a single statement). This is ON by default because it seems safe and saves a few hundred bytes on some libs that I tested it on, but pass --no-seqs to disable it. - public boolean noSeqs; - - //--no-dead-code — by default, UglifyJS will remove code that is obviously unreachable (code that follows a return, throw, break or continue statement and is not a function/variable declaration). Pass this option to disable this optimization. - public boolean noDeadCode; - - //-nc or --no-copyright — by default, uglifyjs will keep the initial comment tokens in the generated code (assumed to be copyright information etc.). If you pass this it will discard it. - public boolean noCopyright; - - //-o filename or --output filename — put the result in filename. If this isn't given, the result goes to standard output (or see next one). - public String output; - - //--overwrite — if the code is read from a file (not from STDIN) and you pass --overwrite then the output will be written in the same file. - public boolean overwrite; - - //--ast — pass this if you want to get the Abstract Syntax Tree instead of JavaScript as output. Useful for debugging or learning more about the internals. - public boolean ast; - - //--extra — enable additional optimizations that have not yet been extensively tested. These might, or might not, break your code. If you find a bug using this option, please report a test case. - public boolean extra; - - //--unsafe — enable other additional optimizations that are known to be unsafe in some contrived situations, but could still be generally useful. For now only this: - //foo.toString() ==> foo+"" - public boolean unsafe; - //--max-line-len (default 32K characters) — add a newline after around 32K characters. I've seen both FF and Chrome croak when all the code was on a single line of around 670K. Pass –max-line-len 0 to disable this safety feature. - public Integer maxLineLen; - - //--reserved-names — some libraries rely on certain names to be used, as pointed out in issue #92 and #81, so this option allow you to exclude such names from the mangler. For example, to keep names require and $super intact you'd specify –reserved-names "require,$super". - public String reservedNames; - - - - public ArrayList<String> toArgList(){ - - ArrayList<String> options= new ArrayList<String>(); - - if(verbose){ - options.add("--verbose"); - } - if(beautify){ - options.add("--beautify"); - } - if(quoteKeys){ - options.add("--quote-keys"); - } - if(noMangle){ - options.add("--no-mangle"); - } - if(noSqueeze ){ - options.add("--no-squeeze"); - } - if(mangleToplevel){ - options.add("--mangle-toplevel"); - } - if(noSeqs){ - options.add("--no-seqs"); - } - if(noDeadCode){ - options.add("--no-dead-code"); - } - if(noCopyright){ - options.add("--no-copyright"); - } - if(overwrite){ - options.add("--overwrite"); - } - if(ast){ - options.add("--ast"); - } - if(extra){ - options.add("--extra"); - } - if(unsafe){ - options.add("--unsafe"); - } - if(ascii){ - options.add("--ascii"); - } - - if(maxLineLen != null){ - options.add("--max-line-len"); - options.add(""+maxLineLen); - } - - if(indent != null){ - options.add("--indent"); - options.add(""+indent); - - } - if(reservedNames != null){ - options.add("--reserved-names"); - options.add(reservedNames); - } - - if(output != null){ - options.add("--output"); - options.add(output); - } - - return options; - } +public class UglifyOptions +{ + // -v or --verbose — output some notes on STDERR (for now just how long each operation takes). + public boolean verbose; + + // -b or --beautify — output indented code; when passed, additional options control the beautifier: + public boolean beautify; + + // -i N or --indent N — indentation level (number of spaces) + public Integer indent; + + // -q or --quote-keys — quote keys in literal objects (by default, only keys that cannot be identifier names will be quotes). + public boolean quoteKeys; + + public boolean ascii; + + // -nm or --no-mangle — don't mangle variable names + public boolean noMangle; + + // -ns or --no-squeeze — don't call ast_squeeze() (which does various optimizations that result in smaller, less readable code). + public boolean noSqueeze; + + // -mt or --mangle-toplevel — mangle names in the toplevel scope too (by default we don't do this). + public boolean mangleToplevel; + + // --no-seqs — when ast_squeeze() is called (thus, unless you pass --no-squeeze) it will reduce consecutive statements in blocks into a sequence. + // For example, "a = 10; b = 20; foo();" will be written as "a=10,b=20,foo();". In various occasions, this allows us to discard the block brackets + // (since the block becomes a single statement). This is ON by default because it seems safe and saves a few hundred bytes on some libs that I + // tested it on, but pass --no-seqs to disable it. + public boolean noSeqs; + + // --no-dead-code — by default, UglifyJS will remove code that is obviously unreachable (code that follows a return, throw, break or continue + // statement and is not a function/variable declaration). Pass this option to disable this optimization. + public boolean noDeadCode; + + // -nc or --no-copyright — by default, uglifyjs will keep the initial comment tokens in the generated code (assumed to be copyright information + // etc.). If you pass this it will discard it. + public boolean noCopyright; + + // -o filename or --output filename — put the result in filename. If this isn't given, the result goes to standard output (or see next one). + public String output; + + // --overwrite — if the code is read from a file (not from STDIN) and you pass --overwrite then the output will be written in the same file. + public boolean overwrite; + + // --ast — pass this if you want to get the Abstract Syntax Tree instead of JavaScript as output. Useful for debugging or learning more about the + // internals. + public boolean ast; + + // --extra — enable additional optimizations that have not yet been extensively tested. These might, or might not, break your code. If you find a + // bug using this option, please report a test case. + public boolean extra; + + // --unsafe — enable other additional optimizations that are known to be unsafe in some contrived situations, but could still be generally useful. + // For now only this: + // foo.toString() ==> foo+"" + public boolean unsafe; + + // --max-line-len (default 32K characters) — add a newline after around 32K characters. I've seen both FF and Chrome croak when all the code was + // on a single line of around 670K. Pass –max-line-len 0 to disable this safety feature. + public Integer maxLineLen; + + // --reserved-names — some libraries rely on certain names to be used, as pointed out in issue #92 and #81, so this option allow you to exclude + // such names from the mangler. For example, to keep names require and $super intact you'd specify –reserved-names "require,$super". + public String reservedNames; + + public ArrayList<String> toArgList() + { + + ArrayList<String> options = new ArrayList<String>(); + + if (verbose) + { + options.add("--verbose"); + } + if (beautify) + { + options.add("--beautify"); + } + if (quoteKeys) + { + options.add("--quote-keys"); + } + if (noMangle) + { + options.add("--no-mangle"); + } + if (noSqueeze) + { + options.add("--no-squeeze"); + } + if (mangleToplevel) + { + options.add("--mangle-toplevel"); + } + if (noSeqs) + { + options.add("--no-seqs"); + } + if (noDeadCode) + { + options.add("--no-dead-code"); + } + if (noCopyright) + { + options.add("--no-copyright"); + } + if (overwrite) + { + options.add("--overwrite"); + } + if (ast) + { + options.add("--ast"); + } + if (extra) + { + options.add("--extra"); + } + if (unsafe) + { + options.add("--unsafe"); + } + if (ascii) + { + options.add("--ascii"); + } + + if (maxLineLen != null) + { + options.add("--max-line-len"); + options.add("" + maxLineLen); + } + + if (indent != null) + { + options.add("--indent"); + options.add("" + indent); + + } + if (reservedNames != null) + { + options.add("--reserved-names"); + options.add(reservedNames); + } + + if (output != null) + { + options.add("--output"); + options.add(output); + } + + return options; + } } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/property/PropertyAssignmentComparatorFactory.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/property/PropertyAssignmentComparatorFactory.java index 51977744c98..fd1199bded8 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/property/PropertyAssignmentComparatorFactory.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/property/PropertyAssignmentComparatorFactory.java @@ -27,15 +27,13 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.helper.sort.AbstractStringCom import ch.ethz.sis.openbis.generic.server.asapi.v3.helper.sort.ComparatorFactory; /** - * - * * @author Franz-Josef Elmer */ public class PropertyAssignmentComparatorFactory extends ComparatorFactory { private static final Map<String, Comparator<PropertyAssignment>> COMPARATORS_BY_FIELD = new HashMap<>(); - - static + + static { COMPARATORS_BY_FIELD.put(PropertyAssignmentSortOptions.CODE, new AbstractPropertyAssignmentComparator() { @@ -46,13 +44,13 @@ public class PropertyAssignmentComparatorFactory extends ComparatorFactory } }); COMPARATORS_BY_FIELD.put(PropertyAssignmentSortOptions.LABEL, new AbstractPropertyAssignmentComparator() - { - @Override - protected String getValue(PropertyType propertyType) { - return propertyType.getLabel(); - } - }); + @Override + protected String getValue(PropertyType propertyType) + { + return propertyType.getLabel(); + } + }); } @Override @@ -82,8 +80,8 @@ public class PropertyAssignmentComparatorFactory extends ComparatorFactory String v = propertyType == null ? null : getValue(propertyType); return v == null ? "" : v; } - + protected abstract String getValue(PropertyType propertyType); - + } } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/service/IScriptRunnerFactory.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/service/IScriptRunnerFactory.java index 3dc05112dd9..c8053e8c454 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/service/IScriptRunnerFactory.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/service/IScriptRunnerFactory.java @@ -19,13 +19,11 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.helper.service; import ch.ethz.sis.openbis.generic.asapi.v3.plugin.service.context.ServiceContext; /** - * - * * @author Franz-Josef Elmer */ public interface IScriptRunnerFactory { public String getScriptPath(); - + public IServiceScriptRunner createServiceRunner(ServiceContext context); } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/service/IServiceScriptRunner.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/service/IServiceScriptRunner.java index 547d1fce28e..adffa8ffc76 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/service/IServiceScriptRunner.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/service/IServiceScriptRunner.java @@ -21,8 +21,6 @@ import java.io.Serializable; import ch.ethz.sis.openbis.generic.asapi.v3.dto.service.CustomASServiceExecutionOptions; /** - * - * * @author Franz-Josef Elmer */ public interface IServiceScriptRunner diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/service/JythonBasedCustomASServiceExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/service/JythonBasedCustomASServiceExecutor.java index 762875119f2..896d9bbcb95 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/service/JythonBasedCustomASServiceExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/helper/service/JythonBasedCustomASServiceExecutor.java @@ -27,21 +27,19 @@ import ch.systemsx.cisd.common.properties.PropertyUtils; import ch.systemsx.cisd.openbis.generic.server.CommonServiceProvider; /** - * - * * @author Franz-Josef Elmer */ public class JythonBasedCustomASServiceExecutor implements ICustomASServiceExecutor { private static final String SCRIPT_PATH = "script-path"; - + private final CustomASServiceScriptRunnerFactory factory; public JythonBasedCustomASServiceExecutor(Properties properties) { this(PropertyUtils.getMandatoryProperty(properties, SCRIPT_PATH), CommonServiceProvider.getApplicationServerApi()); } - + JythonBasedCustomASServiceExecutor(String scriptPath, IApplicationServerApi applicationService) { factory = new CustomASServiceScriptRunnerFactory(scriptPath, applicationService); diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/AttachmentBaseRecord.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/AttachmentBaseRecord.java index 2704eb7ccca..29e5aa5f8ea 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/AttachmentBaseRecord.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/AttachmentBaseRecord.java @@ -21,20 +21,26 @@ import java.util.Date; import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.common.ObjectBaseRecord; /** - * - * * @author Franz-Josef Elmer */ public class AttachmentBaseRecord extends ObjectBaseRecord { public String title; + public String fileName; + public String description; + public int version; + public Date registrationDate; + public String projectCode; + public String spaceCode; + public String samplePermId; + public String experimentPermId; } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/AttachmentContentRecord.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/AttachmentContentRecord.java index 6b58af70b96..5e6c150997b 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/AttachmentContentRecord.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/AttachmentContentRecord.java @@ -19,8 +19,6 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.attachment import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.common.ObjectBaseRecord; /** - * - * * @author Franz-Josef Elmer */ public class AttachmentContentRecord extends ObjectBaseRecord diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/AttachmentContentTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/AttachmentContentTranslator.java index f78d8385012..95da0a3e82f 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/AttachmentContentTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/AttachmentContentTranslator.java @@ -33,12 +33,10 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.common.Obje import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.common.ObjectToOneRelationTranslator; /** - * - * * @author Franz-Josef Elmer */ @Component -public class AttachmentContentTranslator extends ObjectToOneRelationTranslator<byte[], EmptyFetchOptions> +public class AttachmentContentTranslator extends ObjectToOneRelationTranslator<byte[], EmptyFetchOptions> implements IAttachmentContentTranslator { @Override @@ -49,7 +47,7 @@ public class AttachmentContentTranslator extends ObjectToOneRelationTranslator<b } @Override - protected Map<Long, byte[]> translateRelated(TranslationContext context, Collection<Long> contentIds, + protected Map<Long, byte[]> translateRelated(TranslationContext context, Collection<Long> contentIds, EmptyFetchOptions relatedFetchOptions) { AttachmentQuery query = QueryTool.getManagedQuery(AttachmentQuery.class); diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/AttachmentQuery.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/AttachmentQuery.java index 29161c3c950..390ae3a9b63 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/AttachmentQuery.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/AttachmentQuery.java @@ -27,24 +27,22 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.common.Obje import ch.systemsx.cisd.common.db.mapper.LongSetMapper; /** - * - * * @author Franz-Josef Elmer */ public interface AttachmentQuery extends ObjectQuery { - @Select(sql = "select proj_id as objectId, id as relatedId from attachments where proj_id = any(?{1})", + @Select(sql = "select proj_id as objectId, id as relatedId from attachments where proj_id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<ObjectRelationRecord> getProjectAttachments(LongSet projectIds); - - @Select(sql = "select samp_id as objectId, id as relatedId from attachments where samp_id = any(?{1})", + + @Select(sql = "select samp_id as objectId, id as relatedId from attachments where samp_id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<ObjectRelationRecord> getSampleAttachments(LongSet sampleIds); - - @Select(sql = "select expe_id as objectId, id as relatedId from attachments where expe_id = any(?{1})", + + @Select(sql = "select expe_id as objectId, id as relatedId from attachments where expe_id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<ObjectRelationRecord> getExperimentAttachments(LongSet experimentIds); - + @Select(sql = "select a.id, a.title, a.file_name as fileName, a.description, " + "a.registration_timestamp as registrationDate, a.version, " + "p.code as projectCode, sp.code as spaceCode, " @@ -53,19 +51,19 @@ public interface AttachmentQuery extends ObjectQuery + "left outer join projects p on a.proj_id=p.id left outer join spaces sp on p.space_id=sp.id " + "left outer join samples s on a.samp_id=s.id " + "left outer join experiments e on a.expe_id=e.id " - + "where a.id = any(?{1})", + + "where a.id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<AttachmentBaseRecord> getAttachments(LongSet attachmentIds); - - @Select(sql = "select id as objectId, pers_id_registerer as relatedId from attachments where id = any(?{1})", + + @Select(sql = "select id as objectId, pers_id_registerer as relatedId from attachments where id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<ObjectRelationRecord> getRegistratorIds(LongSet attachmentIds); - - @Select(sql = "select id as objectId, exac_id as relatedId from attachments where id = any(?{1})", + + @Select(sql = "select id as objectId, exac_id as relatedId from attachments where id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<ObjectRelationRecord> getContentIds(LongSet attachmentIds); - - @Select(sql = "select id,value as content from attachment_contents where id = any(?{1})", + + @Select(sql = "select id,value as content from attachment_contents where id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<AttachmentContentRecord> getAttachmentContents(LongSet attachmentContentsIds); diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/AttachmentTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/AttachmentTranslator.java index 3f8a5bba531..ed8f5d5ebb6 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/AttachmentTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/AttachmentTranslator.java @@ -48,23 +48,23 @@ public class AttachmentTranslator extends AbstractCachingTranslator<Long, Attach implements IAttachmentTranslator { private static Comparator<AttachmentBaseRecord> VERSION_COMPARATOR = new Comparator<AttachmentBaseRecord>() + { + @Override + public int compare(AttachmentBaseRecord r1, AttachmentBaseRecord r2) { - @Override - public int compare(AttachmentBaseRecord r1, AttachmentBaseRecord r2) - { - return r2.version - r1.version; - } - }; - - @Autowired + return r2.version - r1.version; + } + }; + + @Autowired private IAttachmentBaseTranslator baseTranslator; - + @Autowired private IAttachmentRegistratorTranslator registratorTranslator; - + @Autowired private IAttachmentContentTranslator contentTranslator; - + @Override protected Attachment createObject(TranslationContext context, Long input, AttachmentFetchOptions fetchOptions) { @@ -86,7 +86,7 @@ public class AttachmentTranslator extends AbstractCachingTranslator<Long, Attach buildingHelper.translateRelatedObjects(context); return buildingHelper; } - + private List<List<AttachmentBaseRecord>> groupAndSortByVersion(Collection<ObjectHolder<AttachmentBaseRecord>> records) { Map<String, List<AttachmentBaseRecord>> mapByFileName = new HashMap<>(); @@ -109,7 +109,7 @@ public class AttachmentTranslator extends AbstractCachingTranslator<Long, Attach } return new ArrayList<>(lists); } - + private String createKey(AttachmentBaseRecord record) { StringBuilder builder = new StringBuilder(); @@ -121,7 +121,7 @@ public class AttachmentTranslator extends AbstractCachingTranslator<Long, Attach } @Override - protected void updateObject(TranslationContext context, Long attachmentId, Attachment result, + protected void updateObject(TranslationContext context, Long attachmentId, Attachment result, Object objectRelations, AttachmentFetchOptions fetchOptions) { AttachmentsBuildingHelper buildingHelper = (AttachmentsBuildingHelper) objectRelations; @@ -140,7 +140,7 @@ public class AttachmentTranslator extends AbstractCachingTranslator<Long, Attach result.setLatestVersionPermlink(createPermlink(baseRecord, baseIndexURL, true)); buildingHelper.addRegistratorAndContent(result, attachmentId); } - + private String createPermlink(AttachmentBaseRecord baseRecord, String baseIndexURL, boolean latestVersionPermlink) { @@ -148,40 +148,47 @@ public class AttachmentTranslator extends AbstractCachingTranslator<Long, Attach Integer version = latestVersionPermlink ? null : baseRecord.version; if (baseRecord.projectCode != null) { - return PermlinkUtilities.createProjectAttachmentPermlinkURL(baseIndexURL, fileName, version, + return PermlinkUtilities.createProjectAttachmentPermlinkURL(baseIndexURL, fileName, version, baseRecord.projectCode, baseRecord.spaceCode); } if (baseRecord.samplePermId != null) { - return PermlinkUtilities.createAttachmentPermlinkURL(baseIndexURL, fileName, version, + return PermlinkUtilities.createAttachmentPermlinkURL(baseIndexURL, fileName, version, AttachmentHolderKind.SAMPLE, baseRecord.samplePermId); } - return PermlinkUtilities.createAttachmentPermlinkURL(baseIndexURL, fileName, version, + return PermlinkUtilities.createAttachmentPermlinkURL(baseIndexURL, fileName, version, AttachmentHolderKind.EXPERIMENT, baseRecord.experimentPermId); } - + private final class AttachmentsBuildingHelper { private Map<Long, AttachmentBaseRecord> records = new HashMap<>(); + private Map<PersonFetchOptions, List<Long>> attachmentsWithRegistrator = new HashMap<>(); + private Set<Long> attachmentsWithContent = new HashSet<>(); + private Map<Long, AttachmentFetchOptions> fetchOptionsByAttachmentId = new HashMap<>(); + private Map<Long, ObjectHolder<Person>> registratorsByAttachmentId = new HashMap<>(); + private Map<Long, ObjectHolder<byte[]>> contentsByAttachmentId; + private Map<Long, Long> nextVersionIdByAttachmentId = new HashMap<>(); + private Map<Long, Attachment> attachments = new HashMap<>(); - + AttachmentBaseRecord getBaseRecord(Long attachmentId) { return records.get(attachmentId); } - + private <T> T getObject(Map<Long, ObjectHolder<T>> objectsById, Long attachmentId) { ObjectHolder<T> objectHolder = objectsById.get(attachmentId); return objectHolder == null ? null : objectHolder.getObject(); } - + void addRegistratorAndContent(Attachment attachment, Long attachmentId) { attachments.put(attachmentId, attachment); @@ -210,7 +217,7 @@ public class AttachmentTranslator extends AbstractCachingTranslator<Long, Attach } } - void handleAttachmentsOfDifferentVersions(List<AttachmentBaseRecord> recordsSortedByVersion, + void handleAttachmentsOfDifferentVersions(List<AttachmentBaseRecord> recordsSortedByVersion, AttachmentFetchOptions fetchOptions) { AttachmentFetchOptions currentFetchOptions = fetchOptions; @@ -240,7 +247,7 @@ public class AttachmentTranslator extends AbstractCachingTranslator<Long, Attach nextVersionId = attachmentId; } } - + void translateRelatedObjects(TranslationContext context) { Set<Entry<PersonFetchOptions, List<Long>>> entrySet = attachmentsWithRegistrator.entrySet(); @@ -252,7 +259,7 @@ public class AttachmentTranslator extends AbstractCachingTranslator<Long, Attach } contentsByAttachmentId = contentTranslator.translate(context, attachmentsWithContent, null); } - + private void addRequestForRegistrator(Long attachmentId, PersonFetchOptions fetchOptions) { List<Long> list = attachmentsWithRegistrator.get(fetchOptions); @@ -263,7 +270,7 @@ public class AttachmentTranslator extends AbstractCachingTranslator<Long, Attach } list.add(attachmentId); } - + } - + } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/EntityAttachmentTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/EntityAttachmentTranslator.java index 73d4eac3d9c..c3460c25a7a 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/EntityAttachmentTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/EntityAttachmentTranslator.java @@ -38,8 +38,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.common.Obje import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.common.ObjectToManyRelationTranslator; /** - * - * * @author Franz-Josef Elmer */ public abstract class EntityAttachmentTranslator extends ObjectToManyRelationTranslator<Attachment, AttachmentFetchOptions> @@ -48,7 +46,7 @@ public abstract class EntityAttachmentTranslator extends ObjectToManyRelationTra private IAttachmentTranslator attachmentTranslator; protected abstract List<ObjectRelationRecord> loadRecords(LongOpenHashSet entityIds, AttachmentQuery query); - + @Override protected Map<Long, Attachment> filterRelatedObjects(Map<Long, Attachment> relatedObjects) { diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/IAttachmentBaseTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/IAttachmentBaseTranslator.java index 1b77c1095fd..a466d588fd5 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/IAttachmentBaseTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/IAttachmentBaseTranslator.java @@ -19,8 +19,6 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.attachment import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.common.IObjectBaseTranslator; /** - * - * * @author Franz-Josef Elmer */ public interface IAttachmentBaseTranslator extends IObjectBaseTranslator<AttachmentBaseRecord> diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/IAttachmentContentTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/IAttachmentContentTranslator.java index e70198ec17c..f1ac108edf4 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/IAttachmentContentTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/attachment/IAttachmentContentTranslator.java @@ -20,8 +20,6 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.fetchoptions.EmptyFetchOp import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.common.IObjectToOneRelationTranslator; /** - * - * * @author Franz-Josef Elmer */ public interface IAttachmentContentTranslator extends IObjectToOneRelationTranslator<byte[], EmptyFetchOptions> diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/common/ObjectToManyRelationTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/common/ObjectToManyRelationTranslator.java index 1415ab1cdfd..f32618caf86 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/common/ObjectToManyRelationTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/common/ObjectToManyRelationTranslator.java @@ -86,7 +86,7 @@ public abstract class ObjectToManyRelationTranslator<RELATED_OBJECT, RELATED_FET return objectIdToRelatedMap; } - + protected Map<Long, RELATED_OBJECT> filterRelatedObjects(Map<Long, RELATED_OBJECT> relatedObjects) { return relatedObjects; diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/dataset/DataSetPropertyAssignmentTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/dataset/DataSetPropertyAssignmentTranslator.java index 81a7344c240..09783cfc702 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/dataset/DataSetPropertyAssignmentTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/dataset/DataSetPropertyAssignmentTranslator.java @@ -32,8 +32,6 @@ import it.unimi.dsi.fastutil.longs.LongOpenHashSet; import net.lemnik.eodsql.QueryTool; /** - * - * * @author Franz-Josef Elmer */ @Component @@ -48,7 +46,7 @@ public class DataSetPropertyAssignmentTranslator extends PropertyAssignmentTrans } @Override - protected Map<Long, PropertyAssignment> translateRelated(TranslationContext context, + protected Map<Long, PropertyAssignment> translateRelated(TranslationContext context, Collection<Long> dataSetTypePropertyTypeIds, PropertyAssignmentFetchOptions relatedFetchOptions) { DataSetQuery query = QueryTool.getManagedQuery(DataSetQuery.class); diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/dataset/DataSetQuery.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/dataset/DataSetQuery.java index 1972f65e214..38974488994 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/dataset/DataSetQuery.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/dataset/DataSetQuery.java @@ -184,11 +184,11 @@ public interface DataSetQuery extends ObjectQuery @Select(sql = "select d.id as objectId, d.pers_id_modifier as relatedId from data d where d.id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<ObjectRelationRecord> getModifierIds(LongSet dataSetIds); - - @Select(sql = "select dsty_id as objectId, id as relatedId from data_set_type_property_types where dsty_id = any(?{1})", + + @Select(sql = "select dsty_id as objectId, id as relatedId from data_set_type_property_types where dsty_id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<ObjectRelationRecord> getPropertyAssignmentIds(LongSet dataSetTypeIds); - + @Select(sql = "select * from data_set_type_property_types where id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<PropertyAssignmentRecord> getPropertyAssignments(LongSet dataSetTypePropertyTypeIds); diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/dataset/DataSetTypeTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/dataset/DataSetTypeTranslator.java index d30f1e9d925..2ff4a0cbe05 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/dataset/DataSetTypeTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/dataset/DataSetTypeTranslator.java @@ -43,7 +43,7 @@ public class DataSetTypeTranslator extends AbstractCachingTranslator<Long, DataS @Autowired private IDataSetTypeBaseTranslator baseTranslator; - + @Autowired private IDataSetPropertyAssignmentTranslator assignmentTranslator; @@ -63,7 +63,7 @@ public class DataSetTypeTranslator extends AbstractCachingTranslator<Long, DataS relations.put(IDataSetTypeBaseTranslator.class, baseTranslator.translate(context, typeIds, null)); if (fetchOptions.hasPropertyAssignments()) { - relations.put(IDataSetPropertyAssignmentTranslator.class, + relations.put(IDataSetPropertyAssignmentTranslator.class, assignmentTranslator.translate(context, typeIds, fetchOptions.withPropertyAssignments())); } @@ -82,7 +82,7 @@ public class DataSetTypeTranslator extends AbstractCachingTranslator<Long, DataS result.setKind(DataSetKind.valueOf(baseRecord.kind)); result.setDescription(baseRecord.description); result.setModificationDate(baseRecord.modificationDate); - + if (fetchOptions.hasPropertyAssignments()) { Collection<PropertyAssignment> assignments = relations.get(IDataSetPropertyAssignmentTranslator.class, typeId); diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/dataset/IDataSetPropertyAssignmentTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/dataset/IDataSetPropertyAssignmentTranslator.java index 937690b1290..aee24f179b1 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/dataset/IDataSetPropertyAssignmentTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/dataset/IDataSetPropertyAssignmentTranslator.java @@ -19,8 +19,6 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.dataset; import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.property.IPropertyAssignmentTranslator; /** - * - * * @author Franz-Josef Elmer */ public interface IDataSetPropertyAssignmentTranslator extends IPropertyAssignmentTranslator diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/experiment/ExperimentAttachmentTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/experiment/ExperimentAttachmentTranslator.java index 8712690ea63..0cc840be84d 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/experiment/ExperimentAttachmentTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/experiment/ExperimentAttachmentTranslator.java @@ -27,8 +27,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.attachment. import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.common.ObjectRelationRecord; /** - * - * * @author Franz-Josef Elmer */ @Component diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/experiment/ExperimentPropertyAssignmentTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/experiment/ExperimentPropertyAssignmentTranslator.java index 09ebf33caca..961b8d5d222 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/experiment/ExperimentPropertyAssignmentTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/experiment/ExperimentPropertyAssignmentTranslator.java @@ -32,8 +32,6 @@ import it.unimi.dsi.fastutil.longs.LongOpenHashSet; import net.lemnik.eodsql.QueryTool; /** - * - * * @author Franz-Josef Elmer */ @Component @@ -48,7 +46,7 @@ public class ExperimentPropertyAssignmentTranslator extends PropertyAssignmentTr } @Override - protected Map<Long, PropertyAssignment> translateRelated(TranslationContext context, + protected Map<Long, PropertyAssignment> translateRelated(TranslationContext context, Collection<Long> experimentTypePropertyTypeIds, PropertyAssignmentFetchOptions relatedFetchOptions) { ExperimentQuery query = QueryTool.getManagedQuery(ExperimentQuery.class); diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/experiment/ExperimentQuery.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/experiment/ExperimentQuery.java index 5a2d48e92e8..fde26503a0d 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/experiment/ExperimentQuery.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/experiment/ExperimentQuery.java @@ -106,10 +106,10 @@ public interface ExperimentQuery extends ObjectQuery @Select(sql = "select ma.expe_id as objectId, ma.mepr_id as relatedId from metaproject_assignments ma where ma.expe_id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<ObjectRelationRecord> getTagIds(LongSet experimentIds); - @Select(sql = "select exty_id as objectId, id as relatedId from experiment_type_property_types where exty_id = any(?{1})", + @Select(sql = "select exty_id as objectId, id as relatedId from experiment_type_property_types where exty_id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<ObjectRelationRecord> getPropertyAssignmentIds(LongSet experimentTypeIds); - + @Select(sql = "select * from experiment_type_property_types where id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<PropertyAssignmentRecord> getPropertyAssignments(LongSet experimentTypePropertyTypeIds); diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/experiment/ExperimentTypeTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/experiment/ExperimentTypeTranslator.java index 5b0239239ed..51a99b5540b 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/experiment/ExperimentTypeTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/experiment/ExperimentTypeTranslator.java @@ -42,7 +42,7 @@ public class ExperimentTypeTranslator extends AbstractCachingTranslator<Long, Ex @Autowired private IExperimentTypeBaseTranslator baseTranslator; - + @Autowired private IExperimentPropertyAssignmentTranslator assignmentTranslator; @@ -62,7 +62,7 @@ public class ExperimentTypeTranslator extends AbstractCachingTranslator<Long, Ex relations.put(IExperimentTypeBaseTranslator.class, baseTranslator.translate(context, typeIds, null)); if (fetchOptions.hasPropertyAssignments()) { - relations.put(IExperimentPropertyAssignmentTranslator.class, + relations.put(IExperimentPropertyAssignmentTranslator.class, assignmentTranslator.translate(context, typeIds, fetchOptions.withPropertyAssignments())); } @@ -80,7 +80,7 @@ public class ExperimentTypeTranslator extends AbstractCachingTranslator<Long, Ex result.setCode(baseRecord.code); result.setDescription(baseRecord.description); result.setModificationDate(baseRecord.modificationDate); - + if (fetchOptions.hasPropertyAssignments()) { Collection<PropertyAssignment> assignments = relations.get(IExperimentPropertyAssignmentTranslator.class, typeId); diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/experiment/IExperimentPropertyAssignmentTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/experiment/IExperimentPropertyAssignmentTranslator.java index a3495c00459..0f1e4eceed8 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/experiment/IExperimentPropertyAssignmentTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/experiment/IExperimentPropertyAssignmentTranslator.java @@ -19,8 +19,6 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.experiment import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.property.IPropertyAssignmentTranslator; /** - * - * * @author Franz-Josef Elmer */ public interface IExperimentPropertyAssignmentTranslator extends IPropertyAssignmentTranslator diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/material/IMaterialPropertyAssignmentTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/material/IMaterialPropertyAssignmentTranslator.java index 5ed58b82217..f5677748763 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/material/IMaterialPropertyAssignmentTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/material/IMaterialPropertyAssignmentTranslator.java @@ -19,8 +19,6 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.material; import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.property.IPropertyAssignmentTranslator; /** - * - * * @author Franz-Josef Elmer */ public interface IMaterialPropertyAssignmentTranslator extends IPropertyAssignmentTranslator diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/material/MaterialPropertyAssignmentTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/material/MaterialPropertyAssignmentTranslator.java index 147cf880924..3535d14111f 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/material/MaterialPropertyAssignmentTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/material/MaterialPropertyAssignmentTranslator.java @@ -32,8 +32,6 @@ import it.unimi.dsi.fastutil.longs.LongOpenHashSet; import net.lemnik.eodsql.QueryTool; /** - * - * * @author Franz-Josef Elmer */ @Component @@ -48,7 +46,7 @@ public class MaterialPropertyAssignmentTranslator extends PropertyAssignmentTran } @Override - protected Map<Long, PropertyAssignment> translateRelated(TranslationContext context, + protected Map<Long, PropertyAssignment> translateRelated(TranslationContext context, Collection<Long> materialTypePropertyTaypeIds, PropertyAssignmentFetchOptions relatedFetchOptions) { MaterialQuery query = QueryTool.getManagedQuery(MaterialQuery.class); diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/material/MaterialQuery.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/material/MaterialQuery.java index 78362534dd3..f7bf68cbf6a 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/material/MaterialQuery.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/material/MaterialQuery.java @@ -79,11 +79,11 @@ public interface MaterialQuery extends ObjectQuery @Select(sql = "select ma.mate_id as objectId, ma.mepr_id as relatedId from metaproject_assignments ma where ma.mate_id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<ObjectRelationRecord> getTagIds(LongSet materialIds); - - @Select(sql = "select maty_id as objectId, id as relatedId from material_type_property_types where maty_id = any(?{1})", + + @Select(sql = "select maty_id as objectId, id as relatedId from material_type_property_types where maty_id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<ObjectRelationRecord> getPropertyAssignmentIds(LongSet materialTypeIds); - + @Select(sql = "select * from material_type_property_types where id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<PropertyAssignmentRecord> getPropertyAssignments(LongSet materialTypePropertyTypeIds); diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/material/MaterialTypeTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/material/MaterialTypeTranslator.java index 97974c17e82..a4fe018f8d8 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/material/MaterialTypeTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/material/MaterialTypeTranslator.java @@ -42,7 +42,7 @@ public class MaterialTypeTranslator extends AbstractCachingTranslator<Long, Mate @Autowired private IMaterialTypeBaseTranslator baseTranslator; - + @Autowired private IMaterialPropertyAssignmentTranslator assignmentTranslator; @@ -62,7 +62,7 @@ public class MaterialTypeTranslator extends AbstractCachingTranslator<Long, Mate relations.put(IMaterialTypeBaseTranslator.class, baseTranslator.translate(context, typeIds, null)); if (fetchOptions.hasPropertyAssignments()) { - relations.put(IMaterialPropertyAssignmentTranslator.class, + relations.put(IMaterialPropertyAssignmentTranslator.class, assignmentTranslator.translate(context, typeIds, fetchOptions.withPropertyAssignments())); } @@ -80,7 +80,7 @@ public class MaterialTypeTranslator extends AbstractCachingTranslator<Long, Mate result.setCode(baseRecord.code); result.setDescription(baseRecord.description); result.setModificationDate(baseRecord.modificationDate); - + if (fetchOptions.hasPropertyAssignments()) { Collection<PropertyAssignment> assignments = relations.get(IMaterialPropertyAssignmentTranslator.class, typeId); diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/IPropertyAssignmentTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/IPropertyAssignmentTranslator.java index f5e5086fa2f..e141f145c95 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/IPropertyAssignmentTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/IPropertyAssignmentTranslator.java @@ -21,8 +21,6 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.property.fetchoptions.PropertyAs import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.common.IObjectToManyRelationTranslator; /** - * - * * @author Franz-Josef Elmer */ public interface IPropertyAssignmentTranslator extends IObjectToManyRelationTranslator<PropertyAssignment, PropertyAssignmentFetchOptions> diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/PropertyAssignmentRecord.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/PropertyAssignmentRecord.java index a2ebb7e055b..0b4c9cb83c5 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/PropertyAssignmentRecord.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/PropertyAssignmentRecord.java @@ -19,12 +19,11 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.property; import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.common.ObjectBaseRecord; /** - * - * * @author Franz-Josef Elmer */ public class PropertyAssignmentRecord extends ObjectBaseRecord { public Boolean is_mandatory; + public Long prty_id; } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/PropertyAssignmentTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/PropertyAssignmentTranslator.java index b42b3dcbf6b..29d4643a3e4 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/PropertyAssignmentTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/PropertyAssignmentTranslator.java @@ -32,8 +32,6 @@ import it.unimi.dsi.fastutil.longs.LongOpenHashSet; import net.lemnik.eodsql.QueryTool; /** - * - * * @author Franz-Josef Elmer */ public abstract class PropertyAssignmentTranslator extends ObjectToManyRelationTranslator<PropertyAssignment, PropertyAssignmentFetchOptions> @@ -74,7 +72,6 @@ public abstract class PropertyAssignmentTranslator extends ObjectToManyRelationT return assignments; } - @Override protected Collection<PropertyAssignment> createCollection() { diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/PropertyQueryGenerator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/PropertyQueryGenerator.java index 5a2297315d0..b609fe2c003 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/PropertyQueryGenerator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/PropertyQueryGenerator.java @@ -124,7 +124,7 @@ public class PropertyQueryGenerator { StringBuilder sb = new StringBuilder(); - + for (String line : StringUtils.trim(query).split("\\n")) { if (line.isEmpty()) diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/PropertyTypeQuery.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/PropertyTypeQuery.java index 49da3813ffe..320869904c1 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/PropertyTypeQuery.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/PropertyTypeQuery.java @@ -25,14 +25,12 @@ import it.unimi.dsi.fastutil.longs.LongSet; import net.lemnik.eodsql.Select; /** - * - * * @author Franz-Josef Elmer */ public interface PropertyTypeQuery extends ObjectQuery { @Select(sql = "select pt.*, t.code as dataSetTypeCode " - + "from property_types pt join data_types t on pt.daty_id=t.id where pt.id = any(?{1})", + + "from property_types pt join data_types t on pt.daty_id=t.id where pt.id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<PropertyTypeRecord> getPropertyTypes(LongSet propertyTypeIds); } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/PropertyTypeRecord.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/PropertyTypeRecord.java index 61a6ced468e..79e5c03835b 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/PropertyTypeRecord.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/property/PropertyTypeRecord.java @@ -19,15 +19,17 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.property; import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.common.ObjectBaseRecord; /** - * - * * @author Franz-Josef Elmer */ public class PropertyTypeRecord extends ObjectBaseRecord { public String code; + public String label; + public String description; + public Boolean is_internal_namespace; + public String dataSetTypeCode; } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/ISampleProjectTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/ISampleProjectTranslator.java index 70802f954e5..e18b84985d4 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/ISampleProjectTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/ISampleProjectTranslator.java @@ -19,8 +19,6 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.sample; import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.project.IObjectToProjectTranslator; /** - * - * * @author Franz-Josef Elmer */ public interface ISampleProjectTranslator extends IObjectToProjectTranslator diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/ISamplePropertyAssignmentTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/ISamplePropertyAssignmentTranslator.java index 7c62a2d03bc..e6f6ca486a9 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/ISamplePropertyAssignmentTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/ISamplePropertyAssignmentTranslator.java @@ -19,8 +19,6 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.sample; import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.property.IPropertyAssignmentTranslator; /** - * - * * @author Franz-Josef Elmer */ public interface ISamplePropertyAssignmentTranslator extends IPropertyAssignmentTranslator diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SampleAttachmentTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SampleAttachmentTranslator.java index 52836fa6f18..3069d2459d0 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SampleAttachmentTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SampleAttachmentTranslator.java @@ -27,8 +27,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.attachment. import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.common.ObjectRelationRecord; /** - * - * * @author Franz-Josef Elmer */ @Component diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SampleBaseRecord.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SampleBaseRecord.java index 82d4ed177a2..b57621c5df8 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SampleBaseRecord.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SampleBaseRecord.java @@ -31,7 +31,7 @@ public class SampleBaseRecord extends ObjectBaseRecord public String spaceCode; public String projectCode; - + public String containerCode; public String permId; diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SampleProjectTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SampleProjectTranslator.java index 83f1480f5d0..aa92ade9715 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SampleProjectTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SampleProjectTranslator.java @@ -28,8 +28,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.common.Obje import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.entity.project.ObjectToProjectTranslator; /** - * - * * @author Franz-Josef Elmer */ @Component diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SamplePropertyAssignmentTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SamplePropertyAssignmentTranslator.java index c3680de801e..db87489f50e 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SamplePropertyAssignmentTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SamplePropertyAssignmentTranslator.java @@ -32,8 +32,6 @@ import it.unimi.dsi.fastutil.longs.LongOpenHashSet; import net.lemnik.eodsql.QueryTool; /** - * - * * @author Franz-Josef Elmer */ @Component @@ -47,7 +45,7 @@ public class SamplePropertyAssignmentTranslator extends PropertyAssignmentTransl } @Override - protected Map<Long, PropertyAssignment> translateRelated(TranslationContext context, + protected Map<Long, PropertyAssignment> translateRelated(TranslationContext context, Collection<Long> sampleTypePropertyTypeIds, PropertyAssignmentFetchOptions relatedFetchOptions) { SampleQuery query = QueryTool.getManagedQuery(SampleQuery.class); diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SampleQuery.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SampleQuery.java index e3a2adeed5f..77df7b386af 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SampleQuery.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SampleQuery.java @@ -90,7 +90,7 @@ public interface SampleQuery extends ObjectQuery + "srh.entity_perm_id as relatedObjectId, srh.valid_from_timestamp as validFrom, srh.valid_until_timestamp as validTo, " + "srh.space_id as spaceId, srh.expe_id as experimentId, srh.samp_id as sampleId, srh.data_id as dataSetId " + "from sample_relationships_history srh where srh.valid_until_timestamp is not null and srh.main_samp_id = any(?{1})", parameterBindings = { - LongSetMapper.class }, fetchSize = FETCH_SIZE) + LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<SampleRelationshipRecord> getRelationshipsHistory(LongSet sampleIds); @Select(sql = "select s.id as objectId, s.expe_id as relatedId from samples s where s.id = any(?{1})", parameterBindings = { @@ -108,13 +108,13 @@ public interface SampleQuery extends ObjectQuery @Select(sql = "select sr.sample_id_child as objectId, sr.sample_id_parent as relatedId from " + "sample_relationships sr, relationship_types rt " + "where sr.relationship_id = rt.id and rt.code = 'PARENT_CHILD' and sr.sample_id_child = any(?{1}) order by sr.id", parameterBindings = { - LongSetMapper.class }, fetchSize = FETCH_SIZE) + LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<ObjectRelationRecord> getParentIds(LongSet sampleIds); @Select(sql = "select sr.sample_id_parent as objectId, sr.sample_id_child as relatedId from " + "sample_relationships sr, relationship_types rt " + "where sr.relationship_id = rt.id and rt.code = 'PARENT_CHILD' and sr.sample_id_parent = any(?{1}) order by sr.id", parameterBindings = { - LongSetMapper.class }, fetchSize = FETCH_SIZE) + LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<ObjectRelationRecord> getChildIds(LongSet sampleIds); @Select(sql = "select s.id as objectId, s.pers_id_registerer as relatedId from samples s where s.id = any(?{1})", parameterBindings = { @@ -140,11 +140,11 @@ public interface SampleQuery extends ObjectQuery @Select(sql = "select s.id as objectId, s.proj_id as relatedId from samples s where s.id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<ObjectRelationRecord> getProjectIds(LongSet sampleIds); - - @Select(sql = "select saty_id as objectId, id as relatedId from sample_type_property_types where saty_id = any(?{1})", + + @Select(sql = "select saty_id as objectId, id as relatedId from sample_type_property_types where saty_id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<ObjectRelationRecord> getPropertyAssignmentIds(LongSet sampleTypeIds); - + @Select(sql = "select * from sample_type_property_types where id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<PropertyAssignmentRecord> getPropertyAssignments(LongSet sampleTypePropertyTypeIds); diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SampleTypeTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SampleTypeTranslator.java index be62800dd23..5ed089ad0df 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SampleTypeTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/sample/SampleTypeTranslator.java @@ -55,7 +55,7 @@ public class SampleTypeTranslator extends AbstractCachingTranslator<Long, Sample } @Override - protected TranslationResults getObjectsRelations(TranslationContext context, Collection<Long> typeIds, + protected TranslationResults getObjectsRelations(TranslationContext context, Collection<Long> typeIds, SampleTypeFetchOptions fetchOptions) { TranslationResults relations = new TranslationResults(); @@ -63,7 +63,7 @@ public class SampleTypeTranslator extends AbstractCachingTranslator<Long, Sample relations.put(ISampleTypeBaseTranslator.class, baseTranslator.translate(context, typeIds, null)); if (fetchOptions.hasPropertyAssignments()) { - relations.put(ISamplePropertyAssignmentTranslator.class, + relations.put(ISamplePropertyAssignmentTranslator.class, assignmentTranslator.translate(context, typeIds, fetchOptions.withPropertyAssignments())); } @@ -86,7 +86,7 @@ public class SampleTypeTranslator extends AbstractCachingTranslator<Long, Sample result.setShowParentMetadata(baseRecord.showParentMetadata); result.setSubcodeUnique(baseRecord.subcodeUnique); result.setModificationDate(baseRecord.modificationDate); - + if (fetchOptions.hasPropertyAssignments()) { Collection<PropertyAssignment> assignments = relations.get(ISamplePropertyAssignmentTranslator.class, typeId); diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/tag/TagQuery.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/tag/TagQuery.java index e098467cc2c..53e515ed445 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/tag/TagQuery.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/tag/TagQuery.java @@ -33,7 +33,7 @@ public interface TagQuery extends ObjectQuery @Select(sql = "select m.id, m.name, m.description, p.user_id as owner, m.private as isPrivate, m.creation_date as registrationDate from " + "metaprojects m, persons p where m.owner = p.id and m.id = any(?{1})", parameterBindings = { - LongSetMapper.class }, fetchSize = FETCH_SIZE) + LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<TagBaseRecord> getTags(LongSet tagIds); @Select(sql = "select m.id, p.user_id as owner, not m.private as isPublic from metaprojects m, persons p where " diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/vocabulary/VocabularyQuery.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/vocabulary/VocabularyQuery.java index 93b1b671b6a..fc4c1e78b72 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/vocabulary/VocabularyQuery.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/entity/vocabulary/VocabularyQuery.java @@ -42,7 +42,7 @@ public interface VocabularyQuery extends ObjectQuery @Select(sql = "select v.code as vocabularyCode, v.is_internal_namespace as isInternalNamespace, t.id, t.code, t.label, t.description, t.ordinal, t.is_official as isOfficial, t.registration_timestamp as registrationDate " + "from controlled_vocabulary_terms t, controlled_vocabularies v where t.id = any(?{1}) and t.covo_id = v.id", parameterBindings = { - LongSetMapper.class }, fetchSize = FETCH_SIZE) + LongSetMapper.class }, fetchSize = FETCH_SIZE) public List<VocabularyTermBaseRecord> getTerms(LongSet termIds); @Select(sql = "select t.id as objectId, t.pers_id_registerer as relatedId " diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/AbstractCompositeSearchCriteriaTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/AbstractCompositeSearchCriteriaTranslator.java index e70ca15b81a..0ed7ecb93dd 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/AbstractCompositeSearchCriteriaTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/AbstractCompositeSearchCriteriaTranslator.java @@ -73,7 +73,8 @@ public abstract class AbstractCompositeSearchCriteriaTranslator extends Abstract continue; } else { - for (DetailedSearchCriteria additionalCriteria: translationResult.getCriteriaList()) { + for (DetailedSearchCriteria additionalCriteria : translationResult.getCriteriaList()) + { detailedCriterionList.addAll(additionalCriteria.getCriteria()); } detailedCriterionList.addAll(translationResult.getCriterionList()); diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/DataSetSearchCriteriaTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/DataSetSearchCriteriaTranslator.java index 2e1bdb33248..4927d83b7b0 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/DataSetSearchCriteriaTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/DataSetSearchCriteriaTranslator.java @@ -49,7 +49,7 @@ public class DataSetSearchCriteriaTranslator extends AbstractCompositeSearchCrit context.pushEntityKind(EntityKind.DATA_SET); SearchCriteriaTranslationResult translationResult = super.doTranslate(context, criteria); context.popEntityKind(); - + if (criteria instanceof DataSetSearchCriteria && context.peekEntityKind() == null) { return translationResult; diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/EntityTypeSearchCriteriaTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/EntityTypeSearchCriteriaTranslator.java index 7593061bbf6..0559d2b8d9a 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/EntityTypeSearchCriteriaTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/EntityTypeSearchCriteriaTranslator.java @@ -40,7 +40,7 @@ public class EntityTypeSearchCriteriaTranslator extends AbstractFieldFromComposi @Override protected boolean doAccepts(ISearchCriteria criteria) { - return criteria instanceof EntityTypeSearchCriteria + return criteria instanceof EntityTypeSearchCriteria && false == (criteria instanceof SampleTypeSearchCriteria); } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/NumberFieldSearchCriteriaTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/NumberFieldSearchCriteriaTranslator.java index 196b7345e58..0e1c0078826 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/NumberFieldSearchCriteriaTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/NumberFieldSearchCriteriaTranslator.java @@ -54,23 +54,28 @@ public class NumberFieldSearchCriteriaTranslator extends AbstractFieldSearchCrit if (valueObject instanceof NumberLessThanValue) { NumberLessThanValue lessToValue = (NumberLessThanValue) valueObject; - return new SearchCriteriaTranslationResult(new DetailedSearchCriterion(getDetailedSearchField(context, numberCriteria), CompareType.LESS_THAN, lessToValue.getValue())); + return new SearchCriteriaTranslationResult(new DetailedSearchCriterion(getDetailedSearchField(context, numberCriteria), + CompareType.LESS_THAN, lessToValue.getValue())); } else if (valueObject instanceof NumberLessThanOrEqualToValue) { NumberLessThanOrEqualToValue lessOrEqualToValue = (NumberLessThanOrEqualToValue) valueObject; - return new SearchCriteriaTranslationResult(new DetailedSearchCriterion(getDetailedSearchField(context, numberCriteria), CompareType.LESS_THAN_OR_EQUAL, lessOrEqualToValue.getValue())); + return new SearchCriteriaTranslationResult(new DetailedSearchCriterion(getDetailedSearchField(context, numberCriteria), + CompareType.LESS_THAN_OR_EQUAL, lessOrEqualToValue.getValue())); } else if (valueObject instanceof NumberEqualToValue) { NumberEqualToValue equalToValue = (NumberEqualToValue) valueObject; - return new SearchCriteriaTranslationResult(new DetailedSearchCriterion(getDetailedSearchField(context, numberCriteria), CompareType.EQUALS, equalToValue.getValue())); + return new SearchCriteriaTranslationResult(new DetailedSearchCriterion(getDetailedSearchField(context, numberCriteria), + CompareType.EQUALS, equalToValue.getValue())); } else if (valueObject instanceof NumberGreaterThanOrEqualToValue) { NumberGreaterThanOrEqualToValue greaterOrEqualToValue = (NumberGreaterThanOrEqualToValue) valueObject; - return new SearchCriteriaTranslationResult(new DetailedSearchCriterion(getDetailedSearchField(context, numberCriteria), CompareType.MORE_THAN_OR_EQUAL, greaterOrEqualToValue.getValue())); + return new SearchCriteriaTranslationResult(new DetailedSearchCriterion(getDetailedSearchField(context, numberCriteria), + CompareType.MORE_THAN_OR_EQUAL, greaterOrEqualToValue.getValue())); } else if (valueObject instanceof NumberGreaterThanValue) { NumberGreaterThanValue greaterToValue = (NumberGreaterThanValue) valueObject; - return new SearchCriteriaTranslationResult(new DetailedSearchCriterion(getDetailedSearchField(context, numberCriteria), CompareType.MORE_THAN, greaterToValue.getValue())); + return new SearchCriteriaTranslationResult(new DetailedSearchCriterion(getDetailedSearchField(context, numberCriteria), + CompareType.MORE_THAN, greaterToValue.getValue())); } else { throw new IllegalArgumentException("Unknown number field value: " + valueObject); diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/ProjectSearchCriteriaTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/ProjectSearchCriteriaTranslator.java index b99209814db..c1d6ed5e601 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/ProjectSearchCriteriaTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/ProjectSearchCriteriaTranslator.java @@ -53,23 +53,23 @@ public class ProjectSearchCriteriaTranslator extends AbstractFieldFromCompositeS protected boolean doAccepts(ISearchCriteria criteria) { // TODO: project samples -// return criteria instanceof NoProjectSearchCriteria || criteria instanceof ProjectSearchCriteria; + // return criteria instanceof NoProjectSearchCriteria || criteria instanceof ProjectSearchCriteria; return criteria instanceof ProjectSearchCriteria; } @Override protected SearchCriteriaTranslationResult doTranslate(SearchTranslationContext context, ISearchCriteria criteria) { - if (EnumSet.of(EntityKind.EXPERIMENT, EntityKind.SAMPLE).contains(context.peekEntityKind()) == false) + if (EnumSet.of(EntityKind.EXPERIMENT, EntityKind.SAMPLE).contains(context.peekEntityKind()) == false) { throw new IllegalArgumentException("Project criteria can be used only in experiment or sample criteria, " + "but was used in: " + context.peekEntityKind() + " context."); } // TODO: project samples -// if (criteria instanceof NoProjectSearchCriteria) -// { -// return new SearchCriteriaTranslationResult(new DetailedSearchCriterion(PROJECT_ID_FIELD, NullBridge.NULL)); -// } + // if (criteria instanceof NoProjectSearchCriteria) + // { + // return new SearchCriteriaTranslationResult(new DetailedSearchCriterion(PROJECT_ID_FIELD, NullBridge.NULL)); + // } AbstractCompositeSearchCriteria compositeCriteria = (AbstractCompositeSearchCriteria) criteria; Collection<ISearchCriteria> subCriteria = compositeCriteria.getCriteria(); if (subCriteria.isEmpty()) @@ -88,12 +88,12 @@ public class ProjectSearchCriteriaTranslator extends AbstractFieldFromCompositeS if (subCriteria instanceof CodeSearchCriteria) { return DetailedSearchField.createAttributeField( - entityKind == EntityKind.EXPERIMENT ? ExperimentAttributeSearchFieldKind.PROJECT + entityKind == EntityKind.EXPERIMENT ? ExperimentAttributeSearchFieldKind.PROJECT : SampleAttributeSearchFieldKind.PROJECT); } else if (subCriteria instanceof PermIdSearchCriteria) { return DetailedSearchField.createAttributeField( - entityKind == EntityKind.EXPERIMENT ? ExperimentAttributeSearchFieldKind.PROJECT_PERM_ID + entityKind == EntityKind.EXPERIMENT ? ExperimentAttributeSearchFieldKind.PROJECT_PERM_ID : SampleAttributeSearchFieldKind.PROJECT_PERM_ID); } else if (subCriteria instanceof SpaceSearchCriteria) { diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/SpaceSearchCriteriaTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/SpaceSearchCriteriaTranslator.java index 16636b94b50..97c20be9e54 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/SpaceSearchCriteriaTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/translator/search/SpaceSearchCriteriaTranslator.java @@ -32,8 +32,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleAttributeSearchFi public class SpaceSearchCriteriaTranslator extends AbstractFieldFromCompositeSearchCriteriaTranslator { - private static final EnumSet<EntityKind> ENTITY_KINDS_WITH_SPACE - = EnumSet.of(EntityKind.EXPERIMENT, EntityKind.SAMPLE); + private static final EnumSet<EntityKind> ENTITY_KINDS_WITH_SPACE = EnumSet.of(EntityKind.EXPERIMENT, EntityKind.SAMPLE); public SpaceSearchCriteriaTranslator(IDAOFactory daoFactory, IEntityAttributeProviderFactory entityAttributeProviderFactory) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/BuildAndEnvironmentInfo.java b/openbis/source/java/ch/systemsx/cisd/openbis/BuildAndEnvironmentInfo.java index 34e2a128618..3463c9abb49 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/BuildAndEnvironmentInfo.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/BuildAndEnvironmentInfo.java @@ -18,7 +18,6 @@ package ch.systemsx.cisd.openbis; import ch.systemsx.cisd.base.utilities.AbstractBuildAndEnvironmentInfo; - /** * The build and environment information for openBIS. * @@ -27,9 +26,9 @@ import ch.systemsx.cisd.base.utilities.AbstractBuildAndEnvironmentInfo; public class BuildAndEnvironmentInfo extends AbstractBuildAndEnvironmentInfo { private final static String BASE = "openbis"; - + public final static BuildAndEnvironmentInfo INSTANCE = new BuildAndEnvironmentInfo(); - + private BuildAndEnvironmentInfo() { super(BASE); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/cli/DataSetLister.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/cli/DataSetLister.java index 932dd45f88f..a559e757509 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/cli/DataSetLister.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/cli/DataSetLister.java @@ -33,8 +33,7 @@ import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchCriteria.MatchCl /** * A rudimentary example of using the openBIS IGeneralInformationService API to find data sets. * <p> - * The main method gets a reference to the openBIS informational API and then uses this API to list - * samples and data sets. + * The main method gets a reference to the openBIS informational API and then uses this API to list samples and data sets. * * @author Chandrasekhar Ramakrishnan */ @@ -93,8 +92,7 @@ public class DataSetLister } /** - * An example that finds all data sets. Depending on the size of the DB, this could be very - * slow. + * An example that finds all data sets. Depending on the size of the DB, this could be very slow. */ @SuppressWarnings("unused") private void findAllDataSets() diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/cli/Login.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/cli/Login.java index 163070c86cf..786607d7bdd 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/cli/Login.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/cli/Login.java @@ -39,8 +39,7 @@ import ch.systemsx.cisd.openbis.common.api.client.ServiceFinder; import ch.systemsx.cisd.openbis.generic.shared.api.v1.IGeneralInformationService; /** - * A class to provide a login on an openBIS server. The login information will be put into a - * sub-directory of the user's home directory. + * A class to provide a login on an openBIS server. The login information will be put into a sub-directory of the user's home directory. * * @author Bernd Rinn */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/console/ICommand.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/console/ICommand.java index 78e1fa8c0df..c3cf588c055 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/console/ICommand.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/console/ICommand.java @@ -19,8 +19,6 @@ package ch.systemsx.cisd.openbis.generic.client.console; import ch.systemsx.cisd.openbis.generic.shared.ICommonServer; /** - * - * * @author Franz-Josef Elmer */ interface ICommand diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/console/Lexer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/console/Lexer.java index fbe3300d090..ce22063c87d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/console/Lexer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/console/Lexer.java @@ -27,8 +27,9 @@ class Lexer private static class ParsingContext { private final List<String> tokens = new ArrayList<String>(); + private final StringBuilder builder = new StringBuilder(); - + public void addCharacter(char character) { builder.append(character); @@ -39,7 +40,7 @@ class Lexer tokens.add(builder.toString()); builder.setLength(0); } - + public List<String> getTokens() { if (builder.length() > 0) @@ -49,7 +50,7 @@ class Lexer return tokens; } } - + private enum State { BETWEEN_TOKENS() @@ -103,7 +104,7 @@ class Lexer abstract State next(char character, ParsingContext context); } - + static List<String> extractTokens(String string) { ParsingContext context = new ParsingContext(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/console/ScriptContext.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/console/ScriptContext.java index e9c609d2cda..3e2d84df62a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/console/ScriptContext.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/console/ScriptContext.java @@ -25,14 +25,12 @@ import java.util.Map.Entry; import ch.systemsx.cisd.common.string.Template; /** - * - * * @author Franz-Josef Elmer */ class ScriptContext { private final Map<String, String> bindings = new HashMap<String, String>(); - + ScriptContext(Properties properties) { Set<Entry<Object, Object>> entrySet = properties.entrySet(); @@ -41,7 +39,7 @@ class ScriptContext bind((String) entry.getKey(), (String) entry.getValue()); } } - + void bind(String variable, String value) { bindings.put(variable, value); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/console/Set.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/console/Set.java index 7ff7c841f17..c58b8397953 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/console/Set.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/console/Set.java @@ -19,8 +19,6 @@ package ch.systemsx.cisd.openbis.generic.client.console; import ch.systemsx.cisd.openbis.generic.shared.ICommonServer; /** - * - * * @author Franz-Josef Elmer */ class Set implements ICommand diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientService.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientService.java index 632a0c0b4a5..0b2f3e4da6e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientService.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientService.java @@ -598,7 +598,7 @@ public interface ICommonClientService extends IClientService public TypedTableResultSet<AbstractExternalData> listSampleDataSets(final TechId sampleId, DefaultResultSetConfig<String, TableModelRowWithObject<AbstractExternalData>> criteria, final boolean showOnlyDirectlyConnected) throws UserFailureException; - + /** * For given the given sample returns contained data sets. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientServiceAsync.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientServiceAsync.java index 6e0dad21534..638fd27a0e3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientServiceAsync.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientServiceAsync.java @@ -503,18 +503,19 @@ public interface ICommonClientServiceAsync extends IClientServiceAsync DefaultResultSetConfig<String, TableModelRowWithObject<AbstractExternalData>> criteria, boolean showOnlyDirectlyConnected, AsyncCallback<TypedTableResultSet<AbstractExternalData>> asyncCallback); - + /** * @see ICommonClientService#listSampleDataSets(TechId sampleId, boolean showOnlyDirectlyConnected) */ public void listSampleDataSets(TechId sampleId, boolean showOnlyDirectlyConnected, - AsyncCallback<List<String>> asyncCallback); + AsyncCallback<List<String>> asyncCallback); /** * @see ICommonClientService#getSampleChildrenInfo(List<TechId> sampleIds, boolean showOnlyDirectlyConnected) */ public void getSampleChildrenInfo(List<TechId> sampleIds, boolean showOnlyDirectlyConnected, AsyncCallback<List<SampleChildrenInfo>> asyncCallback); + /** * @see ICommonClientService#listExperimentDataSets(TechId, DefaultResultSetConfig, boolean) */ @@ -1200,7 +1201,7 @@ public interface ICommonClientServiceAsync extends IClientServiceAsync * @see ICommonClientService#listPredeployedPlugins(ScriptType) */ public void listPredeployedPlugins(ScriptType scriptType, AsyncCallback<List<String>> callback); - + /** * @see ICommonClientService#getDisabledText() */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/IOnlineHelpResourceLocatorService.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/IOnlineHelpResourceLocatorService.java index 72b246dd2d5..826ba3b2bb9 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/IOnlineHelpResourceLocatorService.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/IOnlineHelpResourceLocatorService.java @@ -17,9 +17,8 @@ package ch.systemsx.cisd.openbis.generic.client.web.client; /** - * A interface for getting the resources necessary for the help system. Online help is broken into - * two sections: Generic -- help for OpenBIS in general, provided by CISD; and Specific -- help for - * the specific installation of OpenBIS, provided by the host of the installation. + * A interface for getting the resources necessary for the help system. Online help is broken into two sections: Generic -- help for OpenBIS in + * general, provided by CISD; and Specific -- help for the specific installation of OpenBIS, provided by the host of the installation. * * @author Chandrasekhar Ramakrishnan */ @@ -31,11 +30,9 @@ public interface IOnlineHelpResourceLocatorService String getOnlineHelpGenericRootURL(); /** - * The generic page template is a URL that encodes how to reference the help pages. It takes one - * argument, title -- the title of the page, and it should be constructed to automatically - * create the page if no page exists. Example: - * https://wiki-bsse.ethz.ch/pages/createpage.action?spaceKey=CISDDoc&title=${title - * }&linkCreation=true&fromPageId=40633829 + * The generic page template is a URL that encodes how to reference the help pages. It takes one argument, title -- the title of the page, and it + * should be constructed to automatically create the page if no page exists. Example: + * https://wiki-bsse.ethz.ch/pages/createpage.action?spaceKey=CISDDoc&title=${title }&linkCreation=true&fromPageId=40633829 */ String getOnlineHelpGenericPageTemplate(); @@ -45,11 +42,9 @@ public interface IOnlineHelpResourceLocatorService String getOnlineHelpSpecificRootURL(); /** - * The specific page template is a URL that encodes how to reference the help pages. It takes - * one argument, title -- the title of the page, and it should be constructed to automatically - * create the page if no page exists. Example: - * https://wiki-bsse.ethz.ch/pages/createpage.action?spaceKey=CISDDoc&title=${title - * }&linkCreation=true&fromPageId=40633829 + * The specific page template is a URL that encodes how to reference the help pages. It takes one argument, title -- the title of the page, and it + * should be constructed to automatically create the page if no page exists. Example: + * https://wiki-bsse.ethz.ch/pages/createpage.action?spaceKey=CISDDoc&title=${title }&linkCreation=true&fromPageId=40633829 */ String getOnlineHelpSpecificPageTemplate(); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractAsyncCallback.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractAsyncCallback.java index 4a617f393c1..02f9ad7a257 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractAsyncCallback.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractAsyncCallback.java @@ -35,8 +35,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.exception.InvalidSessi import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; /** - * Abstract super class of call backs. Subclasses have to implement {@link #process(Object)}. Note, - * that instances of this class and its subclasses are stateful and can not be reused. + * Abstract super class of call backs. Subclasses have to implement {@link #process(Object)}. Note, that instances of this class and its subclasses + * are stateful and can not be reused. * * @author Franz-Josef Elmer */ @@ -187,8 +187,7 @@ public abstract class AbstractAsyncCallback<T> implements AsyncCallback<T> /** * Returns the callback id which can be used in tests. * <p> - * This method should be subclassed if differentiation between callbacks of the same class is - * needed in the tests. + * This method should be subclassed if differentiation between callbacks of the same class is needed in the tests. * </p> */ public String getCallbackId() @@ -341,11 +340,9 @@ public abstract class AbstractAsyncCallback<T> implements AsyncCallback<T> } /** - * This method should be overriden if callback should be ignored on success. By default - * <var>successAction</var> is always executed. + * This method should be overriden if callback should be ignored on success. By default <var>successAction</var> is always executed. * <p> - * In overriden method one should ignore the callback with {@link #ignore()}. Otherwise the - * <var>successAction</var> should be executed. + * In overriden method one should ignore the callback with {@link #ignore()}. Otherwise the <var>successAction</var> should be executed. */ protected void performSuccessActionOrIgnore(IDelegatedAction successAction) { @@ -353,8 +350,8 @@ public abstract class AbstractAsyncCallback<T> implements AsyncCallback<T> } /** - * This method should be called if callback will not be processed immediately after creation. It - * is needed for our system test framework to work properly. + * This method should be called if callback will not be processed immediately after creation. It is needed for our system test framework to work + * properly. */ public final void ignore() { @@ -362,12 +359,10 @@ public abstract class AbstractAsyncCallback<T> implements AsyncCallback<T> } /** - * NOTE: The basic rule is 'Never reuse a callback object: Instances of AbstractAsyncCallback - * are stateful'. + * NOTE: The basic rule is 'Never reuse a callback object: Instances of AbstractAsyncCallback are stateful'. * <p> - * This method is only for special callbacks that are reusable. Call it just before calling - * service method but make sure {@link #ignore()} was called first in callback constructor after - * calling abstract constructor. It is needed for our system test framework to work properly. + * This method is only for special callbacks that are reusable. Call it just before calling service method but make sure {@link #ignore()} was + * called first in callback constructor after calling abstract constructor. It is needed for our system test framework to work properly. */ public final void reuse() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractPluginViewContext.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractPluginViewContext.java index 83dc5a6f9a8..4e14b31f051 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractPluginViewContext.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractPluginViewContext.java @@ -32,8 +32,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ApplicationInfo; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.WebClientConfiguration; /** - * An <i>abstract</i> {@link IViewContext} implementation which should be extended by each plugin - * based technology. + * An <i>abstract</i> {@link IViewContext} implementation which should be extended by each plugin based technology. * * @author Christian Ribeaud */ @@ -70,8 +69,7 @@ public abstract class AbstractPluginViewContext<T extends IClientServiceAsync> i } /** - * Creates the service. Implementations will usually invoke {@link GWT#create(Class)} with the - * corresponding synchronous service interface. + * Creates the service. Implementations will usually invoke {@link GWT#create(Class)} with the corresponding synchronous service interface. */ protected abstract T createClientServiceAsync(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AsyncCallbackWithProgressBar.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AsyncCallbackWithProgressBar.java index c7453397a5a..fbbad4585a5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AsyncCallbackWithProgressBar.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AsyncCallbackWithProgressBar.java @@ -24,8 +24,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUt import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; /** - * {@link AsyncCallback} decorator adding a progress bar that is visible until response is received - * from a RPC call. + * {@link AsyncCallback} decorator adding a progress bar that is visible until response is received from a RPC call. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/CallbackListenerAdapter.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/CallbackListenerAdapter.java index 9cdd735f6b5..e27e9e259af 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/CallbackListenerAdapter.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/CallbackListenerAdapter.java @@ -21,8 +21,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMess /** * A {@link ICallbackListener} implementation with an empty body for each method implemented. * <p> - * Usually the only method that gets overridden is - * {@link #onFailureOf(IMessageProvider, AbstractAsyncCallback, String, Throwable)}. + * Usually the only method that gets overridden is {@link #onFailureOf(IMessageProvider, AbstractAsyncCallback, String, Throwable)}. * </p> * * @author Christian Ribeaud diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/DisposableTabContent.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/DisposableTabContent.java index 7210fd9b3da..97f5fab30e0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/DisposableTabContent.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/DisposableTabContent.java @@ -21,8 +21,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.ID import ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder; /** - * Panel of a details view showing a component which should be disposed at the end (i.e. browser - * grid). + * Panel of a details view showing a component which should be disposed at the end (i.e. browser grid). * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/GenericConstants.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/GenericConstants.java index df20081f95c..17b448cdef4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/GenericConstants.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/GenericConstants.java @@ -95,7 +95,7 @@ public final class GenericConstants public static final int DESCRIPTION_2000 = 2000; public static final int DESCRIPTION_500000 = 500000; - + public static final int MAIN_DS_PATH_LENGTH = 1000; public static final int MAIN_DS_PATTERN_LENGTH = 300; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ICallbackListener.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ICallbackListener.java index 45b716f51fe..bbd7eeb07be 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ICallbackListener.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ICallbackListener.java @@ -28,18 +28,16 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMess public interface ICallbackListener<T> { /** - * Handles invocations of {@link AsyncCallback#onFailure(Throwable)} of the specified callback - * object with the specified failure message and throwable. This method will be invoked before - * the callback object is showing the failure message in a popup dialog. + * Handles invocations of {@link AsyncCallback#onFailure(Throwable)} of the specified callback object with the specified failure message and + * throwable. This method will be invoked before the callback object is showing the failure message in a popup dialog. */ public void onFailureOf(final IMessageProvider messageProvider, final AbstractAsyncCallback<T> callback, final String failureMessage, final Throwable throwable); /** - * Handles invocations of {@link AsyncCallback#onSuccess(Object)} of the specified callback - * object with the specified result object. This method will be invoked after the callback - * object is actually processing the result object. + * Handles invocations of {@link AsyncCallback#onSuccess(Object)} of the specified callback object with the specified result object. This method + * will be invoked after the callback object is actually processing the result object. */ public void finishOnSuccessOf(final AbstractAsyncCallback<T> callback, final T result); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/IPageController.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/IPageController.java index 6d761160d5b..79d2048bfd5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/IPageController.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/IPageController.java @@ -24,7 +24,7 @@ import com.extjs.gxt.ui.client.mvc.Dispatcher; * This controller lies on top of the ones specified in {@link Dispatcher}. * </p> * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ public interface IPageController { @@ -34,8 +34,7 @@ public interface IPageController * Depending whether you are logged in or not, this determines the page you will be landing. * </p> * - * @param logout whether the reload happens after a logout (meaning that the {@link Dispatcher} - * will be cleared). + * @param logout whether the reload happens after a logout (meaning that the {@link Dispatcher} will be cleared). */ public void reload(final boolean logout); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/InfoBoxCallbackListener.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/InfoBoxCallbackListener.java index a8879d3a6a3..c2faf6e176e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/InfoBoxCallbackListener.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/InfoBoxCallbackListener.java @@ -20,8 +20,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget. import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; /** - * A {@link ICallbackListener} which outputs the failure message to the specified - * {@link IInfoHandler}. + * A {@link ICallbackListener} which outputs the failure message to the specified {@link IInfoHandler}. * * @author Christian Ribeaud */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/TabContent.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/TabContent.java index fb5d83bc81c..53a92c44c14 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/TabContent.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/TabContent.java @@ -27,8 +27,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder; /** * {@link ContentPanel} for sections with deferred request handling. * <p> - * If this panel is used outside of {@link SectionsPanel} one needs call - * {@link #setContentVisible(boolean)} to process requests coming from this section. + * If this panel is used outside of {@link SectionsPanel} one needs call {@link #setContentVisible(boolean)} to process requests coming from this + * section. * * @author Izabela Adamczyk */ @@ -44,10 +44,9 @@ abstract public class TabContent extends ContentPanel private boolean isContentVisible = false; /** - * Whether additional components created for this section (e.g. browsers) should be - * automatically disposed when the section is detached from its container. For sections that can - * be temporarily removed from container as in {@link SectionsPanel} it should be turned off and - * the container should dispose section components manually. + * Whether additional components created for this section (e.g. browsers) should be automatically disposed when the section is detached from its + * container. For sections that can be temporarily removed from container as in {@link SectionsPanel} it should be turned off and the container + * should dispose section components manually. */ private boolean autoDisposeComponents = true; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/AbstractDatabaseModificationObserverWithCallback.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/AbstractDatabaseModificationObserverWithCallback.java index 344dd3b64a2..1b1cf11df9d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/AbstractDatabaseModificationObserverWithCallback.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/AbstractDatabaseModificationObserverWithCallback.java @@ -19,8 +19,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.framework import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; /** - * Abstract {@link IDatabaseModificationObserverWithCallback} implementation that delegates - * execution of {@link IDelegatedAction}. + * Abstract {@link IDatabaseModificationObserverWithCallback} implementation that delegates execution of {@link IDelegatedAction}. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/AbstractTabItemFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/AbstractTabItemFactory.java index a9381d83cfb..ac1ad726032 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/AbstractTabItemFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/AbstractTabItemFactory.java @@ -34,11 +34,9 @@ public abstract class AbstractTabItemFactory public abstract ITabItem create(); /** - * Returns the unique identifier of this tab item. Note that the id should be unique among all - * tabs, not widgets. + * Returns the unique identifier of this tab item. Note that the id should be unique among all tabs, not widgets. * <p> - * The framework ensures that no two components with the same id will be displayed. Instead the - * one already created will get the focus. + * The framework ensures that no two components with the same id will be displayed. Instead the one already created will get the focus. * </p> */ public abstract String getId(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/CompositeDatabaseModificationObserver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/CompositeDatabaseModificationObserver.java index 9383ae7e538..d741342fb6b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/CompositeDatabaseModificationObserver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/CompositeDatabaseModificationObserver.java @@ -25,8 +25,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.SetUt import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; /** - * Composite class to implement {@link IDatabaseModificationObserver} interface for a collection of - * observers. + * Composite class to implement {@link IDatabaseModificationObserver} interface for a collection of observers. * * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/CompositeDatabaseModificationObserverWithMainObserver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/CompositeDatabaseModificationObserverWithMainObserver.java index 965b317e556..0e7bdd3cd68 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/CompositeDatabaseModificationObserverWithMainObserver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/CompositeDatabaseModificationObserverWithMainObserver.java @@ -24,9 +24,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.SetUt import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; /** - * {@link CompositeDatabaseModificationObserver} extension with update of added observers stopped - * until main observer update is finished. If main observer fails to update other observers will not - * update at all. + * {@link CompositeDatabaseModificationObserver} extension with update of added observers stopped until main observer update is finished. If main + * observer fails to update other observers will not update at all. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DatabaseModificationAwareComponent.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DatabaseModificationAwareComponent.java index cda41bae1de..0f1177c0a15 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DatabaseModificationAwareComponent.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DatabaseModificationAwareComponent.java @@ -28,8 +28,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.ID public class DatabaseModificationAwareComponent extends DatabaseModificationAwareObject<Component> { /** - * Creates an instance by conversion from a disposable component, these two classes have the - * same functionality. + * Creates an instance by conversion from a disposable component, these two classes have the same functionality. */ public static DatabaseModificationAwareComponent create(IDisposableComponent disposableComponent) { @@ -38,8 +37,8 @@ public class DatabaseModificationAwareComponent extends DatabaseModificationAwar } /** - * Creates a mock with a dummy database modification observer. Use this method if your component - * does not need to be refreshed when the database changes. + * Creates a mock with a dummy database modification observer. Use this method if your component does not need to be refreshed when the database + * changes. */ public static DatabaseModificationAwareComponent wrapUnaware(Component component) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DatabaseModificationAwareField.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DatabaseModificationAwareField.java index 87ad8a99aef..0a50bf8e7d5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DatabaseModificationAwareField.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DatabaseModificationAwareField.java @@ -26,8 +26,8 @@ import com.extjs.gxt.ui.client.widget.form.Field; public class DatabaseModificationAwareField<T> extends DatabaseModificationAwareObject<Field<T>> { /** - * Creates a mock with a dummy database modification observer. Use this method if your field - * does not need to be refreshed when the database changes. + * Creates a mock with a dummy database modification observer. Use this method if your field does not need to be refreshed when the database + * changes. */ public static <T> DatabaseModificationAwareField<T> wrapUnaware(Field<T> field) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DatabaseModificationAwareObject.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DatabaseModificationAwareObject.java index 659c2795ae0..6fb12a0e946 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DatabaseModificationAwareObject.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DatabaseModificationAwareObject.java @@ -23,8 +23,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKin /** * Stores an object and its database modification observer. * <p> - * This class is useful when you cannot modify some class T to extend - * {@link IDatabaseModificationObserver} interface (because e.g. this class comes from a library). + * This class is useful when you cannot modify some class T to extend {@link IDatabaseModificationObserver} interface (because e.g. this class comes + * from a library). * </p> * * @author Tomasz Pylak diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DatabaseModificationAwareWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DatabaseModificationAwareWidget.java index c8bec91ac2a..903ac116dfc 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DatabaseModificationAwareWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DatabaseModificationAwareWidget.java @@ -26,8 +26,8 @@ import com.google.gwt.user.client.ui.Widget; public class DatabaseModificationAwareWidget extends DatabaseModificationAwareObject<Widget> { /** - * Creates a mock with a dummy database modification observer. Use this method if your field - * does not need to be refreshed when the database changes. + * Creates a mock with a dummy database modification observer. Use this method if your field does not need to be refreshed when the database + * changes. */ public static DatabaseModificationAwareWidget wrapUnaware(Widget widget) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DebugPanelManager.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DebugPanelManager.java index 494ac9621bc..4ce61926679 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DebugPanelManager.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DebugPanelManager.java @@ -61,8 +61,8 @@ public class DebugPanelManager implements DebugPanelWidget.Listener private Widget createWidget() { return new DebugPanelWidget(this, true, new DebugPanelWidget.Component[] - { panelComponent, new DefaultExceptionDebugPanelComponent(em), - new DefaultCookieDebugPanelComponent(), logComponent, xmlComponent }); + { panelComponent, new DefaultExceptionDebugPanelComponent(em), + new DefaultCookieDebugPanelComponent(), logComponent, xmlComponent }); } // @Override diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DispatcherHelper.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DispatcherHelper.java index 598c2385877..bbebce9d0bf 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DispatcherHelper.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DispatcherHelper.java @@ -35,8 +35,7 @@ public final class DispatcherHelper } /** - * Creates and dispatches an event of type {@link OpenUrlEvent#OPEN_URL_EVENT} which opens a new - * window. + * Creates and dispatches an event of type {@link OpenUrlEvent#OPEN_URL_EVENT} which opens a new window. */ public final static void dispatchOpenUrlEvent(String url) { @@ -44,8 +43,7 @@ public final class DispatcherHelper } /** - * Creates and dispatches an event of type {@link OpenUrlEvent#OPEN_URL_EVENT} which changes the - * url of the current window. + * Creates and dispatches an event of type {@link OpenUrlEvent#OPEN_URL_EVENT} which changes the url of the current window. */ public final static void dispatchRedirectUrlEvent(String url, String target) { @@ -53,8 +51,7 @@ public final class DispatcherHelper } /** - * Creates and dispatches an event of type {@link AppEvents#NAVI_EVENT}. The event opens a new - * tab. + * Creates and dispatches an event of type {@link AppEvents#NAVI_EVENT}. The event opens a new tab. */ public final static void dispatchNaviEvent(final AbstractTabItemFactory tabItemFactory) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DisplaySettingsManager.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DisplaySettingsManager.java index 9f48f7be69c..ae9517f85cc 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DisplaySettingsManager.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DisplaySettingsManager.java @@ -537,7 +537,7 @@ public class DisplaySettingsManager /** * @returns hidden tabs for given panel - which tab should be selected<br> - * <br> + * <br> * NOTE: Returned value should be used read only */ public final DetailViewConfiguration tryGetDetailViewSettings(String entityDetailViewID) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DummyComponent.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DummyComponent.java index a122572452f..2e1db819fa6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DummyComponent.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DummyComponent.java @@ -34,7 +34,7 @@ public final class DummyComponent extends LayoutContainer { this("This feature will be implemented later..."); } - + public DummyComponent(String message) { setId(ID); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/IComponentWithCloseConfirmation.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/IComponentWithCloseConfirmation.java index a0be8aca2ba..30d65f14d6b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/IComponentWithCloseConfirmation.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/IComponentWithCloseConfirmation.java @@ -17,8 +17,8 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.framework; /** - * Components that implement this interface and are added as tab contents can dynamically control - * whether closing the tab requires an additional confirmation. + * Components that implement this interface and are added as tab contents can dynamically control whether closing the tab requires an additional + * confirmation. * * @author pkupczyk */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/IDatabaseModificationObserver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/IDatabaseModificationObserver.java index 1545a1abc22..cb44a13bab4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/IDatabaseModificationObserver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/IDatabaseModificationObserver.java @@ -21,24 +21,23 @@ import java.util.Set; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; /** - * Interface to be implemented if a component wants to be notified of if for a list of relevant - * {@link DatabaseModificationKind} instances changes have been observed. + * Interface to be implemented if a component wants to be notified of if for a list of relevant {@link DatabaseModificationKind} instances changes + * have been observed. * * @author Tomasz Pylak */ public interface IDatabaseModificationObserver { /** - * Informs about new modifications in the database. This method is called only if at least one - * observed modification is the relevant one. + * Informs about new modifications in the database. This method is called only if at least one observed modification is the relevant one. * * @param observedModifications The new database modifications which have occurred. */ void update(Set<DatabaseModificationKind> observedModifications); /** - * @return the list of database object modifications in which this observer is interested. Used - * to call the refresh method only when it is really necessary. + * @return the list of database object modifications in which this observer is interested. Used to call the refresh method only when it is really + * necessary. */ DatabaseModificationKind[] getRelevantModifications(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/IDatabaseModificationObserverWithCallback.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/IDatabaseModificationObserverWithCallback.java index 60484915023..caa03805a4b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/IDatabaseModificationObserverWithCallback.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/IDatabaseModificationObserverWithCallback.java @@ -19,8 +19,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.framework import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; /** - * {@link IDatabaseModificationObserver} extension with a {@link IDelegatedAction} that should be - * executed upon successful update completion. + * {@link IDatabaseModificationObserver} extension with a {@link IDelegatedAction} that should be executed upon successful update completion. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/IDisplayTypeIDGenerator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/IDisplayTypeIDGenerator.java index 6d513e8f852..604e0116ca5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/IDisplayTypeIDGenerator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/IDisplayTypeIDGenerator.java @@ -19,7 +19,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.framework /** * Generator of diplay type ID as used by {@link DisplaySettingsManager}. * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ public interface IDisplayTypeIDGenerator { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/LastModificationStateUpdater.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/LastModificationStateUpdater.java index 3a12a9a1b02..75fba85854e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/LastModificationStateUpdater.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/LastModificationStateUpdater.java @@ -27,14 +27,11 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKin import ch.systemsx.cisd.openbis.generic.shared.basic.dto.LastModificationState; /** - * Stores last database modification state and provides a method to update the state from the - * server. Informs a specified modification observer about relevant modifications. For more details - * see {@link LastModificationState}. + * Stores last database modification state and provides a method to update the state from the server. Informs a specified modification observer about + * relevant modifications. For more details see {@link LastModificationState}. * <p> - * This updater is associated with {@link DefaultTabItem} where either a - * {@link DatabaseModificationAwareComponent} or an {@link IDisposableComponent} is the - * {@link IDatabaseModificationObserver} instance which will be informed if relevant modifications - * have been detected. + * This updater is associated with {@link DefaultTabItem} where either a {@link DatabaseModificationAwareComponent} or an {@link IDisposableComponent} + * is the {@link IDatabaseModificationObserver} instance which will be informed if relevant modifications have been detected. * * @author Tomasz Pylak */ @@ -43,8 +40,8 @@ class LastModificationStateUpdater extends AbstractAsyncCallback<LastModificatio private final ICommonClientServiceAsync commonService; /* - * The last database objects modification state seen by this tab. Can be null only for a short - * period after the first tab activation when we are waiting for the server response. + * The last database objects modification state seen by this tab. Can be null only for a short period after the first tab activation when we are + * waiting for the server response. */ private LastModificationState lastSeenModificationStateOrNull; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/LoginPage.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/LoginPage.java index 0b482a1db26..34cbf8a2a86 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/LoginPage.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/LoginPage.java @@ -71,7 +71,7 @@ final class LoginPage extends com.google.gwt.user.client.ui.VerticalPanel } welcomePanel.setStyleName("login-welcome-text"); final CellPanel northPanel = createNorthPanel(); - + final HorizontalPanel topPanel = new HorizontalPanel(); northPanel.add(topPanel); northPanel.add(logo); @@ -89,7 +89,7 @@ final class LoginPage extends com.google.gwt.user.client.ui.VerticalPanel add(footerPanel); } }); - + this.setCellVerticalAlignment(footerPanel, HasVerticalAlignment.ALIGN_BOTTOM); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/WelcomePanelHelper.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/WelcomePanelHelper.java index 7c18bfd8be3..399c018c083 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/WelcomePanelHelper.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/WelcomePanelHelper.java @@ -38,7 +38,7 @@ public class WelcomePanelHelper private static final String SIMPLE_VIEW_MODE_PAGE_BASE_NAME_GENERIC = "./custom/welcomePageSimpleGeneric"; private static final String SIMPLE_VIEW_MODE_PAGE_BASE_NAME_SCREENING = "./custom/welcomePageSimpleScreening"; - + public static final Component createWelcomePanel(IViewContext<?> viewContext, String idPrefix) { final LayoutContainer layoutContainer = new LayoutContainer(new BorderLayout()); @@ -62,11 +62,14 @@ public class WelcomePanelHelper return viewContext.isSimpleOrEmbeddedMode() ? getSimpleModeWelcomePageBaseName(viewContext) : APPLICATION_VIEW_MODE_PAGE_BASE_NAME; } - - private static final String getSimpleModeWelcomePageBaseName(IViewContext<?> viewContext) { - if (viewContext.getModel().getApplicationInfo().getEnabledTechnologies().contains("screening")) { + + private static final String getSimpleModeWelcomePageBaseName(IViewContext<?> viewContext) + { + if (viewContext.getModel().getApplicationInfo().getEnabledTechnologies().contains("screening")) + { return SIMPLE_VIEW_MODE_PAGE_BASE_NAME_SCREENING; - } else { + } else + { return SIMPLE_VIEW_MODE_PAGE_BASE_NAME_GENERIC; } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/help/HelpPageIdentifier.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/help/HelpPageIdentifier.java index 9795ffb0c46..db544f6519d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/help/HelpPageIdentifier.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/help/HelpPageIdentifier.java @@ -22,8 +22,7 @@ import java.util.List; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; /** - * An identifier that uniquely designates a help page. The identifier is made up of a domain and an - * action. + * An identifier that uniquely designates a help page. The identifier is made up of a domain and an action. * * @author Chandrasekhar Ramakrishnan * @author Piotr Buczek @@ -97,8 +96,7 @@ public class HelpPageIdentifier } /** - * List of {@link HelpPageDomain}s starting from the base domain (a domain without super - * domain) down to this domain. + * List of {@link HelpPageDomain}s starting from the base domain (a domain without super domain) down to this domain. */ public List<HelpPageDomain> getDomainPath() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/AbstractViewLocatorResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/AbstractViewLocatorResolver.java index f3dfa08eb7a..62e9fb24026 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/AbstractViewLocatorResolver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/AbstractViewLocatorResolver.java @@ -8,9 +8,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; /** * Default implementation of the IViewLocatorHandler interface. Designed to be subclassed. * <p> - * The default implementation is bound to one particular action. The method - * {@link #canHandleLocator(ViewLocator)} returns true if the locator's action matches my - * handledAction. + * The default implementation is bound to one particular action. The method {@link #canHandleLocator(ViewLocator)} returns true if the locator's + * action matches my handledAction. * * @author Chandrasekhar Ramakrishnan * @author Piotr Buczek @@ -84,8 +83,7 @@ public abstract class AbstractViewLocatorResolver implements IViewLocatorResolve } /** - * Utility method that throws an exception with a standard error message if the required - * paramter is not specified + * Utility method that throws an exception with a standard error message if the required paramter is not specified */ protected static final void checkRequiredParameter(String valueOrNull, String paramName) throws UserFailureException diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/AttachmentDownloadLocatorResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/AttachmentDownloadLocatorResolver.java index b480e201639..fc58c882b36 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/AttachmentDownloadLocatorResolver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/AttachmentDownloadLocatorResolver.java @@ -15,8 +15,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Project; /** - * ViewLocatorHandler used for downloading attachment. We use permIds to identify attachment holder - * and we don't have permIds for projects so these locators work only for samples and experiments. + * ViewLocatorHandler used for downloading attachment. We use permIds to identify attachment holder and we don't have permIds for projects so these + * locators work only for samples and experiments. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/IViewLocatorResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/IViewLocatorResolver.java index b2e540beb42..48afcc95ec3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/IViewLocatorResolver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/IViewLocatorResolver.java @@ -33,12 +33,10 @@ public interface IViewLocatorResolver public void locatorExists(ViewLocator locator, AsyncCallback<Void> callback); /** - * Invoke the code to open the view specified by the locator. Implementations should try to - * interpret the parameters to the best of their abilities and not fail unless absolutely - * necessary (e.g., unnecessary parameters should be ignored). + * Invoke the code to open the view specified by the locator. Implementations should try to interpret the parameters to the best of their + * abilities and not fail unless absolutely necessary (e.g., unnecessary parameters should be ignored). * - * @exception UserFailureException May be thrown if it is determined that some mandatory - * information is not specified. + * @exception UserFailureException May be thrown if it is determined that some mandatory information is not specified. */ public void resolve(ViewLocator locator) throws UserFailureException; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/MaterialCodeUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/MaterialCodeUtils.java index 074abb1c373..eeba7418b16 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/MaterialCodeUtils.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/MaterialCodeUtils.java @@ -28,17 +28,15 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.URLLi public class MaterialCodeUtils { /** - * IMPORTANT: The method will work correctly *if* the material codes in the openBIS database do - * not contain the character '%'. + * IMPORTANT: The method will work correctly *if* the material codes in the openBIS database do not contain the character '%'. * <p> - * This is an attempt to work-around browser incompatibilities. Basically, all browsers have - * different ways of handling url decoding of their history tokens. + * This is an attempt to work-around browser incompatibilities. Basically, all browsers have different ways of handling url decoding of their + * history tokens. * <p> - * For example, in the current version of Chrome a URL parameter '%28c%3AC%29' will be decoded - * as '(c%3AC)' instead of the expected '(c:C)'. + * For example, in the current version of Chrome a URL parameter '%28c%3AC%29' will be decoded as '(c%3AC)' instead of the expected '(c:C)'. * <p> - * Firefox has yet another way of dealing with decoding of history tokens. The issue is - * explained in http://stackoverflow.com/questions/2334312/using-gwt-history-to-pass-parameters + * Firefox has yet another way of dealing with decoding of history tokens. The issue is explained in + * http://stackoverflow.com/questions/2334312/using-gwt-history-to-pass-parameters * <p> */ public static String decode(String materialCode) @@ -59,8 +57,7 @@ public class MaterialCodeUtils } /** - * Assumes GWT has done a preliminary decoding pass-through, but not all characters have been decoded - * successfully. + * Assumes GWT has done a preliminary decoding pass-through, but not all characters have been decoded successfully. * <p> * The implementation is based on the java.net.URLDecoder.decode and uses UTF-8 encoding by default. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/MaterialLocatorResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/MaterialLocatorResolver.java index 07e89e68297..d35b980fa05 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/MaterialLocatorResolver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/MaterialLocatorResolver.java @@ -11,8 +11,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialIdentifier; /** - * ViewLocatorHandler for Material locators. We don't have permIds for materials so we need a - * different way of handling permlinks for them. We use material code and type to identify material. + * ViewLocatorHandler for Material locators. We don't have permIds for materials so we need a different way of handling permlinks for them. We use + * material code and type to identify material. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/PermlinkLocatorResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/PermlinkLocatorResolver.java index 336d10e504f..392229f7dba 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/PermlinkLocatorResolver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/PermlinkLocatorResolver.java @@ -65,26 +65,29 @@ public class PermlinkLocatorResolver extends AbstractViewLocatorResolver checkRequiredParameter(entityKindValueOrNull, PermlinkUtilities.ENTITY_KIND_PARAMETER_KEY); checkRequiredParameter(permIdValueOrNull, PermlinkUtilities.PERM_ID_PARAMETER_KEY); - + String subtab = parseHistoryToken(locator.getHistoryToken()).get(PermlinkUtilities.SUBTAB_PARAMETER_KEY); - + openInitialEntityViewer(entityKindValueOrNull, permIdValueOrNull, subtab); } } - - private Map<String, String> parseHistoryToken(String token) { - Map<String, String> map = new HashMap<String,String>(); - for (String parameter : token.split("&")) { + private Map<String, String> parseHistoryToken(String token) + { + Map<String, String> map = new HashMap<String, String>(); + + for (String parameter : token.split("&")) + { String[] keyval = parameter.split("=", 2); - if (keyval.length == 2) { + if (keyval.length == 2) + { map.put(keyval[0], keyval[1]); } } - + return map; } - + protected String tryGetEntityKind(ViewLocator locator) { return locator.tryGetEntity(); @@ -114,12 +117,12 @@ public class PermlinkLocatorResolver extends AbstractViewLocatorResolver { openInitialEntityViewer(entityKindValue, permIdValue, ""); } - + protected void openInitialEntityViewer(String entityKindValue, String permIdValue, String subtab) throws UserFailureException { EntityKind entityKind = getEntityKind(entityKindValue); OpenEntityDetailsTabHelper.open(viewContext, entityKind, permIdValue, false, subtab); - } + } } \ No newline at end of file diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/ProjectLocatorResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/ProjectLocatorResolver.java index abbdae6a27c..5eacddb3dab 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/ProjectLocatorResolver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/ProjectLocatorResolver.java @@ -12,8 +12,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.BasicProjectIdentifier; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Project; /** - * ViewLocatorHandler for Project locators. We don't have permIds for projects so we need a - * different way of handling permlinks for them. We use project and space codes to identify project. + * ViewLocatorHandler for Project locators. We don't have permIds for projects so we need a different way of handling permlinks for them. We use + * project and space codes to identify project. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/SampleSearchLocatorResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/SampleSearchLocatorResolver.java index 2cc321cdeaf..a6fc3b2f2c0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/SampleSearchLocatorResolver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/SampleSearchLocatorResolver.java @@ -94,7 +94,7 @@ public class SampleSearchLocatorResolver // were found, open the search view. switch (result.getResultSet().getTotalLength()) { - // Nothing found -- notify the user + // Nothing found -- notify the user case 0: GWTUtils.alert("Error", "No samples matching criteria [" + displayCriteria.getSearchCriteria().toString() + "] were found."); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/SearchLocatorResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/SearchLocatorResolver.java index ebf124a93ba..850a7e6ffa0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/SearchLocatorResolver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/SearchLocatorResolver.java @@ -112,7 +112,8 @@ public class SearchLocatorResolver extends AbstractViewLocatorResolver } } else { - if (key.startsWith("ui-") == false) { + if (key.startsWith("ui-") == false) + { DetailedSearchCriterion searchCriterion = getSearchCriterionForKeyValueAndEntityKind(key, value); criterionList.add(searchCriterion); @@ -136,8 +137,7 @@ public class SearchLocatorResolver extends AbstractViewLocatorResolver } /** - * Convert the key/value to a search criterion. The kind of field depends on whether the key - * refers to an attribute or property. + * Convert the key/value to a search criterion. The kind of field depends on whether the key refers to an attribute or property. */ protected DetailedSearchCriterion getSearchCriterionForKeyValueAndEntityKind(String key, String value) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/ViewLocatorResolverRegistry.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/ViewLocatorResolverRegistry.java index a304b163bc5..edf3a160674 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/ViewLocatorResolverRegistry.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/ViewLocatorResolverRegistry.java @@ -23,8 +23,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; /** - * A class that dispatches view locators to handlers for processing (i.e., opening a view with the - * parameters specified in the locator). + * A class that dispatches view locators to handlers for processing (i.e., opening a view with the parameters specified in the locator). * * @author Chandrasekhar Ramakrishnan * @author Piotr Buczek diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/AbstractActionMenu.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/AbstractActionMenu.java index d274e3ce6d3..a6d9a749500 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/AbstractActionMenu.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/AbstractActionMenu.java @@ -21,8 +21,6 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewConte import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; /** - * - * * @author Franz-Josef Elmer */ public abstract class AbstractActionMenu<S extends IClientServiceAsync> diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/ITabActionMenuItemDefinition.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/ITabActionMenuItemDefinition.java index 2ffb109c3c8..4538b79b98f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/ITabActionMenuItemDefinition.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/ITabActionMenuItemDefinition.java @@ -26,8 +26,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework. public interface ITabActionMenuItemDefinition<S extends IClientServiceAsync> { /** - * Used to create widget ids and dictionary messages. Following messages are expected to be - * defined in the dictionary: ${name}_menu_item, ${name}_tab_label + * Used to create widget ids and dictionary messages. Following messages are expected to be defined in the dictionary: ${name}_menu_item, + * ${name}_tab_label */ public String getName(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/modules/ModulesMenu.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/modules/ModulesMenu.java index 50fa0d34a5f..9ae23c7f695 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/modules/ModulesMenu.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/modules/ModulesMenu.java @@ -67,9 +67,8 @@ public class ModulesMenu extends TopMenuItem implements IModuleInitializationObs } /** - * Adds menu items supplied by the specified <var>modules</var> to the this menu and then shows - * the menu. Additional simplification of the menu structure is done if there is only one item - * in the submenu. + * Adds menu items supplied by the specified <var>modules</var> to the this menu and then shows the menu. Additional simplification of the menu + * structure is done if there is only one item in the submenu. */ void addModuleItems(List<IModule> modules) { @@ -121,8 +120,7 @@ public class ModulesMenu extends TopMenuItem implements IModuleInitializationObs } /** - * If there is only one item in specified <var>topMenu</var> and that item has a sub menu then - * 'pull up' this one item into the top menu. + * If there is only one item in specified <var>topMenu</var> and that item has a sub menu then 'pull up' this one item into the top menu. */ private static void simplifyIfNecessary(TopMenuItem topMenu) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/BaseEntityModel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/BaseEntityModel.java index 4a200731731..674d34e1eee 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/BaseEntityModel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/BaseEntityModel.java @@ -27,8 +27,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.IColumnDefinition; import ch.systemsx.cisd.openbis.generic.shared.basic.PrimitiveValue; /** - * The generic model which can be created automatically using the array of {@link IColumnDefinition} - * . + * The generic model which can be created automatically using the array of {@link IColumnDefinition} . * * @author Franz-Josef Elmer * @author Tomasz Pylak diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/DataSetTypeModel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/DataSetTypeModel.java index f7eb5569866..9caed25211a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/DataSetTypeModel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/DataSetTypeModel.java @@ -35,7 +35,6 @@ public class DataSetTypeModel extends SimplifiedBaseModelData private static final long serialVersionUID = 1L; - public DataSetTypeModel(final DataSetType dataSetType) { this(dataSetType.getCode(), dataSetType); @@ -49,7 +48,6 @@ public class DataSetTypeModel extends SimplifiedBaseModelData set(ModelDataPropertyNames.OBJECT, object); } - public final static List<DataSetTypeModel> convert(final List<DataSetType> dataSetTypes, boolean withAll, boolean withTypesInFile) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/EntityVisitModel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/EntityVisitModel.java index 2ca3cccfc8e..37fef27e18a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/EntityVisitModel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/EntityVisitModel.java @@ -19,8 +19,6 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.model; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityVisit; /** - * - * * @author Franz-Josef Elmer */ public class EntityVisitModel extends SimplifiedBaseModel @@ -33,7 +31,7 @@ public class EntityVisitModel extends SimplifiedBaseModel set(ModelDataPropertyNames.CODE, visit.getIdentifier()); set(ModelDataPropertyNames.OBJECT, visit); } - + public EntityVisit getVisit() { return (EntityVisit) get(ModelDataPropertyNames.OBJECT); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/ModelDataPropertyNames.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/ModelDataPropertyNames.java index 836e2bc691a..676fb2232f5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/ModelDataPropertyNames.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/ModelDataPropertyNames.java @@ -20,16 +20,14 @@ import com.extjs.gxt.ui.client.data.ModelData; import com.extjs.gxt.ui.client.widget.grid.ColumnConfig; /** - * Some constants used in {@link ModelData} implementations. These constants are typically used in - * {@link ColumnConfig#setId(String)}. Because they serve a different purpose, they should not be - * used in {@link ColumnConfig#setHeader(String)}. + * Some constants used in {@link ModelData} implementations. These constants are typically used in {@link ColumnConfig#setId(String)}. Because they + * serve a different purpose, they should not be used in {@link ColumnConfig#setHeader(String)}. * <p> - * Use <i>Java</i> coding standard for naming these property names and be aware that some of them - * could be use for sorting when using <i>Result Set</i>. + * Use <i>Java</i> coding standard for naming these property names and be aware that some of them could be use for sorting when using <i>Result + * Set</i>. * </p> * <p> - * <b>Important note</b>: Do not put a <code>_</code> in the property name except for specifying a - * field path. + * <b>Important note</b>: Do not put a <code>_</code> in the property name except for specifying a field path. * </p> * * @author Christian Ribeaud @@ -37,8 +35,7 @@ import com.extjs.gxt.ui.client.widget.grid.ColumnConfig; public final class ModelDataPropertyNames { /** - * Try to avoid using this class! Define your model keys as private constants in the model and - * expose them with getters. + * Try to avoid using this class! Define your model keys as private constants in the model and expose them with getters. */ public static final String CODE = "code"; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/SimplifiedBaseModel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/SimplifiedBaseModel.java index 9fe0b7652bb..362a72389c5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/SimplifiedBaseModel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/SimplifiedBaseModel.java @@ -20,8 +20,7 @@ import com.extjs.gxt.ui.client.data.BaseModel; import com.extjs.gxt.ui.client.data.RpcMap; /** - * A Subclass of the GXT BaseModel that simplifies default behavior ignoring special characters - * (e.g. '.', '[', ']'). + * A Subclass of the GXT BaseModel that simplifies default behavior ignoring special characters (e.g. '.', '[', ']'). * * @see SimplifiedBaseModelData * @author Chandrasekhar Ramakrishnan diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/SimplifiedBaseModelData.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/SimplifiedBaseModelData.java index cba83aa1fe5..85407b1440e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/SimplifiedBaseModelData.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/model/SimplifiedBaseModelData.java @@ -20,16 +20,13 @@ import com.extjs.gxt.ui.client.data.BaseModelData; import com.extjs.gxt.ui.client.data.RpcMap; /** - * A Subclass of the GXT BaseModelData that simplifies default behavior ignoring special characters - * ('.', '[', ']'). + * A Subclass of the GXT BaseModelData that simplifies default behavior ignoring special characters ('.', '[', ']'). * <p> - * As a result nested value support is turned off. NestedValues check for key strings with '.' in - * then treat them as paths for traversing multiple HashMaps. We don't need this, and, in fact, it - * causes problems for us, since we occasionally use '.' as part of a normal column name for a table + * As a result nested value support is turned off. NestedValues check for key strings with '.' in then treat them as paths for traversing multiple + * HashMaps. We don't need this, and, in fact, it causes problems for us, since we occasionally use '.' as part of a normal column name for a table * without intending the nested-value semantics; thus we turn it off. * <p> - * Also handling of property maps with syntax p1[key1] is switched off to allow '[' and ']' - * characters in normal column names. + * Also handling of property maps with syntax p1[key1] is switched off to allow '[' and ']' characters in normal column names. * * @author Chandrasekhar Ramakrishnan * @author Piotr Buczek diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/ClientPluginAdapter.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/ClientPluginAdapter.java index f294ec06532..4979b9b0db3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/ClientPluginAdapter.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/ClientPluginAdapter.java @@ -30,8 +30,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.BasicEntityType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.api.IManagedInputWidgetDescription; /** - * A dummy {@link IClientPlugin} implementation which throws {@link UnsupportedOperationException} - * as default behavior. + * A dummy {@link IClientPlugin} implementation which throws {@link UnsupportedOperationException} as default behavior. * * @author Christian Ribeaud */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/IClientPluginFactory.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/IClientPluginFactory.java index cb867549082..93337b2eb3a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/IClientPluginFactory.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/IClientPluginFactory.java @@ -35,21 +35,19 @@ public interface IClientPluginFactory public boolean isEnabled(); /** - * 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 Set<String> getEntityTypeCodes(final EntityKind entityKind); /** - * Creates and returns a {@link IClientPlugin} implementation specific to given - * <var>entityKind</var> and given <var>entityType</var> each time this method is called. + * Creates and returns a {@link IClientPlugin} implementation specific to given <var>entityKind</var> and given <var>entityType</var> each time + * this method is called. */ public <T extends BasicEntityType, I extends IIdAndCodeHolder> IClientPlugin<T, I> createClientPlugin( final EntityKind entityKind); /** - * Returns {@link IModule} defined for given 'technology' or null if no module should be - * created. + * Returns {@link IModule} defined for given 'technology' or null if no module should be created. */ public IModule tryGetModule(); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/IClientPluginFactoryProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/IClientPluginFactoryProvider.java index 1b132b1d0d2..d5a47223808 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/IClientPluginFactoryProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/IClientPluginFactoryProvider.java @@ -36,8 +36,7 @@ public interface IClientPluginFactoryProvider final BasicEntityType entityType); /** - * Registers {@link IModuleInitializationObserver}, that will be modified about all initialized - * modules after their initialization. + * Registers {@link IModuleInitializationObserver}, that will be modified about all initialized modules after their initialization. */ void registerModuleInitializationObserver(IModuleInitializationObserver observer); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/IClientPluginFactoryUsingWildcards.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/IClientPluginFactoryUsingWildcards.java index f598fc62d99..bbb666b890b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/IClientPluginFactoryUsingWildcards.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/IClientPluginFactoryUsingWildcards.java @@ -21,16 +21,14 @@ import java.util.List; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; /** - * An extension of the @{link IClientPluginFactory} that supports using regular expression wildcards - * in the codes. + * An extension of the @{link IClientPluginFactory} that supports using regular expression wildcards in the codes. * * @author Chandrasekhar Ramakrishnan */ public interface IClientPluginFactoryUsingWildcards extends IClientPluginFactory { /** - * 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/client/web/client/application/plugin/IModule.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/IModule.java index 86976f78716..e855c80572d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/IModule.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/IModule.java @@ -27,18 +27,16 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.TabContent import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithIdentifier; /** - * Plugin that does not depend on entity kind and type. All methods except - * {@link #initialize(AsyncCallback)} are invoked after invocation of the call back of the - * initialization method. + * Plugin that does not depend on entity kind and type. All methods except {@link #initialize(AsyncCallback)} are invoked after invocation of the call + * back of the initialization method. * * @author Izabela Adamczyk */ public interface IModule { /** - * Initializes the module and invoke method {@link AsyncCallback#onSuccess(Object)} on the - * specified call back after successful initialization. Otherwise - * {@link AsyncCallback#onFailure(Throwable)} is invoked. + * Initializes the module and invoke method {@link AsyncCallback#onSuccess(Object)} on the specified call back after successful initialization. + * Otherwise {@link AsyncCallback#onFailure(Throwable)} is invoked. */ void initialize(AsyncCallback<Void> callback); @@ -48,14 +46,12 @@ public interface IModule String getName(); /** - * Returns a list with menu items (they can be complex submenus or single menu items). The list - * should be empty if this module isn't applicable. + * Returns a list with menu items (they can be complex submenus or single menu items). The list should be empty if this module isn't applicable. */ List<? extends MenuItem> getMenuItems(); /** - * Returns a collection of {@link DisposableTabContent}s that will be added to entity details - * view. + * Returns a collection of {@link DisposableTabContent}s that will be added to entity details view. */ Collection<? extends TabContent> getSections( IEntityInformationHolderWithIdentifier entity); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/IModuleInitializationObserver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/IModuleInitializationObserver.java index faf82686a4d..bd44fdb0567 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/IModuleInitializationObserver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/IModuleInitializationObserver.java @@ -18,7 +18,6 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.plugin; import java.util.List; - /** * @author Izabela Adamczyk */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/ModuleInitializationController.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/ModuleInitializationController.java index 99dea0b65c0..86c34de86da 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/ModuleInitializationController.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/ModuleInitializationController.java @@ -24,8 +24,8 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; /** - * This class controls initialization process of all modules and notifies the - * {@link IModuleInitializationObserver}s when all initialization is finished. + * This class controls initialization process of all modules and notifies the {@link IModuleInitializationObserver}s when all initialization is + * finished. * * @author Piotr Buczek */ @@ -34,9 +34,8 @@ public class ModuleInitializationController private static ModuleInitializationController INSTANCE; /** - * Cleans up the controller instance which is kept as a singleton on the client. Should be - * called after logout, otherwise module initialization might not be performed on the server - * after server restart and modules will stop working (see LMS-2154) . + * Cleans up the controller instance which is kept as a singleton on the client. Should be called after logout, otherwise module initialization + * might not be performed on the server after server restart and modules will stop working (see LMS-2154) . */ public static void cleanup() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/WildcardSupportingPluginFactoryMap.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/WildcardSupportingPluginFactoryMap.java index fac9bf3f08b..452a3989fa5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/WildcardSupportingPluginFactoryMap.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/plugin/WildcardSupportingPluginFactoryMap.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 - * IClientPluginFactory objects. + * Utility class that manages mappings from entity types/codes (possibly including wildcards) to IClientPluginFactory objects. * * @author Chandrasekhar Ramakrishnan */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/LinkRenderer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/LinkRenderer.java index baa97cb8bb8..ab449ff5cee 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/LinkRenderer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/LinkRenderer.java @@ -225,8 +225,8 @@ public class LinkRenderer } /** - * @return {@link Anchor} GWT widget that is displayed as a link with given <var>text</var> and - * a <var>listener</var> registered on the click event. + * @return {@link Anchor} GWT widget that is displayed as a link with given <var>text</var> and a <var>listener</var> registered on the click + * event. * <p> * The link display style is default (not invalidated). */ @@ -249,10 +249,9 @@ public class LinkRenderer /** * It is suggested to use {@link #getLinkWidget} method instead of this one. * - * @return {@link Hyperlink} GWT widget that is displayed as a link with given <var>text</var>. - * If <var>historyHref</var> is not null and simple view mode is active - * <var>historyHref</var> will be appended to the link after '#'. Otherwise if - * <var>listener</var> is not null it will be registered on the click event. + * @return {@link Hyperlink} GWT widget that is displayed as a link with given <var>text</var>. If <var>historyHref</var> is not null and simple + * view mode is active <var>historyHref</var> will be appended to the link after '#'. Otherwise if <var>listener</var> is not null it will + * be registered on the click event. * <p> * The link display style is default (not invalidated). */ @@ -308,8 +307,8 @@ public class LinkRenderer } /** - * Sets the click listener which executes the specified action when the click occurs if we are - * in normal view mode and redirects to the provided URL in simple view mode. + * Sets the click listener which executes the specified action when the click occurs if we are in normal view mode and redirects to the provided + * URL in simple view mode. */ @SuppressWarnings("deprecation") public static Widget createButtonLink(Button button, diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/PersonRenderer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/PersonRenderer.java index 62c7399002b..56b24eba574 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/PersonRenderer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/PersonRenderer.java @@ -50,8 +50,7 @@ public final class PersonRenderer private static final char LOGIN_START = '['; /** - * Registrator renderer. Works only with {@link TableModelRowWithObject} wrapping a DTO - * implementing {@link IRegistratorHolder}. + * Registrator renderer. Works only with {@link TableModelRowWithObject} wrapping a DTO implementing {@link IRegistratorHolder}. */ public static final GridCellRenderer<BaseEntityModel<?>> REGISTRATOR_RENDERER = new GridCellRenderer<BaseEntityModel<?>>() @@ -70,8 +69,7 @@ public final class PersonRenderer }; /** - * Modifier renderer. Works only with {@link TableModelRowWithObject} wrapping a DTO - * implementing {@link IRegistratorAndModifierHolder}. + * Modifier renderer. Works only with {@link TableModelRowWithObject} wrapping a DTO implementing {@link IRegistratorAndModifierHolder}. */ public static final GridCellRenderer<BaseEntityModel<?>> MODIFIER_RENDERER = new GridCellRenderer<BaseEntityModel<?>>() diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/PropertyTypeRenderer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/PropertyTypeRenderer.java index 8313420f8b8..a33475689a2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/PropertyTypeRenderer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/PropertyTypeRenderer.java @@ -26,9 +26,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.PropertyType; public class PropertyTypeRenderer { /** - * @return text which can be used as the specified property description. If the property label - * is unique in the specified set of properties, it will be used. Otherwise the code - * will be attached. + * @return text which can be used as the specified property description. If the property label is unique in the specified set of properties, it + * will be used. Otherwise the code will be attached. */ public static String getDisplayName(final PropertyType propertyType, List<PropertyType> types) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/TimestampStringCellRenderer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/TimestampStringCellRenderer.java index 5c177fbc897..fa0657f92b1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/TimestampStringCellRenderer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/TimestampStringCellRenderer.java @@ -28,9 +28,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.Base import ch.systemsx.cisd.openbis.generic.shared.basic.BasicConstant; /** - * An {@link GridCellRenderer} which renders date value stored in - * {@link BasicConstant#CANONICAL_DATE_FORMAT_PATTERN} in more readable format (the one used in date - * fields in registration forms). + * An {@link GridCellRenderer} which renders date value stored in {@link BasicConstant#CANONICAL_DATE_FORMAT_PATTERN} in more readable format (the one + * used in date fields in registration forms). * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/YesNoRenderer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/YesNoRenderer.java index 7fdeadc1598..88f162d694a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/YesNoRenderer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/renderer/YesNoRenderer.java @@ -9,8 +9,7 @@ import com.extjs.gxt.ui.client.widget.grid.GridCellRenderer; import ch.systemsx.cisd.openbis.generic.shared.basic.SimpleYesNoRenderer; /** - * Renderer of {@link Boolean} value. Render <code>true</code> to <code>yes</code> and - * <code>false</code> to <code>no</code>. + * Renderer of {@link Boolean} value. Render <code>true</code> to <code>yes</code> and <code>false</code> to <code>no</code>. * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AbstractViewerWithVerticalSplit.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AbstractViewerWithVerticalSplit.java index 1f938a7a012..976f3dc9cb3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AbstractViewerWithVerticalSplit.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AbstractViewerWithVerticalSplit.java @@ -25,8 +25,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.Borde import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolder; /** - * {@link AbstractViewer} extension with additional support for vertical layout with left panel - * state (expanded size / collapsed) saved in display settings. + * {@link AbstractViewer} extension with additional support for vertical layout with left panel state (expanded size / collapsed) saved in display + * settings. * * @author Piotr Buczek */ @@ -50,8 +50,7 @@ public abstract class AbstractViewerWithVerticalSplit<D extends IEntityInformati } /** - * Creates {@link BorderLayoutData} for the left panel extracting initial size from display - * settings. + * Creates {@link BorderLayoutData} for the left panel extracting initial size from display settings. */ protected final BorderLayoutData createLeftBorderLayoutData() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AuthorizationGroupGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AuthorizationGroupGrid.java index 96c51099712..5a00e5d397a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AuthorizationGroupGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AuthorizationGroupGrid.java @@ -267,8 +267,8 @@ public class AuthorizationGroupGrid extends TypedTableGrid<AuthorizationGroup> public DatabaseModificationKind[] getRelevantModifications() { return new DatabaseModificationKind[] - { DatabaseModificationKind.createOrDelete(ObjectKind.AUTHORIZATION_GROUP), - DatabaseModificationKind.edit(ObjectKind.AUTHORIZATION_GROUP) }; + { DatabaseModificationKind.createOrDelete(ObjectKind.AUTHORIZATION_GROUP), + DatabaseModificationKind.edit(ObjectKind.AUTHORIZATION_GROUP) }; } private static final class GroupListDeletionConfirmationDialog extends diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/CodesArea.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/CodesArea.java index 4e017773638..63dc6724429 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/CodesArea.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/CodesArea.java @@ -24,8 +24,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.ICodeHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Code; /** - * A text area to specify list of codes. Codes are specified separated by commas, spaces or new - * lines. + * A text area to specify list of codes. Codes are specified separated by commas, spaces or new lines. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/ColumnSettingsConfigurer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/ColumnSettingsConfigurer.java index 6e561404aff..e68c65a292e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/ColumnSettingsConfigurer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/ColumnSettingsConfigurer.java @@ -43,8 +43,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRowWithObject /** * A class that manages the configuring of column settings in the AbstractBrowserGrid. * <p> - * Considered a friend class to AbstractBrowserGried, i.e., it is allowed to use methods that are - * otherwise private. + * Considered a friend class to AbstractBrowserGried, i.e., it is allowed to use methods that are otherwise private. * * @author Chandrasekhar Ramakrishnan */ @@ -177,8 +176,8 @@ public class ColumnSettingsConfigurer<T extends Serializable> } /** - * Creates a new column model based on the specified column data models and the old full column - * model as provided by {@link TypedTableGrid#getFullColumnModel()}. + * Creates a new column model based on the specified column data models and the old full column model as provided by + * {@link TypedTableGrid#getFullColumnModel()}. */ private ColumnModel createNewColumnModel(List<ColumnDataModel> newColumnDataModels) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/GeneralImportComponent.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/GeneralImportComponent.java index 77240e0f698..049601d0684 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/GeneralImportComponent.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/GeneralImportComponent.java @@ -11,8 +11,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleType; /** - * Allows to specify search criteria for materials contained in wells. Used in experiment section - * panel or as a standalone module. + * Allows to specify search criteria for materials contained in wells. Used in experiment section panel or as a standalone module. * * @author Pawel Glyzewski */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/LoginPanelAutofill.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/LoginPanelAutofill.java index 63795617dc8..79ec6bc8edb 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/LoginPanelAutofill.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/LoginPanelAutofill.java @@ -32,14 +32,11 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewConte import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; /** - * This class uses a variant of a trick described in the GWT discussion forum to support autofill. - * Browsers do not support autofill on input fields that are generated on the client by javascript, - * so it is necessary for the page to statically contain the input fields we want to autofill. These + * This class uses a variant of a trick described in the GWT discussion forum to support autofill. Browsers do not support autofill on input fields + * that are generated on the client by javascript, so it is necessary for the page to statically contain the input fields we want to autofill. These * fields are unhidden and used on the login page. * - * @see <a href - * ="http://groups.google.com/group/Google-Web-Toolkit/browse%5Fthread/thread/2b2ce0b6aaa82461">GWT - * Discussion Forum</a> + * @see <a href ="http://groups.google.com/group/Google-Web-Toolkit/browse%5Fthread/thread/2b2ce0b6aaa82461">GWT Discussion Forum</a> * @author Chandrasekhar Ramakrishnan */ // TODO 2010-03-10, CR: This implementation currently supports Firefox, but not Safari or Chrome. To diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/ModulesSectionsManager.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/ModulesSectionsManager.java index bf3cc9ee467..edb85f16864 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/ModulesSectionsManager.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/ModulesSectionsManager.java @@ -25,8 +25,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget. import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithIdentifier; /** - * Adds module sections the viewer after both {@link SectionsPanel} and {@link IModule}s are - * initialized. + * Adds module sections the viewer after both {@link SectionsPanel} and {@link IModule}s are initialized. * * @author Izabela Adamczyk */ @@ -40,8 +39,7 @@ public class ModulesSectionsManager private List<IModule> modules; /** - * Sets the values of chosen fields. Adds module sections to given container if called after - * {@link #initialize(List)}. + * Sets the values of chosen fields. Adds module sections to given container if called after {@link #initialize(List)}. */ @SuppressWarnings("hiding") public void initialize(final SectionsPanel container, diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/PropertyValueRenderers.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/PropertyValueRenderers.java index f56a81e1b0b..bbce31d8424 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/PropertyValueRenderers.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/PropertyValueRenderers.java @@ -148,8 +148,7 @@ public final class PropertyValueRenderers } /** - * Creates a {@link IPropertyValueRenderer} implementation for rendering {@link IEntityProperty} - * . + * Creates a {@link IPropertyValueRenderer} implementation for rendering {@link IEntityProperty} . */ public final static IPropertyValueRenderer<IEntityProperty> createEntityPropertyPropertyValueRenderer( final IViewContext<?> viewContext) @@ -176,8 +175,7 @@ public final class PropertyValueRenderers } /** - * Creates a {@link IPropertyValueRenderer} implementation for rendering a String with newlines - * preserved. + * Creates a {@link IPropertyValueRenderer} implementation for rendering a String with newlines preserved. */ public final static IPropertyValueRenderer<String> createMultilineStringPropertyValueRenderer( final IMessageProvider messageProvider) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/RoleAssignmentGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/RoleAssignmentGrid.java index 9a43b4b548d..1c9b771542b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/RoleAssignmentGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/RoleAssignmentGrid.java @@ -197,7 +197,7 @@ public class RoleAssignmentGrid extends TypedTableGrid<RoleAssignment> public DatabaseModificationKind[] getRelevantModifications() { return new DatabaseModificationKind[] - { DatabaseModificationKind.createOrDelete(ObjectKind.ROLE_ASSIGNMENT), - DatabaseModificationKind.edit(ObjectKind.ROLE_ASSIGNMENT) }; + { DatabaseModificationKind.createOrDelete(ObjectKind.ROLE_ASSIGNMENT), + DatabaseModificationKind.edit(ObjectKind.ROLE_ASSIGNMENT) }; } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/RowLayoutManager.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/RowLayoutManager.java index abf35d97342..a3d387aca08 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/RowLayoutManager.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/RowLayoutManager.java @@ -36,9 +36,8 @@ import com.extjs.gxt.ui.client.widget.layout.RowData; import com.extjs.gxt.ui.client.widget.layout.RowLayout; /** - * Helper class for doing {@link RowLayout} of a {@link LayoutContainer} with instances of - * {@link ContentPanel} in a dynamic way. Collapsed row components lead to a resize of the - * non-collapsed components if the row size is defined by a positive value <= 1. + * Helper class for doing {@link RowLayout} of a {@link LayoutContainer} with instances of {@link ContentPanel} in a dynamic way. Collapsed row + * components lead to a resize of the non-collapsed components if the row size is defined by a positive value <= 1. * * @author Franz-Josef Elmer */ @@ -51,9 +50,9 @@ public class RowLayoutManager void setFor(RowData rowData, double newValue); int getFrameSizeFor(ContentPanel panel); - + int getSize(Container<?> container); - + int getPositionFrom(DragEvent dragEvent); } @@ -130,7 +129,7 @@ public class RowLayoutManager { return dragEvent.getX(); } - + }; private final LayoutContainer container; @@ -249,7 +248,7 @@ public class RowLayoutManager } }; } - + private void handleSplitMovement(final ContentPanel contentPanel, int diff, int indexInDynamicRowDataArray) { int indexOfResizablePanelAbove = -1; @@ -296,11 +295,11 @@ public class RowLayoutManager diffRatio = Math.min(diffRatio, 1 - DELTA - above.originalValue); diffRatio = Math.min(diffRatio, below.originalValue - DELTA); diffRatio = Math.max(diffRatio, below.originalValue - 1 + DELTA); - + above.originalValue += diffRatio; below.originalValue -= diffRatio; adjustRelative(); } - + private static final double DELTA = 0.02; } \ No newline at end of file diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SimpleModeHeader.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SimpleModeHeader.java index 7b3ab1adbb0..819e043570f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SimpleModeHeader.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SimpleModeHeader.java @@ -49,7 +49,6 @@ public class SimpleModeHeader extends LayoutContainer { public static final String ID = GenericConstants.ID_PREFIX + "simple-mode-header"; - private final ToolBar toolBar; private final IViewContext<ICommonClientServiceAsync> viewContext; @@ -100,6 +99,7 @@ public class SimpleModeHeader extends LayoutContainer return new Button(logoutLabel, new SelectionListener<ButtonEvent>() { private LoginAction loginAction = new LoginAction(viewContext); + @Override public void componentSelected(ButtonEvent ce) { @@ -113,17 +113,18 @@ public class SimpleModeHeader extends LayoutContainer { String logoutLabel = viewContext.getMessage(Dict.BUTTON_LOGOUT_LABEL); return new Button(logoutLabel, new SelectionListener<ButtonEvent>() - { - private LogoutAction logoutAction = new LogoutAction(viewContext); - @Override - public void componentSelected(ButtonEvent ce) { - logoutAction.execute(); - } - - }); + private LogoutAction logoutAction = new LogoutAction(viewContext); + + @Override + public void componentSelected(ButtonEvent ce) + { + logoutAction.execute(); + } + + }); } - + @Override protected void onRender(final Element parent, final int pos) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SpaceGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SpaceGrid.java index 8404eef66b3..9b882f894d3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SpaceGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SpaceGrid.java @@ -208,8 +208,8 @@ public class SpaceGrid extends TypedTableGrid<Space> public DatabaseModificationKind[] getRelevantModifications() { return new DatabaseModificationKind[] - { DatabaseModificationKind.createOrDelete(ObjectKind.SPACE), - DatabaseModificationKind.edit(ObjectKind.SPACE) }; + { DatabaseModificationKind.createOrDelete(ObjectKind.SPACE), + DatabaseModificationKind.edit(ObjectKind.SPACE) }; } private static final class GroupListDeletionConfirmationDialog extends diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/aggregation/AggregationServiceLocatorResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/aggregation/AggregationServiceLocatorResolver.java index 0c5fd93e13c..8f7e5c12998 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/aggregation/AggregationServiceLocatorResolver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/aggregation/AggregationServiceLocatorResolver.java @@ -15,8 +15,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.Vi import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; /** - * An {@link IViewLocatorResolver} that shows the results of an aggregation service as a table - * model. + * An {@link IViewLocatorResolver} that shows the results of an aggregation service as a table model. * * @author Chandrasekhar Ramakrishnan */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/attachment/AttachmentBrowser.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/attachment/AttachmentBrowser.java index 37ba3cd5f8b..f395943ffe0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/attachment/AttachmentBrowser.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/attachment/AttachmentBrowser.java @@ -505,7 +505,7 @@ public class AttachmentBrowser extends TypedTableGrid<AttachmentVersions> public DatabaseModificationKind[] getRelevantModifications() { return new DatabaseModificationKind[] - { DatabaseModificationKind.edit(getObjectKind()) }; + { DatabaseModificationKind.edit(getObjectKind()) }; } private ObjectKind getObjectKind() diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/AbstractExternalDataGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/AbstractExternalDataGrid.java index f2b664b06b0..a035f65eec0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/AbstractExternalDataGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/AbstractExternalDataGrid.java @@ -197,9 +197,8 @@ public abstract class AbstractExternalDataGrid extends AbstractEntityGrid<Abstra } /* - * Provides property types which should be shown as the grid columns. Takes into account what - * types of datasets are displayed and does not show property types which are not assigned to - * any of those types. + * Provides property types which should be shown as the grid columns. Takes into account what types of datasets are displayed and does not show + * property types which are not assigned to any of those types. */ private ICriteriaProvider<PropertyTypesCriteria> createCriteriaProvider() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetReportGenerator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetReportGenerator.java index bdecaeb4f7f..44c3d901e58 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetReportGenerator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetReportGenerator.java @@ -57,8 +57,7 @@ public class DataSetReportGenerator } /** - * Generates a report for specified datasets and invokes specified action with component - * containing this report. + * Generates a report for specified datasets and invokes specified action with component containing this report. */ public static void generateAndInvoke(IViewContext<ICommonClientServiceAsync> viewContext, DatastoreServiceDescription service, DisplayedOrSelectedDatasetCriteria criteria, diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetTypeSelectionWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetTypeSelectionWidget.java index 2783456d111..405cd76465f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetTypeSelectionWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetTypeSelectionWidget.java @@ -99,9 +99,9 @@ public final class DataSetTypeSelectionWidget extends DropDownList<DataSetTypeMo public DatabaseModificationKind[] getRelevantModifications() { return new DatabaseModificationKind[] - { createOrDelete(ObjectKind.DATASET_TYPE), edit(ObjectKind.DATASET_TYPE), - createOrDelete(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), - edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT) }; + { createOrDelete(ObjectKind.DATASET_TYPE), edit(ObjectKind.DATASET_TYPE), + createOrDelete(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), + edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT) }; } // diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetUploadForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetUploadForm.java index f3516078de2..b78e9723fe5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetUploadForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetUploadForm.java @@ -46,8 +46,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.DataSetUploadInfo.DataSetUp import ch.systemsx.cisd.openbis.generic.shared.basic.URLMethodWithParameters; /** - * Panel that allows to specify information necessary to upload data sets and redirects user to - * specified upload service. + * Panel that allows to specify information necessary to upload data sets and redirects user to specified upload service. * * @author Izabela Adamczyk */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DatastoreServiceDescriptionModel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DatastoreServiceDescriptionModel.java index afc58c07052..d2b43447935 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DatastoreServiceDescriptionModel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DatastoreServiceDescriptionModel.java @@ -36,8 +36,7 @@ public class DatastoreServiceDescriptionModel extends SimplifiedBaseModelData } /** - * @param datasetOrNull if not null only services that match the data set's type will be - * converted + * @param datasetOrNull if not null only services that match the data set's type will be converted */ public final static List<DatastoreServiceDescriptionModel> convert( final List<DatastoreServiceDescription> services, final AbstractExternalData datasetOrNull) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/deletion/DeletionGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/deletion/DeletionGrid.java index 0e6c4479dfa..339966a1490 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/deletion/DeletionGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/deletion/DeletionGrid.java @@ -187,6 +187,6 @@ public class DeletionGrid extends TypedTableGrid<Deletion> public DatabaseModificationKind[] getRelevantModifications() { return new DatabaseModificationKind[] - { DatabaseModificationKind.createOrDelete(ObjectKind.DELETION) }; + { DatabaseModificationKind.createOrDelete(ObjectKind.DELETION) }; } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentBrowserGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentBrowserGrid.java index 87863a0e5bc..a7f9b993ff4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentBrowserGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentBrowserGrid.java @@ -180,8 +180,7 @@ public class ExperimentBrowserGrid extends AbstractEntityGrid<Experiment> } /** - * Create a grid with the toolbar and a tree and optional initial selection of experiment type - * and project. + * Create a grid with the toolbar and a tree and optional initial selection of experiment type and project. */ public static DisposableEntityChooser<TableModelRowWithObject<Experiment>> create( final IViewContext<ICommonClientServiceAsync> viewContext, String initialSpaceOrNull, diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentBrowserToolbar.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentBrowserToolbar.java index c014eafd299..b1db2c7804d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentBrowserToolbar.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentBrowserToolbar.java @@ -139,9 +139,9 @@ class ExperimentBrowserToolbar extends ToolBar implements IDisposableComponent, public DatabaseModificationKind[] getRelevantModifications() { return new DatabaseModificationKind[] - { createOrDelete(ObjectKind.EXPERIMENT_TYPE), createOrDelete(ObjectKind.PROJECT), - edit(ObjectKind.PROJECT), createOrDelete(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), - edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT) }; + { createOrDelete(ObjectKind.EXPERIMENT_TYPE), createOrDelete(ObjectKind.PROJECT), + edit(ObjectKind.PROJECT), createOrDelete(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), + edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT) }; } @Override @@ -158,7 +158,8 @@ class ExperimentBrowserToolbar extends ToolBar implements IDisposableComponent, || observedModifications.contains(edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT))) { selectExperimentTypeCombo.refreshStore(entityTypeRefreshCallback); - } else { + } else + { entityTypeRefreshCallback.postRefresh(true); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentTypeSelectionWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentTypeSelectionWidget.java index 86a84aa36ae..8bf16ca25b2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentTypeSelectionWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentTypeSelectionWidget.java @@ -97,9 +97,9 @@ public final class ExperimentTypeSelectionWidget extends public DatabaseModificationKind[] getRelevantModifications() { return new DatabaseModificationKind[] - { createOrDelete(ObjectKind.EXPERIMENT_TYPE), edit(ObjectKind.EXPERIMENT_TYPE), - createOrDelete(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), - edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT) }; + { createOrDelete(ObjectKind.EXPERIMENT_TYPE), edit(ObjectKind.EXPERIMENT_TYPE), + createOrDelete(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), + edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT) }; } // diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ProjectSelectionTreeGridContainer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ProjectSelectionTreeGridContainer.java index b6447ccf695..cabd094eca9 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ProjectSelectionTreeGridContainer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ProjectSelectionTreeGridContainer.java @@ -71,8 +71,8 @@ import com.google.gwt.user.client.ui.InlineHTML; import com.google.gwt.user.client.ui.Widget; /** - * {@link LayoutContainer} containing a {@link TreeGrid} with projects loaded from the server. Main - * items of the tree are project spaces and projects are their children. + * {@link LayoutContainer} containing a {@link TreeGrid} with projects loaded from the server. Main items of the tree are project spaces and projects + * are their children. * * @author Piotr Buczek */ @@ -421,8 +421,8 @@ public final class ProjectSelectionTreeGridContainer extends LayoutContainer imp } /** - * Refreshes the whole tree. If the previously selected project is no longer present in the db, - * nothing will be selected. Otherwise the previous selection will be preserved. + * Refreshes the whole tree. If the previously selected project is no longer present in the db, nothing will be selected. Otherwise the previous + * selection will be preserved. */ public void refreshTree() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/CheckBoxField.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/CheckBoxField.java index dbde3208012..4529e44662b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/CheckBoxField.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/CheckBoxField.java @@ -21,8 +21,7 @@ import com.extjs.gxt.ui.client.widget.form.CheckBox; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.FieldUtil; /** - * A small {@link CheckBox} extension for registering a boolean. Created field will always be - * aligned to the left. + * A small {@link CheckBox} extension for registering a boolean. Created field will always be aligned to the left. * * @author Christian Ribeaud * @author Piotr Buczek @@ -40,11 +39,11 @@ public final class CheckBoxField extends CheckBox protected void alignElements() { input.alignTo(getElement(), "l-l", new int[] - { 0, 0 }); + { 0, 0 }); if (getBoxLabel() != null) { boxLabelEl.alignTo(input.dom, "l-r", new int[] - { 5, 0 }); + { 5, 0 }); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/ExperimentChooserField.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/ExperimentChooserField.java index 88c643eb12c..65bf0b0ec05 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/ExperimentChooserField.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/ExperimentChooserField.java @@ -31,8 +31,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRowWithObject; /** - * A field for selecting an experiment in a fixed group from a list or by specifying code and - * project. + * A field for selecting an experiment in a fixed group from a list or by specifying code and project. * * @author Tomasz Pylak */ @@ -54,8 +53,7 @@ public class ExperimentChooserField extends ChosenEntitySetter<TableModelRowWith } /** - * Creates a text field with the additional browse button which allow to choose an experiment - * from the list. + * Creates a text field with the additional browse button which allow to choose an experiment from the list. */ public static ExperimentChooserFieldAdaptor create(final String labelField, final boolean mandatory, final ExperimentIdentifier initialValueOrNull, diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/HyperlinkField.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/HyperlinkField.java index d14c75a2291..eb8a80e602a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/HyperlinkField.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/HyperlinkField.java @@ -24,8 +24,8 @@ import com.extjs.gxt.ui.client.widget.form.Validator; import ch.systemsx.cisd.openbis.generic.shared.basic.ValidationUtilities.HyperlinkValidationHelper; /** - * A {@link TextField} extension for registering text (<code>String</code>) that will be rendered as - * a link. Default protocol ("http://") is added on blur if user doesn't provide one.<br> + * A {@link TextField} extension for registering text (<code>String</code>) that will be rendered as a link. Default protocol ("http://") is added on + * blur if user doesn't provide one.<br> * The text characters are validated. * * @author Piotr Buczek diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/MultilineItemsField.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/MultilineItemsField.java index 07c53c173ba..568dedd8b0c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/MultilineItemsField.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/MultilineItemsField.java @@ -60,8 +60,7 @@ public class MultilineItemsField extends MultilineVarcharField } /** - * @return null if the area has not been modified, the list of all items (separated by comma or - * a new line) otherwise + * @return null if the area has not been modified, the list of all items (separated by comma or a new line) otherwise */ public final String[] tryGetModifiedItemList() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/MultilineVarcharField.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/MultilineVarcharField.java index a16cf57e30a..c766b50edfc 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/MultilineVarcharField.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/MultilineVarcharField.java @@ -67,8 +67,8 @@ public class MultilineVarcharField extends TextArea } /** - * By default tab key will cause change of focus to next field. Call this method to change the - * behaviour to act like a text editor where tab key appends a tab. + * By default tab key will cause change of focus to next field. Call this method to change the behaviour to act like a text editor where tab key + * appends a tab. */ public void treatTabKeyAsInput() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/SampleChooserButton.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/SampleChooserButton.java index 71dad65cd2f..892fa133e04 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/SampleChooserButton.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/SampleChooserButton.java @@ -58,8 +58,7 @@ public class SampleChooserButton extends Button implements new LinkedHashSet<IChosenEntitiesListener<TableModelRowWithObject<Sample>>>(); /** - * Creates a text field with the additional browse button which allow to choose a sample from - * the list. + * Creates a text field with the additional browse button which allow to choose a sample from the list. */ public static SampleChooserButtonAdaptor create(final String labelField, final String buttonText, final boolean addShared, boolean addAll, diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/SampleChooserField.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/SampleChooserField.java index 4d69130ddeb..e14534aa326 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/SampleChooserField.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/SampleChooserField.java @@ -51,8 +51,7 @@ public class SampleChooserField extends ChosenEntitySetter<TableModelRowWithObje } /** - * Creates a text field with the additional browse button which allow to choose a sample from - * the list. + * Creates a text field with the additional browse button which allow to choose a sample from the list. */ public static SampleChooserFieldAdaptor create(final String labelField, final boolean mandatory, final String initialValueOrNull, final boolean addShared, diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/VocabularyTermSelectionWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/VocabularyTermSelectionWidget.java index 8b1ef966660..0c56035c2a4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/VocabularyTermSelectionWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/VocabularyTermSelectionWidget.java @@ -213,8 +213,7 @@ public class VocabularyTermSelectionWidget extends private String typedValueOrNull = null; /** - * Allows to choose one of the specified vocabulary's terms, is able to refresh the available - * terms by calling the server. + * Allows to choose one of the specified vocabulary's terms, is able to refresh the available terms by calling the server. */ public static DatabaseModificationAwareField<VocabularyTermModel> create(String idSuffix, String label, Vocabulary vocabulary, final boolean mandatory, @@ -225,8 +224,7 @@ public class VocabularyTermSelectionWidget extends } /** - * Allows to choose one of the specified vocabulary's terms, is able to refresh the available - * terms by calling the server. + * Allows to choose one of the specified vocabulary's terms, is able to refresh the available terms by calling the server. */ public static DatabaseModificationAwareField<VocabularyTermModel> create(String idSuffix, String label, Vocabulary vocabulary, final boolean mandatory, diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/XmlField.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/XmlField.java index 9f86a27bbb3..be73bbaee35 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/XmlField.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/XmlField.java @@ -23,8 +23,7 @@ import com.google.gwt.xml.client.XMLParser; import com.google.gwt.xml.client.impl.DOMParseException; /** - * Text field allowing to specify an XML document. The document will be validated on blur (it should - * be a well-formed XML). + * Text field allowing to specify an XML document. The document will be validated on blur (it should be a well-formed XML). * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/AbstractColumnSettingsDataModelProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/AbstractColumnSettingsDataModelProvider.java index d09f33c4969..09e898adbd6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/AbstractColumnSettingsDataModelProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/AbstractColumnSettingsDataModelProvider.java @@ -32,8 +32,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.GridCustomColumn; public abstract class AbstractColumnSettingsDataModelProvider { /** - * Will be called passing the columns settings chosen by the user (with the right order) as a - * parameter when the Column Settings dialog closes. + * Will be called passing the columns settings chosen by the user (with the right order) as a parameter when the Column Settings dialog closes. */ protected abstract void onClose(List<ColumnDataModel> newColumnDataModels); @@ -48,8 +47,8 @@ public abstract class AbstractColumnSettingsDataModelProvider } /** - * @return column data model including the current state of the custom columns. Note that the - * order may be different than the one chosen by the user. + * @return column data model including the current state of the custom columns. Note that the order may be different than the one chosen by the + * user. */ public List<ColumnDataModel> getColumnDataModels() { @@ -57,8 +56,8 @@ public abstract class AbstractColumnSettingsDataModelProvider } /** - * Called when all custom columns definitions are loaded from the database. Some custom columns - * may have been added or deleted, it will be taken into account when updating columnDataModels. + * Called when all custom columns definitions are loaded from the database. Some custom columns may have been added or deleted, it will be taken + * into account when updating columnDataModels. * * @param customColumns all custom columns for the grid */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/BrowserGridPagingToolBar.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/BrowserGridPagingToolBar.java index c38a10d7e76..60a61dbfbf6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/BrowserGridPagingToolBar.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/BrowserGridPagingToolBar.java @@ -48,8 +48,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUt import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; /** - * {@link PagingToolBar} extension with overwritten behavior of the <i>Refresh</i> button and - * additional <i>Export</i> button. + * {@link PagingToolBar} extension with overwritten behavior of the <i>Refresh</i> button and additional <i>Export</i> button. * * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ColumnListener.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ColumnListener.java index d3c45e25b2e..1fea5b0833b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ColumnListener.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ColumnListener.java @@ -29,8 +29,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.Base import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.WidgetUtils; /** - * Listener for a Grid which delegates click on a cell or link in a cell to a registered - * {@link ICellListener}. + * Listener for a Grid which delegates click on a cell or link in a cell to a registered {@link ICellListener}. * * @author Franz-Josef Elmer */ @@ -60,10 +59,8 @@ public final class ColumnListener<T, M extends BaseEntityModel<T>> implements } /** - * Invokes {@link ICellListener#handle(Object,boolean)} with the base object of the row - * specified by the row index of the event. The cell listener is determined by the column index. - * This method does nothing if no cell listener has been registered for column determined by the - * event. + * Invokes {@link ICellListener#handle(Object,boolean)} with the base object of the row specified by the row index of the event. The cell listener + * is determined by the column index. This method does nothing if no cell listener has been registered for column determined by the event. */ @Override @SuppressWarnings("unchecked") diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ColumnSettingsDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ColumnSettingsDialog.java index 12d47ee8d50..a6f78d88c75 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ColumnSettingsDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ColumnSettingsDialog.java @@ -148,8 +148,7 @@ public class ColumnSettingsDialog extends Dialog } /** - * The default implementation links all column settings dialogs to one help page. Subclasses may - * override. + * The default implementation links all column settings dialogs to one help page. Subclasses may override. */ protected HelpPageIdentifier createHelpPageIdentifier() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ColumnUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ColumnUtils.java index 633dfe61101..5169d249566 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ColumnUtils.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ColumnUtils.java @@ -187,9 +187,8 @@ public class ColumnUtils } /** - * Extension of GXT {@link CellEditor} with automatic conversion from String values that we hold - * in tables to specific data types (like {@link Date} or {@link Boolean}) handled by editor - * fields and vice versa. + * Extension of GXT {@link CellEditor} with automatic conversion from String values that we hold in tables to specific data types (like + * {@link Date} or {@link Boolean}) handled by editor fields and vice versa. */ private static class StringBasedCellEditor extends CellEditor { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/DisposableEntityChooser.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/DisposableEntityChooser.java index 54a3600afec..a51514f0e82 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/DisposableEntityChooser.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/DisposableEntityChooser.java @@ -19,8 +19,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid; import java.util.List; /** - * An interface for a component which has a functionality of selecting non, one or more objects of - * the specified type. + * An interface for a component which has a functionality of selecting non, one or more objects of the specified type. * * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ExtendedGridView.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ExtendedGridView.java index 9a7f967e74f..30108500694 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ExtendedGridView.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ExtendedGridView.java @@ -26,9 +26,8 @@ import com.google.gwt.user.client.ui.Widget; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.BaseEntityModel; /** - * {@link GridView} with {@link ColumnHeader} allowing to define additional behavior for header - * click when SHIFT button is pressed at the same time. By default the width of the column is - * adjusted. + * {@link GridView} with {@link ColumnHeader} allowing to define additional behavior for header click when SHIFT button is pressed at the same time. + * By default the width of the column is adjusted. * * @author Izabela Adamczyk */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ICellListenerAndLinkGenerator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ICellListenerAndLinkGenerator.java index 6c0dcf00352..7e2a18f9fad 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ICellListenerAndLinkGenerator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ICellListenerAndLinkGenerator.java @@ -21,8 +21,7 @@ import java.io.Serializable; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRowWithObject; /** - * Interface for classes implementing click listener action and generating corresponding URL for - * simple view mode. + * Interface for classes implementing click listener action and generating corresponding URL for simple view mode. * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ICriteriaProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ICriteriaProvider.java index 30ab367f0b5..f4044f1fa75 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ICriteriaProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ICriteriaProvider.java @@ -27,8 +27,8 @@ public interface ICriteriaProvider<K> K tryGetCriteria(); /** - * calls the refresh callback only after appropriate criteria are updated. But if there is - * nothing to update in the criteria provider the callback is called immediately. + * calls the refresh callback only after appropriate criteria are updated. But if there is nothing to update in the criteria provider the callback + * is called immediately. */ void update(Set<DatabaseModificationKind> observedModifications, final IDataRefreshCallback dataRefreshCallback); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ListColumnFilterWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ListColumnFilterWidget.java index 7bf0e7859f2..928ff174b31 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ListColumnFilterWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ListColumnFilterWidget.java @@ -42,8 +42,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GridColumnFilterIn import ch.systemsx.cisd.openbis.generic.shared.basic.IColumnDefinition; /** - * Combobox which allows to specify the filter for one grid column by choosing one of its values - * from the list or by typing part of it. + * Combobox which allows to specify the filter for one grid column by choosing one of its values from the list or by typing part of it. * * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/PendingFetchManager.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/PendingFetchManager.java index 4ac57765c2c..29cc6493695 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/PendingFetchManager.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/PendingFetchManager.java @@ -34,8 +34,7 @@ public class PendingFetchManager } /** - * Pushes a fetchConfig to the stack of pending fetches, though we currently only keep track of - * one pending fetch. + * Pushes a fetchConfig to the stack of pending fetches, though we currently only keep track of one pending fetch. */ public void pushPendingFetchConfig(ResultSetFetchConfig<String> fetchConfig) { @@ -43,8 +42,7 @@ public class PendingFetchManager } /** - * Returns a pending fetch config. If {@link #hasPendingFetch()} is true, the return value is - * non-null. Otherwise, it is null. + * Returns a pending fetch config. If {@link #hasPendingFetch()} is true, the return value is non-null. Otherwise, it is null. */ public ResultSetFetchConfig<String> tryTopPendingFetchConfig() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/entity/PropertyTypesCriteria.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/entity/PropertyTypesCriteria.java index dc96c9f74fe..98aa7b6d3e0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/entity/PropertyTypesCriteria.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/entity/PropertyTypesCriteria.java @@ -7,8 +7,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AbstractExternalData; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.PropertyType; /** - * Use this criteria class if you want to enable auto-refresh when property types change. Even when - * there are no criteria to pre-filter the grid besides the standard paging tab controls. + * Use this criteria class if you want to enable auto-refresh when property types change. Even when there are no criteria to pre-filter the grid + * besides the standard paging tab controls. */ public class PropertyTypesCriteria extends DefaultResultSetConfig<String, AbstractExternalData> { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/entity/PropertyTypesCriteriaProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/entity/PropertyTypesCriteriaProvider.java index 46d1f5a1f3f..f39925dd398 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/entity/PropertyTypesCriteriaProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/entity/PropertyTypesCriteriaProvider.java @@ -17,8 +17,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.PropertyType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRowWithObject; /** - * The provider which is able to load and reload property types. When property types are loaded the - * specified callback is executed.<br> + * The provider which is able to load and reload property types. When property types are loaded the specified callback is executed.<br> */ public class PropertyTypesCriteriaProvider implements ICriteriaProvider<PropertyTypesCriteria> { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/entity/PropertyTypesFilterUtil.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/entity/PropertyTypesFilterUtil.java index 93209c9e1e4..f7f6f0e1c03 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/entity/PropertyTypesFilterUtil.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/entity/PropertyTypesFilterUtil.java @@ -49,8 +49,7 @@ public class PropertyTypesFilterUtil } /** - * returns these property types in specified criteria which are assigned to any of the specified - * entity types + * returns these property types in specified criteria which are assigned to any of the specified entity types */ public static PropertyTypesCriteria filterPropertyTypesForEntityTypes( PropertyTypesCriteria propertyTypesCriteriaOrNull, EntityKind entityKind, diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/column/GridCustomColumnGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/column/GridCustomColumnGrid.java index c0b0445151a..b0820d218a3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/column/GridCustomColumnGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/column/GridCustomColumnGrid.java @@ -362,7 +362,7 @@ public class GridCustomColumnGrid extends TypedTableGrid<GridCustomColumn> public DatabaseModificationKind[] getRelevantModifications() { return new DatabaseModificationKind[] - { DatabaseModificationKind.createOrDelete(ObjectKind.GRID_CUSTOM_COLUMN), - DatabaseModificationKind.edit(ObjectKind.GRID_CUSTOM_COLUMN) }; + { DatabaseModificationKind.createOrDelete(ObjectKind.GRID_CUSTOM_COLUMN), + DatabaseModificationKind.edit(ObjectKind.GRID_CUSTOM_COLUMN) }; } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/common/GridColumnChooser.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/common/GridColumnChooser.java index 75012a2a9af..164cc628e92 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/common/GridColumnChooser.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/common/GridColumnChooser.java @@ -18,9 +18,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.Co import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; /** - * Allows to select grid columns which should be used in the grid custom filter or column - * expression. Chosen value is a string that can be used in an expression to address selected grid - * columns. + * Allows to select grid columns which should be used in the grid custom filter or column expression. Chosen value is a string that can be used in an + * expression to address selected grid columns. * * @author Izabela Adamczyk */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/common/GridColumnChooserDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/common/GridColumnChooserDialog.java index 33e9b574492..4a51ee196ab 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/common/GridColumnChooserDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/common/GridColumnChooserDialog.java @@ -17,8 +17,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewConte import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.AbstractColumnSettingsDataModelProvider; /** - * {@link Dialog} displaying {@link GridColumnChooser}. Used to insert selected columns into an - * expression to build the custom grid filter or column. + * {@link Dialog} displaying {@link GridColumnChooser}. Used to insert selected columns into an expression to build the custom grid filter or column. * * @author Izabela Adamczyk */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/filter/GridCustomFilterGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/filter/GridCustomFilterGrid.java index baa8b486c86..b33421be51c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/filter/GridCustomFilterGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/filter/GridCustomFilterGrid.java @@ -310,7 +310,7 @@ public class GridCustomFilterGrid extends TypedTableGrid<GridCustomFilter> public DatabaseModificationKind[] getRelevantModifications() { return new DatabaseModificationKind[] - { DatabaseModificationKind.createOrDelete(ObjectKind.GRID_CUSTOM_FILTER), - DatabaseModificationKind.edit(ObjectKind.GRID_CUSTOM_FILTER) }; + { DatabaseModificationKind.createOrDelete(ObjectKind.GRID_CUSTOM_FILTER), + DatabaseModificationKind.edit(ObjectKind.GRID_CUSTOM_FILTER) }; } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/filter/IColumnFilterWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/filter/IColumnFilterWidget.java index 2e5142cdab7..00657f5073f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/filter/IColumnFilterWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/filter/IColumnFilterWidget.java @@ -34,7 +34,7 @@ public interface IColumnFilterWidget<T> /** @return filter with the pattern */ GridColumnFilterInfo<T> getFilter(); - + void setFilteredField(IColumnDefinition<T> filteredField); /** id of the filtered column */ @@ -44,11 +44,9 @@ public interface IColumnFilterWidget<T> Widget getWidget(); /** - * @return creates an appropriate widget or refreshes this one depending on previous state and - * the fact if distinct values are specified. - * @param distinctValuesOrNull list of values present in the filtered column which can be chosen - * from the filter or null if user has no list of available choices and has to type - * it by himself + * @return creates an appropriate widget or refreshes this one depending on previous state and the fact if distinct values are specified. + * @param distinctValuesOrNull list of values present in the filtered column which can be chosen from the filter or null if user has no list of + * available choices and has to type it by himself */ IColumnFilterWidget<T> createOrRefresh(List<String> distinctValuesOrNull); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/listener/OpenEntityDetailsTabHelper.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/listener/OpenEntityDetailsTabHelper.java index 8b6802e3073..9dff6ac30b7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/listener/OpenEntityDetailsTabHelper.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/listener/OpenEntityDetailsTabHelper.java @@ -50,15 +50,15 @@ public class OpenEntityDetailsTabHelper public static void open(IViewContext<?> viewContext, EntityKind entityKind, String permId, boolean keyPressed) { - open(viewContext, entityKind, permId, keyPressed, ""); + open(viewContext, entityKind, permId, keyPressed, ""); } - + public static void open(IViewContext<?> viewContext, EntityKind entityKind, String permId, boolean keyPressed, String subtab) { viewContext.getCommonService().getEntityInformationHolder(entityKind, permId, new OpenEntityDetailsTabCallback(viewContext, keyPressed, subtab)); - } + } public static void open(IViewContext<?> viewContext, BasicEntityDescription description, boolean keyPressed) @@ -80,7 +80,7 @@ public class OpenEntityDetailsTabHelper { private final boolean keyPressed; - + private final String subtab; private OpenEntityDetailsTabCallback(final IViewContext<?> viewContext, @@ -97,7 +97,6 @@ public class OpenEntityDetailsTabHelper this(viewContext, keyPressed, ""); } - private OpenEntityDetailsTabCallback(final IViewContext<?> viewContext) { this(viewContext, false); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyGrid.java index f904649646f..914c9498c29 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyGrid.java @@ -187,13 +187,13 @@ public class ManagedPropertyGrid extends TypedTableGrid<ReportRowModel> public DatabaseModificationKind[] getRelevantModifications() { return new DatabaseModificationKind[] - { - // script changes can cause all sorts of changes to the grid - DatabaseModificationKind.edit(ObjectKind.SCRIPT), - // different script can be assigned - DatabaseModificationKind.edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT) + { + // script changes can cause all sorts of changes to the grid + DatabaseModificationKind.edit(ObjectKind.SCRIPT), + // different script can be assigned + DatabaseModificationKind.edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT) - }; + }; } @Override diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyGridActionDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyGridActionDialog.java index 6c528a8197f..cc8d1337242 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyGridActionDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyGridActionDialog.java @@ -137,9 +137,8 @@ public final class ManagedPropertyGridActionDialog extends } /** - * If the managed action requires single row to be selected and there is a binding between given - * input field and a table column it tries to get the value from the selected table row and sets - * it in the input model. + * If the managed action requires single row to be selected and there is a binding between given input field and a table column it tries to get + * the value from the selected table row and sets it in the input model. */ private void trySetBoundedValue(IManagedInputWidgetDescription inputDescription) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialBrowserGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialBrowserGrid.java index 56c8f3698b2..57c124a965b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialBrowserGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialBrowserGrid.java @@ -75,8 +75,7 @@ public class MaterialBrowserGrid extends AbstractEntityGrid<Material> public static final String GRID_ID = BROWSER_ID + "_grid"; /** - * Creates a browser with a toolbar which allows to choose the material type. Allows to show or - * edit material details. + * Creates a browser with a toolbar which allows to choose the material type. Allows to show or edit material details. * * @param initialMaterialTypeOrNull */ @@ -139,8 +138,7 @@ public class MaterialBrowserGrid extends AbstractEntityGrid<Material> } /** - * If the material type is given, does not show the toolbar with material type selection and - * refreshes the grid automatically.<br> + * If the material type is given, does not show the toolbar with material type selection and refreshes the grid automatically.<br> * Does not allow to show or edit the material details. */ public static DisposableEntityChooser<TableModelRowWithObject<Material>> create( diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialBrowserToolbar.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialBrowserToolbar.java index 73131901cf4..0f77c50b12c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialBrowserToolbar.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialBrowserToolbar.java @@ -109,9 +109,9 @@ public class MaterialBrowserToolbar extends ToolBar implements IDisposableCompon public DatabaseModificationKind[] getRelevantModifications() { return new DatabaseModificationKind[] - { createOrDelete(ObjectKind.MATERIAL_TYPE), - createOrDelete(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), - edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT) }; + { createOrDelete(ObjectKind.MATERIAL_TYPE), + createOrDelete(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), + edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT) }; } @Override diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialTypeSelectionWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialTypeSelectionWidget.java index 5c5e88122f9..f99541c6e5a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialTypeSelectionWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialTypeSelectionWidget.java @@ -57,8 +57,7 @@ public final class MaterialTypeSelectionWidget extends private final boolean withTypeInFile; /** - * Creates a material type chooser with one additional option. It's useful when you want to have - * one special value on the list. + * Creates a material type chooser with one additional option. It's useful when you want to have one special value on the list. */ public static MaterialTypeSelectionWidget createWithAdditionalOption( final IViewContext<ICommonClientServiceAsync> viewContext, @@ -129,8 +128,7 @@ public final class MaterialTypeSelectionWidget extends /** * Returns the {@link MaterialType} currently selected. * - * @return <code>null</code> if nothing is selected yet or "none" option has been chosen (if it - * has been enabled before). + * @return <code>null</code> if nothing is selected yet or "none" option has been chosen (if it has been enabled before). */ public final MaterialType tryGetSelectedMaterialType() { @@ -173,9 +171,9 @@ public final class MaterialTypeSelectionWidget extends public DatabaseModificationKind[] getRelevantModifications() { return new DatabaseModificationKind[] - { createOrDelete(ObjectKind.MATERIAL_TYPE), edit(ObjectKind.MATERIAL_TYPE), - createOrDelete(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), - edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT) }; + { createOrDelete(ObjectKind.MATERIAL_TYPE), edit(ObjectKind.MATERIAL_TYPE), + createOrDelete(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), + edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT) }; } // diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/ProjectGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/ProjectGrid.java index ac006286a05..46a183c8f09 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/ProjectGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/ProjectGrid.java @@ -304,7 +304,7 @@ public class ProjectGrid extends TypedTableGrid<Project> public DatabaseModificationKind[] getRelevantModifications() { return new DatabaseModificationKind[] - { DatabaseModificationKind.createOrDelete(ObjectKind.PROJECT), - DatabaseModificationKind.edit(ObjectKind.PROJECT) }; + { DatabaseModificationKind.createOrDelete(ObjectKind.PROJECT), + DatabaseModificationKind.edit(ObjectKind.PROJECT) }; } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property/AbstractSimplePropertyValueRenderer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property/AbstractSimplePropertyValueRenderer.java index f9767a9c10d..68612f3a85a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property/AbstractSimplePropertyValueRenderer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property/AbstractSimplePropertyValueRenderer.java @@ -22,8 +22,8 @@ import com.google.gwt.user.client.ui.Widget; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; /** - * A default <code>PropertyValueRenderer</code> implementation for simple property values which - * catches <code>null</code> value by rendering <code>-</code> and renders as an inline html. + * A default <code>PropertyValueRenderer</code> implementation for simple property values which catches <code>null</code> value by rendering + * <code>-</code> and renders as an inline html. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property/ObjectArrayPropertyValueRenderer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property/ObjectArrayPropertyValueRenderer.java index 9ea8d9e5a82..1f323c9cc45 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property/ObjectArrayPropertyValueRenderer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property/ObjectArrayPropertyValueRenderer.java @@ -22,8 +22,7 @@ import com.google.gwt.user.client.ui.Widget; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; /** - * A <code>PropertyValueRenderer</code> implementation for <code>Object[]</code> that renders as a - * one column table. + * A <code>PropertyValueRenderer</code> implementation for <code>Object[]</code> that renders as a one column table. * * @author Christian Ribeaud */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property/PropertyGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property/PropertyGrid.java index 4a505682d5e..8d16ecc731b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property/PropertyGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property/PropertyGrid.java @@ -113,15 +113,14 @@ public final class PropertyGrid extends Grid } /** - * For given <var>className</var> returns the corresponding <code>PropertyValueRenderer</code> - * or {@link #defaultPropertyValueRenderer} if: + * For given <var>className</var> returns the corresponding <code>PropertyValueRenderer</code> or {@link #defaultPropertyValueRenderer} if: * <ul> * <li>none is found</li> * <li>given <var>clazz</var> is <code>null</code></li> * </ul> */ @SuppressWarnings( - { "unchecked", "rawtypes" }) + { "unchecked", "rawtypes" }) private final <T> IPropertyValueRenderer<? super T> getPropertyValueRenderer(final T value) { if (value == null) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/EntityTypePropertyTypeSelectionWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/EntityTypePropertyTypeSelectionWidget.java index 432cc225247..c093ad69713 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/EntityTypePropertyTypeSelectionWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/EntityTypePropertyTypeSelectionWidget.java @@ -35,8 +35,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityTypePropertyType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.ObjectKind; /** - * {@link ComboBox} containing list of property type codes assigned to specified entity type loaded - * from the server. + * {@link ComboBox} containing list of property type codes assigned to specified entity type loaded from the server. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeAssignmentGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeAssignmentGrid.java index da9a02945fe..048876965bd 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeAssignmentGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeAssignmentGrid.java @@ -296,13 +296,13 @@ public class PropertyTypeAssignmentGrid extends TypedTableGrid<EntityTypePropert final AsyncCallback<Integer> callback = new UnassignmentPreparationCallback(viewContext, etpt, invoker, new UnassigmentExecution() - { - @Override - public void executeUnassignment() - { - (new InMemoryGridRemoveCallback()).callback(etpt); - } - }); + { + @Override + public void executeUnassignment() + { + (new InMemoryGridRemoveCallback()).callback(etpt); + } + }); viewContext.getService().countPropertyTypedEntities(entityKind, propertyTypeCode, entityTypeCode, callback); } @@ -491,21 +491,21 @@ public class PropertyTypeAssignmentGrid extends TypedTableGrid<EntityTypePropert viewContext.getCommonService().listPropertyTypeAssignments(etpt.getEntityType(), new AbstractAsyncCallback<List<EntityTypePropertyType<?>>>(viewContext) - { - @Override - protected void process(List<EntityTypePropertyType<?>> etpts) - { - form.remove(loading); - if (assignmentsHolder.getAssignments() == null) { - initFields(etpts); - } else - { - initFields(assignmentsHolder.getAssignments().getEntity().getAssignedPropertyTypes()); - } - isLoaded = true; - } - }); + @Override + protected void process(List<EntityTypePropertyType<?>> etpts) + { + form.remove(loading); + if (assignmentsHolder.getAssignments() == null) + { + initFields(etpts); + } else + { + initFields(assignmentsHolder.getAssignments().getEntity().getAssignedPropertyTypes()); + } + isLoaded = true; + } + }); } private void initFields(List<? extends EntityTypePropertyType<?>> etpts) @@ -532,7 +532,7 @@ public class PropertyTypeAssignmentGrid extends TypedTableGrid<EntityTypePropert // Script Field scriptChooser = createScriptChooserField(viewContext, script != null ? script.getName() : null, script != null, script != null ? script.getScriptType() - : null, + : null, entityKind); addField(scriptChooser); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeGrid.java index c8f1a28519a..a431a1545a3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeGrid.java @@ -285,8 +285,8 @@ public class PropertyTypeGrid extends TypedTableGrid<PropertyType> public DatabaseModificationKind[] getRelevantModifications() { return new DatabaseModificationKind[] - { createOrDelete(ObjectKind.PROPERTY_TYPE), edit(ObjectKind.PROPERTY_TYPE), - createOrDelete(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), - edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT) }; + { createOrDelete(ObjectKind.PROPERTY_TYPE), edit(ObjectKind.PROPERTY_TYPE), + createOrDelete(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), + edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT) }; } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/SectionSelectionWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/SectionSelectionWidget.java index 220e0c3edc3..174a50604a1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/SectionSelectionWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/SectionSelectionWidget.java @@ -32,8 +32,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUt import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityTypePropertyType; /** - * A {@link ComboBox} extension using simple strings for selecting section name of - * {@link EntityTypePropertyType}. + * A {@link ComboBox} extension using simple strings for selecting section name of {@link EntityTypePropertyType}. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBatchRegisterUpdatePanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBatchRegisterUpdatePanel.java index 5692d65736f..20a5748088b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBatchRegisterUpdatePanel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBatchRegisterUpdatePanel.java @@ -38,8 +38,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleType; /** - * The {@link LayoutContainer} extension for batch registration and update of samples of certain - * type. + * The {@link LayoutContainer} extension for batch registration and update of samples of certain type. * * @author Christian Ribeaud */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBrowserGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBrowserGrid.java index 2395462e0ba..975b054613f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBrowserGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBrowserGrid.java @@ -176,8 +176,7 @@ public class SampleBrowserGrid extends AbstractEntityGrid<Sample> } /** - * Create a grid with a toolbar with no initial selection and optional initial selection of - * sample type and group. + * Create a grid with a toolbar with no initial selection and optional initial selection of sample type and group. */ public static IDisposableComponent create(IViewContext<ICommonClientServiceAsync> viewContext, String initialGroupOrNull, String initialSampleTypeOrNull) @@ -301,9 +300,8 @@ public class SampleBrowserGrid extends AbstractEntityGrid<Sample> } /** - * Besides providing the static {@link ListSampleCriteria} this class provides all property - * types which should be used to build the grid property columns. It is also able to refresh - * these properties from the server. + * Besides providing the static {@link ListSampleCriteria} this class provides all property types which should be used to build the grid property + * columns. It is also able to refresh these properties from the server. */ protected static class SampleCriteriaProvider implements ISampleCriteriaProvider { @@ -502,9 +500,8 @@ public class SampleBrowserGrid extends AbstractEntityGrid<Sample> /** * Initializes criteria and refreshes the grid when criteria are fetched. <br> - * Note that in this way we do not refresh the grid automatically, but we wait until all the - * property types will be fetched from the server (criteria provider will be updated), to set - * the available grid columns. + * Note that in this way we do not refresh the grid automatically, but we wait until all the property types will be fetched from the server + * (criteria provider will be updated), to set the available grid columns. */ protected void updateCriteriaProviderAndRefresh() { @@ -582,37 +579,43 @@ public class SampleBrowserGrid extends AbstractEntityGrid<Sample> final AbstractAsyncCallback<Void> callback = createRefreshCallback(invoker); final DisplayedAndSelectedEntities<TableModelRowWithObject<Sample>> s = getDisplayedAndSelectedItemsAction().execute(); - + List<TableModelRowWithObject<Sample>> selectedSamples = s.getSelectedItems(); final Map<String, String> techIdsToSampleIds = new HashMap<String, String>(); - + List<TechId> sampleIds = TechId.createList(samples); - //put the TechId:SampleIdentifier pairs to a map to use - //later when displaying message to the user + // put the TechId:SampleIdentifier pairs to a map to use + // later when displaying message to the user for (TableModelRowWithObject<Sample> rowObj : selectedSamples) - { + { Sample smp = rowObj.getObjectOrNull(); techIdsToSampleIds.put(TechId.create(smp).toString(), smp.getIdentifier()); } - + AbstractAsyncCallback<List<SampleChildrenInfo>> confirmationCallback = - new AbstractAsyncCallback<List<SampleChildrenInfo>>(viewContext) - { - @Override - protected void process(List<SampleChildrenInfo> sampleChildrenInfoList) - { - String additionalMessage = null; - if(sampleChildrenInfoList.size() == 1) - { - additionalMessage = EntityDeletionConfirmationUtils.getMessageForSingleSample(sampleChildrenInfoList.get(0)); - } - else { - additionalMessage = EntityDeletionConfirmationUtils.getMessageForMultipleSamples(sampleChildrenInfoList, techIdsToSampleIds); - } - new SampleListDeletionConfirmationDialog<TableModelRowWithObject<Sample>>(viewContext.getCommonViewContext(), samples, callback, s, additionalMessage).show();; - } - }; - viewContext.getCommonService().getSampleChildrenInfo(sampleIds, true, confirmationCallback); + new AbstractAsyncCallback<List<SampleChildrenInfo>>(viewContext) + { + @Override + protected void process(List<SampleChildrenInfo> sampleChildrenInfoList) + { + String additionalMessage = null; + if (sampleChildrenInfoList.size() == 1) + { + additionalMessage = + EntityDeletionConfirmationUtils.getMessageForSingleSample(sampleChildrenInfoList.get(0)); + } + else + { + additionalMessage = + EntityDeletionConfirmationUtils.getMessageForMultipleSamples(sampleChildrenInfoList, + techIdsToSampleIds); + } + new SampleListDeletionConfirmationDialog<TableModelRowWithObject<Sample>>(viewContext.getCommonViewContext(), + samples, callback, s, additionalMessage).show(); + ; + } + }; + viewContext.getCommonService().getSampleChildrenInfo(sampleIds, true, confirmationCallback); } }); @@ -635,7 +638,7 @@ public class SampleBrowserGrid extends AbstractEntityGrid<Sample> }); return button; } - + protected final IDelegatedActionWithResult<DisplayedAndSelectedEntities<TableModelRowWithObject<Sample>>> getDisplayedAndSelectedItemsAction() { return new IDelegatedActionWithResult<DisplayedAndSelectedEntities<TableModelRowWithObject<Sample>>>() @@ -720,17 +723,19 @@ public class SampleBrowserGrid extends AbstractEntityGrid<Sample> } }; } - - private abstract class AbstractCreateDialogListenerForSampleGrid extends AbstractCreateDialogListener { + + private abstract class AbstractCreateDialogListenerForSampleGrid extends AbstractCreateDialogListener + { @Override protected Dialog createDialog(List<TableModelRowWithObject<Sample>> data, IBrowserGridActionInvoker invoker) { - createAndShowDialog(data, invoker); - return null; + createAndShowDialog(data, invoker); + return null; } + protected abstract void createAndShowDialog(List<TableModelRowWithObject<Sample>> data, - IBrowserGridActionInvoker invoker) ; + IBrowserGridActionInvoker invoker); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBrowserToolbar.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBrowserToolbar.java index 3d40f444543..5b6284a018f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBrowserToolbar.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBrowserToolbar.java @@ -192,10 +192,10 @@ final class SampleBrowserToolbar extends ToolBar implements ISampleCriteriaProvi public DatabaseModificationKind[] getRelevantModifications() { return new DatabaseModificationKind[] - { createOrDelete(ObjectKind.SAMPLE_TYPE), edit(ObjectKind.SAMPLE_TYPE), - createOrDelete(ObjectKind.SPACE), - createOrDelete(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), - edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT) }; + { createOrDelete(ObjectKind.SAMPLE_TYPE), edit(ObjectKind.SAMPLE_TYPE), + createOrDelete(ObjectKind.SPACE), + createOrDelete(ObjectKind.PROPERTY_TYPE_ASSIGNMENT), + edit(ObjectKind.PROPERTY_TYPE_ASSIGNMENT) }; } @Override diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleListDeletionConfirmationDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleListDeletionConfirmationDialog.java index 19f5348e4fe..10f3a905505 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleListDeletionConfirmationDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleListDeletionConfirmationDialog.java @@ -66,7 +66,7 @@ public final class SampleListDeletionConfirmationDialog<T extends IIdHolder> ext this.selectedAndDisplayedItemsOrNull = null; this.setId("deletion-confirmation-dialog"); this.additionalMessage = additionalMessage; - } + } @Override protected void executeDeletion(AsyncCallback<Void> deletionCallback) @@ -84,14 +84,13 @@ public final class SampleListDeletionConfirmationDialog<T extends IIdHolder> ext reason.getValue(), deletionType, deletionCallback); } } - + @Override protected String getAdditionalMessage() { - return this.additionalMessage; - } - - + return this.additionalMessage; + } + @Override protected String getEntityName() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/ScriptGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/ScriptGrid.java index f59615a9645..3f86cbb5f99 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/ScriptGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/ScriptGrid.java @@ -200,8 +200,8 @@ public class ScriptGrid extends TypedTableGrid<Script> public DatabaseModificationKind[] getRelevantModifications() { return new DatabaseModificationKind[] - { DatabaseModificationKind.createOrDelete(ObjectKind.SCRIPT), - DatabaseModificationKind.edit(ObjectKind.SCRIPT) }; + { DatabaseModificationKind.createOrDelete(ObjectKind.SCRIPT), + DatabaseModificationKind.edit(ObjectKind.SCRIPT) }; } private void openEditor(BaseEntityModel<TableModelRowWithObject<Script>> selectedItem, diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchCriteriaWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchCriteriaWidget.java index 93a8b038ced..a639106722a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchCriteriaWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchCriteriaWidget.java @@ -97,9 +97,8 @@ abstract public class DetailedSearchCriteriaWidget extends VerticalPanel } /** - * Removes given {@link DetailedSearchCriterionWidget} from the panel, unless it is the only one - * that left. In this case the state of chosen {@link DetailedSearchCriterionWidget} is set to - * initial value (reset). + * Removes given {@link DetailedSearchCriterionWidget} from the panel, unless it is the only one that left. In this case the state of chosen + * {@link DetailedSearchCriterionWidget} is set to initial value (reset). */ void removeCriterion(DetailedSearchCriterionWidget w) { @@ -196,8 +195,7 @@ abstract public class DetailedSearchCriteriaWidget extends VerticalPanel } /** - * Resets "match criteria" radio buttons to initial values, removes unnecessary criteria widgets - * and resets the remaining ones. + * Resets "match criteria" radio buttons to initial values, removes unnecessary criteria widgets and resets the remaining ones. */ public void reset() { @@ -211,8 +209,8 @@ abstract public class DetailedSearchCriteriaWidget extends VerticalPanel } /** - * Set the initial search criteria to the argument. This should be called after creation but - * before the user has had a chance to use the window, otherwise user input may be overwritten. + * Set the initial search criteria to the argument. This should be called after creation but before the user has had a chance to use the window, + * otherwise user input may be overwritten. */ public void setInitialSearchCritera(DetailedSearchCriteria searchCriteria) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchCriterionWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchCriterionWidget.java index 9334a062a8a..6cd691cf9e2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchCriterionWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchCriterionWidget.java @@ -163,8 +163,7 @@ public class DetailedSearchCriterionWidget extends HorizontalPanel } /** - * Adds a new {@link DetailedSearchCriterionWidget} coping data from given the - * <em>name field</em>. + * Adds a new {@link DetailedSearchCriterionWidget} coping data from given the <em>name field</em>. */ private void createNew() { @@ -198,8 +197,8 @@ public class DetailedSearchCriterionWidget extends HorizontalPanel } /** - * Returns {@link DetailedSearchCriterion} for selected <em>name</em> and <em>value</em>. If - * either <em>name</em> or <em>value</em> is not specified, returns null. + * Returns {@link DetailedSearchCriterion} for selected <em>name</em> and <em>value</em>. If either <em>name</em> or <em>value</em> is not + * specified, returns null. */ public DetailedSearchCriterion tryGetValue() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchFieldsSelectionWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchFieldsSelectionWidget.java index 45cddb8c021..a60c4c91fb8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchFieldsSelectionWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchFieldsSelectionWidget.java @@ -52,8 +52,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.PropertyType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRowWithObject; /** - * {@link ComboBox} containing list of detailed search fields loaded from the server (property - * types) and static ones. + * {@link ComboBox} containing list of detailed search fields loaded from the server (property types) and static ones. * * @author Izabela Adamczyk * @author Piotr Buczek @@ -107,8 +106,7 @@ public final class DetailedSearchFieldsSelectionWidget extends } /** - * Returns {@link DetailedSearchField} connected with selected option, or null - if nothing - * selected. + * Returns {@link DetailedSearchField} connected with selected option, or null - if nothing selected. */ public DetailedSearchField tryGetSelectedField() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchWindow.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchWindow.java index 8d32722405e..f0e55005ed5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchWindow.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchWindow.java @@ -265,9 +265,8 @@ public class DetailedSearchWindow extends Dialog } /** - * Return a help page identifier, possibly using the entity kind as clue to determine it. The - * default implementation ignores the entity kind and returns an identifier referencing the - * advanced search domain. Subclasses may override. + * Return a help page identifier, possibly using the entity kind as clue to determine it. The default implementation ignores the entity kind and + * returns an identifier referencing the advanced search domain. Subclasses may override. */ protected HelpPageIdentifier createHelpPageIdentifier(final EntityKind entityKind) { @@ -280,10 +279,8 @@ public class DetailedSearchWindow extends Dialog } /** - * Set the initial search string for this window to the argument. Call this after instantiation, - * but before the user has provided input, otherwise user input will be overwritten. This method - * does not notify the listener of any changes -- the caller must keep the window and toolbar in - * sync. + * Set the initial search string for this window to the argument. Call this after instantiation, but before the user has provided input, otherwise + * user input will be overwritten. This method does not notify the listener of any changes -- the caller must keep the window and toolbar in sync. */ public void setInitialSearchCriteria(DetailedSearchCriteria searchCriteria) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyGrid.java index cae70039f12..5679878f5f4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyGrid.java @@ -369,7 +369,7 @@ public class VocabularyGrid extends TypedTableGrid<Vocabulary> public DatabaseModificationKind[] getRelevantModifications() { return new DatabaseModificationKind[] - { DatabaseModificationKind.createOrDelete(ObjectKind.VOCABULARY) }; + { DatabaseModificationKind.createOrDelete(ObjectKind.VOCABULARY) }; } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractDataListDeletionConfirmationDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractDataListDeletionConfirmationDialog.java index 9c87864b1f0..5701b2ee9c6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractDataListDeletionConfirmationDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractDataListDeletionConfirmationDialog.java @@ -30,8 +30,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.Widge import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DeletionType; /** - * {@link AbstractDataConfirmationDialog} abstract implementation for deleting given list of data on - * confirm. + * {@link AbstractDataConfirmationDialog} abstract implementation for deleting given list of data on confirm. * * @author Piotr Buczek */ @@ -106,13 +105,13 @@ public abstract class AbstractDataListDeletionConfirmationDialog<T> extends } return messageProvider.getMessage(Dict.DELETE_CONFIRMATION_MESSAGE_WITH_REASON_TEMPLATE, getOperationName(), deletedObjects, getAdditionalMessage()); - } - + } - protected String getAdditionalMessage() { + protected String getAdditionalMessage() + { return null; } - + protected abstract String getEntityName(); protected abstract void executeDeletion(AsyncCallback<Void> callback); @@ -151,8 +150,7 @@ public abstract class AbstractDataListDeletionConfirmationDialog<T> extends } /** - * This method should be overriden in subclasses if dialog is supposed to use a radio and set - * {@link #onlySelectedRadioOrNull}. + * This method should be overriden in subclasses if dialog is supposed to use a radio and set {@link #onlySelectedRadioOrNull}. */ protected RadioGroup createRadio() { @@ -165,8 +163,7 @@ public abstract class AbstractDataListDeletionConfirmationDialog<T> extends } /** - * Returns deletion callback and shows a progress bar that will be hidden when the callback is - * finished. + * Returns deletion callback and shows a progress bar that will be hidden when the callback is finished. */ private AsyncCallback<Void> getCallbackWithProgressBar() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractDataListPermanentDeletionConfirmationDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractDataListPermanentDeletionConfirmationDialog.java index 162c6e9875c..2f8512f5fd0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractDataListPermanentDeletionConfirmationDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractDataListPermanentDeletionConfirmationDialog.java @@ -25,8 +25,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewConte import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DeletionType; /** - * {@link AbstractDataListDeletionConfirmationDialog} abstract implementation for a confirmation - * dialog shown before permanent deletion of list of data. + * {@link AbstractDataListDeletionConfirmationDialog} abstract implementation for a confirmation dialog shown before permanent deletion of list of + * data. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractDataListTrashDeletionConfirmationDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractDataListTrashDeletionConfirmationDialog.java index 7af2733fd41..332cb34856a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractDataListTrashDeletionConfirmationDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractDataListTrashDeletionConfirmationDialog.java @@ -24,8 +24,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewConte import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DeletionType; /** - * {@link AbstractDataListDeletionConfirmationDialog} abstract implementation for a confirmation - * dialog shown before moving list of data to trash. + * {@link AbstractDataListDeletionConfirmationDialog} abstract implementation for a confirmation dialog shown before moving list of data to trash. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractRegistrationDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractRegistrationDialog.java index 07395e81091..51a73f4b790 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractRegistrationDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractRegistrationDialog.java @@ -31,8 +31,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDele import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; /** - * Abstract {@link Window} with Save and Cancel buttons, useful when simple registration operation - * is needed. + * Abstract {@link Window} with Save and Cancel buttons, useful when simple registration operation is needed. * * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/ButtonWithLoadingMask.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/ButtonWithLoadingMask.java index 6b81a6b59a6..4e9c27d0c1b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/ButtonWithLoadingMask.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/ButtonWithLoadingMask.java @@ -45,8 +45,8 @@ public abstract class ButtonWithLoadingMask extends LayoutContainer } /** - * @param loadingMaskDirection on which direction you would like the loading mask picture. Only - * {@link Direction#LEFT} or {@link Direction#RIGHT} are supported. + * @param loadingMaskDirection on which direction you would like the loading mask picture. Only {@link Direction#LEFT} or {@link Direction#RIGHT} + * are supported. */ public ButtonWithLoadingMask(final String buttonLabel, final String buttonIdOrNull, final Direction loadingMaskDirection) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/CheckBoxGroupWithModel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/CheckBoxGroupWithModel.java index bbdf35736a2..38038ee6da0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/CheckBoxGroupWithModel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/CheckBoxGroupWithModel.java @@ -60,8 +60,7 @@ public class CheckBoxGroupWithModel<T> extends CheckBoxGroup private final Set<CheckBoxGroupListner<T>> listeners; /** - * Create a group of check-boxes, one for each item. Use {@link #getSelected()} to fetch items - * for which the check-boxes are selected. + * Create a group of check-boxes, one for each item. Use {@link #getSelected()} to fetch items for which the check-boxes are selected. */ public CheckBoxGroupWithModel(List<LabeledItem<T>> items) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/FormPanelWithSavePoint.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/FormPanelWithSavePoint.java index 31b1ebc43ea..f13c79c3cde 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/FormPanelWithSavePoint.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/FormPanelWithSavePoint.java @@ -39,7 +39,7 @@ import com.extjs.gxt.ui.client.widget.form.MultiField; */ @SuppressWarnings( - { "rawtypes", "unchecked" }) +{ "rawtypes", "unchecked" }) public class FormPanelWithSavePoint extends ClickableFormPanel { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/InlineHyperlink.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/InlineHyperlink.java index 86b36ef4a24..98ef50dd0ae 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/InlineHyperlink.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/InlineHyperlink.java @@ -19,8 +19,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget import com.google.gwt.user.client.ui.Hyperlink; /** - * A {@link Hyperlink} widget extension that changes default display style from block to inline and - * keeps no history token. + * A {@link Hyperlink} widget extension that changes default display style from block to inline and keeps no history token. * * @author Piotr Buczek */ @@ -37,5 +36,5 @@ public final class InlineHyperlink extends Hyperlink super(text, null); addStyleName("inline"); } - + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/LabeledItem.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/LabeledItem.java index 00ac887e3f8..c620e5c9cff 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/LabeledItem.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/LabeledItem.java @@ -3,8 +3,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget import com.extjs.gxt.ui.client.widget.form.SimpleComboBox; /** - * Item with label which can be conveniently used in {@link SimpleComboBox} or - * {@link CheckBoxGroupWithModel}. + * Item with label which can be conveniently used in {@link SimpleComboBox} or {@link CheckBoxGroupWithModel}. * * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/NotScrollableContainer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/NotScrollableContainer.java index f1939fe0e25..b91a147b0d0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/NotScrollableContainer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/NotScrollableContainer.java @@ -20,8 +20,8 @@ import com.extjs.gxt.ui.client.Style.Scroll; import com.extjs.gxt.ui.client.widget.LayoutContainer; /** - * Extension of {@link LayoutContainer} which will neither have scrollbars switched on nor the - * content cut. It is usable when only the parent container should have the scrollbar. + * Extension of {@link LayoutContainer} which will neither have scrollbars switched on nor the content cut. It is usable when only the parent + * container should have the scrollbar. * * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/SectionsPanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/SectionsPanel.java index db67a116696..f0c0cc1f031 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/SectionsPanel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/SectionsPanel.java @@ -22,8 +22,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework. import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DetailViewConfiguration; /** - * {@link LayoutContainer} which allows to choose which contained panels should be visible and uses - * the whole space available to show them. + * {@link LayoutContainer} which allows to choose which contained panels should be visible and uses the whole space available to show them. * * @author Izabela Adamczyk */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/SimpleModelComboBox.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/SimpleModelComboBox.java index 9b11dbea6a1..54dddd49dea 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/SimpleModelComboBox.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/SimpleModelComboBox.java @@ -13,8 +13,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUt import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; /** - * A simple combobox which provides a model class {@link LabeledItem} to store any value and its - * label. + * A simple combobox which provides a model class {@link LabeledItem} to store any value and its label. * * @author Tomasz Pylak */ @@ -34,8 +33,7 @@ public class SimpleModelComboBox<T> extends SimpleComboBox<LabeledItem<T>> } /** - * Creates a combobox and selects the first value. For each item there should be one - * corresponding label. + * Creates a combobox and selects the first value. For each item there should be one corresponding label. */ public SimpleModelComboBox(IMessageProvider messageProvider, List<T> items, List<String> labels, List<String> tooltips, Integer widthPx) @@ -114,8 +112,7 @@ public class SimpleModelComboBox<T> extends SimpleComboBox<LabeledItem<T>> * @param value the value */ @Override - public void add(@SuppressWarnings("hiding") - LabeledItem<T> value) + public void add(@SuppressWarnings("hiding") LabeledItem<T> value) { store.add(new ExtendedSimpleComboValue<T>(value)); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/IWizardDataModel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/IWizardDataModel.java index c1221037723..7923fea31cb 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/IWizardDataModel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/IWizardDataModel.java @@ -27,12 +27,12 @@ public interface IWizardDataModel * Returns the workflow model. */ public WizardWorkflowModel getWorkflow(); - + /** * Determines at workflow branches the next state based on the specified current state. */ public IWizardState determineNextState(IWizardState currentState); - + /** * Finishes the wizard, submit/commit data and return a success message for the user. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/IWizardState.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/IWizardState.java index c016e2f28a3..ca876281970 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/IWizardState.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/IWizardState.java @@ -17,8 +17,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.wizard; /** - * Marker interface for immutable value objects representing a state of a - * {@link WizardWorkflowModel}. + * Marker interface for immutable value objects representing a state of a {@link WizardWorkflowModel}. * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/IWizardStateChangeListener.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/IWizardStateChangeListener.java index 289f1b96e6a..73bc17d0aaf 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/IWizardStateChangeListener.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/IWizardStateChangeListener.java @@ -17,8 +17,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.wizard; /** - * Interface to be implemented by classes interested in {@link IWizardState} changes in - * {@link WizardWorkflowModel}. + * Interface to be implemented by classes interested in {@link IWizardState} changes in {@link WizardWorkflowModel}. * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/Wizard.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/Wizard.java index cd567741ce2..e6883d9d301 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/Wizard.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/Wizard.java @@ -39,14 +39,14 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKin public class Wizard<M extends IWizardDataModel> extends LayoutContainer implements IDisposableComponent { private final CardLayout layout; - + private final M model; private final WizardWorkflowModel workflowModel; private final Map<IWizardState, WizardPage<M>> pages = new HashMap<IWizardState, WizardPage<M>>(); - + private final Set<WizardPage<M>> visitedPages = new HashSet<WizardPage<M>>(); /** @@ -69,7 +69,7 @@ public class Wizard<M extends IWizardDataModel> extends LayoutContainer implemen }); } - + public M getWizardDataModel() { return model; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/WizardPage.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/WizardPage.java index fd257fd6caa..f25d6fa70d6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/WizardPage.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/WizardPage.java @@ -34,31 +34,38 @@ import com.extjs.gxt.ui.client.widget.layout.RowLayout; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; /** - * Base class of a page of a {@link Wizard}. Should be subclassed by overriding {@link #init()}, - * {@link #deactivate()}, {@link #activate()}, {@link #destroy()} if needed. + * Base class of a page of a {@link Wizard}. Should be subclassed by overriding {@link #init()}, {@link #deactivate()}, {@link #activate()}, + * {@link #destroy()} if needed. * * @author Franz-Josef Elmer */ public class WizardPage<M extends IWizardDataModel> extends LayoutContainer { private static final String _LEFT_CONTENT = "_left_content"; + public static final String PREVIOUS_BUTTON_LABEL_KEY = "wizard_page_previous_button_label"; + public static final String NEXT_BUTTON_LABEL_KEY = "wizard_page_next_button_label"; + public static final String FINISH_BUTTON_LABEL_KEY = "wizard_page_finish_button_label"; - + private final IMessageProvider messageProvider; + protected final M model; + private final IWizardState state; + private final LayoutContainer leftContent; + private final LayoutContainer rightContent; + private Button previousButton; + private Button nextOrFinishButton; /** - * Creates an instance for specified message provider, wizard state and wizard data model. - * Subclasses should create in the constructor only widget components which do not need - * sever calls. Components created/populated by server callbacks should be created in - * {@link #init()}. + * Creates an instance for specified message provider, wizard state and wizard data model. Subclasses should create in the constructor only widget + * components which do not need sever calls. Components created/populated by server callbacks should be created in {@link #init()}. */ public WizardPage(IMessageProvider messageProvider, IWizardState state, final M model) { @@ -108,15 +115,15 @@ public class WizardPage<M extends IWizardDataModel> extends LayoutContainer }); rightPanel.addButton(nextOrFinishButton); } - + IWizardState getWizardState() { return state; } /** - * Sets the content of the left panel by an HTML snippet defined in the dictionary by the - * specified key. Note that the complete key in the dictionary reads <code><wizard + * Sets the content of the left panel by an HTML snippet defined in the dictionary by the specified key. Note that the complete key in the + * dictionary reads <code><wizard * state>_left_content</code>. */ public void setLeftContentByDictionary() @@ -134,14 +141,13 @@ public class WizardPage<M extends IWizardDataModel> extends LayoutContainer } /** - * Adds specified component to the right hand part of this wizard page. All components are - * layout by a vertical {@link RowLayout}. + * Adds specified component to the right hand part of this wizard page. All components are layout by a vertical {@link RowLayout}. */ public void addToRightContent(Component component, RowData layoutData) { rightContent.add(component, layoutData); } - + /** * Enables/disables next/finish button. */ @@ -149,9 +155,9 @@ public class WizardPage<M extends IWizardDataModel> extends LayoutContainer { nextOrFinishButton.setEnabled(enabled); } - - /** - * Initializes this wizard page when it is shown the first time in the wizard. + + /** + * Initializes this wizard page when it is shown the first time in the wizard. * <p> * This is a hook method which does nothing. It should be overridden if needed. */ @@ -160,8 +166,7 @@ public class WizardPage<M extends IWizardDataModel> extends LayoutContainer } /** - * Activates this page. This is called after {@link #deactivate()} has been invoked for the - * previous page (if any). + * Activates this page. This is called after {@link #deactivate()} has been invoked for the previous page (if any). * <p> * This is a hook method which does nothing. It should be overridden if needed. */ @@ -170,27 +175,24 @@ public class WizardPage<M extends IWizardDataModel> extends LayoutContainer } /** - * Deactivates this page. This is called after the next/finish button has been pressed but - * before {@link #activate()} for the next page has been invoked. After invoking this method and - * before invocation of {@link #activate()} the method - * {@link IWizardDataModel#determineNextState(IWizardState)} will be invoked if more than one - * next states are possible. + * Deactivates this page. This is called after the next/finish button has been pressed but before {@link #activate()} for the next page has been + * invoked. After invoking this method and before invocation of {@link #activate()} the method + * {@link IWizardDataModel#determineNextState(IWizardState)} will be invoked if more than one next states are possible. * <p> * This is a hook method which does nothing. It should be overridden if needed. */ public void deactivate() { } - + /** - * Destroys this page. It will be invoked when the wizard has successfully be finished. That is, - * after {@link IWizardDataModel#finish()} has been invoked. This method can be used to release - * resources. + * Destroys this page. It will be invoked when the wizard has successfully be finished. That is, after {@link IWizardDataModel#finish()} has been + * invoked. This method can be used to release resources. * <p> * This is a hook method which does nothing. It should be overridden if needed. */ public void destroy() { - + } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/WizardWorkflowModel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/WizardWorkflowModel.java index 52d0b3e90fe..a6a8cc96190 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/WizardWorkflowModel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/wizard/WizardWorkflowModel.java @@ -32,8 +32,8 @@ import com.google.gwt.core.client.JavaScriptException; */ public class WizardWorkflowModel { - private static final List<IWizardState> EMPTY_LIST = Arrays.<IWizardState>asList(); - + private static final List<IWizardState> EMPTY_LIST = Arrays.<IWizardState> asList(); + private final List<IWizardStateChangeListener> changeListeners = new ArrayList<IWizardStateChangeListener>(); @@ -46,28 +46,26 @@ public class WizardWorkflowModel private final Stack<IWizardState> visitedStates = new Stack<IWizardState>(); private final IWizardDataModel dataModel; - + private IWizardState initialState; - + /** - * Creates an instance for the specified data model. The data model is needed to make - * decision at workflow branches. + * Creates an instance for the specified data model. The data model is needed to make decision at workflow branches. */ public WizardWorkflowModel(IWizardDataModel dataModel) { this.dataModel = dataModel; } - + void addStateChangeListener(IWizardStateChangeListener stateChangeListener) { changeListeners.add(stateChangeListener); } /** - * Adds a transition from specified state to specified next state. For one state several - * transations can be added. In this branching case - * {@link IWizardDataModel#determineNextState(IWizardState)} will be invoked during execution - * of the workflow in order to determine which transition to follow. + * Adds a transition from specified state to specified next state. For one state several transations can be added. In this branching case + * {@link IWizardDataModel#determineNextState(IWizardState)} will be invoked during execution of the workflow in order to determine which + * transition to follow. */ public void addTransition(IWizardState state, IWizardState nextState) { @@ -131,7 +129,7 @@ public class WizardWorkflowModel { return transitionsToNext.get(state) != null; } - + private List<IWizardState> getNextStates() { IWizardState currentState = tryGetCurrentState(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/BorderLayoutHelper.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/BorderLayoutHelper.java index 56b4b01f407..44241caff23 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/BorderLayoutHelper.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/BorderLayoutHelper.java @@ -53,8 +53,7 @@ public class BorderLayoutHelper } /** - * Creates {@link BorderLayoutData} for the left panel extracting initial size from display - * settings. + * Creates {@link BorderLayoutData} for the left panel extracting initial size from display settings. */ public BorderLayoutData createLeftBorderLayoutData() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/CompositeMessageProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/CompositeMessageProvider.java index fb6142a61fb..7129d0c507f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/CompositeMessageProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/CompositeMessageProvider.java @@ -94,8 +94,8 @@ public final class CompositeMessageProvider implements IMessageProvider } /** - * Returns a {@link IMessageProvider} containing key {@link #IS_DEFAULT_DICTIONARY} with value = - * {@link #TRUE} or null if no such {@link IMessageProvider} defined. + * Returns a {@link IMessageProvider} containing key {@link #IS_DEFAULT_DICTIONARY} with value = {@link #TRUE} or null if no such + * {@link IMessageProvider} defined. */ private IMessageProvider tryGetDefaultDictionary(final String key) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/DOMUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/DOMUtils.java index 9ea3fef2027..db50bcc4384 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/DOMUtils.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/DOMUtils.java @@ -44,12 +44,10 @@ public final class DOMUtils } /** - * Creates an <i>HTML</i> link with given <var>href</var>, <var>styleClass</var> and given - * <var>title</var>. + * Creates an <i>HTML</i> link with given <var>href</var>, <var>styleClass</var> and given <var>title</var>. * * @param href if <code>null</code> then no <code>href</code> attribute will be added. - * @param styleClass if <code>null</code> then no <code>class</code> attribute will be - * added. + * @param styleClass if <code>null</code> then no <code>class</code> attribute will be added. * @param title if <code>null</code> then no <code>title</code> attribute will be added. */ public final static Element createAnchorElement(final String styleClass, final String href, diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/DialogWithOnlineHelpUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/DialogWithOnlineHelpUtils.java index 58897085f0f..198ad7a4c6e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/DialogWithOnlineHelpUtils.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/DialogWithOnlineHelpUtils.java @@ -32,9 +32,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.URLMethodWithParameters; /** * An utility class used for enhancing {@link Window} with online help functionality. * <p> - * NOTE: Adding abstract superclass to our dialog hierarchy doesn't work well in our case as we - * already have complex dialog hierarchy subclassing either {@link Window} and {@link Dialog} and we - * don't want all our dialogs to have help. + * NOTE: Adding abstract superclass to our dialog hierarchy doesn't work well in our case as we already have complex dialog hierarchy subclassing + * either {@link Window} and {@link Dialog} and we don't want all our dialogs to have help. * * @author Chandrasekhar Ramakrishnan * @author Piotr Buczek diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/DictonaryBasedMessageProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/DictonaryBasedMessageProvider.java index 6e957ad86b4..176b1c89406 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/DictonaryBasedMessageProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/DictonaryBasedMessageProvider.java @@ -22,14 +22,14 @@ import com.extjs.gxt.ui.client.util.Format; import com.google.gwt.i18n.client.Dictionary; /** - * Message provider based on a {@link Dictionary} instance. The messages are dynamically loaded at - * runtime from a JavaScript file. + * Message provider based on a {@link Dictionary} instance. The messages are dynamically loaded at runtime from a JavaScript file. * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ public final class DictonaryBasedMessageProvider implements IMessageProvider { private final Dictionary dictionary; + private final String dictionaryName; public DictonaryBasedMessageProvider(final String dictionaryName) @@ -47,7 +47,7 @@ public final class DictonaryBasedMessageProvider implements IMessageProvider { return dictionaryName; } - + @Override public final boolean containsKey(final String key) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/EntityDeletionConfirmationUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/EntityDeletionConfirmationUtils.java index 462c388c455..09d2fa6d297 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/EntityDeletionConfirmationUtils.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/EntityDeletionConfirmationUtils.java @@ -9,15 +9,16 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleChildrenInfo public class EntityDeletionConfirmationUtils { - - //return information about selected samples child samples and data sets - public static String getMessageForSingleSample(SampleChildrenInfo sampleChildrenInfo) { + + // return information about selected samples child samples and data sets + public static String getMessageForSingleSample(SampleChildrenInfo sampleChildrenInfo) + { final int MAX_DISPLAY_SIZE = 10; StringBuffer additionalMessage = new StringBuffer(); StringBuffer sampleSb = new StringBuffer(); StringBuffer dataSetSb = new StringBuffer(); - + for (String child : sampleChildrenInfo.getDerivedSamples()) { sampleSb.append("<br>" + child); @@ -27,73 +28,93 @@ public class EntityDeletionConfirmationUtils dataSetSb.append("<br>" + ds); } - if(sampleSb.length() > 0) { - additionalMessage.append("<br>The sample has " + sampleChildrenInfo.getChildCount() + " children samples, these relationships will be broken but the children will remain:"); + if (sampleSb.length() > 0) + { + additionalMessage.append("<br>The sample has " + sampleChildrenInfo.getChildCount() + + " children samples, these relationships will be broken but the children will remain:"); additionalMessage.append("<br>"); additionalMessage.append(sampleSb); - if(sampleChildrenInfo.getChildCount() > MAX_DISPLAY_SIZE ) { - additionalMessage.append("<br> and " + (sampleChildrenInfo.getChildCount()-MAX_DISPLAY_SIZE) + " more"); + if (sampleChildrenInfo.getChildCount() > MAX_DISPLAY_SIZE) + { + additionalMessage.append("<br> and " + (sampleChildrenInfo.getChildCount() - MAX_DISPLAY_SIZE) + " more"); } additionalMessage.append("<br>"); } - if(dataSetSb.length() > 0) { - additionalMessage.append("<br>The sample has " + sampleChildrenInfo.getDataSetCount() + " datasets, these will be deleted with the sample:"); + if (dataSetSb.length() > 0) + { + additionalMessage.append("<br>The sample has " + sampleChildrenInfo.getDataSetCount() + + " datasets, these will be deleted with the sample:"); additionalMessage.append("<br>"); additionalMessage.append(dataSetSb); - if(sampleChildrenInfo.getDataSetCount() > MAX_DISPLAY_SIZE) { - additionalMessage.append("<br>and " + (sampleChildrenInfo.getDataSetCount()-MAX_DISPLAY_SIZE) + " more"); + if (sampleChildrenInfo.getDataSetCount() > MAX_DISPLAY_SIZE) + { + additionalMessage.append("<br>and " + (sampleChildrenInfo.getDataSetCount() - MAX_DISPLAY_SIZE) + " more"); } additionalMessage.append("<br>"); - } + } return additionalMessage.toString(); } - - //return information about the number of samples with child samples and data sets - //and a summary of those - public static String getMessageForMultipleSamples(List<SampleChildrenInfo> sampleChildrenInfo, Map<String, String> techIdsToSampleIds) { + + // return information about the number of samples with child samples and data sets + // and a summary of those + public static String getMessageForMultipleSamples(List<SampleChildrenInfo> sampleChildrenInfo, Map<String, String> techIdsToSampleIds) + { StringBuffer additionalMessage = new StringBuffer(); - int samplesWithChildren = 0; - int samplesWithDataSets = 0; + int samplesWithChildren = 0; + int samplesWithDataSets = 0; final int MAX_DISPLAY_SIZE = 10; - + Set<String> samplesWithChildrenToDisplay = new HashSet<String>(); Set<String> samplesWithDataSetsToDisplay = new HashSet<String>(); - - for(SampleChildrenInfo info: sampleChildrenInfo) { - if(info.getChildCount() > 0) { + + for (SampleChildrenInfo info : sampleChildrenInfo) + { + if (info.getChildCount() > 0) + { samplesWithChildren++; - if(samplesWithChildren <= MAX_DISPLAY_SIZE) { + if (samplesWithChildren <= MAX_DISPLAY_SIZE) + { samplesWithChildrenToDisplay.add(techIdsToSampleIds.get(info.getSampleIdentifier())); } } - if(info.getDataSetCount() > 0) { + if (info.getDataSetCount() > 0) + { samplesWithDataSets++; - if(samplesWithDataSets <= MAX_DISPLAY_SIZE) { + if (samplesWithDataSets <= MAX_DISPLAY_SIZE) + { samplesWithDataSetsToDisplay.add(techIdsToSampleIds.get(info.getSampleIdentifier())); } } } - if(samplesWithChildren > 0) { - additionalMessage.append("<br>There are " + samplesWithChildren + " sample(s) with children samples, these relationships will be broken but the children will remain:<br>"); - for(String sample : samplesWithChildrenToDisplay) { - additionalMessage.append("<br>" + sample); - } - if(samplesWithChildren > MAX_DISPLAY_SIZE) { - additionalMessage.append("<br>and " + (samplesWithChildren-MAX_DISPLAY_SIZE) + " more"); - } - additionalMessage.append("<br>"); + if (samplesWithChildren > 0) + { + additionalMessage.append("<br>There are " + samplesWithChildren + + " sample(s) with children samples, these relationships will be broken but the children will remain:<br>"); + for (String sample : samplesWithChildrenToDisplay) + { + additionalMessage.append("<br>" + sample); + } + if (samplesWithChildren > MAX_DISPLAY_SIZE) + { + additionalMessage.append("<br>and " + (samplesWithChildren - MAX_DISPLAY_SIZE) + " more"); + } + additionalMessage.append("<br>"); + } + if (samplesWithDataSets > 0) + { + additionalMessage + .append("<br>There are " + samplesWithDataSets + " sample(s) with data sets, these will be deleted with the sample:<br>"); + for (String sample : samplesWithDataSetsToDisplay) + { + additionalMessage.append("<br>" + sample); + } + if (samplesWithDataSets > MAX_DISPLAY_SIZE) + { + additionalMessage.append("<br>and " + (samplesWithDataSets - MAX_DISPLAY_SIZE) + " more"); + } + additionalMessage.append("<br>"); } - if(samplesWithDataSets > 0) { - additionalMessage.append("<br>There are " + samplesWithDataSets + " sample(s) with data sets, these will be deleted with the sample:<br>"); - for(String sample : samplesWithDataSetsToDisplay) { - additionalMessage.append("<br>" + sample); - } - if(samplesWithDataSets > MAX_DISPLAY_SIZE) { - additionalMessage.append("<br>and " + (samplesWithDataSets-MAX_DISPLAY_SIZE) + " more"); - } - additionalMessage.append("<br>"); - } - return additionalMessage.toString(); - } + return additionalMessage.toString(); + } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/GWTUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/GWTUtils.java index e49ac77ca00..a98adb5a027 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/GWTUtils.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/GWTUtils.java @@ -59,8 +59,7 @@ public final class GWTUtils { /** - * The <code>null</code> value label for {@link ListBox} resp. {@link ComboBox} when no value - * has been selected by the user. + * The <code>null</code> value label for {@link ListBox} resp. {@link ComboBox} when no value has been selected by the user. */ public static final String NONE_LIST_ITEM = "(None)"; @@ -97,7 +96,7 @@ public final class GWTUtils + CommonViewContext.ClientStaticState.getPageTitleSuffix(); Window.setTitle(title); } - + public static void alert(String title, String message) { MessageBox.alert(title, message, null).getDialog().setResizable(true); @@ -124,10 +123,9 @@ public final class GWTUtils }); return dialog; } - + /** - * Sets up {@link ComboBox} to have width of list auto adjusted to maximum width of elements in - * the list. + * Sets up {@link ComboBox} to have width of list auto adjusted to maximum width of elements in the list. */ // TODO 2010-05-19, Piotr Buczek: the width is not updated when store is changed; public static void setupAutoWidth(final ComboBox<?> comboBox) @@ -291,8 +289,8 @@ public final class GWTUtils } /** - * Sets the tooltip of the component using default configuration (disappear after mouse moved), - * replace new lines with html breaks. If null value is passed, tooltip is removed. + * Sets the tooltip of the component using default configuration (disappear after mouse moved), replace new lines with html breaks. If null value + * is passed, tooltip is removed. */ public static void setToolTip(Component component, String textOrNull) { @@ -306,8 +304,7 @@ public final class GWTUtils } /** - * Sets the tooltip of the component using given configuration and replaces new lines with html - * breaks. + * Sets the tooltip of the component using given configuration and replaces new lines with html breaks. */ public static void setToolTip(Component component, ToolTipConfig config) { @@ -382,8 +379,7 @@ public final class GWTUtils } /** - * Tries to return the selected object code (saved as {@link ModelDataPropertyNames#CODE} in the - * model) from the given {@link ComboBox}. + * Tries to return the selected object code (saved as {@link ModelDataPropertyNames#CODE} in the model) from the given {@link ComboBox}. * * @returns <code>null</code> if nothing is selected. */ @@ -394,8 +390,7 @@ public final class GWTUtils } /** - * Tries to return the selected object (saved as {@link ModelDataPropertyNames#OBJECT} in the - * model) from the given {@link ComboBox}. + * Tries to return the selected object (saved as {@link ModelDataPropertyNames#OBJECT} in the model) from the given {@link ComboBox}. * * @returns <code>null</code> if nothing is selected. */ @@ -411,8 +406,7 @@ public final class GWTUtils } /** - * Enables and makes visible the field with appropriate 'on' flag set to true. Performs its work - * when one and only one 'on' flag is set to true. + * Enables and makes visible the field with appropriate 'on' flag set to true. Performs its work when one and only one 'on' flag is set to true. */ public static final void updateVisibleField(boolean firstOn, boolean secondOn, Field<?> firstField, Field<?> secondField) @@ -469,8 +463,7 @@ public final class GWTUtils } /** - * Returns the <i>search</i> of a <i>Javascript</i> window location (without the starting - * <code>?</code> if any). + * Returns the <i>search</i> of a <i>Javascript</i> window location (without the starting <code>?</code> if any). * * @return something like <code>key1=value1&key2=value2</code>. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/IDelegatedAction.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/IDelegatedAction.java index 82816c7268c..10bd07481cb 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/IDelegatedAction.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/IDelegatedAction.java @@ -19,8 +19,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.util; import com.google.gwt.core.client.Scheduler.ScheduledCommand; /** - * Use this interface to delegate any kind of action to a different part of code without adding an - * explicit dependency. + * Use this interface to delegate any kind of action to a different part of code without adding an explicit dependency. * * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/IDelegatedActionWithResult.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/IDelegatedActionWithResult.java index 79f580190ce..d9388160a73 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/IDelegatedActionWithResult.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/IDelegatedActionWithResult.java @@ -17,8 +17,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.util; /** - * Use this interface to delegate any kind of action to a different part of code without adding an - * explicit dependency. The action return a result. + * Use this interface to delegate any kind of action to a different part of code without adding an explicit dependency. The action return a result. * * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/IMessageProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/IMessageProvider.java index 7596bd3b09c..fa9ff052c65 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/IMessageProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/IMessageProvider.java @@ -19,7 +19,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.util; /** * Interface of objects providing messages. * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ public interface IMessageProvider { @@ -27,18 +27,17 @@ public interface IMessageProvider * Returns the name of the message provider. */ public String getName(); - + /** - * Returns the message specified by a key. Optional parameters are used to render the message by - * replacing <code>{0}</code> by the first parameter, <code>{1}</code> by the second one - * etc. + * Returns the message specified by a key. Optional parameters are used to render the message by replacing <code>{0}</code> by the first + * parameter, <code>{1}</code> by the second one etc. * <p> - * If a message couldn't be found an error message is returned which includes the invalid key - * and information about the message source of this provider. + * If a message couldn't be found an error message is returned which includes the invalid key and information about the message source of this + * provider. */ public String getMessage(String key, Object... parameters); /** Whether this implementation contains given <var>key</var>. */ public boolean containsKey(String key); - + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/IResultUpdater.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/IResultUpdater.java index b2c57e956a8..b99ea31e436 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/IResultUpdater.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/IResultUpdater.java @@ -17,8 +17,8 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.util; /** - * Use this interface to pass the result from one class to another without making the class - * receiving the result visible to the class generating the result. + * Use this interface to pass the result from one class to another without making the class receiving the result visible to the class generating the + * result. * * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/ToolTipAction.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/ToolTipAction.java index c0adb8afe1c..6591fe289e2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/ToolTipAction.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/ToolTipAction.java @@ -29,9 +29,8 @@ import com.google.gwt.user.client.Event; import com.google.gwt.user.client.Timer; /** - * Helper class for setting up a delegated action to be invoked when user puts mouse over a - * {@link Component}. Implementation of delayed invocation of the action is based on delayed showing - * of a {@link ToolTip} (with the same naming conventions). + * Helper class for setting up a delegated action to be invoked when user puts mouse over a {@link Component}. Implementation of delayed invocation of + * the action is based on delayed showing of a {@link ToolTip} (with the same naming conventions). */ public class ToolTipAction { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/URLListEncoder.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/URLListEncoder.java index d891cfeb81f..479366a02ed 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/URLListEncoder.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/URLListEncoder.java @@ -38,8 +38,7 @@ public class URLListEncoder private final static String ESCAPED_SEPARATOR = "" + ITEM_LIST_SEPARATOR + ITEM_LIST_SEPARATOR; /** - * Encodes a list of items by escaping the separator. Decode it back with - * {@link #decodeItemList} + * Encodes a list of items by escaping the separator. Decode it back with {@link #decodeItemList} */ public static String encodeItemList(String[] items) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/WindowUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/WindowUtils.java index 3cb3eaeea9c..2607f5e917a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/WindowUtils.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/WindowUtils.java @@ -91,8 +91,7 @@ public class WindowUtils } /** - * Opens a new window with given parameters if pop-up blocker has not been detected and displays - * an alert message otherwise. + * Opens a new window with given parameters if pop-up blocker has not been detected and displays an alert message otherwise. */ private static void doOpenWindow(String url, String target) { @@ -105,8 +104,7 @@ public class WindowUtils } /** - * @return true if the window has been opened, false otherwise (it can be a case e.g. when the - * pop-up detector is switched on) + * @return true if the window has been opened, false otherwise (it can be a case e.g. when the pop-up detector is switched on) */ private static native boolean openWindow(String url, String target, String features) /*-{ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/lang/Entities.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/lang/Entities.java index 8028e4d8545..c879bce03e6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/lang/Entities.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/lang/Entities.java @@ -29,9 +29,8 @@ import java.util.TreeMap; * This is an implementation taken from org.apache.commons.lang with java.io dependencies removed. * </p> * <p> - * To update this to a new version of apache.commons.lang add an inner {@link StringWriter} class to - * the class code and remove throws IOException declaration everywhere. To remove warnings add - * {@link SuppressWarnings} annotation on the class and some {@link Override} annotations on a few + * To update this to a new version of apache.commons.lang add an inner {@link StringWriter} class to the class code and remove throws IOException + * declaration everywhere. To remove warnings add {@link SuppressWarnings} annotation on the class and some {@link Override} annotations on a few * methods. {@link IntHashMap} is copied without changes. * </p> * @@ -41,331 +40,331 @@ class Entities { private static final String[][] BASIC_ARRAY = - { + { { "quot", "34" }, // " - double-quote - { "amp", "38" }, // & - ampersand - { "lt", "60" }, // < - less-than - { "gt", "62" }, // > - greater-than - }; + { "amp", "38" }, // & - ampersand + { "lt", "60" }, // < - less-than + { "gt", "62" }, // > - greater-than + }; private static final String[][] APOS_ARRAY = - { + { { "apos", "39" }, // XML apostrophe - }; + }; // package scoped for testing static final String[][] ISO8859_1_ARRAY = - { + { { "nbsp", "160" }, // non-breaking space - { "iexcl", "161" }, // inverted exclamation mark - { "cent", "162" }, // cent sign - { "pound", "163" }, // pound sign - { "curren", "164" }, // currency sign - { "yen", "165" }, // yen sign = yuan sign - { "brvbar", "166" }, // broken bar = broken vertical bar - { "sect", "167" }, // section sign - { "uml", "168" }, // diaeresis = spacing diaeresis - { "copy", "169" }, // © - copyright sign - { "ordf", "170" }, // feminine ordinal indicator - { "laquo", "171" }, // left-pointing double angle quotation mark = left pointing - // guillemet - { "not", "172" }, // not sign - { "shy", "173" }, // soft hyphen = discretionary hyphen - { "reg", "174" }, // Æ - registered trademark sign - { "macr", "175" }, // macron = spacing macron = overline = APL overbar - { "deg", "176" }, // degree sign - { "plusmn", "177" }, // plus-minus sign = plus-or-minus sign - { "sup2", "178" }, // superscript two = superscript digit two = squared - { "sup3", "179" }, // superscript three = superscript digit three = cubed - { "acute", "180" }, // acute accent = spacing acute - { "micro", "181" }, // micro sign - { "para", "182" }, // pilcrow sign = paragraph sign - { "middot", "183" }, // middle dot = Georgian comma = Greek middle dot - { "cedil", "184" }, // cedilla = spacing cedilla - { "sup1", "185" }, // superscript one = superscript digit one - { "ordm", "186" }, // masculine ordinal indicator - { "raquo", "187" }, // right-pointing double angle quotation mark = right - // pointing guillemet - { "frac14", "188" }, // vulgar fraction one quarter = fraction one quarter - { "frac12", "189" }, // vulgar fraction one half = fraction one half - { "frac34", "190" }, // vulgar fraction three quarters = fraction three quarters - { "iquest", "191" }, // inverted question mark = turned question mark - { "Agrave", "192" }, // ¿ - uppercase A, grave accent - { "Aacute", "193" }, // ¡ - uppercase A, acute accent - { "Acirc", "194" }, // ¬ - uppercase A, circumflex accent - { "Atilde", "195" }, // √ - uppercase A, tilde - { "Auml", "196" }, // Æ’ - uppercase A, umlaut - { "Aring", "197" }, // ≈ - uppercase A, ring - { "AElig", "198" }, // ∆ - uppercase AE - { "Ccedil", "199" }, // « - uppercase C, cedilla - { "Egrave", "200" }, // » - uppercase E, grave accent - { "Eacute", "201" }, // … - uppercase E, acute accent - { "Ecirc", "202" }, //  - uppercase E, circumflex accent - { "Euml", "203" }, // À - uppercase E, umlaut - { "Igrave", "204" }, // à - uppercase I, grave accent - { "Iacute", "205" }, // Õ - uppercase I, acute accent - { "Icirc", "206" }, // Å’ - uppercase I, circumflex accent - { "Iuml", "207" }, // Å“ - uppercase I, umlaut - { "ETH", "208" }, // – - uppercase Eth, Icelandic - { "Ntilde", "209" }, // — - uppercase N, tilde - { "Ograve", "210" }, // “ - uppercase O, grave accent - { "Oacute", "211" }, // †- uppercase O, acute accent - { "Ocirc", "212" }, // ‘ - uppercase O, circumflex accent - { "Otilde", "213" }, // ’ - uppercase O, tilde - { "Ouml", "214" }, // ÷ - uppercase O, umlaut - { "times", "215" }, // multiplication sign - { "Oslash", "216" }, // ÿ - uppercase O, slash - { "Ugrave", "217" }, // Ÿ - uppercase U, grave accent - { "Uacute", "218" }, // â„ - uppercase U, acute accent - { "Ucirc", "219" }, // ¤ - uppercase U, circumflex accent - { "Uuml", "220" }, // ‹ - uppercase U, umlaut - { "Yacute", "221" }, // › - uppercase Y, acute accent - { "THORN", "222" }, // ï¬ - uppercase THORN, Icelandic - { "szlig", "223" }, // fl - lowercase sharps, German - { "agrave", "224" }, // ‡ - lowercase a, grave accent - { "aacute", "225" }, // · - lowercase a, acute accent - { "acirc", "226" }, // ‚ - lowercase a, circumflex accent - { "atilde", "227" }, // „ - lowercase a, tilde - { "auml", "228" }, // ‰ - lowercase a, umlaut - { "aring", "229" }, //  - lowercase a, ring - { "aelig", "230" }, // Ê - lowercase ae - { "ccedil", "231" }, // à - lowercase c, cedilla - { "egrave", "232" }, // Ë - lowercase e, grave accent - { "eacute", "233" }, // È - lowercase e, acute accent - { "ecirc", "234" }, // à - lowercase e, circumflex accent - { "euml", "235" }, // ÃŽ - lowercase e, umlaut - { "igrave", "236" }, // à - lowercase i, grave accent - { "iacute", "237" }, // ÃŒ - lowercase i, acute accent - { "icirc", "238" }, // Ó - lowercase i, circumflex accent - { "iuml", "239" }, // Ô - lowercase i, umlaut - { "eth", "240" }, // # - lowercase eth, Icelandic - { "ntilde", "241" }, // Ã’ - lowercase n, tilde - { "ograve", "242" }, // Ú - lowercase o, grave accent - { "oacute", "243" }, // Û - lowercase o, acute accent - { "ocirc", "244" }, // Ù - lowercase o, circumflex accent - { "otilde", "245" }, // ı - lowercase o, tilde - { "ouml", "246" }, // ˆ - lowercase o, umlaut - { "divide", "247" }, // division sign - { "oslash", "248" }, // ¯ - lowercase o, slash - { "ugrave", "249" }, // ˘ - lowercase u, grave accent - { "uacute", "250" }, // Ë™ - lowercase u, acute accent - { "ucirc", "251" }, // Ëš - lowercase u, circumflex accent - { "uuml", "252" }, // ¸ - lowercase u, umlaut - { "yacute", "253" }, // Ë - lowercase y, acute accent - { "thorn", "254" }, // Ë› - lowercase thorn, Icelandic - { "yuml", "255" }, // ˇ - lowercase y, umlaut - }; + { "iexcl", "161" }, // inverted exclamation mark + { "cent", "162" }, // cent sign + { "pound", "163" }, // pound sign + { "curren", "164" }, // currency sign + { "yen", "165" }, // yen sign = yuan sign + { "brvbar", "166" }, // broken bar = broken vertical bar + { "sect", "167" }, // section sign + { "uml", "168" }, // diaeresis = spacing diaeresis + { "copy", "169" }, // © - copyright sign + { "ordf", "170" }, // feminine ordinal indicator + { "laquo", "171" }, // left-pointing double angle quotation mark = left pointing + // guillemet + { "not", "172" }, // not sign + { "shy", "173" }, // soft hyphen = discretionary hyphen + { "reg", "174" }, // Æ - registered trademark sign + { "macr", "175" }, // macron = spacing macron = overline = APL overbar + { "deg", "176" }, // degree sign + { "plusmn", "177" }, // plus-minus sign = plus-or-minus sign + { "sup2", "178" }, // superscript two = superscript digit two = squared + { "sup3", "179" }, // superscript three = superscript digit three = cubed + { "acute", "180" }, // acute accent = spacing acute + { "micro", "181" }, // micro sign + { "para", "182" }, // pilcrow sign = paragraph sign + { "middot", "183" }, // middle dot = Georgian comma = Greek middle dot + { "cedil", "184" }, // cedilla = spacing cedilla + { "sup1", "185" }, // superscript one = superscript digit one + { "ordm", "186" }, // masculine ordinal indicator + { "raquo", "187" }, // right-pointing double angle quotation mark = right + // pointing guillemet + { "frac14", "188" }, // vulgar fraction one quarter = fraction one quarter + { "frac12", "189" }, // vulgar fraction one half = fraction one half + { "frac34", "190" }, // vulgar fraction three quarters = fraction three quarters + { "iquest", "191" }, // inverted question mark = turned question mark + { "Agrave", "192" }, // ¿ - uppercase A, grave accent + { "Aacute", "193" }, // ¡ - uppercase A, acute accent + { "Acirc", "194" }, // ¬ - uppercase A, circumflex accent + { "Atilde", "195" }, // √ - uppercase A, tilde + { "Auml", "196" }, // Æ’ - uppercase A, umlaut + { "Aring", "197" }, // ≈ - uppercase A, ring + { "AElig", "198" }, // ∆ - uppercase AE + { "Ccedil", "199" }, // « - uppercase C, cedilla + { "Egrave", "200" }, // » - uppercase E, grave accent + { "Eacute", "201" }, // … - uppercase E, acute accent + { "Ecirc", "202" }, //  - uppercase E, circumflex accent + { "Euml", "203" }, // À - uppercase E, umlaut + { "Igrave", "204" }, // à - uppercase I, grave accent + { "Iacute", "205" }, // Õ - uppercase I, acute accent + { "Icirc", "206" }, // Å’ - uppercase I, circumflex accent + { "Iuml", "207" }, // Å“ - uppercase I, umlaut + { "ETH", "208" }, // – - uppercase Eth, Icelandic + { "Ntilde", "209" }, // — - uppercase N, tilde + { "Ograve", "210" }, // “ - uppercase O, grave accent + { "Oacute", "211" }, // †- uppercase O, acute accent + { "Ocirc", "212" }, // ‘ - uppercase O, circumflex accent + { "Otilde", "213" }, // ’ - uppercase O, tilde + { "Ouml", "214" }, // ÷ - uppercase O, umlaut + { "times", "215" }, // multiplication sign + { "Oslash", "216" }, // ÿ - uppercase O, slash + { "Ugrave", "217" }, // Ÿ - uppercase U, grave accent + { "Uacute", "218" }, // â„ - uppercase U, acute accent + { "Ucirc", "219" }, // ¤ - uppercase U, circumflex accent + { "Uuml", "220" }, // ‹ - uppercase U, umlaut + { "Yacute", "221" }, // › - uppercase Y, acute accent + { "THORN", "222" }, // ï¬ - uppercase THORN, Icelandic + { "szlig", "223" }, // fl - lowercase sharps, German + { "agrave", "224" }, // ‡ - lowercase a, grave accent + { "aacute", "225" }, // · - lowercase a, acute accent + { "acirc", "226" }, // ‚ - lowercase a, circumflex accent + { "atilde", "227" }, // „ - lowercase a, tilde + { "auml", "228" }, // ‰ - lowercase a, umlaut + { "aring", "229" }, //  - lowercase a, ring + { "aelig", "230" }, // Ê - lowercase ae + { "ccedil", "231" }, // à - lowercase c, cedilla + { "egrave", "232" }, // Ë - lowercase e, grave accent + { "eacute", "233" }, // È - lowercase e, acute accent + { "ecirc", "234" }, // à - lowercase e, circumflex accent + { "euml", "235" }, // ÃŽ - lowercase e, umlaut + { "igrave", "236" }, // à - lowercase i, grave accent + { "iacute", "237" }, // ÃŒ - lowercase i, acute accent + { "icirc", "238" }, // Ó - lowercase i, circumflex accent + { "iuml", "239" }, // Ô - lowercase i, umlaut + { "eth", "240" }, // # - lowercase eth, Icelandic + { "ntilde", "241" }, // Ã’ - lowercase n, tilde + { "ograve", "242" }, // Ú - lowercase o, grave accent + { "oacute", "243" }, // Û - lowercase o, acute accent + { "ocirc", "244" }, // Ù - lowercase o, circumflex accent + { "otilde", "245" }, // ı - lowercase o, tilde + { "ouml", "246" }, // ˆ - lowercase o, umlaut + { "divide", "247" }, // division sign + { "oslash", "248" }, // ¯ - lowercase o, slash + { "ugrave", "249" }, // ˘ - lowercase u, grave accent + { "uacute", "250" }, // Ë™ - lowercase u, acute accent + { "ucirc", "251" }, // Ëš - lowercase u, circumflex accent + { "uuml", "252" }, // ¸ - lowercase u, umlaut + { "yacute", "253" }, // Ë - lowercase y, acute accent + { "thorn", "254" }, // Ë› - lowercase thorn, Icelandic + { "yuml", "255" }, // ˇ - lowercase y, umlaut + }; // http://www.w3.org/TR/REC-html40/sgml/entities.html // package scoped for testing static final String[][] HTML40_ARRAY = - { + { // <!-- Latin Extended-B --> - { "fnof", "402" }, // latin small f with hook = function= florin, U+0192 ISOtech --> - // <!-- Greek --> - { "Alpha", "913" }, // greek capital letter alpha, U+0391 --> - { "Beta", "914" }, // greek capital letter beta, U+0392 --> - { "Gamma", "915" }, // greek capital letter gamma,U+0393 ISOgrk3 --> - { "Delta", "916" }, // greek capital letter delta,U+0394 ISOgrk3 --> - { "Epsilon", "917" }, // greek capital letter epsilon, U+0395 --> - { "Zeta", "918" }, // greek capital letter zeta, U+0396 --> - { "Eta", "919" }, // greek capital letter eta, U+0397 --> - { "Theta", "920" }, // greek capital letter theta,U+0398 ISOgrk3 --> - { "Iota", "921" }, // greek capital letter iota, U+0399 --> - { "Kappa", "922" }, // greek capital letter kappa, U+039A --> - { "Lambda", "923" }, // greek capital letter lambda,U+039B ISOgrk3 --> - { "Mu", "924" }, // greek capital letter mu, U+039C --> - { "Nu", "925" }, // greek capital letter nu, U+039D --> - { "Xi", "926" }, // greek capital letter xi, U+039E ISOgrk3 --> - { "Omicron", "927" }, // greek capital letter omicron, U+039F --> - { "Pi", "928" }, // greek capital letter pi, U+03A0 ISOgrk3 --> - { "Rho", "929" }, // greek capital letter rho, U+03A1 --> - // <!-- there is no Sigmaf, and no U+03A2 character either --> - { "Sigma", "931" }, // greek capital letter sigma,U+03A3 ISOgrk3 --> - { "Tau", "932" }, // greek capital letter tau, U+03A4 --> - { "Upsilon", "933" }, // greek capital letter upsilon,U+03A5 ISOgrk3 --> - { "Phi", "934" }, // greek capital letter phi,U+03A6 ISOgrk3 --> - { "Chi", "935" }, // greek capital letter chi, U+03A7 --> - { "Psi", "936" }, // greek capital letter psi,U+03A8 ISOgrk3 --> - { "Omega", "937" }, // greek capital letter omega,U+03A9 ISOgrk3 --> - { "alpha", "945" }, // greek small letter alpha,U+03B1 ISOgrk3 --> - { "beta", "946" }, // greek small letter beta, U+03B2 ISOgrk3 --> - { "gamma", "947" }, // greek small letter gamma,U+03B3 ISOgrk3 --> - { "delta", "948" }, // greek small letter delta,U+03B4 ISOgrk3 --> - { "epsilon", "949" }, // greek small letter epsilon,U+03B5 ISOgrk3 --> - { "zeta", "950" }, // greek small letter zeta, U+03B6 ISOgrk3 --> - { "eta", "951" }, // greek small letter eta, U+03B7 ISOgrk3 --> - { "theta", "952" }, // greek small letter theta,U+03B8 ISOgrk3 --> - { "iota", "953" }, // greek small letter iota, U+03B9 ISOgrk3 --> - { "kappa", "954" }, // greek small letter kappa,U+03BA ISOgrk3 --> - { "lambda", "955" }, // greek small letter lambda,U+03BB ISOgrk3 --> - { "mu", "956" }, // greek small letter mu, U+03BC ISOgrk3 --> - { "nu", "957" }, // greek small letter nu, U+03BD ISOgrk3 --> - { "xi", "958" }, // greek small letter xi, U+03BE ISOgrk3 --> - { "omicron", "959" }, // greek small letter omicron, U+03BF NEW --> - { "pi", "960" }, // greek small letter pi, U+03C0 ISOgrk3 --> - { "rho", "961" }, // greek small letter rho, U+03C1 ISOgrk3 --> - { "sigmaf", "962" }, // greek small letter final sigma,U+03C2 ISOgrk3 --> - { "sigma", "963" }, // greek small letter sigma,U+03C3 ISOgrk3 --> - { "tau", "964" }, // greek small letter tau, U+03C4 ISOgrk3 --> - { "upsilon", "965" }, // greek small letter upsilon,U+03C5 ISOgrk3 --> - { "phi", "966" }, // greek small letter phi, U+03C6 ISOgrk3 --> - { "chi", "967" }, // greek small letter chi, U+03C7 ISOgrk3 --> - { "psi", "968" }, // greek small letter psi, U+03C8 ISOgrk3 --> - { "omega", "969" }, // greek small letter omega,U+03C9 ISOgrk3 --> - { "thetasym", "977" }, // greek small letter theta symbol,U+03D1 NEW --> - { "upsih", "978" }, // greek upsilon with hook symbol,U+03D2 NEW --> - { "piv", "982" }, // greek pi symbol, U+03D6 ISOgrk3 --> - // <!-- General Punctuation --> - { "bull", "8226" }, // bullet = black small circle,U+2022 ISOpub --> - // <!-- bullet is NOT the same as bullet operator, U+2219 --> - { "hellip", "8230" }, // horizontal ellipsis = three dot leader,U+2026 ISOpub --> - { "prime", "8242" }, // prime = minutes = feet, U+2032 ISOtech --> - { "Prime", "8243" }, // double prime = seconds = inches,U+2033 ISOtech --> - { "oline", "8254" }, // overline = spacing overscore,U+203E NEW --> - { "frasl", "8260" }, // fraction slash, U+2044 NEW --> - // <!-- Letterlike Symbols --> - { "weierp", "8472" }, // script capital P = power set= Weierstrass p, U+2118 ISOamso - // --> - { "image", "8465" }, // blackletter capital I = imaginary part,U+2111 ISOamso --> - { "real", "8476" }, // blackletter capital R = real part symbol,U+211C ISOamso - // --> - { "trade", "8482" }, // trade mark sign, U+2122 ISOnum --> - { "alefsym", "8501" }, // alef symbol = first transfinite cardinal,U+2135 NEW - // --> - // <!-- alef symbol is NOT the same as hebrew letter alef,U+05D0 although the - // same glyph could be used to depict both characters --> - // <!-- Arrows --> - { "larr", "8592" }, // leftwards arrow, U+2190 ISOnum --> - { "uarr", "8593" }, // upwards arrow, U+2191 ISOnum--> - { "rarr", "8594" }, // rightwards arrow, U+2192 ISOnum --> - { "darr", "8595" }, // downwards arrow, U+2193 ISOnum --> - { "harr", "8596" }, // left right arrow, U+2194 ISOamsa --> - { "crarr", "8629" }, // downwards arrow with corner leftwards= carriage return, - // U+21B5 NEW --> - { "lArr", "8656" }, // leftwards double arrow, U+21D0 ISOtech --> - // <!-- ISO 10646 does not say that lArr is the same as the 'is implied by' - // arrow but also does not have any other character for that function. - // So ? lArr canbe used for 'is implied by' as ISOtech suggests --> - { "uArr", "8657" }, // upwards double arrow, U+21D1 ISOamsa --> - { "rArr", "8658" }, // rightwards double arrow,U+21D2 ISOtech --> - // <!-- ISO 10646 does not say this is the 'implies' character but does not - // have another character with this function so ?rArr can be used for - // 'implies' as ISOtech suggests --> - { "dArr", "8659" }, // downwards double arrow, U+21D3 ISOamsa --> - { "hArr", "8660" }, // left right double arrow,U+21D4 ISOamsa --> - // <!-- Mathematical Operators --> - { "forall", "8704" }, // for all, U+2200 ISOtech --> - { "part", "8706" }, // partial differential, U+2202 ISOtech --> - { "exist", "8707" }, // there exists, U+2203 ISOtech --> - { "empty", "8709" }, // empty set = null set = diameter,U+2205 ISOamso --> - { "nabla", "8711" }, // nabla = backward difference,U+2207 ISOtech --> - { "isin", "8712" }, // element of, U+2208 ISOtech --> - { "notin", "8713" }, // not an element of, U+2209 ISOtech --> - { "ni", "8715" }, // contains as member, U+220B ISOtech --> - // <!-- should there be a more memorable name than 'ni'? --> - { "prod", "8719" }, // n-ary product = product sign,U+220F ISOamsb --> - // <!-- prod is NOT the same character as U+03A0 'greek capital letter pi' - // though the same glyph might be used for both --> - { "sum", "8721" }, // n-ary summation, U+2211 ISOamsb --> - // <!-- sum is NOT the same character as U+03A3 'greek capital letter sigma' - // though the same glyph might be used for both --> - { "minus", "8722" }, // minus sign, U+2212 ISOtech --> - { "lowast", "8727" }, // asterisk operator, U+2217 ISOtech --> - { "radic", "8730" }, // square root = radical sign,U+221A ISOtech --> - { "prop", "8733" }, // proportional to, U+221D ISOtech --> - { "infin", "8734" }, // infinity, U+221E ISOtech --> - { "ang", "8736" }, // angle, U+2220 ISOamso --> - { "and", "8743" }, // logical and = wedge, U+2227 ISOtech --> - { "or", "8744" }, // logical or = vee, U+2228 ISOtech --> - { "cap", "8745" }, // intersection = cap, U+2229 ISOtech --> - { "cup", "8746" }, // union = cup, U+222A ISOtech --> - { "int", "8747" }, // integral, U+222B ISOtech --> - { "there4", "8756" }, // therefore, U+2234 ISOtech --> - { "sim", "8764" }, // tilde operator = varies with = similar to,U+223C ISOtech - // --> - // <!-- tilde operator is NOT the same character as the tilde, U+007E,although - // the same glyph might be used to represent both --> - { "cong", "8773" }, // approximately equal to, U+2245 ISOtech --> - { "asymp", "8776" }, // almost equal to = asymptotic to,U+2248 ISOamsr --> - { "ne", "8800" }, // not equal to, U+2260 ISOtech --> - { "equiv", "8801" }, // identical to, U+2261 ISOtech --> - { "le", "8804" }, // less-than or equal to, U+2264 ISOtech --> - { "ge", "8805" }, // greater-than or equal to,U+2265 ISOtech --> - { "sub", "8834" }, // subset of, U+2282 ISOtech --> - { "sup", "8835" }, // superset of, U+2283 ISOtech --> - // <!-- note that nsup, 'not a superset of, U+2283' is not covered by the - // Symbol font encoding and is not included. Should it be, for symmetry? - // It is in ISOamsn --> <!ENTITY nsub", "8836"}, - // not a subset of, U+2284 ISOamsn --> - { "sube", "8838" }, // subset of or equal to, U+2286 ISOtech --> - { "supe", "8839" }, // superset of or equal to,U+2287 ISOtech --> - { "oplus", "8853" }, // circled plus = direct sum,U+2295 ISOamsb --> - { "otimes", "8855" }, // circled times = vector product,U+2297 ISOamsb --> - { "perp", "8869" }, // up tack = orthogonal to = perpendicular,U+22A5 ISOtech - // --> - { "sdot", "8901" }, // dot operator, U+22C5 ISOamsb --> - // <!-- dot operator is NOT the same character as U+00B7 middle dot --> - // <!-- Miscellaneous Technical --> - { "lceil", "8968" }, // left ceiling = apl upstile,U+2308 ISOamsc --> - { "rceil", "8969" }, // right ceiling, U+2309 ISOamsc --> - { "lfloor", "8970" }, // left floor = apl downstile,U+230A ISOamsc --> - { "rfloor", "8971" }, // right floor, U+230B ISOamsc --> - { "lang", "9001" }, // left-pointing angle bracket = bra,U+2329 ISOtech --> - // <!-- lang is NOT the same character as U+003C 'less than' or U+2039 'single - // left-pointing angle quotation - // mark' --> - { "rang", "9002" }, // right-pointing angle bracket = ket,U+232A ISOtech --> - // <!-- rang is NOT the same character as U+003E 'greater than' or U+203A - // 'single right-pointing angle quotation mark' --> - // <!-- Geometric Shapes --> - { "loz", "9674" }, // lozenge, U+25CA ISOpub --> - // <!-- Miscellaneous Symbols --> - { "spades", "9824" }, // black spade suit, U+2660 ISOpub --> - // <!-- black here seems to mean filled as opposed to hollow --> - { "clubs", "9827" }, // black club suit = shamrock,U+2663 ISOpub --> - { "hearts", "9829" }, // black heart suit = valentine,U+2665 ISOpub --> - { "diams", "9830" }, // black diamond suit, U+2666 ISOpub --> - - // <!-- Latin Extended-A --> - { "OElig", "338" }, // -- latin capital ligature OE,U+0152 ISOlat2 --> - { "oelig", "339" }, // -- latin small ligature oe, U+0153 ISOlat2 --> - // <!-- ligature is a misnomer, this is a separate character in some languages - // --> - { "Scaron", "352" }, // -- latin capital letter S with caron,U+0160 ISOlat2 --> - { "scaron", "353" }, // -- latin small letter s with caron,U+0161 ISOlat2 --> - { "Yuml", "376" }, // -- latin capital letter Y with diaeresis,U+0178 ISOlat2 - // --> - // <!-- Spacing Modifier Letters --> - { "circ", "710" }, // -- modifier letter circumflex accent,U+02C6 ISOpub --> - { "tilde", "732" }, // small tilde, U+02DC ISOdia --> - // <!-- General Punctuation --> - { "ensp", "8194" }, // en space, U+2002 ISOpub --> - { "emsp", "8195" }, // em space, U+2003 ISOpub --> - { "thinsp", "8201" }, // thin space, U+2009 ISOpub --> - { "zwnj", "8204" }, // zero width non-joiner,U+200C NEW RFC 2070 --> - { "zwj", "8205" }, // zero width joiner, U+200D NEW RFC 2070 --> - { "lrm", "8206" }, // left-to-right mark, U+200E NEW RFC 2070 --> - { "rlm", "8207" }, // right-to-left mark, U+200F NEW RFC 2070 --> - { "ndash", "8211" }, // en dash, U+2013 ISOpub --> - { "mdash", "8212" }, // em dash, U+2014 ISOpub --> - { "lsquo", "8216" }, // left single quotation mark,U+2018 ISOnum --> - { "rsquo", "8217" }, // right single quotation mark,U+2019 ISOnum --> - { "sbquo", "8218" }, // single low-9 quotation mark, U+201A NEW --> - { "ldquo", "8220" }, // left double quotation mark,U+201C ISOnum --> - { "rdquo", "8221" }, // right double quotation mark,U+201D ISOnum --> - { "bdquo", "8222" }, // double low-9 quotation mark, U+201E NEW --> - { "dagger", "8224" }, // dagger, U+2020 ISOpub --> - { "Dagger", "8225" }, // double dagger, U+2021 ISOpub --> - { "permil", "8240" }, // per mille sign, U+2030 ISOtech --> - { "lsaquo", "8249" }, // single left-pointing angle quotation mark,U+2039 ISO - // proposed --> - // <!-- lsaquo is proposed but not yet ISO standardized --> - { "rsaquo", "8250" }, // single right-pointing angle quotation mark,U+203A ISO - // proposed --> - // <!-- rsaquo is proposed but not yet ISO standardized --> - { "euro", "8364" }, // -- euro sign, U+20AC NEW --> - }; + { "fnof", "402" }, // latin small f with hook = function= florin, U+0192 ISOtech --> + // <!-- Greek --> + { "Alpha", "913" }, // greek capital letter alpha, U+0391 --> + { "Beta", "914" }, // greek capital letter beta, U+0392 --> + { "Gamma", "915" }, // greek capital letter gamma,U+0393 ISOgrk3 --> + { "Delta", "916" }, // greek capital letter delta,U+0394 ISOgrk3 --> + { "Epsilon", "917" }, // greek capital letter epsilon, U+0395 --> + { "Zeta", "918" }, // greek capital letter zeta, U+0396 --> + { "Eta", "919" }, // greek capital letter eta, U+0397 --> + { "Theta", "920" }, // greek capital letter theta,U+0398 ISOgrk3 --> + { "Iota", "921" }, // greek capital letter iota, U+0399 --> + { "Kappa", "922" }, // greek capital letter kappa, U+039A --> + { "Lambda", "923" }, // greek capital letter lambda,U+039B ISOgrk3 --> + { "Mu", "924" }, // greek capital letter mu, U+039C --> + { "Nu", "925" }, // greek capital letter nu, U+039D --> + { "Xi", "926" }, // greek capital letter xi, U+039E ISOgrk3 --> + { "Omicron", "927" }, // greek capital letter omicron, U+039F --> + { "Pi", "928" }, // greek capital letter pi, U+03A0 ISOgrk3 --> + { "Rho", "929" }, // greek capital letter rho, U+03A1 --> + // <!-- there is no Sigmaf, and no U+03A2 character either --> + { "Sigma", "931" }, // greek capital letter sigma,U+03A3 ISOgrk3 --> + { "Tau", "932" }, // greek capital letter tau, U+03A4 --> + { "Upsilon", "933" }, // greek capital letter upsilon,U+03A5 ISOgrk3 --> + { "Phi", "934" }, // greek capital letter phi,U+03A6 ISOgrk3 --> + { "Chi", "935" }, // greek capital letter chi, U+03A7 --> + { "Psi", "936" }, // greek capital letter psi,U+03A8 ISOgrk3 --> + { "Omega", "937" }, // greek capital letter omega,U+03A9 ISOgrk3 --> + { "alpha", "945" }, // greek small letter alpha,U+03B1 ISOgrk3 --> + { "beta", "946" }, // greek small letter beta, U+03B2 ISOgrk3 --> + { "gamma", "947" }, // greek small letter gamma,U+03B3 ISOgrk3 --> + { "delta", "948" }, // greek small letter delta,U+03B4 ISOgrk3 --> + { "epsilon", "949" }, // greek small letter epsilon,U+03B5 ISOgrk3 --> + { "zeta", "950" }, // greek small letter zeta, U+03B6 ISOgrk3 --> + { "eta", "951" }, // greek small letter eta, U+03B7 ISOgrk3 --> + { "theta", "952" }, // greek small letter theta,U+03B8 ISOgrk3 --> + { "iota", "953" }, // greek small letter iota, U+03B9 ISOgrk3 --> + { "kappa", "954" }, // greek small letter kappa,U+03BA ISOgrk3 --> + { "lambda", "955" }, // greek small letter lambda,U+03BB ISOgrk3 --> + { "mu", "956" }, // greek small letter mu, U+03BC ISOgrk3 --> + { "nu", "957" }, // greek small letter nu, U+03BD ISOgrk3 --> + { "xi", "958" }, // greek small letter xi, U+03BE ISOgrk3 --> + { "omicron", "959" }, // greek small letter omicron, U+03BF NEW --> + { "pi", "960" }, // greek small letter pi, U+03C0 ISOgrk3 --> + { "rho", "961" }, // greek small letter rho, U+03C1 ISOgrk3 --> + { "sigmaf", "962" }, // greek small letter final sigma,U+03C2 ISOgrk3 --> + { "sigma", "963" }, // greek small letter sigma,U+03C3 ISOgrk3 --> + { "tau", "964" }, // greek small letter tau, U+03C4 ISOgrk3 --> + { "upsilon", "965" }, // greek small letter upsilon,U+03C5 ISOgrk3 --> + { "phi", "966" }, // greek small letter phi, U+03C6 ISOgrk3 --> + { "chi", "967" }, // greek small letter chi, U+03C7 ISOgrk3 --> + { "psi", "968" }, // greek small letter psi, U+03C8 ISOgrk3 --> + { "omega", "969" }, // greek small letter omega,U+03C9 ISOgrk3 --> + { "thetasym", "977" }, // greek small letter theta symbol,U+03D1 NEW --> + { "upsih", "978" }, // greek upsilon with hook symbol,U+03D2 NEW --> + { "piv", "982" }, // greek pi symbol, U+03D6 ISOgrk3 --> + // <!-- General Punctuation --> + { "bull", "8226" }, // bullet = black small circle,U+2022 ISOpub --> + // <!-- bullet is NOT the same as bullet operator, U+2219 --> + { "hellip", "8230" }, // horizontal ellipsis = three dot leader,U+2026 ISOpub --> + { "prime", "8242" }, // prime = minutes = feet, U+2032 ISOtech --> + { "Prime", "8243" }, // double prime = seconds = inches,U+2033 ISOtech --> + { "oline", "8254" }, // overline = spacing overscore,U+203E NEW --> + { "frasl", "8260" }, // fraction slash, U+2044 NEW --> + // <!-- Letterlike Symbols --> + { "weierp", "8472" }, // script capital P = power set= Weierstrass p, U+2118 ISOamso + // --> + { "image", "8465" }, // blackletter capital I = imaginary part,U+2111 ISOamso --> + { "real", "8476" }, // blackletter capital R = real part symbol,U+211C ISOamso + // --> + { "trade", "8482" }, // trade mark sign, U+2122 ISOnum --> + { "alefsym", "8501" }, // alef symbol = first transfinite cardinal,U+2135 NEW + // --> + // <!-- alef symbol is NOT the same as hebrew letter alef,U+05D0 although the + // same glyph could be used to depict both characters --> + // <!-- Arrows --> + { "larr", "8592" }, // leftwards arrow, U+2190 ISOnum --> + { "uarr", "8593" }, // upwards arrow, U+2191 ISOnum--> + { "rarr", "8594" }, // rightwards arrow, U+2192 ISOnum --> + { "darr", "8595" }, // downwards arrow, U+2193 ISOnum --> + { "harr", "8596" }, // left right arrow, U+2194 ISOamsa --> + { "crarr", "8629" }, // downwards arrow with corner leftwards= carriage return, + // U+21B5 NEW --> + { "lArr", "8656" }, // leftwards double arrow, U+21D0 ISOtech --> + // <!-- ISO 10646 does not say that lArr is the same as the 'is implied by' + // arrow but also does not have any other character for that function. + // So ? lArr canbe used for 'is implied by' as ISOtech suggests --> + { "uArr", "8657" }, // upwards double arrow, U+21D1 ISOamsa --> + { "rArr", "8658" }, // rightwards double arrow,U+21D2 ISOtech --> + // <!-- ISO 10646 does not say this is the 'implies' character but does not + // have another character with this function so ?rArr can be used for + // 'implies' as ISOtech suggests --> + { "dArr", "8659" }, // downwards double arrow, U+21D3 ISOamsa --> + { "hArr", "8660" }, // left right double arrow,U+21D4 ISOamsa --> + // <!-- Mathematical Operators --> + { "forall", "8704" }, // for all, U+2200 ISOtech --> + { "part", "8706" }, // partial differential, U+2202 ISOtech --> + { "exist", "8707" }, // there exists, U+2203 ISOtech --> + { "empty", "8709" }, // empty set = null set = diameter,U+2205 ISOamso --> + { "nabla", "8711" }, // nabla = backward difference,U+2207 ISOtech --> + { "isin", "8712" }, // element of, U+2208 ISOtech --> + { "notin", "8713" }, // not an element of, U+2209 ISOtech --> + { "ni", "8715" }, // contains as member, U+220B ISOtech --> + // <!-- should there be a more memorable name than 'ni'? --> + { "prod", "8719" }, // n-ary product = product sign,U+220F ISOamsb --> + // <!-- prod is NOT the same character as U+03A0 'greek capital letter pi' + // though the same glyph might be used for both --> + { "sum", "8721" }, // n-ary summation, U+2211 ISOamsb --> + // <!-- sum is NOT the same character as U+03A3 'greek capital letter sigma' + // though the same glyph might be used for both --> + { "minus", "8722" }, // minus sign, U+2212 ISOtech --> + { "lowast", "8727" }, // asterisk operator, U+2217 ISOtech --> + { "radic", "8730" }, // square root = radical sign,U+221A ISOtech --> + { "prop", "8733" }, // proportional to, U+221D ISOtech --> + { "infin", "8734" }, // infinity, U+221E ISOtech --> + { "ang", "8736" }, // angle, U+2220 ISOamso --> + { "and", "8743" }, // logical and = wedge, U+2227 ISOtech --> + { "or", "8744" }, // logical or = vee, U+2228 ISOtech --> + { "cap", "8745" }, // intersection = cap, U+2229 ISOtech --> + { "cup", "8746" }, // union = cup, U+222A ISOtech --> + { "int", "8747" }, // integral, U+222B ISOtech --> + { "there4", "8756" }, // therefore, U+2234 ISOtech --> + { "sim", "8764" }, // tilde operator = varies with = similar to,U+223C ISOtech + // --> + // <!-- tilde operator is NOT the same character as the tilde, U+007E,although + // the same glyph might be used to represent both --> + { "cong", "8773" }, // approximately equal to, U+2245 ISOtech --> + { "asymp", "8776" }, // almost equal to = asymptotic to,U+2248 ISOamsr --> + { "ne", "8800" }, // not equal to, U+2260 ISOtech --> + { "equiv", "8801" }, // identical to, U+2261 ISOtech --> + { "le", "8804" }, // less-than or equal to, U+2264 ISOtech --> + { "ge", "8805" }, // greater-than or equal to,U+2265 ISOtech --> + { "sub", "8834" }, // subset of, U+2282 ISOtech --> + { "sup", "8835" }, // superset of, U+2283 ISOtech --> + // <!-- note that nsup, 'not a superset of, U+2283' is not covered by the + // Symbol font encoding and is not included. Should it be, for symmetry? + // It is in ISOamsn --> <!ENTITY nsub", "8836"}, + // not a subset of, U+2284 ISOamsn --> + { "sube", "8838" }, // subset of or equal to, U+2286 ISOtech --> + { "supe", "8839" }, // superset of or equal to,U+2287 ISOtech --> + { "oplus", "8853" }, // circled plus = direct sum,U+2295 ISOamsb --> + { "otimes", "8855" }, // circled times = vector product,U+2297 ISOamsb --> + { "perp", "8869" }, // up tack = orthogonal to = perpendicular,U+22A5 ISOtech + // --> + { "sdot", "8901" }, // dot operator, U+22C5 ISOamsb --> + // <!-- dot operator is NOT the same character as U+00B7 middle dot --> + // <!-- Miscellaneous Technical --> + { "lceil", "8968" }, // left ceiling = apl upstile,U+2308 ISOamsc --> + { "rceil", "8969" }, // right ceiling, U+2309 ISOamsc --> + { "lfloor", "8970" }, // left floor = apl downstile,U+230A ISOamsc --> + { "rfloor", "8971" }, // right floor, U+230B ISOamsc --> + { "lang", "9001" }, // left-pointing angle bracket = bra,U+2329 ISOtech --> + // <!-- lang is NOT the same character as U+003C 'less than' or U+2039 'single + // left-pointing angle quotation + // mark' --> + { "rang", "9002" }, // right-pointing angle bracket = ket,U+232A ISOtech --> + // <!-- rang is NOT the same character as U+003E 'greater than' or U+203A + // 'single right-pointing angle quotation mark' --> + // <!-- Geometric Shapes --> + { "loz", "9674" }, // lozenge, U+25CA ISOpub --> + // <!-- Miscellaneous Symbols --> + { "spades", "9824" }, // black spade suit, U+2660 ISOpub --> + // <!-- black here seems to mean filled as opposed to hollow --> + { "clubs", "9827" }, // black club suit = shamrock,U+2663 ISOpub --> + { "hearts", "9829" }, // black heart suit = valentine,U+2665 ISOpub --> + { "diams", "9830" }, // black diamond suit, U+2666 ISOpub --> + + // <!-- Latin Extended-A --> + { "OElig", "338" }, // -- latin capital ligature OE,U+0152 ISOlat2 --> + { "oelig", "339" }, // -- latin small ligature oe, U+0153 ISOlat2 --> + // <!-- ligature is a misnomer, this is a separate character in some languages + // --> + { "Scaron", "352" }, // -- latin capital letter S with caron,U+0160 ISOlat2 --> + { "scaron", "353" }, // -- latin small letter s with caron,U+0161 ISOlat2 --> + { "Yuml", "376" }, // -- latin capital letter Y with diaeresis,U+0178 ISOlat2 + // --> + // <!-- Spacing Modifier Letters --> + { "circ", "710" }, // -- modifier letter circumflex accent,U+02C6 ISOpub --> + { "tilde", "732" }, // small tilde, U+02DC ISOdia --> + // <!-- General Punctuation --> + { "ensp", "8194" }, // en space, U+2002 ISOpub --> + { "emsp", "8195" }, // em space, U+2003 ISOpub --> + { "thinsp", "8201" }, // thin space, U+2009 ISOpub --> + { "zwnj", "8204" }, // zero width non-joiner,U+200C NEW RFC 2070 --> + { "zwj", "8205" }, // zero width joiner, U+200D NEW RFC 2070 --> + { "lrm", "8206" }, // left-to-right mark, U+200E NEW RFC 2070 --> + { "rlm", "8207" }, // right-to-left mark, U+200F NEW RFC 2070 --> + { "ndash", "8211" }, // en dash, U+2013 ISOpub --> + { "mdash", "8212" }, // em dash, U+2014 ISOpub --> + { "lsquo", "8216" }, // left single quotation mark,U+2018 ISOnum --> + { "rsquo", "8217" }, // right single quotation mark,U+2019 ISOnum --> + { "sbquo", "8218" }, // single low-9 quotation mark, U+201A NEW --> + { "ldquo", "8220" }, // left double quotation mark,U+201C ISOnum --> + { "rdquo", "8221" }, // right double quotation mark,U+201D ISOnum --> + { "bdquo", "8222" }, // double low-9 quotation mark, U+201E NEW --> + { "dagger", "8224" }, // dagger, U+2020 ISOpub --> + { "Dagger", "8225" }, // double dagger, U+2021 ISOpub --> + { "permil", "8240" }, // per mille sign, U+2030 ISOtech --> + { "lsaquo", "8249" }, // single left-pointing angle quotation mark,U+2039 ISO + // proposed --> + // <!-- lsaquo is proposed but not yet ISO standardized --> + { "rsaquo", "8250" }, // single right-pointing angle quotation mark,U+203A ISO + // proposed --> + // <!-- rsaquo is proposed but not yet ISO standardized --> + { "euro", "8364" }, // -- euro sign, U+20AC NEW --> + }; /** * <p> @@ -580,8 +579,7 @@ class Entities /** * <p> - * Returns the lookup table for this entity map. The lookup table is created if it has not - * been previously. + * Returns the lookup table for this entity map. The lookup table is created if it has not been previously. * </p> * * @return the lookup table @@ -597,8 +595,7 @@ class Entities /** * <p> - * Creates an entity lookup table of LOOKUP_TABLE_SIZE elements, initialized with entity - * names. + * Creates an entity lookup table of LOOKUP_TABLE_SIZE elements, initialized with entity names. * </p> */ private void createLookupTable() @@ -631,8 +628,7 @@ class Entities } /** - * Constructs a new instance of <code>ArrayEntityMap</code> specifying the size by which the - * array should grow. + * Constructs a new instance of <code>ArrayEntityMap</code> specifying the size by which the array should grow. * * @param growBy array will be initialized to and will grow by this amount */ @@ -719,8 +715,7 @@ class Entities } /** - * Constructs a new instance of <code>ArrayEntityMap</code> specifying the size by which the - * underlying array should grow. + * Constructs a new instance of <code>ArrayEntityMap</code> specifying the size by which the underlying array should grow. * * @param growBy array will be initialized to and will grow by this amount */ @@ -730,8 +725,7 @@ class Entities } /** - * Performs a binary search of the entity array for the specified key. This method is based - * on code in {@link java.util.Arrays}. + * Performs a binary search of the entity array for the specified key. This method is based on code in {@link java.util.Arrays}. * * @param key the key to be found * @return the index of the entity array matching the specified key @@ -857,8 +851,7 @@ class Entities * Escapes the characters in a <code>String</code>. * </p> * <p> - * For example, if you have called addEntity("foo", 0xA1), escape("\u00A1") - * will return "&foo;" + * For example, if you have called addEntity("foo", 0xA1), escape("\u00A1") will return "&foo;" * </p> * * @param str The <code>String</code> to escape. @@ -873,12 +866,10 @@ class Entities /** * <p> - * Escapes the characters in the <code>String</code> passed and writes the result to the - * <code>StringWriter</code> passed. + * Escapes the characters in the <code>String</code> passed and writes the result to the <code>StringWriter</code> passed. * </p> * - * @param writer The <code>StringWriter</code> to write the results of the escaping to. Assumed - * to be a non-null value. + * @param writer The <code>StringWriter</code> to write the results of the escaping to. Assumed to be a non-null value. * @param str The <code>String</code> to escape. Assumed to be a non-null value. * @see #escape(String) * @see StringWriter @@ -915,8 +906,7 @@ class Entities * Unescapes the entities in a <code>String</code>. * </p> * <p> - * For example, if you have called addEntity("foo", 0xA1), - * unescape("&foo;") will return "\u00A1" + * For example, if you have called addEntity("foo", 0xA1), unescape("&foo;") will return "\u00A1" * </p> * * @param str The <code>String</code> to escape. @@ -949,8 +939,7 @@ class Entities /** * <p> - * Unescapes the escaped entities in the <code>String</code> passed and writes the result to the - * <code>Writer</code> passed. + * Unescapes the escaped entities in the <code>String</code> passed and writes the result to the <code>Writer</code> passed. * </p> * * @param writer The <code>StringWriter</code> to write the results to; assumed to be non-null. @@ -972,8 +961,7 @@ class Entities } /** - * Underlying unescape method that allows the optimisation of not starting from the 0 index - * again. + * Underlying unescape method that allows the optimisation of not starting from the 0 index again. * * @param writer The <code>Writer</code> to write the results to; assumed to be non-null. * @param str The source <code>String</code> to unescape; assumed to be non-null. @@ -1009,7 +997,7 @@ class Entities { if (entityContent.charAt(0) == '#') { // escaped value content is an integer (decimal or - // hexidecimal) + // hexidecimal) if (entityContentLen > 1) { char isHexChar = entityContent.charAt(1); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/lang/IntHashMap.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/lang/IntHashMap.java index 84742c15b61..d723a2fb50a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/lang/IntHashMap.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/lang/IntHashMap.java @@ -27,9 +27,8 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.util.lang * A hash map that uses primitive ints for the key rather than objects. * </p> * <p> - * Note that this class is for internal optimization purposes only, and may not be supported in - * future releases of Apache Commons Lang. Utilities of this sort may be included in future releases - * of Apache Commons Collections. + * Note that this class is for internal optimization purposes only, and may not be supported in future releases of Apache Commons Lang. Utilities of + * this sort may be included in future releases of Apache Commons Collections. * </p> * * @author Justin Couch @@ -53,8 +52,7 @@ class IntHashMap private transient int count; /** - * The table is rehashed when its size exceeds this threshold. (The value of this field is - * (int)(capacity * loadFactor).) + * The table is rehashed when its size exceeds this threshold. (The value of this field is (int)(capacity * loadFactor).) * * @serial */ @@ -100,8 +98,7 @@ class IntHashMap /** * <p> - * Constructs a new, empty hashtable with a default capacity and load factor, which is - * <code>20</code> and <code>0.75</code> respectively. + * Constructs a new, empty hashtable with a default capacity and load factor, which is <code>20</code> and <code>0.75</code> respectively. * </p> */ public IntHashMap() @@ -111,8 +108,7 @@ class IntHashMap /** * <p> - * Constructs a new, empty hashtable with the specified initial capacity and default load - * factor, which is <code>0.75</code>. + * Constructs a new, empty hashtable with the specified initial capacity and default load factor, which is <code>0.75</code>. * </p> * * @param initialCapacity the initial capacity of the hashtable. @@ -125,14 +121,12 @@ class IntHashMap /** * <p> - * Constructs a new, empty hashtable with the specified initial capacity and the specified load - * factor. + * Constructs a new, empty hashtable with the specified initial capacity and the specified load factor. * </p> * * @param initialCapacity the initial capacity of the hashtable. * @param loadFactor the load factor of the hashtable. - * @throws IllegalArgumentException if the initial capacity is less than zero, or if the load - * factor is nonpositive. + * @throws IllegalArgumentException if the initial capacity is less than zero, or if the load factor is nonpositive. */ public IntHashMap(int initialCapacity, float loadFactor) { @@ -170,8 +164,7 @@ class IntHashMap * Tests if this hashtable maps no keys to values. * </p> * - * @return <code>true</code> if this hashtable maps no keys to values; <code>false</code> - * otherwise. + * @return <code>true</code> if this hashtable maps no keys to values; <code>false</code> otherwise. */ public boolean isEmpty() { @@ -180,18 +173,15 @@ class IntHashMap /** * <p> - * Tests if some key maps into the specified value in this hashtable. This operation is more - * expensive than the <code>containsKey</code> method. + * Tests if some key maps into the specified value in this hashtable. This operation is more expensive than the <code>containsKey</code> method. * </p> * <p> - * Note that this method is identical in functionality to containsValue, (which is part of the - * Map interface in the collections framework). + * Note that this method is identical in functionality to containsValue, (which is part of the Map interface in the collections framework). * </p> * * @param value a value to search for. - * @return <code>true</code> if and only if some key maps to the <code>value</code> argument in - * this hashtable as determined by the <tt>equals</tt> method; <code>false</code> - * otherwise. + * @return <code>true</code> if and only if some key maps to the <code>value</code> argument in this hashtable as determined by the + * <tt>equals</tt> method; <code>false</code> otherwise. * @throws NullPointerException if the value is <code>null</code>. * @see #containsKey(int) * @see #containsValue(Object) @@ -223,8 +213,7 @@ class IntHashMap * Returns <code>true</code> if this HashMap maps one or more keys to this value. * </p> * <p> - * Note that this method is identical in functionality to contains (which predates the Map - * interface). + * Note that this method is identical in functionality to contains (which predates the Map interface). * </p> * * @param value value whose presence in this HashMap is to be tested. @@ -243,8 +232,8 @@ class IntHashMap * </p> * * @param key possible key. - * @return <code>true</code> if and only if the specified object is a key in this hashtable, as - * determined by the <tt>equals</tt> method; <code>false</code> otherwise. + * @return <code>true</code> if and only if the specified object is a key in this hashtable, as determined by the <tt>equals</tt> method; + * <code>false</code> otherwise. * @see #contains(Object) */ public boolean containsKey(int key) @@ -267,8 +256,7 @@ class IntHashMap * </p> * * @param key a key in the hashtable. - * @return the value to which the key is mapped in this hashtable; <code>null</code> if the key - * is not mapped to any value in this hashtable. + * @return the value to which the key is mapped in this hashtable; <code>null</code> if the key is not mapped to any value in this hashtable. * @see #put(int, Object) */ public Object get(int key) @@ -287,12 +275,10 @@ class IntHashMap /** * <p> - * Increases the capacity of and internally reorganizes this hashtable, in order to accommodate - * and access its entries more efficiently. + * Increases the capacity of and internally reorganizes this hashtable, in order to accommodate and access its entries more efficiently. * </p> * <p> - * This method is called automatically when the number of keys in the hashtable exceeds this - * hashtable's capacity and load factor. + * This method is called automatically when the number of keys in the hashtable exceeds this hashtable's capacity and load factor. * </p> */ protected void rehash() @@ -322,18 +308,15 @@ class IntHashMap /** * <p> - * Maps the specified <code>key</code> to the specified <code>value</code> in this hashtable. - * The key cannot be <code>null</code>. + * Maps the specified <code>key</code> to the specified <code>value</code> in this hashtable. The key cannot be <code>null</code>. * </p> * <p> - * The value can be retrieved by calling the <code>get</code> method with a key that is equal to - * the original key. + * The value can be retrieved by calling the <code>get</code> method with a key that is equal to the original key. * </p> * * @param key the hashtable key. * @param value the value. - * @return the previous value of the specified key in this hashtable, or <code>null</code> if it - * did not have one. + * @return the previous value of the specified key in this hashtable, or <code>null</code> if it did not have one. * @throws NullPointerException if the key is <code>null</code>. * @see #get(int) */ @@ -377,8 +360,7 @@ class IntHashMap * </p> * * @param key the key that needs to be removed. - * @return the value to which the key had been mapped in this hashtable, or <code>null</code> if - * the key did not have a mapping. + * @return the value to which the key had been mapped in this hashtable, or <code>null</code> if the key did not have a mapping. */ public Object remove(int key) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/lang/StringEscapeUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/lang/StringEscapeUtils.java index 02ea432dbfe..2c2489f24ce 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/lang/StringEscapeUtils.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/lang/StringEscapeUtils.java @@ -21,12 +21,10 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.util.lang * Escapes and unescapes <code>String</code>s for HTML. * </p> * <p> - * This is a small part of implementation taken from org.apache.commons.lang with java.io - * dependencies removed. + * This is a small part of implementation taken from org.apache.commons.lang with java.io dependencies removed. * </p> * <p> - * See {@link Entities} for update to a new version of apache.commons.lang instructions. This class - * should rather be left without changes. + * See {@link Entities} for update to a new version of apache.commons.lang instructions. This class should rather be left without changes. * </p> * * @see Entities @@ -50,23 +48,18 @@ public class StringEscapeUtils * <code>&quot;bread&quot; &amp; &quot;butter&quot;</code>. * </p> * <p> - * Supports all known HTML 4.0 entities, including funky accents. Note that the commonly used - * apostrophe escape character (&apos;) is not a legal entity and so is not supported). + * Supports all known HTML 4.0 entities, including funky accents. Note that the commonly used apostrophe escape character (&apos;) is not a + * legal entity and so is not supported). * </p> * * @param str the <code>String</code> to escape, may be null * @return a new escaped <code>String</code>, <code>null</code> if null string input * @see #unescapeHtml(String) - * @see <a href="http://hotwired.lycos.com/webmonkey/reference/special_characters/">ISO - * Entities</a> - * @see <a href="http://www.w3.org/TR/REC-html32#latin1">HTML 3.2 Character Entities for ISO - * Latin-1</a> - * @see <a href="http://www.w3.org/TR/REC-html40/sgml/entities.html">HTML 4.0 Character entity - * references</a> - * @see <a href="http://www.w3.org/TR/html401/charset.html#h-5.3">HTML 4.01 Character - * References</a> - * @see <a href="http://www.w3.org/TR/html401/charset.html#code-position">HTML 4.01 Code - * positions</a> + * @see <a href="http://hotwired.lycos.com/webmonkey/reference/special_characters/">ISO Entities</a> + * @see <a href="http://www.w3.org/TR/REC-html32#latin1">HTML 3.2 Character Entities for ISO Latin-1</a> + * @see <a href="http://www.w3.org/TR/REC-html40/sgml/entities.html">HTML 4.0 Character entity references</a> + * @see <a href="http://www.w3.org/TR/html401/charset.html#h-5.3">HTML 4.01 Character References</a> + * @see <a href="http://www.w3.org/TR/html401/charset.html#code-position">HTML 4.01 Code positions</a> */ public static String escapeHtml(String str) { @@ -79,16 +72,15 @@ public class StringEscapeUtils /** * <p> - * Unescapes a string containing entity escapes to a string containing the actual Unicode - * characters corresponding to the escapes. Supports HTML 4.0 entities. + * Unescapes a string containing entity escapes to a string containing the actual Unicode characters corresponding to the escapes. Supports HTML + * 4.0 entities. * </p> * <p> - * For example, the string "&lt;Fran&ccedil;ais&gt;" will become - * "<Français>" + * For example, the string "&lt;Fran&ccedil;ais&gt;" will become "<Français>" * </p> * <p> - * If an entity is unrecognized, it is left alone, and inserted verbatim into the result string. - * e.g. "&gt;&zzzz;x" will become ">&zzzz;x". + * If an entity is unrecognized, it is left alone, and inserted verbatim into the result string. e.g. "&gt;&zzzz;x" will become + * ">&zzzz;x". * </p> * * @param str the <code>String</code> to unescape, may be null diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/log/IProfilingTable.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/log/IProfilingTable.java index 89e1130a81d..6005f7e4251 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/log/IProfilingTable.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/log/IProfilingTable.java @@ -31,20 +31,18 @@ public interface IProfilingTable /** * Logs the event. It's cheap to call this method. * - * @return id of the logged task. Use this id in {@link #logStop} method to measure the time - * between event start and stop of the event. + * @return id of the logged task. Use this id in {@link #logStop} method to measure the time between event start and stop of the event. */ public int log(String description); /** - * Logs the event with the specified id. Use {@link #log(String)} if you do not want to manage - * the events ids. + * Logs the event with the specified id. Use {@link #log(String)} if you do not want to manage the events ids. */ public void log(int taskId, String description); /** - * Logs end of the already started event. It's cheap to call this method. Call this method to - * log the time from a call of a particular {@link #log} method. + * Logs end of the already started event. It's cheap to call this method. Call this method to log the time from a call of a particular + * {@link #log} method. */ public void logStop(int taskId); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/log/ProfilingTable.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/log/ProfilingTable.java index 54cec3fbcef..792687f26c3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/log/ProfilingTable.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/log/ProfilingTable.java @@ -22,8 +22,7 @@ import java.util.HashMap; import java.util.List; /** - * Class for profiling and debugging by developers. Stores debug information about logged events, - * allows to see duration time of logged events. + * Class for profiling and debugging by developers. Stores debug information about logged events, allows to see duration time of logged events. * * @author Tomasz Pylak */ @@ -129,8 +128,7 @@ public class ProfilingTable implements IProfilingTable /** * Logs the event. * - * @return id of the logged task. Use this id in {@link #logStop} method to measure the time - * between event start and stop. + * @return id of the logged task. Use this id in {@link #logStop} method to measure the time between event start and stop. */ @Override public int log(String description) @@ -141,8 +139,7 @@ public class ProfilingTable implements IProfilingTable } /** - * Logs the event with the specified id. Use {@link #log(String)} if you do not want to manage - * the events ids. + * Logs the event with the specified id. Use {@link #log(String)} if you do not want to manage the events ids. */ @Override public void log(int taskId, String description) @@ -151,8 +148,7 @@ public class ProfilingTable implements IProfilingTable } /** - * Logs end of the event. It's cheap to call this method. Call this method only if you want to - * measure time between start and stop. + * Logs end of the event. It's cheap to call this method. Call this method only if you want to measure time between start and stop. */ @Override public void logStop(int taskId) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ArchivingResult.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ArchivingResult.java index 994cb4d27ce..9d27d50893e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ArchivingResult.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ArchivingResult.java @@ -19,9 +19,8 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.dto; import com.google.gwt.user.client.rpc.IsSerializable; /** - * Archiving operations are based on data set archiving status. This class returns to the client - * information needed to create a message after set of data sets have been scheduled for such an - * operation on the server side. + * Archiving operations are based on data set archiving status. This class returns to the client information needed to create a message after set of + * data sets have been scheduled for such an operation on the server side. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/AttachmentGridColumnIDs.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/AttachmentGridColumnIDs.java index c6e545e21a5..c3f3758834d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/AttachmentGridColumnIDs.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/AttachmentGridColumnIDs.java @@ -24,10 +24,16 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.dto; public class AttachmentGridColumnIDs { public static final String FILE_NAME = "FILE_NAME"; + public static final String PERMLINK = "PERMLINK"; + public static final String VERSION = "VERSION"; + public static final String TITLE = "TITLE"; + public static final String DESCRIPTION = "DESCRIPTION"; + public static final String REGISTRATOR = "REGISTRATOR"; + public static final String REGISTRATION_DATE = "REGISTRATION_DATE"; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/AuthorizationGroupGridColumnIDs.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/AuthorizationGroupGridColumnIDs.java index 6b3234c59d6..da1903de3f6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/AuthorizationGroupGridColumnIDs.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/AuthorizationGroupGridColumnIDs.java @@ -26,7 +26,10 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.Authori public class AuthorizationGroupGridColumnIDs { public static final String CODE = "CODE"; + public static final String DESCRIPTION = "DESCRIPTION"; + public static final String REGISTRATOR = "REGISTRATOR"; + public static final String REGISTRATION_DATE = "REGISTRATION_DATE"; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/CustomGridColumnGridColumnIDs.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/CustomGridColumnGridColumnIDs.java index 1f9515908a2..7000248f72b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/CustomGridColumnGridColumnIDs.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/CustomGridColumnGridColumnIDs.java @@ -17,17 +17,21 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.dto; /** - * - * * @author Franz-Josef Elmer */ public class CustomGridColumnGridColumnIDs { public static final String CODE = "CODE"; + public static final String NAME = "NAME"; + public static final String DESCRIPTION = "DESCRIPTION"; + public static final String EXPRESSION = "EXPRESSION"; + public static final String IS_PUBLIC = "IS_PUBLIC"; + public static final String REGISTRATOR = "REGISTRATOR"; + public static final String REGISTRATION_DATE = "REGISTRATION_DATE"; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DataSetUploadParameters.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DataSetUploadParameters.java index c967cdfd5de..8305503d9d8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DataSetUploadParameters.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DataSetUploadParameters.java @@ -19,20 +19,18 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.dto; import com.google.gwt.user.client.rpc.IsSerializable; /** - * - * - * @author Franz-Josef Elmer + * @author Franz-Josef Elmer */ public class DataSetUploadParameters implements IsSerializable { private String cifexURL; - + private String fileName; private String userID; - + private String password; - + private String comment; public final String getCifexURL() diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DefaultResultSetConfig.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DefaultResultSetConfig.java index 6a0d104178d..120dfb4b662 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DefaultResultSetConfig.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DefaultResultSetConfig.java @@ -177,8 +177,7 @@ public class DefaultResultSetConfig<K, T> implements IResultSetConfig<K, T>, IsS } /** - * Does this result set return long error messages from errors on custom columns? Defaults to - * false. + * Does this result set return long error messages from errors on custom columns? Defaults to false. */ @Override public boolean isCustomColumnErrorMessageLong() diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DeletionGridColumnIDs.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DeletionGridColumnIDs.java index 130b471684b..cc9916d6484 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DeletionGridColumnIDs.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DeletionGridColumnIDs.java @@ -30,7 +30,7 @@ public class DeletionGridColumnIDs public static final String DELETER = "DELETER"; public static final String DELETION_DATE = "DELETION_DATE"; - + public static final String ENTITIES = "ENTITIES"; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DisplayedCriteriaOrSelectedEntityHolder.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DisplayedCriteriaOrSelectedEntityHolder.java index 50cc9d61f6b..fa9dbf96ab8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DisplayedCriteriaOrSelectedEntityHolder.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DisplayedCriteriaOrSelectedEntityHolder.java @@ -1 +1 @@ -/* * 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.client.web.client.dto; import java.util.List; import com.google.gwt.user.client.rpc.IsSerializable; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder; /** * Contains either a collection of entities or a the criteria to get those entities from the cache. * * @author Izabela Adamczyk * @author Chandrasekhar Ramakrishnan */ public final class DisplayedCriteriaOrSelectedEntityHolder<T extends IIdHolder> implements IsSerializable { private TableExportCriteria<T> displayedItemsOrNull; private List<T> selectedItemsOrNull; public static <T extends IIdHolder> DisplayedCriteriaOrSelectedEntityHolder<T> createSelectedItems( List<T> selectedItems) { return new DisplayedCriteriaOrSelectedEntityHolder<T>(null, selectedItems); } public static <T extends IIdHolder> DisplayedCriteriaOrSelectedEntityHolder<T> createDisplayedItems( TableExportCriteria<T> tableExportCriteria) { return new DisplayedCriteriaOrSelectedEntityHolder<T>(tableExportCriteria, null); } private DisplayedCriteriaOrSelectedEntityHolder(TableExportCriteria<T> displayedItemsOrNull, List<T> selectedItemsOrNull) { this.displayedItemsOrNull = displayedItemsOrNull; this.selectedItemsOrNull = selectedItemsOrNull; } public List<T> tryGetSelectedItems() { return selectedItemsOrNull; } public TableExportCriteria<T> tryGetDisplayedItems() { return displayedItemsOrNull; } /** * Call this to test if you should get the selected items or the displayed items. * * @return True if I have selected items; false if I have the criteria to get the displayed * items. */ public boolean hasSelectedItems() { return selectedItemsOrNull != null; } // GWT only @Deprecated private DisplayedCriteriaOrSelectedEntityHolder() { } } \ No newline at end of file +/* * 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.client.web.client.dto; import java.util.List; import com.google.gwt.user.client.rpc.IsSerializable; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder; /** * Contains either a collection of entities or a the criteria to get those entities from the cache. * * @author Izabela Adamczyk * @author Chandrasekhar Ramakrishnan */ public final class DisplayedCriteriaOrSelectedEntityHolder<T extends IIdHolder> implements IsSerializable { private TableExportCriteria<T> displayedItemsOrNull; private List<T> selectedItemsOrNull; public static <T extends IIdHolder> DisplayedCriteriaOrSelectedEntityHolder<T> createSelectedItems( List<T> selectedItems) { return new DisplayedCriteriaOrSelectedEntityHolder<T>(null, selectedItems); } public static <T extends IIdHolder> DisplayedCriteriaOrSelectedEntityHolder<T> createDisplayedItems( TableExportCriteria<T> tableExportCriteria) { return new DisplayedCriteriaOrSelectedEntityHolder<T>(tableExportCriteria, null); } private DisplayedCriteriaOrSelectedEntityHolder(TableExportCriteria<T> displayedItemsOrNull, List<T> selectedItemsOrNull) { this.displayedItemsOrNull = displayedItemsOrNull; this.selectedItemsOrNull = selectedItemsOrNull; } public List<T> tryGetSelectedItems() { return selectedItemsOrNull; } public TableExportCriteria<T> tryGetDisplayedItems() { return displayedItemsOrNull; } /** * Call this to test if you should get the selected items or the displayed items. * * @return True if I have selected items; false if I have the criteria to get the displayed items. */ public boolean hasSelectedItems() { return selectedItemsOrNull != null; } // GWT only @Deprecated private DisplayedCriteriaOrSelectedEntityHolder() { } } \ No newline at end of file diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DisplayedOrSelectedDatasetCriteria.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DisplayedOrSelectedDatasetCriteria.java index 614af5e1d6c..46eda40f1b1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DisplayedOrSelectedDatasetCriteria.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DisplayedOrSelectedDatasetCriteria.java @@ -24,8 +24,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AbstractExternalData; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRowWithObject; /** - * Defines a set of datasets by either enumerating their codes or providing the grid configuration - * for it (together with the cache identifier). + * Defines a set of datasets by either enumerating their codes or providing the grid configuration for it (together with the cache identifier). * * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DisplayedOrSelectedIdHolderCriteria.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DisplayedOrSelectedIdHolderCriteria.java index e79b5d120d3..3853e06f6be 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DisplayedOrSelectedIdHolderCriteria.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DisplayedOrSelectedIdHolderCriteria.java @@ -1 +1 @@ -/* * 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.client.web.client.dto; import java.util.List; import com.google.gwt.user.client.rpc.IsSerializable; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; /** * Defines a set of {@link IIdHolder}s by either enumerating their ids or providing the grid * configuration for it (together with the cache identifier). * * @author Izabela Adamczyk */ public final class DisplayedOrSelectedIdHolderCriteria<T extends IIdHolder> implements IsSerializable { private TableExportCriteria<T> displayedItemsOrNull; private List<TechId> selectedItemsTechIdsOrNull; public static <T extends IIdHolder> DisplayedOrSelectedIdHolderCriteria<T> createSelectedItems( List<T> displayedItems) { return new DisplayedOrSelectedIdHolderCriteria<T>(null, TechId.createList(displayedItems)); } public static <T extends IIdHolder> DisplayedOrSelectedIdHolderCriteria<T> createDisplayedItems( TableExportCriteria<T> tableExportCriteria) { return new DisplayedOrSelectedIdHolderCriteria<T>(tableExportCriteria, null); } private DisplayedOrSelectedIdHolderCriteria(TableExportCriteria<T> displayedItemsOrNull, List<TechId> selectedItemsTechIdOrNull) { this.displayedItemsOrNull = displayedItemsOrNull; selectedItemsTechIdsOrNull = selectedItemsTechIdOrNull; } public List<TechId> tryGetSelectedItems() { return selectedItemsTechIdsOrNull; } public TableExportCriteria<T> tryGetDisplayedItems() { return displayedItemsOrNull; } // GWT only @Deprecated private DisplayedOrSelectedIdHolderCriteria() { } } +/* * 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.client.web.client.dto; import java.util.List; import com.google.gwt.user.client.rpc.IsSerializable; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; /** * Defines a set of {@link IIdHolder}s by either enumerating their ids or providing the grid configuration for it (together with the cache * identifier). * * @author Izabela Adamczyk */ public final class DisplayedOrSelectedIdHolderCriteria<T extends IIdHolder> implements IsSerializable { private TableExportCriteria<T> displayedItemsOrNull; private List<TechId> selectedItemsTechIdsOrNull; public static <T extends IIdHolder> DisplayedOrSelectedIdHolderCriteria<T> createSelectedItems( List<T> displayedItems) { return new DisplayedOrSelectedIdHolderCriteria<T>(null, TechId.createList(displayedItems)); } public static <T extends IIdHolder> DisplayedOrSelectedIdHolderCriteria<T> createDisplayedItems( TableExportCriteria<T> tableExportCriteria) { return new DisplayedOrSelectedIdHolderCriteria<T>(tableExportCriteria, null); } private DisplayedOrSelectedIdHolderCriteria(TableExportCriteria<T> displayedItemsOrNull, List<TechId> selectedItemsTechIdOrNull) { this.displayedItemsOrNull = displayedItemsOrNull; selectedItemsTechIdsOrNull = selectedItemsTechIdOrNull; } public List<TechId> tryGetSelectedItems() { return selectedItemsTechIdsOrNull; } public TableExportCriteria<T> tryGetDisplayedItems() { return displayedItemsOrNull; } // GWT only @Deprecated private DisplayedOrSelectedIdHolderCriteria() { } } \ No newline at end of file diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/EntityPropertyUpdatesResult.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/EntityPropertyUpdatesResult.java index 1a0ca194c7b..99def95e39e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/EntityPropertyUpdatesResult.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/EntityPropertyUpdatesResult.java @@ -21,8 +21,7 @@ import java.io.Serializable; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ServiceVersionHolder; /** - * Stores result of update of properties of an entity. Currently used only to transfer error - * messages to the client side. + * Stores result of update of properties of an entity. Currently used only to transfer error messages to the client side. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/FileFormatTypeGridColumnIDs.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/FileFormatTypeGridColumnIDs.java index 3d76412fe17..e8057362c22 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/FileFormatTypeGridColumnIDs.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/FileFormatTypeGridColumnIDs.java @@ -23,7 +23,7 @@ public class FileFormatTypeGridColumnIDs { public static final String CODE = "CODE"; - + public static final String DESCRIPTION = "DESCRIPTION"; - + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/GridFilters.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/GridFilters.java index 1ec2840e621..6d4b9a60fda 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/GridFilters.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/GridFilters.java @@ -63,10 +63,8 @@ public class GridFilters<T> implements IsSerializable } /** - * @return null if custom filter should be applied. Otherwise returns the column filters which - * are visible for the user, they should be applied for the result if they are not - * empty. They will be also used to calculate distinct values in columns for more - * convenient filtering. + * @return null if custom filter should be applied. Otherwise returns the column filters which are visible for the user, they should be applied + * for the result if they are not empty. They will be also used to calculate distinct values in columns for more convenient filtering. */ public List<GridColumnFilterInfo<T>> tryGetFilterInfos() { @@ -74,8 +72,7 @@ public class GridFilters<T> implements IsSerializable } /** - * The custom filter which should be applied for the result or null if no custom filter should - * be applied. + * The custom filter which should be applied for the result or null if no custom filter should be applied. */ public CustomFilterInfo<T> tryGetCustomFilterInfo() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/GridRowModels.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/GridRowModels.java index 9c055727ddc..0600bf51357 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/GridRowModels.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/GridRowModels.java @@ -40,11 +40,9 @@ public class GridRowModels<T> extends ArrayList<GridRowModel<T>> implements Seri private List<GridCustomColumnInfo> customColumnsMetadata; /** - * Information about distinct values in the columns. Only those columns which user wanted to - * filter with column filters and which at the same time had values belonging to a small set are - * included.<br> - * Note that all rows are taken into account to compute distinct values, not only those from - * this grid row model.<br> + * Information about distinct values in the columns. Only those columns which user wanted to filter with column filters and which at the same time + * had values belonging to a small set are included.<br> + * Note that all rows are taken into account to compute distinct values, not only those from this grid row model.<br> */ private List<ColumnDistinctValues> columnDistinctValues; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/IResultSetConfig.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/IResultSetConfig.java index 94cdf8a473f..27724c85e70 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/IResultSetConfig.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/IResultSetConfig.java @@ -50,8 +50,8 @@ public interface IResultSetConfig<K, T> public int getLimit(); /** - * Returns all columns available. Needed for customized filters and columns. The result will - * include custom columns only if this information was already fetched. + * Returns all columns available. Needed for customized filters and columns. The result will include custom columns only if this information was + * already fetched. */ public Set<IColumnDefinition<T>> getAvailableColumns(); @@ -69,8 +69,7 @@ public interface IResultSetConfig<K, T> public GridFilters<T> getFilters(); /** - * @return grid id which can be used to figure out what are the available custom columns and how - * to compute them. + * @return grid id which can be used to figure out what are the available custom columns and how to compute them. */ public String tryGetGridDisplayId(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/IUpdateResult.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/IUpdateResult.java index a11a8a29079..a890a5640ce 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/IUpdateResult.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/IUpdateResult.java @@ -24,8 +24,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.dto; public interface IUpdateResult { /** - * Returns <code>null</code> if the update was successfully otherwise an error message is - * return. + * Returns <code>null</code> if the update was successfully otherwise an error message is return. */ public String tryGetErrorMessage(); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ListEntityDisplayCriteriaKind.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ListEntityDisplayCriteriaKind.java index 0b092d449ed..4f6ca91b1aa 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ListEntityDisplayCriteriaKind.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ListEntityDisplayCriteriaKind.java @@ -21,8 +21,7 @@ import com.google.gwt.user.client.rpc.IsSerializable; /** * Enumeration of display criteria kinds that can be used to list entities.<br> * <br> - * Display criteria for entities can consist of either detailed search criterions or simple browsing - * criterions. + * Display criteria for entities can consist of either detailed search criterions or simple browsing criterions. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/PropertyTypeGridColumnIDs.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/PropertyTypeGridColumnIDs.java index b902c680152..67a9e4e36fe 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/PropertyTypeGridColumnIDs.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/PropertyTypeGridColumnIDs.java @@ -26,16 +26,28 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.propert public class PropertyTypeGridColumnIDs { public static final String LABEL = "LABEL"; + public static final String CODE = "CODE"; + public static final String DATA_TYPE = "DATA_TYPE"; + public static final String DATA_TYPE_CODE = "DATA_TYPE_CODE"; + public static final String VOCABULARY = "VOCABULARY"; + public static final String MATERIAL_TYPE = "MATERIAL_TYPE"; + public static final String XML_SCHEMA = "XML_SCHEMA"; + public static final String XSLT = "XSLT"; + public static final String DESCRIPTION = "DESCRIPTION"; + public static final String SAMPLE_TYPES = "SAMPLE_TYPES"; + public static final String EXPERIMENT_TYPES = "EXPERIMENT_TYPES"; + public static final String MATERIAL_TYPES = "MATERIAL_TYPES"; + public static final String DATA_SET_TYPES = "DATA_SET_TYPES"; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/RelatedDataSetCriteria.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/RelatedDataSetCriteria.java index 8cf7bd04be4..3236509a69e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/RelatedDataSetCriteria.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/RelatedDataSetCriteria.java @@ -25,8 +25,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MatchingEntity; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRowWithObject; /** - * Criteria for listing <i>data sets</i> related to {@link MatchingEntity}s like samples and - * experiments. + * Criteria for listing <i>data sets</i> related to {@link MatchingEntity}s like samples and experiments. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ResultSet.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ResultSet.java index 827ee628524..bf41ff4ef6e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ResultSet.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ResultSet.java @@ -36,7 +36,7 @@ public final class ResultSet<T> implements IsSerializable, IResultSetHolder<T> private int totalLength; private String resultSetKey; - + private boolean partial; public final void setList(final GridRowModels<T> result) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ResultSetFetchConfig.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ResultSetFetchConfig.java index b5414999cae..3657e34be0a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ResultSetFetchConfig.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ResultSetFetchConfig.java @@ -36,8 +36,8 @@ public class ResultSetFetchConfig<K> implements IsSerializable private K resultSetKeyOrNull; /** - * Instruction to compute a new result and to cache it. Should be used only if the result is - * computed for the first time and has not been cached yet. + * Instruction to compute a new result and to cache it. Should be used only if the result is computed for the first time and has not been cached + * yet. */ public static <K> ResultSetFetchConfig<K> createComputeAndCache() { @@ -65,9 +65,8 @@ public class ResultSetFetchConfig<K> implements IsSerializable } /** - * Instruction to fetch the result at the specified key in the cache an then recompute the - * custom columns and distinct filter values. Remember that rows are filtered anyway, even - * without recomputing. + * Instruction to fetch the result at the specified key in the cache an then recompute the custom columns and distinct filter values. Remember + * that rows are filtered anyway, even without recomputing. */ public static <K> ResultSetFetchConfig<K> createFetchFromCacheAndRecompute(K resultSetKey) { @@ -92,10 +91,8 @@ public class ResultSetFetchConfig<K> implements IsSerializable /** * If mode is COMPUTE_AND_CACHE, returns null.<br> - * If mode is FETCH_FROM_CACHE, returns a key which uniquely identifies a result set in the - * cache on the server side.<br> - * If mode is CLEAR_CACHE_AND_RECOMPUTE, returns a key to the item in the cache which should be - * removed.<br> + * If mode is FETCH_FROM_CACHE, returns a key which uniquely identifies a result set in the cache on the server side.<br> + * If mode is CLEAR_CACHE_AND_RECOMPUTE, returns a key to the item in the cache which should be removed.<br> */ public K tryGetResultSetKey() { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ResultSetWithEntityTypes.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ResultSetWithEntityTypes.java index beeb93b6094..b911d9d4161 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ResultSetWithEntityTypes.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/ResultSetWithEntityTypes.java @@ -25,8 +25,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.annotation.DoNotEscape; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.BasicEntityType; /** - * Holds not only the result set, but also a set of entity types which are contained in the result - * set. + * Holds not only the result set, but also a set of entity types which are contained in the result set. * <p> * Entity types can be helpful in deciding which property types can be found in the result set. * </p> diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/RoleAssignmentGridColumnIDs.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/RoleAssignmentGridColumnIDs.java index 2036e6f51fe..2d1af972ac1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/RoleAssignmentGridColumnIDs.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/RoleAssignmentGridColumnIDs.java @@ -26,8 +26,12 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.RoleAss public class RoleAssignmentGridColumnIDs { public static final String PERSON = "PERSON"; + public static final String AUTHORIZATION_GROUP = "AUTHORIZATION_GROUP"; + public static final String SPACE = "SPACE"; + public static final String ROLE = "ROLE"; + public static final String DATABASE_INSTANCE = "DATABASE_INSTANCE"; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/SampleChildrenInfo.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/SampleChildrenInfo.java index 2ad50a83481..9a559b6b7b6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/SampleChildrenInfo.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/SampleChildrenInfo.java @@ -34,13 +34,15 @@ public final class SampleChildrenInfo implements IsSerializable private String sampleIdentifier; private List<String> derivedSamples = new ArrayList<String>(); + private List<String> dataSets = new ArrayList<String>(); - + // we need the following values in case we want to send // only children count info, not the lists above private int childCount; + private int dataSetCount; - + public int getChildCount() { return childCount; @@ -61,11 +63,13 @@ public final class SampleChildrenInfo implements IsSerializable this.dataSetCount = dataSetCount; } - public void addDerivedSample(String s) { + public void addDerivedSample(String s) + { this.derivedSamples.add(s); } - public void addDataSet(String s) { + public void addDataSet(String s) + { this.dataSets.add(s); } @@ -95,7 +99,6 @@ public final class SampleChildrenInfo implements IsSerializable return dataSets; } - @SuppressWarnings("unused") // GWT only private SampleChildrenInfo() diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/SessionContext.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/SessionContext.java index 122fa8f9234..8e0e0129500 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/SessionContext.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/SessionContext.java @@ -60,9 +60,8 @@ public class SessionContext implements IsSerializable } /** - * Returns the display settings. Display settings shouldn't be manipulated directly. Instead the - * display settings manager should be used. It can be accessed by - * {@link IViewContext#getDisplaySettingsManager()}. + * Returns the display settings. Display settings shouldn't be manipulated directly. Instead the display settings manager should be used. It can + * be accessed by {@link IViewContext#getDisplaySettingsManager()}. */ public final DisplaySettings getDisplaySettings() { @@ -70,9 +69,8 @@ public class SessionContext implements IsSerializable } /** - * Sets the display settings. This method should not be used on the client. In order to - * manipulate the display settings a display settings manager as returned by - * {@link IViewContext#getDisplaySettingsManager()} should be used. + * Sets the display settings. This method should not be used on the client. In order to manipulate the display settings a display settings manager + * as returned by {@link IViewContext#getDisplaySettingsManager()} should be used. */ public final void setDisplaySettings(DisplaySettings displaySettings) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/SpaceGridColumnIDs.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/SpaceGridColumnIDs.java index cf085bca534..bb28891db2e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/SpaceGridColumnIDs.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/SpaceGridColumnIDs.java @@ -16,10 +16,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.dto; - /** - * - * * @author Franz-Josef Elmer */ public class SpaceGridColumnIDs diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/TableExportCriteria.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/TableExportCriteria.java index 2dc8f280ddc..85a54aca73f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/TableExportCriteria.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/TableExportCriteria.java @@ -26,8 +26,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SortInfo; /** - * Describes which entities should be exported, in which order and which columns should be present. - * The result of the export is a table with header. + * Describes which entities should be exported, in which order and which columns should be present. The result of the export is a table with header. * * @author Tomasz Pylak */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/exception/UserFailureException.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/exception/UserFailureException.java index 7dac23347c7..e4e301c8d7e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/exception/UserFailureException.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/exception/UserFailureException.java @@ -19,9 +19,8 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.exception; import com.google.gwt.user.client.rpc.IsSerializable; /** - * The <code>UserFailureException</code> is the super class of all exceptions that have their cause - * in an inappropriate usage of the system. This implies that the user himself (without help of an - * administrator) can fix the problem. + * The <code>UserFailureException</code> is the super class of all exceptions that have their cause in an inappropriate usage of the system. This + * implies that the user himself (without help of an administrator) can fix the problem. * * @author Christian Ribeaud */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractClientService.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractClientService.java index 9470b85d0b8..8a3d42ea6c1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractClientService.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractClientService.java @@ -115,7 +115,7 @@ public abstract class AbstractClientService implements IClientService, @Resource(name = ExposablePropertyPlaceholderConfigurer.PROPERTY_CONFIGURER_BEAN_NAME) private ExposablePropertyPlaceholderConfigurer configurer; - + @Autowired private TableDataCache<String, Object> tableDataCache; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractOriginalDataProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractOriginalDataProvider.java index 3f3eb6d8ae5..34445718393 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractOriginalDataProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractOriginalDataProvider.java @@ -37,5 +37,5 @@ abstract class AbstractOriginalDataProvider<T> extends AbstractOriginalDataProvi this.commonServer = commonServer; this.sessionToken = sessionToken; } - + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractOriginalDataProviderWithoutHeaders.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractOriginalDataProviderWithoutHeaders.java index 8c981c62380..f4efa2b7999 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractOriginalDataProviderWithoutHeaders.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractOriginalDataProviderWithoutHeaders.java @@ -24,8 +24,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.server.resultset.IOriginalDat import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelColumnHeader; /** - * Abstract super class of {@link IOriginalDataProvider} implementations which return no - * {@link TableModelColumnHeader} instances. + * Abstract super class of {@link IOriginalDataProvider} implementations which return no {@link TableModelColumnHeader} instances. * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/ClientServiceExceptionTranslatingAdvisor.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/ClientServiceExceptionTranslatingAdvisor.java index 6fa85ff19ac..ff3922da174 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/ClientServiceExceptionTranslatingAdvisor.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/ClientServiceExceptionTranslatingAdvisor.java @@ -28,8 +28,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.IClientService; import ch.systemsx.cisd.openbis.generic.client.web.server.translator.UserFailureExceptionTranslator; /** - * Translates server side {@link ch.systemsx.cisd.common.exceptions.UserFailureException} thrown by - * all {@link IClientService} methods to client side + * Translates server side {@link ch.systemsx.cisd.common.exceptions.UserFailureException} thrown by all {@link IClientService} methods to client side * {@link ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException}. * * @author Piotr Buczek diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientServiceServlet.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientServiceServlet.java index 0c34172be24..3a3a4f04a72 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientServiceServlet.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientServiceServlet.java @@ -28,16 +28,15 @@ import ch.systemsx.cisd.openbis.generic.shared.ResourceNames; /** * The {@link GWTRPCServiceExporter} for the <i>generic</i> service. * <p> - * <i>URL</i> mappings are: <code>/common</code> and <code>/genericopenbis/common</code>. The - * encapsulated {@link ICommonClientService} service implementation is expected to be defined as - * bean with name <code>common-service</code>. + * <i>URL</i> mappings are: <code>/common</code> and <code>/genericopenbis/common</code>. The encapsulated {@link ICommonClientService} service + * implementation is expected to be defined as bean with name <code>common-service</code>. * </p> * * @author Christian Ribeaud */ @Controller @RequestMapping( - { "/common", "/openbis/common" }) +{ "/common", "/openbis/common" }) public final class CommonClientServiceServlet extends GWTRPCServiceExporter { private static final long serialVersionUID = 1L; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/FileTemplateServiceServlet.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/FileTemplateServiceServlet.java index 9ec57441665..ca331a771bf 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/FileTemplateServiceServlet.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/FileTemplateServiceServlet.java @@ -44,29 +44,31 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.Session; */ @Controller @RequestMapping( - { "/template-download", "/openbis/template-download" }) +{ "/template-download", "/openbis/template-download" }) public class FileTemplateServiceServlet extends AbstractFileDownloadServlet -{ - +{ + @Resource(name = ResourceNames.COMMON_SERVICE) private ICommonClientService service; @Resource(name = ComponentNames.SESSION_MANAGER) protected IOpenBisSessionManager sessionManager; - + protected FileTemplateServiceServlet() { setSynchronizeOnSession(true); - setRequireSession(false); // To allow upload a file for usage from an API given a session token we will manage an alternative session validation programatically. + setRequireSession(false); // To allow upload a file for usage from an API given a session token we will manage an alternative session + // validation programatically. } - + protected Session getSession(final String sessionToken) { assert sessionToken != null : "Unspecified session token"; return sessionManager.getSession(sessionToken); } - - protected HttpSession getSession(final HttpServletRequest request) { + + protected HttpSession getSession(final HttpServletRequest request) + { // We must have a session reaching this point. See the constructor where we set HttpSession session = request.getSession(false); String sessionToken = request.getParameter("sessionID"); @@ -81,7 +83,7 @@ public class FileTemplateServiceServlet extends AbstractFileDownloadServlet session.setAttribute(SessionConstants.OPENBIS_SESSION_TOKEN_ATTRIBUTE_KEY, sessionFromToken.getSessionToken()); } } - + // Corner Case - Same session is been used with a different API Token, update the session token since is the same browser. if (session != null && sessionToken != null && !sessionToken.isEmpty()) { @@ -97,7 +99,7 @@ public class FileTemplateServiceServlet extends AbstractFileDownloadServlet } return session; } - + @Override protected FileContent getFileContent(final HttpServletRequest request) throws Exception { @@ -106,7 +108,7 @@ public class FileTemplateServiceServlet extends AbstractFileDownloadServlet { throw new HttpSessionRequiredException("Pre-existing session required but none found"); } - + final String kind = request.getParameter(GenericConstants.ENTITY_KIND_KEY_PARAMETER); final String type = request.getParameter(GenericConstants.ENTITY_TYPE_KEY_PARAMETER); final String autoGenerate = request.getParameter(GenericConstants.AUTO_GENERATE); @@ -117,7 +119,7 @@ public class FileTemplateServiceServlet extends AbstractFileDownloadServlet : false; String withSapceParameter = request.getParameter(GenericConstants.WITH_SPACE); boolean withSpace = withSapceParameter == null || Boolean.parseBoolean(withSapceParameter); - + final String operationKindParameter = request.getParameter(GenericConstants.BATCH_OPERATION_KIND); final BatchOperationKind operationKind = BatchOperationKind.valueOf(operationKindParameter); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/HelpRedirectServlet.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/HelpRedirectServlet.java index 1667cbb0e63..86f22571ef7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/HelpRedirectServlet.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/HelpRedirectServlet.java @@ -31,15 +31,14 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericCon import ch.systemsx.cisd.openbis.generic.shared.ResourceNames; /** - * Takes a help page identifier (i.e., the context for the help request) and redirects to the - * appropriate page for that identifier. + * Takes a help page identifier (i.e., the context for the help request) and redirects to the appropriate page for that identifier. * * @author Chandrasekhar Ramakrishnan * @author Piotr Buczek */ @Controller @RequestMapping( - { "/help", "/openbis/help" }) +{ "/help", "/openbis/help" }) public class HelpRedirectServlet extends AbstractController { @@ -63,8 +62,7 @@ public class HelpRedirectServlet extends AbstractController } /** - * Write an HTTP redirect to the help page identified by the request parameters into the - * response. + * Write an HTTP redirect to the help page identified by the request parameters into the response. */ @Override protected ModelAndView handleRequestInternal(HttpServletRequest request, @@ -129,8 +127,8 @@ public class HelpRedirectServlet extends AbstractController } /** - * Construct the portion of the URL that identifies a particular help page from the request. The - * parameter {@link GenericConstants#HELP_REDIRECT_PAGE_TITLE_KEY} is used to do this. + * Construct the portion of the URL that identifies a particular help page from the request. The parameter + * {@link GenericConstants#HELP_REDIRECT_PAGE_TITLE_KEY} is used to do this. */ String tryGetHelpPageTitleForRequest(HttpServletRequest request) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/IBasicTableDataProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/IBasicTableDataProvider.java index 05fcb94ed1f..9b7eb58459c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/IBasicTableDataProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/IBasicTableDataProvider.java @@ -19,8 +19,6 @@ package ch.systemsx.cisd.openbis.generic.client.web.server; import java.util.List; /** - * - * * @author Franz-Josef Elmer */ public interface IBasicTableDataProvider @@ -32,8 +30,7 @@ public interface IBasicTableDataProvider public List<List<? extends Comparable<?>>> getRows(); /** - * Returns a list of column titles. The order is the same as the order of row values returned - * by {@link #getRows()}. + * Returns a list of column titles. The order is the same as the order of row values returned by {@link #getRows()}. */ public List<String> getAllColumnTitles(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/StringHtmlEscapingPointcutAdvisor.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/StringHtmlEscapingPointcutAdvisor.java index 5557e14444c..189f22a249b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/StringHtmlEscapingPointcutAdvisor.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/StringHtmlEscapingPointcutAdvisor.java @@ -33,11 +33,10 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.IClientService; import ch.systemsx.cisd.openbis.generic.shared.basic.annotation.DoNotEscape; /** - * The advisor for automatically escaping HTML strings in the values returned by implementations of - * {@link IClientService}. + * The advisor for automatically escaping HTML strings in the values returned by implementations of {@link IClientService}. * <p> - * Though it is not necessary to subclass DefaultPointcutAdvisor for the implementation, we subclass - * here to make the configuration in spring a bit simpler. + * Though it is not necessary to subclass DefaultPointcutAdvisor for the implementation, we subclass here to make the configuration in spring a bit + * simpler. * * @author Chandrasekhar Ramakrishnan */ @@ -102,8 +101,7 @@ public class StringHtmlEscapingPointcutAdvisor extends DefaultPointcutAdvisor MethodInterceptor { /** - * Get the session token and any guarded parameters and invoke the guards on those - * parameters. + * Get the session token and any guarded parameters and invoke the guards on those parameters. */ @Override public Object invoke(MethodInvocation methodInvocation) throws Throwable diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/calculator/ColumnDefinition.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/calculator/ColumnDefinition.java index 67d79c522f8..a060fb63fab 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/calculator/ColumnDefinition.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/calculator/ColumnDefinition.java @@ -16,10 +16,8 @@ package ch.systemsx.cisd.openbis.generic.client.web.server.calculator; - - /** - * Definition of column used in jython. + * Definition of column used in jython. * <p> * All public methods of this class are part of the Filter/Calculated Column API. * @@ -28,6 +26,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.server.calculator; public class ColumnDefinition { private final String columnID; + private final ITableDataProvider provider; ColumnDefinition(String columnID, ITableDataProvider provider) @@ -35,7 +34,7 @@ public class ColumnDefinition this.columnID = columnID; this.provider = provider; } - + /** * Returns the ID of the column. */ @@ -43,7 +42,7 @@ public class ColumnDefinition { return columnID; } - + /** * Returns the value of property specified by the key. * diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/calculator/ColumnGroup.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/calculator/ColumnGroup.java index ace12284762..520665569c5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/calculator/ColumnGroup.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/calculator/ColumnGroup.java @@ -29,14 +29,15 @@ import java.util.List; public class ColumnGroup { private final String propertyValue; + private final List<Object> values; - + ColumnGroup(String propertyValue, List<Object> values) { this.propertyValue = propertyValue; this.values = Collections.unmodifiableList(values); } - + /** * Returns the property value of this group. */ @@ -52,5 +53,5 @@ public class ColumnGroup { return values; } - + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/calculator/GridExpressionUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/calculator/GridExpressionUtils.java index f0492c262a7..7aa4a54f115 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/calculator/GridExpressionUtils.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/calculator/GridExpressionUtils.java @@ -62,8 +62,7 @@ public class GridExpressionUtils private static final String COLUMN_EVALUATION_ERROR_LONG = "Error: (%s)."; /** - * Applies the filter described by <code>customFilterInfo</code> to - * all rows and returns indices of all rows passing the filter. + * Applies the filter described by <code>customFilterInfo</code> to all rows and returns indices of all rows passing the filter. * * @param dataProvider Provider of data and meta-data */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/calculator/ITableDataProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/calculator/ITableDataProvider.java index 21fc9f91d17..f0c4f0b61df 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/calculator/ITableDataProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/calculator/ITableDataProvider.java @@ -21,7 +21,6 @@ import java.util.List; import ch.systemsx.cisd.openbis.generic.client.web.server.IBasicTableDataProvider; - /** * Interface to access table data and meta data. Used by calculator classes. * @@ -40,11 +39,10 @@ public interface ITableDataProvider extends IBasicTableDataProvider * Returns a collection of the identifiers of all columns. */ public Collection<String> getAllColumnIDs(); - + /** * Returns the property of specified key for specified column. */ public String tryToGetProperty(String columnID, String key); - } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/queue/ConsumerQueue.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/queue/ConsumerQueue.java index fd697cbb3d8..a6ec0e6ef46 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/queue/ConsumerQueue.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/queue/ConsumerQueue.java @@ -18,103 +18,126 @@ import org.apache.log4j.Logger; */ public final class ConsumerQueue { - public ConsumerQueue(MailClientParameters mailClientParameters) { + public ConsumerQueue(MailClientParameters mailClientParameters) + { this.mailClientParameters = mailClientParameters; } - - public final synchronized void addTaskAsLast(ConsumerTask task) { + + public final synchronized void addTaskAsLast(ConsumerTask task) + { consumerQueue.addLast(task); } - - private final synchronized ConsumerTask getNextTask() { + + private final synchronized ConsumerTask getNextTask() + { return consumerQueue.pollFirst(); } - + private final Deque<ConsumerTask> consumerQueue = new LinkedList<ConsumerTask>(); + private final Logger operationLog = LogFactory.getLogger(LogCategory.OPERATION, ConsumerQueue.class); + private final MailClientParameters mailClientParameters; - + // Consumer Thread -// { -// Thread consumerThread = new Thread() { -// -// @Override -// public void run() { -// while(true) { -// StringWriter writer = new StringWriter(); -// boolean success = true; -// Date startDate = new Date(); -// ConsumerTask consumerTask = null; -// try { -// consumerTask = getNextTask(); -// if(consumerTask != null) { -// success = consumerTask.doAction(writer); -// } else { -// Thread.sleep(1000 * 5); -// } -// } catch(Throwable anyError) { -// operationLog.error("Asynchronous action '" + consumerTask.getName() + "' failed. ", anyError); -// success = false; -// } finally { -// if(consumerTask != null) { -// try { -// final IMailClient mailClient = new MailClient(mailClientParameters); -// sendEmail(mailClient, writer.toString(), getSubject(consumerTask.getName(), startDate, success), consumerTask.getUserEmail()); -// } catch(Throwable anyErrorOnMail) { -// operationLog.error("Could not send email about asynchronous action '" + consumerTask.getName() + "' result. ", anyErrorOnMail); -// } -// } -// } -// } -// } -// }; -// consumerThread.start(); -// } - + // { + // Thread consumerThread = new Thread() { + // + // @Override + // public void run() { + // while(true) { + // StringWriter writer = new StringWriter(); + // boolean success = true; + // Date startDate = new Date(); + // ConsumerTask consumerTask = null; + // try { + // consumerTask = getNextTask(); + // if(consumerTask != null) { + // success = consumerTask.doAction(writer); + // } else { + // Thread.sleep(1000 * 5); + // } + // } catch(Throwable anyError) { + // operationLog.error("Asynchronous action '" + consumerTask.getName() + "' failed. ", anyError); + // success = false; + // } finally { + // if(consumerTask != null) { + // try { + // final IMailClient mailClient = new MailClient(mailClientParameters); + // sendEmail(mailClient, writer.toString(), getSubject(consumerTask.getName(), startDate, success), consumerTask.getUserEmail()); + // } catch(Throwable anyErrorOnMail) { + // operationLog.error("Could not send email about asynchronous action '" + consumerTask.getName() + "' result. ", anyErrorOnMail); + // } + // } + // } + // } + // } + // }; + // consumerThread.start(); + // } + { - Thread consumerThread = new Thread() { - @Override - public void run() { - while(true) { - final ConsumerTask consumerTask = getNextTask(); - try { - if(consumerTask != null) { - Thread thread = new Thread() { - @Override - public void run() { - boolean success = true; - StringWriter writer = new StringWriter(); - Date startDate = new Date(); - try { - consumerTask.doAction(writer); - } catch(Throwable anyError) { - operationLog.error("Asynchronous action '" + consumerTask.getName() + "' failed. ", anyError); - success = false; - } finally { - if(consumerTask != null) { - try { - final IMailClient mailClient = new MailClient(mailClientParameters); - sendEmail(mailClient, writer.toString(), getSubject(consumerTask.getName(), startDate, success), consumerTask.getUserEmail()); - } catch(Throwable anyErrorOnMail) { - operationLog.error("Could not send email about asynchronous action '" + consumerTask.getName() + "' result. ", anyErrorOnMail); - } - } - } + Thread consumerThread = new Thread() + { + @Override + public void run() + { + while (true) + { + final ConsumerTask consumerTask = getNextTask(); + try + { + if (consumerTask != null) + { + Thread thread = new Thread() + { + @Override + public void run() + { + boolean success = true; + StringWriter writer = new StringWriter(); + Date startDate = new Date(); + try + { + consumerTask.doAction(writer); + } catch (Throwable anyError) + { + operationLog.error("Asynchronous action '" + consumerTask.getName() + "' failed. ", anyError); + success = false; + } finally + { + if (consumerTask != null) + { + try + { + final IMailClient mailClient = new MailClient(mailClientParameters); + sendEmail(mailClient, writer.toString(), + getSubject(consumerTask.getName(), startDate, success), consumerTask.getUserEmail()); + } catch (Throwable anyErrorOnMail) + { + operationLog.error( + "Could not send email about asynchronous action '" + consumerTask.getName() + + "' result. ", anyErrorOnMail); + } + } + } + } + }; + thread.start(); + } else + { + Thread.sleep(1000 * 5); } - }; - thread.start(); - } else { - Thread.sleep(1000 * 5); + } catch (Throwable anyError) + { + operationLog.error("Asynchronous action '" + consumerTask.getName() + "' failed. ", anyError); + } } - } catch(Throwable anyError) { - operationLog.error("Asynchronous action '" + consumerTask.getName() + "' failed. ", anyError); } - } - } - }; + }; consumerThread.start(); } - + // // Mail management // @@ -135,4 +158,3 @@ public final class ConsumerQueue return subject + " (initiated at " + startDate + ")"; } } - diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/queue/ConsumerTask.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/queue/ConsumerTask.java index e5c95d0229a..c8a4760dd47 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/queue/ConsumerTask.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/queue/ConsumerTask.java @@ -9,19 +9,23 @@ import ch.systemsx.cisd.openbis.generic.client.web.server.UploadedFilesBean; public abstract class ConsumerTask { private UploadedFilesBean filesForTask; - + public abstract String getName(); + public abstract String getUserEmail(); + public abstract void doActionOrThrowException(Writer writer); - - public ConsumerTask(UploadedFilesBean filesForTask) throws ch.systemsx.cisd.common.exceptions.UserFailureException { + + public ConsumerTask(UploadedFilesBean filesForTask) throws ch.systemsx.cisd.common.exceptions.UserFailureException + { this.filesForTask = filesForTask; } - - protected UploadedFilesBean getFilesForTask() { + + protected UploadedFilesBean getFilesForTask() + { return filesForTask; } - + public boolean doAction(Writer messageWriter) { try @@ -40,10 +44,11 @@ public abstract class ConsumerTask + " when trying to throw exception: " + ex.getMessage(), ex); } throw ex; - } finally { + } finally + { filesForTask.deleteTransferredFiles(); } return true; } - + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/AbstractCommonTableModelProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/AbstractCommonTableModelProvider.java index 7d5940bf470..bb018495b02 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/AbstractCommonTableModelProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/AbstractCommonTableModelProvider.java @@ -21,8 +21,7 @@ import java.io.Serializable; import ch.systemsx.cisd.openbis.generic.shared.ICommonServer; /** - * Superclass of {@link ITableModelProvider} which creates the table model lazily by using - * {@link ICommonServer}. + * Superclass of {@link ITableModelProvider} which creates the table model lazily by using {@link ICommonServer}. * * @author Franz-Josef Elmer */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/AbstractExternalDataProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/AbstractExternalDataProvider.java index a90d40a9db7..99f2e5bdbd6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/AbstractExternalDataProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/AbstractExternalDataProvider.java @@ -228,7 +228,7 @@ public abstract class AbstractExternalDataProvider extends } return builder.getModel(); } - + private TableMap<String, DataSetType> getDataSetTypes() { List<DataSetType> dataSetTypes = commonServer.listDataSetTypes(sessionToken); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/AbstractTableModelProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/AbstractTableModelProvider.java index 83695cc7956..61562923638 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/AbstractTableModelProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/AbstractTableModelProvider.java @@ -29,8 +29,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRowWithObject import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TypedTableModel; /** - * Superclass of {@link ITableModelProvider} implementations which creates the actual table model - * lazily. + * Superclass of {@link ITableModelProvider} implementations which creates the actual table model lazily. * * @author Franz-Josef Elmer */ @@ -40,8 +39,8 @@ public abstract class AbstractTableModelProvider<T extends Serializable> impleme private TypedTableModel<T> tableModel = null; /** - * Creates the table model with the specified maximum number of rows. If - * {@link Integer#MAX_VALUE} is specified the complete table will be created. + * Creates the table model with the specified maximum number of rows. If {@link Integer#MAX_VALUE} is specified the complete table will be + * created. */ @Override public TypedTableModel<T> getTableModel(int maxSize) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/ColumnSortUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/ColumnSortUtils.java index fabdda2e8b1..1b92473a5bb 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/ColumnSortUtils.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/ColumnSortUtils.java @@ -83,7 +83,7 @@ class ColumnSortUtils } @SuppressWarnings( - { "rawtypes", "unchecked" }) + { "rawtypes", "unchecked" }) protected int compare(Comparable v1, Comparable v2) { return v1.compareTo(v2); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/IColumnCalculator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/IColumnCalculator.java index 5fe3d6a0b7c..f688292c96e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/IColumnCalculator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/IColumnCalculator.java @@ -26,9 +26,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.GridCustomColumn; interface IColumnCalculator { /** - * Calculates the values of the specified custom column definition by using specified data - * and specified column definitions. In case of an error the column value is an error - * message. + * Calculates the values of the specified custom column definition by using specified data and specified column definitions. In case of an error + * the column value is an error message. * * @param errorMessagesAreLong if <code>true</code> a long error message will be created. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/IOriginalDataProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/IOriginalDataProvider.java index c12bbcd1eea..72a70dd6f71 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/IOriginalDataProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/IOriginalDataProvider.java @@ -30,11 +30,10 @@ public interface IOriginalDataProvider<T> { /** - * Gets the original data limited by specified number of items. All data is returned if the - * argument is {@link Integer#MAX_VALUE}. + * Gets the original data limited by specified number of items. All data is returned if the argument is {@link Integer#MAX_VALUE}. */ public List<T> getOriginalData(int maxSize) throws UserFailureException; - + /** * Returns headers if known, otherwise an empty list is returned. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/IResultSet.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/IResultSet.java index 006521a6b4b..09e39fcba83 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/IResultSet.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/IResultSet.java @@ -47,8 +47,7 @@ public interface IResultSet<K, T> public int getTotalLength(); /** - * Returns <code>true</code> if this result set is not complete. Note, that - * {@link #getTotalLength()} is meaningless if this is the case. + * Returns <code>true</code> if this result set is not complete. Note, that {@link #getTotalLength()} is meaningless if this is the case. */ public boolean isPartial(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/IResultSetManager.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/IResultSetManager.java index 82cbcbfafdb..4d4c9eaa3a8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/IResultSetManager.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/IResultSetManager.java @@ -28,11 +28,10 @@ public interface IResultSetManager<K> { /** - * Produces a {@link IResultSet} from given <var>resultConfig</var> and given - * <var>dataProvider</var>. + * Produces a {@link IResultSet} from given <var>resultConfig</var> and given <var>dataProvider</var>. * <p> - * In case of cached data, the {@link IOriginalDataProvider} implementation is only used in the - * first call, when the full data are not already there. + * In case of cached data, the {@link IOriginalDataProvider} implementation is only used in the first call, when the full data are not already + * there. * </p> */ public <T> IResultSet<K, T> getResultSet(final String sessionToken, @@ -45,10 +44,8 @@ public interface IResultSetManager<K> public void removeResultSet(final K resultSetKey) throws UserFailureException; /** - * Locks specified result set. Lock will be released after invocation of - * {@link #removeResultSet(Object)} and after reloading of the result set. - * {@link #getResultSet(String, IResultSetConfig, IOriginalDataProvider)} waits until lock is - * released. + * Locks specified result set. Lock will be released after invocation of {@link #removeResultSet(Object)} and after reloading of the result set. + * {@link #getResultSet(String, IResultSetConfig, IOriginalDataProvider)} waits until lock is released. */ public void lockResultSet(K resultSetKey); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/ITableModelProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/ITableModelProvider.java index d61df720188..48592c8787a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/ITableModelProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/ITableModelProvider.java @@ -28,8 +28,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TypedTableModel; public interface ITableModelProvider<T extends Serializable> { /** - * Returns the table model limited as specified. For {@link Integer#MAX_VALUE} the full table - * model is returned. + * Returns the table model limited as specified. For {@link Integer#MAX_VALUE} the full table model is returned. */ public TypedTableModel<T> getTableModel(int maxSize); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/TableData.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/TableData.java index f0d6c504d09..95605d8652a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/TableData.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/TableData.java @@ -48,7 +48,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRowWithObject class TableData<K, T> { private final K dataKey; - + private final List<T> originalData; @IgnoreSizeOf diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/TableDataCache.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/TableDataCache.java index b7f3ffdd7fd..186848f7191 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/TableDataCache.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/TableDataCache.java @@ -26,8 +26,6 @@ import org.springframework.stereotype.Component; import ch.systemsx.cisd.openbis.generic.shared.util.RuntimeCache; /** - * - * * @author Franz-Josef Elmer */ @Component @@ -40,18 +38,18 @@ public class TableDataCache<K, T> @Autowired private CacheManager cacheManager; - + private RuntimeCache<K, T> runtimeCache; - + public TableDataCache() { } - + public TableDataCache(CacheManager cacheManager) { this.cacheManager = cacheManager; } - + public T getTableData(K key) { return runtimeCache.get(key); @@ -61,7 +59,7 @@ public class TableDataCache<K, T> { runtimeCache.put(key, table); } - + public boolean removeTableData(K key) { return runtimeCache.remove(key); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/translator/SearchableEntityTranslator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/translator/SearchableEntityTranslator.java index 140565b2820..f68f06bb201 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/translator/SearchableEntityTranslator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/translator/SearchableEntityTranslator.java @@ -19,8 +19,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.server.translator; import ch.systemsx.cisd.openbis.generic.shared.dto.SearchableEntity; /** - * A {@link SearchableEntity} <---> - * {@link ch.systemsx.cisd.openbis.generic.client.web.client.dto.SearchableEntity} translator. + * A {@link SearchableEntity} <---> {@link ch.systemsx.cisd.openbis.generic.client.web.client.dto.SearchableEntity} translator. * * @author Christian Ribeaud */ @@ -43,7 +42,7 @@ public final class SearchableEntityTranslator } else { matchingEntities = new SearchableEntity[] - { SearchableEntity.valueOf(searchableEntityOrNull.getName()) }; + { SearchableEntity.valueOf(searchableEntityOrNull.getName()) }; } return matchingEntities; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/translator/UserFailureExceptionTranslator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/translator/UserFailureExceptionTranslator.java index ae9e8566478..cfaa736e8df 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/translator/UserFailureExceptionTranslator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/translator/UserFailureExceptionTranslator.java @@ -23,8 +23,7 @@ import ch.systemsx.cisd.common.reflection.ClassUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; /** - * Translator of server side {@link ch.systemsx.cisd.common.exceptions.UserFailureException} into - * GWT compatible {@link UserFailureException}. + * Translator of server side {@link ch.systemsx.cisd.common.exceptions.UserFailureException} into GWT compatible {@link UserFailureException}. * * @author Franz-Josef Elmer */ @@ -44,9 +43,8 @@ public class UserFailureExceptionTranslator } /** - * Converts any {@link ch.systemsx.cisd.common.exceptions.UserFailureException} or subclass of - * it to a <i>GWT</i> {@link UserFailureException} (or subclass of it if this one could be found - * in the same package). + * Converts any {@link ch.systemsx.cisd.common.exceptions.UserFailureException} or subclass of it to a <i>GWT</i> {@link UserFailureException} (or + * subclass of it if this one could be found in the same package). */ public static UserFailureException translate( ch.systemsx.cisd.common.exceptions.UserFailureException exception) @@ -55,9 +53,8 @@ public class UserFailureExceptionTranslator } /** - * Converts any {@link ch.systemsx.cisd.common.exceptions.UserFailureException} or subclass of - * it to a <i>GWT</i> {@link UserFailureException} (or subclass of it if this one could be found - * in the same package) using specified message as the main message and message in the original + * Converts any {@link ch.systemsx.cisd.common.exceptions.UserFailureException} or subclass of it to a <i>GWT</i> {@link UserFailureException} (or + * subclass of it if this one could be found in the same package) using specified message as the main message and message in the original * exception as the detail message. */ public static UserFailureException translate( diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/HttpUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/HttpUtils.java index a4878b05a99..34e3113f566 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/HttpUtils.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/HttpUtils.java @@ -18,7 +18,6 @@ package ch.systemsx.cisd.openbis.generic.client.web.server.util; import javax.servlet.http.HttpServletRequest; - /** * Some utilities around <i>Http</i>. * diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/OSKind.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/OSKind.java index 8eecb25e0d5..dd358ef5e90 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/OSKind.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/OSKind.java @@ -19,13 +19,12 @@ package ch.systemsx.cisd.openbis.generic.client.web.server.util; /** * Enum holding OS specific attributes like line separator etc. * - * * @author Franz-Josef Elmer */ public enum OSKind { MAC("\n"), WINDOWS("\r\n"), UNIX("\n"), OTHER("\n"); - + private final String lineSeparator; private OSKind(String lineSeparator) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/TSVRenderer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/TSVRenderer.java index 40bd940a010..79dd293700f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/TSVRenderer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/TSVRenderer.java @@ -77,8 +77,7 @@ public class TSVRenderer } /** - * @return <var>value</var> with white-spaces cleaned in the same way that HTML works (all - * contiguous white-spaces are replaced with single space) + * @return <var>value</var> with white-spaces cleaned in the same way that HTML works (all contiguous white-spaces are replaced with single space) */ private String cleanWhitespaces(String value) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/XMLPropertyTransformer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/XMLPropertyTransformer.java index 34277e262a6..6af9f6e7356 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/XMLPropertyTransformer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/util/XMLPropertyTransformer.java @@ -65,5 +65,5 @@ public class XMLPropertyTransformer } } } - + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/AbstractCommonServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/AbstractCommonServer.java index c2eb43f0f24..74894428022 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/AbstractCommonServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/AbstractCommonServer.java @@ -52,7 +52,7 @@ abstract class AbstractCommonServer<T extends IServer> extends AbstractServer<T> private final IAuthenticationService authenticationService; protected final ICommonBusinessObjectFactory businessObjectFactory; - + public AbstractCommonServer(IAuthenticationService authenticationService, IOpenBisSessionManager sessionManager, IDAOFactory daoFactory, IPropertiesBatchManager propertiesBatchManager, @@ -62,7 +62,7 @@ abstract class AbstractCommonServer<T extends IServer> extends AbstractServer<T> this.authenticationService = authenticationService; this.businessObjectFactory = businessObjectFactory; } - + protected List<PersonPE> registerPersons(final String sessionToken, final List<String> userIDs) { final Session session = getSession(sessionToken); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/AbstractServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/AbstractServer.java index 8bc42d071cf..4c68ec20e17 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/AbstractServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/AbstractServer.java @@ -464,7 +464,7 @@ public abstract class AbstractServer<T> extends AbstractServiceWithLogger<T> imp if (DefaultSessionManager.NO_LOGIN_FILE.exists()) { throw new UserFailureException("Login is disabled by the administrator."); - } + } return tryToAuthenticate(sessionManager.tryToOpenSession(user, password)); } @@ -1023,7 +1023,7 @@ public abstract class AbstractServer<T> extends AbstractServiceWithLogger<T> imp { return subject + " (initiated at " + startDate + ")"; } - + static boolean isResolved(String name) { return StringUtils.isNotBlank(name) && name.startsWith("${") == false; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CacheFilter.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CacheFilter.java index b32608ce913..4607a18fb72 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CacheFilter.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CacheFilter.java @@ -33,9 +33,8 @@ import ch.systemsx.cisd.openbis.generic.shared.util.HttpRequestUtils; * A {@link Filter} implementing the a simple caching policy that * <ul> * <li>Instructs browsers and proxies not to cache resources having '.nocache' in their URLs</li> - * <li>Sets the correct caching HTTP headers for all other resources (i.e. the ones without - * '.nocache.' in their names). As a result, static resources such as images stay in cache for a - * long time.</li> + * <li>Sets the correct caching HTTP headers for all other resources (i.e. the ones without '.nocache.' in their names). As a result, static resources + * such as images stay in cache for a long time.</li> * </ul> * * @author Piotr Buczek diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServer.java index 15a389b0e4d..ca5888ecdc2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServer.java @@ -249,7 +249,7 @@ import ch.systemsx.cisd.openbis.generic.shared.util.EntityHelper; import ch.systemsx.cisd.openbis.generic.shared.util.HibernateUtils; import ch.systemsx.cisd.openbis.generic.shared.util.RelationshipUtils; -public final class CommonServer extends AbstractCommonServer<ICommonServerForInternalUse>implements +public final class CommonServer extends AbstractCommonServer<ICommonServerForInternalUse> implements ICommonServerForInternalUse { private final LastModificationState lastModificationState; @@ -401,7 +401,7 @@ public final class CommonServer extends AbstractCommonServer<ICommonServerForInt @Capability("UPDATE_SPACE") public void updateSpace(final String sessionToken, @AuthorizationGuard(guardClass = SpaceUpdatesPredicate.class) - final ISpaceUpdates updates) + final ISpaceUpdates updates) { assert sessionToken != null : "Unspecified session token"; assert updates != null : "Unspecified updates"; @@ -617,7 +617,7 @@ public final class CommonServer extends AbstractCommonServer<ICommonServerForInt @ReturnValueFilter(validatorClass = SampleValidator.class) public List<Sample> listSamples(final String sessionToken, @AuthorizationGuard(guardClass = ListSampleCriteriaPredicate.class) - final ListSampleCriteria criteria) + final ListSampleCriteria criteria) { final Session session = getSession(sessionToken); final ISampleLister sampleLister = businessObjectFactory.createSampleLister(session); @@ -658,7 +658,7 @@ public final class CommonServer extends AbstractCommonServer<ICommonServerForInt @ReturnValueFilter(validatorClass = SampleValidator.class) public List<Sample> listSamplesOnBehalfOfUser(final String sessionToken, @AuthorizationGuard(guardClass = ListSampleCriteriaPredicate.class) - final ListSampleCriteria criteria, String userId) + final ListSampleCriteria criteria, String userId) { final Session session = getSession(sessionToken); @@ -701,7 +701,7 @@ public final class CommonServer extends AbstractCommonServer<ICommonServerForInt @ReturnValueFilter(validatorClass = ExternalDataValidator.class) public List<AbstractExternalData> listSampleExternalData(final String sessionToken, @AuthorizationGuard(guardClass = SampleTechIdPredicate.class) - final TechId sampleId, final boolean showOnlyDirectlyConnected) + final TechId sampleId, final boolean showOnlyDirectlyConnected) { final Session session = getSession(sessionToken); final IDatasetLister datasetLister = createDatasetLister(session); @@ -716,7 +716,7 @@ public final class CommonServer extends AbstractCommonServer<ICommonServerForInt @ReturnValueFilter(validatorClass = ExternalDataValidator.class) public List<AbstractExternalData> listExperimentExternalData(final String sessionToken, @AuthorizationGuard(guardClass = ExperimentTechIdPredicate.class) - final TechId experimentId, boolean showOnlyDirectlyConnected) + final TechId experimentId, boolean showOnlyDirectlyConnected) { final Session session = getSession(sessionToken); final IDatasetLister datasetLister = createDatasetLister(session); @@ -760,7 +760,7 @@ public final class CommonServer extends AbstractCommonServer<ICommonServerForInt @ReturnValueFilter(validatorClass = ExternalDataValidator.class) public List<AbstractExternalData> listDataSetRelationships(final String sessionToken, @AuthorizationGuard(guardClass = DataSetTechIdPredicate.class) - final TechId datasetId, final DataSetRelationshipRole role) + final TechId datasetId, final DataSetRelationshipRole role) { final Session session = getSession(sessionToken); final IDatasetLister datasetLister = createDatasetLister(session); @@ -1575,7 +1575,8 @@ public final class CommonServer extends AbstractCommonServer<ICommonServerForInt @RolesAllowed(RoleWithHierarchy.SPACE_POWER_USER) @Capability("REGISTER_PROJECT") public void registerProject(String sessionToken, - @AuthorizationGuard(guardClass = SpaceIdentifierPredicate.class) ProjectIdentifier projectIdentifier, String description, String leaderId, + @AuthorizationGuard(guardClass = SpaceIdentifierPredicate.class) ProjectIdentifier projectIdentifier, String description, + String leaderId, Collection<NewAttachment> attachments) { final Session session = getSession(sessionToken); @@ -2394,7 +2395,7 @@ public final class CommonServer extends AbstractCommonServer<ICommonServerForInt @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) public SampleParentWithDerived getSampleInfo(final String sessionToken, @AuthorizationGuard(guardClass = SampleTechIdPredicate.class) - final TechId sampleId) throws UserFailureException + final TechId sampleId) throws UserFailureException { assert sessionToken != null : "Unspecified session token."; assert sampleId != null : "Unspecified sample techId."; @@ -2410,7 +2411,7 @@ public final class CommonServer extends AbstractCommonServer<ICommonServerForInt session.tryGetPerson(), sample); return SampleTranslator.translate(getSampleTypeSlaveServerPlugin(sample.getSampleType()) .getSampleInfo(session, sample), session.getBaseIndexURL(), MetaprojectTranslator - .translate(metaprojectPEs), + .translate(metaprojectPEs), managedPropertyEvaluatorFactory); } @@ -3882,7 +3883,7 @@ public final class CommonServer extends AbstractCommonServer<ICommonServerForInt @Capability("RESTORE") public void revertDeletions(final String sessionToken, @AuthorizationGuard(guardClass = RevertDeletionPredicate.class) - final List<TechId> deletionIds) + final List<TechId> deletionIds) { final Session session = getSession(sessionToken); @@ -3936,7 +3937,7 @@ public final class CommonServer extends AbstractCommonServer<ICommonServerForInt @Capability("PURGE") public void deletePermanently(final String sessionToken, @AuthorizationGuard(guardClass = DeletionTechIdCollectionPredicate.class) - final List<TechId> deletionIds) + final List<TechId> deletionIds) { deletePermanentlyCommon(sessionToken, deletionIds, false); } @@ -3946,7 +3947,7 @@ public final class CommonServer extends AbstractCommonServer<ICommonServerForInt @Capability("FORCE_PURGE") public void deletePermanentlyForced(final String sessionToken, @AuthorizationGuard(guardClass = DeletionTechIdCollectionPredicate.class) - final List<TechId> deletionIds) + final List<TechId> deletionIds) { deletePermanentlyCommon(sessionToken, deletionIds, true); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServiceProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServiceProvider.java index 1e16d310250..b311ae93581 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServiceProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServiceProvider.java @@ -65,7 +65,7 @@ public class CommonServiceProvider .getBean(ResourceNames.MAIL_CLIENT_PARAMETERS); return new MailClient(mailClientParameters); } - + public static IApplicationServerApi getApplicationServerApi() { return (IApplicationServerApi) applicationContext.getBean(ApplicationServerApi.INTERNAL_SERVICE_NAME); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServiceServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServiceServer.java index 40bc85a25a8..398711b1aa3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServiceServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServiceServer.java @@ -48,10 +48,11 @@ public class CommonServiceServer extends WhiteAndBlackListHttpInvokerServiceExpo } @RequestMapping( - { "/rmi-common", "/openbis/rmi-common" }) + { "/rmi-common", "/openbis/rmi-common" }) @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/ETLEntityOperationChecker.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ETLEntityOperationChecker.java index 45164afcfed..7ae17b85021 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ETLEntityOperationChecker.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ETLEntityOperationChecker.java @@ -66,8 +66,7 @@ public class ETLEntityOperationChecker implements IETLEntityOperationChecker @Override public void assertProjectUpdateAllowed(IAuthSession session, - @AuthorizationGuard(guardClass = ProjectUpdatesPredicate.class) - List<ProjectUpdatesDTO> projectsToUpdate) + @AuthorizationGuard(guardClass = ProjectUpdatesPredicate.class) List<ProjectUpdatesDTO> projectsToUpdate) { } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ETLServiceServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ETLServiceServer.java index f7636842eeb..8703f60cb6b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ETLServiceServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ETLServiceServer.java @@ -49,7 +49,7 @@ public class ETLServiceServer extends WhiteAndBlackListHttpInvokerServiceExporte setServiceInterface(IServiceForDataStoreServer.class); setService(etlService); setInterceptors(new Object[] - { createExceptionTranslator() }); + { createExceptionTranslator() }); super.afterPropertiesSet(); } @@ -63,10 +63,11 @@ public class ETLServiceServer extends WhiteAndBlackListHttpInvokerServiceExporte return exceptionTranslator; } - @RequestMapping({ "/rmi-etl", "/openbis/rmi-etl", "/openbis/openbis/rmi-etl" }) + @RequestMapping({ "/rmi-etl", "/openbis/rmi-etl", "/openbis/openbis/rmi-etl" }) @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/GenericHttpSessionListener.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/GenericHttpSessionListener.java index 84a934bd283..7368370cd78 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/GenericHttpSessionListener.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/GenericHttpSessionListener.java @@ -32,11 +32,9 @@ import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.dto.Session; /** - * Implements {@link HttpSessionListener} and allows to perform chosen actions when session is being - * created or destroyed. + * Implements {@link HttpSessionListener} and allows to perform chosen actions when session is being created or destroyed. * <p> - * This ensures that the corresponding {@link Session} gets removed when a {@link HttpSession} gets - * destroyed. + * This ensures that the corresponding {@link Session} gets removed when a {@link HttpSession} gets destroyed. * </p> * * @author Izabela Adamczyk diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ICommonServerForInternalUse.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ICommonServerForInternalUse.java index 3482544a391..974fd8c84a0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ICommonServerForInternalUse.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ICommonServerForInternalUse.java @@ -37,16 +37,14 @@ public interface ICommonServerForInternalUse extends ICommonServer public SessionContextDTO tryToAuthenticateAsSystem(); /** - * Registers a core plugin. The operation has no effect if the plugin is already deployed on the - * openBIS AS. + * Registers a core plugin. The operation has no effect if the plugin is already deployed on the openBIS AS. */ @Transactional(readOnly = false) public void registerPlugin(String sessionToken, CorePlugin plugin, ICorePluginResourceLoader pluginLoader); /** - * Lists all DSS server registered this openBIS server instance. Any of the returned instances - * could be offline at the time of the listing. + * Lists all DSS server registered this openBIS server instance. Any of the returned instances could be offline at the time of the listing. */ @Transactional public List<DataStore> listDataStores(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/IDataStoreServiceRegistrator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/IDataStoreServiceRegistrator.java index 809d2671031..09b793df7aa 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/IDataStoreServiceRegistrator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/IDataStoreServiceRegistrator.java @@ -28,15 +28,14 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.DatastoreServiceDescriptions; public interface IDataStoreServiceRegistrator { /** - * Registers for the specified data store all reporting/processing plugins specified in the - * service descriptions. + * Registers for the specified data store all reporting/processing plugins specified in the service descriptions. */ public void setServiceDescriptions(DataStorePE dataStore, DatastoreServiceDescriptions serviceDescriptions); /** - * Registers for the specified data set type DSS services where the data set type code matches - * one of the regular expression for which the service is appropriate. + * Registers for the specified data set type DSS services where the data set type code matches one of the regular expression for which the service + * is appropriate. */ public void register(DataSetType dataSetType); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/IETLEntityOperationChecker.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/IETLEntityOperationChecker.java index 55b83f8a033..428eaedd4bf 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/IETLEntityOperationChecker.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/IETLEntityOperationChecker.java @@ -48,15 +48,14 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SpaceIdentifier; /** * Checking methods to be invoked to check authorization in context of - * {@link ServiceForDataStoreServer#performEntityOperations(String, ch.systemsx.cisd.openbis.generic.shared.dto.AtomicEntityOperationDetails)} - * . + * {@link ServiceForDataStoreServer#performEntityOperations(String, ch.systemsx.cisd.openbis.generic.shared.dto.AtomicEntityOperationDetails)} . * * @author Franz-Josef Elmer */ public interface IETLEntityOperationChecker { @RolesAllowed( - { RoleWithHierarchy.SPACE_ADMIN, RoleWithHierarchy.INSTANCE_ETL_SERVER }) + { RoleWithHierarchy.SPACE_ADMIN, RoleWithHierarchy.INSTANCE_ETL_SERVER }) @Capability("CREATE_SPACES_VIA_DSS") public void assertSpaceCreationAllowed(IAuthSession session, List<NewSpace> newSpaces); @@ -70,77 +69,66 @@ public interface IETLEntityOperationChecker public void assertMaterialUpdateAllowed(IAuthSession session, List<MaterialUpdateDTO> materials); @RolesAllowed( - { RoleWithHierarchy.SPACE_POWER_USER, RoleWithHierarchy.SPACE_ETL_SERVER }) + { RoleWithHierarchy.SPACE_POWER_USER, RoleWithHierarchy.SPACE_ETL_SERVER }) @Capability("CREATE_PROJECTS_VIA_DSS") public void assertProjectCreationAllowed(IAuthSession session, - @AuthorizationGuard(guardClass = NewProjectPredicate.class) - List<NewProject> newProjects); + @AuthorizationGuard(guardClass = NewProjectPredicate.class) List<NewProject> newProjects); @RolesAllowed( - { RoleWithHierarchy.SPACE_POWER_USER, RoleWithHierarchy.SPACE_ETL_SERVER }) + { RoleWithHierarchy.SPACE_POWER_USER, RoleWithHierarchy.SPACE_ETL_SERVER }) @Capability("UPDATE_PROJECTS_VIA_DSS") public void assertProjectUpdateAllowed(IAuthSession session, - @AuthorizationGuard(guardClass = ProjectUpdatesPredicate.class) - List<ProjectUpdatesDTO> projectsToUpdate); + @AuthorizationGuard(guardClass = ProjectUpdatesPredicate.class) List<ProjectUpdatesDTO> projectsToUpdate); @RolesAllowed( - { RoleWithHierarchy.SPACE_USER, RoleWithHierarchy.SPACE_ETL_SERVER }) + { RoleWithHierarchy.SPACE_USER, RoleWithHierarchy.SPACE_ETL_SERVER }) @Capability("CREATE_EXPERIMENTS_VIA_DSS") public void assertExperimentCreationAllowed(IAuthSession session, - @AuthorizationGuard(guardClass = NewExperimentPredicate.class) - List<NewExperiment> newExperiments); + @AuthorizationGuard(guardClass = NewExperimentPredicate.class) List<NewExperiment> newExperiments); @RolesAllowed( - { RoleWithHierarchy.SPACE_USER, RoleWithHierarchy.SPACE_ETL_SERVER }) + { RoleWithHierarchy.SPACE_USER, RoleWithHierarchy.SPACE_ETL_SERVER }) @Capability("UPDATE_EXPERIMENTS_VIA_DSS") public void assertExperimentUpdateAllowed(IAuthSession session, - @AuthorizationGuard(guardClass = ExperimentUpdatesPredicate.class) - List<ExperimentUpdatesDTO> experimentUpdates); + @AuthorizationGuard(guardClass = ExperimentUpdatesPredicate.class) List<ExperimentUpdatesDTO> experimentUpdates); @RolesAllowed(RoleWithHierarchy.INSTANCE_ETL_SERVER) @Capability("CREATE_INSTANCE_SAMPLES_VIA_DSS") public void assertInstanceSampleCreationAllowed(IAuthSession session, - @AuthorizationGuard(guardClass = NewSamplePredicate.class) - List<NewSample> instanceSamples); + @AuthorizationGuard(guardClass = NewSamplePredicate.class) List<NewSample> instanceSamples); @RolesAllowed( - { RoleWithHierarchy.SPACE_USER, RoleWithHierarchy.SPACE_ETL_SERVER }) + { RoleWithHierarchy.SPACE_USER, RoleWithHierarchy.SPACE_ETL_SERVER }) @Capability("CREATE_SPACE_SAMPLES_VIA_DSS") public void assertSpaceSampleCreationAllowed(IAuthSession session, - @AuthorizationGuard(guardClass = NewSamplePredicate.class) - List<NewSample> spaceSamples); + @AuthorizationGuard(guardClass = NewSamplePredicate.class) List<NewSample> spaceSamples); @RolesAllowed(RoleWithHierarchy.INSTANCE_ETL_SERVER) @Capability("UPDATE_INSTANCE_SAMPLES_VIA_DSS") public void assertInstanceSampleUpdateAllowed(IAuthSession session, - @AuthorizationGuard(guardClass = SampleUpdatesCollectionPredicate.class) - List<SampleUpdatesDTO> instanceSamples); + @AuthorizationGuard(guardClass = SampleUpdatesCollectionPredicate.class) List<SampleUpdatesDTO> instanceSamples); @RolesAllowed( - { RoleWithHierarchy.SPACE_USER, RoleWithHierarchy.SPACE_ETL_SERVER }) + { RoleWithHierarchy.SPACE_USER, RoleWithHierarchy.SPACE_ETL_SERVER }) @Capability("UPDATE_SPACE_SAMPLES_VIA_DSS") public void assertSpaceSampleUpdateAllowed(IAuthSession session, - @AuthorizationGuard(guardClass = SampleUpdatesCollectionPredicate.class) - List<SampleUpdatesDTO> spaceSamples); + @AuthorizationGuard(guardClass = SampleUpdatesCollectionPredicate.class) List<SampleUpdatesDTO> spaceSamples); @RolesAllowed( - { RoleWithHierarchy.SPACE_USER, RoleWithHierarchy.SPACE_ETL_SERVER }) + { RoleWithHierarchy.SPACE_USER, RoleWithHierarchy.SPACE_ETL_SERVER }) @Capability("CREATE_DATA_SETS_VIA_DSS") public void assertDataSetCreationAllowed(IAuthSession session, - @AuthorizationGuard(guardClass = NewExternalDataPredicate.class) - List<? extends NewExternalData> dataSets); + @AuthorizationGuard(guardClass = NewExternalDataPredicate.class) List<? extends NewExternalData> dataSets); @RolesAllowed( - { RoleWithHierarchy.SPACE_POWER_USER, RoleWithHierarchy.SPACE_ETL_SERVER }) + { RoleWithHierarchy.SPACE_POWER_USER, RoleWithHierarchy.SPACE_ETL_SERVER }) @Capability("UPDATE_DATA_SETS_VIA_DSS") public void assertDataSetUpdateAllowed(IAuthSession session, - @AuthorizationGuard(guardClass = DataSetUpdatesCollectionPredicate.class) - List<DataSetBatchUpdatesDTO> dataSets); + @AuthorizationGuard(guardClass = DataSetUpdatesCollectionPredicate.class) List<DataSetBatchUpdatesDTO> dataSets); @RolesAllowed( { RoleWithHierarchy.SPACE_ADMIN, RoleWithHierarchy.INSTANCE_ETL_SERVER }) @Capability("ASSIGN_ROLE_TO_SPACE_VIA_DSS") public void assertSpaceRoleAssignmentAllowed(IAuthSession session, - @AuthorizationGuard(guardClass = SpaceIdentifierPredicate.class) - SpaceIdentifier space); + @AuthorizationGuard(guardClass = SpaceIdentifierPredicate.class) SpaceIdentifier space); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/NameServerServlet.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/NameServerServlet.java index 36d9756e304..3dfc7cbc188 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/NameServerServlet.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/NameServerServlet.java @@ -50,12 +50,12 @@ public class NameServerServlet extends AbstractApiServiceExporter super.afterPropertiesSet(); } - @RequestMapping( - { IRpcServiceNameServer.PREFFERED_URL_SUFFIX, "/openbis" + IRpcServiceNameServer.PREFFERED_URL_SUFFIX }) + { IRpcServiceNameServer.PREFFERED_URL_SUFFIX, "/openbis" + IRpcServiceNameServer.PREFFERED_URL_SUFFIX }) @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/NewExternalDataDAG.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/NewExternalDataDAG.java index 8ff52f06fd2..03fa4afe156 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/NewExternalDataDAG.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/NewExternalDataDAG.java @@ -37,8 +37,7 @@ public class NewExternalDataDAG extends EntityGroupingDAG<NewExternalData> } /** - * Return the new data sets in the list of groups, where the earlier groups are independent of - * the latter ones. + * Return the new data sets in the list of groups, where the earlier groups are independent of the latter ones. * * @param dataSetRegistration The list of samples to create. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/OpenBisSessionManager.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/OpenBisSessionManager.java index 097ae31bee1..4b91a77070c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/OpenBisSessionManager.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/OpenBisSessionManager.java @@ -35,7 +35,7 @@ import ch.systemsx.cisd.openbis.generic.shared.util.HibernateUtils; public class OpenBisSessionManager extends DefaultSessionManager<Session> implements IOpenBisSessionManager { private static final int DEFAULT_SESSION_EXPIRATION_PERIOD_FOR_NO_LOGIN = 10; - + private static final int getSessionExpirationPeriodMinutesForNoLogin(String property) { try @@ -46,7 +46,7 @@ public class OpenBisSessionManager extends DefaultSessionManager<Session> implem return DEFAULT_SESSION_EXPIRATION_PERIOD_FOR_NO_LOGIN; } } - + IDAOFactory daoFactory; private String userForAnonymousLogin; @@ -55,7 +55,7 @@ public class OpenBisSessionManager extends DefaultSessionManager<Session> implem IAuthenticationService authenticationService, IRemoteHostProvider remoteHostProvider, int sessionExpirationPeriodMinutes, String sessionExpirationPeriodMinutesForNoLogin, boolean tryEmailAsUserName, IDAOFactory daoFactory) { - super(sessionFactory, prefixGenerator, authenticationService, remoteHostProvider, sessionExpirationPeriodMinutes, + super(sessionFactory, prefixGenerator, authenticationService, remoteHostProvider, sessionExpirationPeriodMinutes, getSessionExpirationPeriodMinutesForNoLogin(sessionExpirationPeriodMinutesForNoLogin), tryEmailAsUserName); this.daoFactory = daoFactory; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/OpenbisCrossOriginFilter.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/OpenbisCrossOriginFilter.java index fc8c4fa013d..74e2d3394bb 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/OpenbisCrossOriginFilter.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/OpenbisCrossOriginFilter.java @@ -72,8 +72,7 @@ public class OpenbisCrossOriginFilter extends AbstractCrossOriginFilter } /** - * By default the openBIS trusts any cross-origin request coming from the registered DSS - * servers. + * By default the openBIS trusts any cross-origin request coming from the registered DSS servers. */ private List<String> getDssDomains(ApplicationContext appContext) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/SampleGroupingDAG.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/SampleGroupingDAG.java index 80cc81f5ccf..32278b4a6a4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/SampleGroupingDAG.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/SampleGroupingDAG.java @@ -34,8 +34,7 @@ public class SampleGroupingDAG extends EntityGroupingDAG<NewSample> } /** - * Return the new samples in the list of groups, where the earlier groups are independent to the - * latter ones. + * Return the new samples in the list of groups, where the earlier groups are independent to the latter ones. * * @param samples The list of samples to create. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/SearchHelper.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/SearchHelper.java index eb1bfb1fcf8..cdf30b5ed46 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/SearchHelper.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/SearchHelper.java @@ -37,8 +37,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPE; import ch.systemsx.cisd.openbis.generic.shared.dto.Session; /** - * A class with helper methods for implementing search. This is the shared code for that searches - * originating from CommonServer and ETLService. + * A class with helper methods for implementing search. This is the shared code for that searches originating from CommonServer and ETLService. * * @author Chandrasekhar Ramakrishnan */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ServerExceptionTranslatingAdvisor.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ServerExceptionTranslatingAdvisor.java index 2a9a6d43841..e1839f8674b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ServerExceptionTranslatingAdvisor.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ServerExceptionTranslatingAdvisor.java @@ -32,15 +32,13 @@ import ch.systemsx.cisd.common.exceptions.UserFailureException; import ch.systemsx.cisd.openbis.generic.shared.IServer; /** - * Translates deeply nested exceptions thrown on server side e.g. by Spring that contain user - * readable error messages (like {@link TransactionSystemException} or {@link DataAccessException}) - * into {UserFailureException} with message taken from the root exception cause. + * Translates deeply nested exceptions thrown on server side e.g. by Spring that contain user readable error messages (like + * {@link TransactionSystemException} or {@link DataAccessException}) into {UserFailureException} with message taken from the root exception cause. * <p> - * The most important reason why this advisor was introduced was to translate exceptions that happen - * just before commit/rollback of transactions, like {@link TransactionSystemException}. Such - * exceptions can't be handled inside the server methods because the commit/rollback is invoked - * outside the server class by Spring AOP (see {@link Transactional}). Without this advisor the - * translation would need to be done in all clients - web, command line, APIs. + * The most important reason why this advisor was introduced was to translate exceptions that happen just before commit/rollback of transactions, like + * {@link TransactionSystemException}. Such exceptions can't be handled inside the server methods because the commit/rollback is invoked outside the + * server class by Spring AOP (see {@link Transactional}). Without this advisor the translation would need to be done in all clients - web, command + * line, APIs. * * @author Piotr Buczek */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ServiceConversationServerManagerServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ServiceConversationServerManagerServer.java index d6f1b4b8a3d..673ba633846 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ServiceConversationServerManagerServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ServiceConversationServerManagerServer.java @@ -49,10 +49,12 @@ public class ServiceConversationServerManagerServer extends WhiteAndBlackListHtt } @RequestMapping( - { IServiceConversationServerManagerRemote.PATH, "/openbis" + IServiceConversationServerManagerRemote.PATH,"/openbis/openbis" + IServiceConversationServerManagerRemote.PATH }) + { IServiceConversationServerManagerRemote.PATH, "/openbis" + IServiceConversationServerManagerRemote.PATH, + "/openbis/openbis" + IServiceConversationServerManagerRemote.PATH }) @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/ServiceForDataStoreServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/ServiceForDataStoreServer.java index fd82c652cdf..e69de29bb2d 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 @@ -1,3390 +0,0 @@ -/* - * 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); - } -} -- GitLab