From d1b1996367ba4f50c7b45ac8c741cf318d7c0c85 Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Tue, 27 Oct 2026 19:14:20 -0700 Subject: [PATCH 1/2] Move single-module classes out of api into their owning modules --- api/src/org/labkey/api/ApiModule.java | 8 - .../api/action/SimpleForwardAction.java | 50 --- api/src/org/labkey/api/arrays/FloatArray.java | 115 ----- .../collections/ArrayListValuedTreeMap.java | 37 -- .../api/data/AtomicDatabaseInteger.java | 209 --------- .../org/labkey/api/data/ConnectionPool.java | 85 ---- .../api/data/HighlightingDisplayColumn.java | 263 ----------- .../api/data/InlineInClauseGenerator.java | 151 ------- api/src/org/labkey/api/data/InputColumn.java | 41 -- .../org/labkey/api/data/LazyForeignKey.java | 133 ------ .../api/data/ResultSetMetaDataWrapper.java | 172 -------- .../api/data/RowTrackingResultSetWrapper.java | 145 ------ .../org/labkey/api/data/TableExtension.java | 128 ------ ...tespacePreservingDisplayColumnFactory.java | 60 --- .../AbstractClrInstallationManager.java | 258 ----------- .../api/data/bigiron/ClrAssemblyManager.java | 57 --- .../api/dataiterator/AsyncDataIterator.java | 261 ----------- .../api/dataiterator/FilterDataIterator.java | 61 --- .../NameExpressionDataIteratorBuilder.java | 46 -- .../api/docker/DockerSessionListener.java | 69 --- .../exp/api/ExpProtocolAttachmentParent.java | 48 -- .../labkey/api/exp/property/PropertyUtil.java | 50 --- .../org/labkey/api/flow/api/FlowService.java | 39 -- .../AbstractSpecimenTransformTask.java | 391 ---------------- .../api/query/QcAwarePropertyForeignKey.java | 417 ------------------ .../api/reader/SimpleXMLStreamReader.java | 77 ---- .../api/reader/XMLStreamReaderWrapper.java | 308 ------------- .../api/reports/report/r/CustomRReport.java | 111 ----- .../api/search/AbstractXMLDocumentParser.java | 157 ------- .../labkey/api/security/FixedHtmlField.java | 57 --- .../labkey/api/security/SectionHeader.java | 30 -- .../settings/AbstractCustomLabelProvider.java | 197 --------- .../api/settings/PreferenceService.java | 219 --------- .../labkey/api/study/AssaySpecimenVisit.java | 25 -- .../org/labkey/api/study/ProductAntigen.java | 30 -- .../labkey/api/study/TreatmentProduct.java | 29 -- .../org/labkey/api/util/FileLoggerWriter.java | 166 ------- api/src/org/labkey/api/util/MatrixUtil.java | 148 ------- .../labkey/api/util/OutputStreamWrapper.java | 89 ---- ...PossiblyGZIPpedFileInputStreamFactory.java | 60 --- api/src/org/labkey/api/util/Result.java | 126 ------ .../api/view/ColorPickerDisplayColumn.java | 82 ---- api/src/org/labkey/api/view/Overview.java | 313 ------------- .../api/visualization/ColorGradient.java | 77 ---- .../org/labkey/api/visualization/Stats.java | 243 ---------- .../dsmiley/httpproxy/ProxyServletUtils.java | 20 - .../org/labkey/api/study/PropertySet.java | 2 +- .../labkey/assay/ModuleAssayCacheHandler.java | 2 +- .../labkey/assay}/data/ArrayExcelWriter.java | 7 +- .../labkey/assay}/data/TSVArrayWriter.java | 3 +- .../module/ModuleResourceLoadException.java | 2 +- .../org/labkey/assay/plate/PlateManager.java | 4 +- core/src/org/labkey/core/CoreModule.java | 20 +- .../core/admin/ActionsExceptionsView.java | 1 - .../org/labkey/core}/admin/ActionsHelper.java | 2 +- .../labkey/core/admin/ActionsTsvWriter.java | 1 - .../org/labkey/core/admin/ActionsView.java | 1 - .../labkey/core/admin/AdminController.java | 6 +- .../core/admin/ConnectionUsageTsvWriter.java | 1 - .../core/admin/lookAndFeelResources.jsp | 2 +- .../attachment/AttachmentServiceImpl.java | 2 +- .../CaseInsensitiveHashSetValuedMap.java | 4 +- .../org/labkey/core}/data/ColumnInfoTests.jsp | 0 .../core}/data/ContainerServiceImpl.java | 5 +- .../files/FileBrowserConfigImporter.java | 4 +- .../core}/files/FileBrowserConfigWriter.java | 4 +- .../login/DbLoginAuthenticationProvider.java | 2 +- .../core/login/DbLoginConfiguration.java | 2 +- .../org/labkey/core/login/DbLoginManager.java | 2 +- .../LoginAttemptDisableLoginProvider.java | 2 +- .../labkey/core/login/LoginController.java | 2 +- .../core/project/FolderNavigationForm.java | 2 +- .../CacheClearingQueryUpdateService.java | 7 +- .../src/org/labkey/core/query/UsersTable.java | 1 - .../labkey/core}/reader/HTMLDataLoader.java | 4 +- .../core/reports/ScriptEngineManagerImpl.java | 6 +- .../report/python/PythonScriptEngine.java | 2 +- .../reports/report/r/RDockerScriptEngine.java | 6 +- .../report/r/RDockerScriptEngineFactory.java | 2 +- .../report/r/RserveScriptEngineFactory.java | 3 +- .../core/security/ApiKeyViewProvider.java | 2 +- .../AuthenticationLogoAttachmentParent.java | 3 +- .../core}/security/PasswordExpiration.java | 2 +- .../LookAndFeelPropertiesManager.java | 6 +- .../org/labkey/core}/util/CountLimiter.java | 5 +- .../org/labkey/core}/view/PopupAdminView.java | 11 +- .../org/labkey/core}/view/PopupHelpView.java | 6 +- .../org/labkey/core}/view/PopupUserView.java | 7 +- .../org/labkey/core}/view/URLException.java | 2 +- .../labkey/core}/view/menu/ContainerMenu.java | 3 +- .../labkey/core}/view/menu/FolderMenu.java | 3 +- .../core}/view/menu/ProjectAdminMenu.java | 3 +- .../labkey/core}/view/menu/ProjectsMenu.java | 10 +- .../labkey/core}/view/menu/SiteAdminMenu.java | 3 +- .../core/view/template/bootstrap/header.jsp | 12 +- .../core/webdav/ModuleStaticResolverImpl.java | 1 - .../core}/webdav/WebdavResourceReadOnly.java | 5 +- .../org/labkey/core/wiki/RadeoxRenderer.java | 8 +- .../ExperimentMigrationSchemaHandler.java | 2 +- .../labkey/experiment/ExperimentModule.java | 6 +- .../src/org/labkey/experiment/XarReader.java | 2 +- .../CountOfUniqueValueTableCustomizer.java | 2 +- .../api/ExpDataClassDataTableImpl.java | 2 +- .../api/SampleTypeUpdateServiceDI.java | 2 +- .../api/UniqueValueCounterTestCase.java | 4 +- .../experiment/api/property/DomainImpl.java | 2 +- .../controllers/exp/ExperimentController.java | 4 +- .../exp/ExperimentRunGroupsView.java | 2 +- .../property/PropertyController.java | 4 +- .../experiment}/data/TSVJSONWriter.java | 3 +- .../data/UniqueValueCounterDefinition.java | 4 +- .../dataiterator/DropColumnsDataIterator.java | 7 +- .../experiment}/exp/ExperimentRunForm.java | 2 +- .../experiment}/exp/api/DomainKindDesign.java | 2 +- .../exp/api/ExpProtocolAttachmentType.java | 3 +- .../exp/api/FilterProtocolInputCriteria.java | 11 +- .../property/DomainPropertyAuditProvider.java | 3 +- .../exp/xar/XarReaderDelegate.java | 2 +- .../exp/xar/XarReaderRegistry.java | 2 +- .../util/SessionTempFileHolder.java | 2 +- .../view/SimpleRenderableDisplayElement.java | 3 +- .../filecontent/FileContentServiceImpl.java | 4 +- .../labkey/filecontent/FileRootManager.java | 2 +- .../org/labkey/filecontent/FileWriter.java | 2 +- .../labkey/filecontent}/files/FileRoot.java | 6 +- .../files/MissingRootDirectoryException.java | 5 +- .../AbstractRemoteExecutionEngineConfig.java | 119 ++--- .../FileAnalysisTaskPipelineImpl.java | 6 +- .../pipeline/api/PipelineJobServiceImpl.java | 4 +- .../pipeline}/formSchema/NumberField.java | 4 +- .../pipeline}/formSchema/SelectField.java | 5 +- .../pipeline}/formSchema/TextareaField.java | 4 +- .../mule/test/DummyRemoteExecutionEngine.java | 2 +- .../pipeline/status/StatusDetailsBean.java | 2 +- .../util/LimitedSizeInputStream.java | 2 +- .../query/JavaExportScriptFactory.java | 6 +- .../labkey}/query/JavaExportScriptModel.java | 4 +- .../labkey/query/ModuleQueryMetadataDef.java | 2 +- .../query/PerlExportScriptFactory.java | 6 +- .../labkey}/query/PerlExportScriptModel.java | 4 +- .../query/PythonExportScriptFactory.java | 6 +- .../query/PythonExportScriptModel.java | 4 +- query/src/org/labkey/query/QueryModule.java | 8 +- .../org/labkey}/query/QuerySchemaWrapper.java | 5 +- .../org/labkey/query/QueryServiceImpl.java | 62 +-- .../labkey}/query/RExportScriptFactory.java | 6 +- .../org/labkey}/query/RExportScriptModel.java | 4 +- .../labkey}/query/SasExportScriptFactory.java | 6 +- .../labkey}/query/SasExportScriptModel.java | 4 +- .../org/labkey}/query/SchemaTreeWalker.java | 8 +- .../org/labkey}/query/TempQuerySettings.java | 6 +- .../labkey}/query/URLExportScriptFactory.java | 6 +- .../labkey}/query/URLExportScriptModel.java | 6 +- .../labkey/query/ValidateQueriesVisitor.java | 1 - .../action/ReportingApiQueryResponse.java | 6 +- .../query}/concurrent/CountingSemaphore.java | 2 +- .../AbstractExternalSchemaForm.java | 2 +- .../query/controllers/QueryController.java | 4 +- .../labkey/query}/data/ReportingWriter.java | 13 +- .../query}/data/SQLParameterException.java | 3 +- .../org/labkey/query/olap/ServerManager.java | 2 +- .../query/reports/ModuleReportCache.java | 12 +- .../query/reports/ReportServiceImpl.java | 4 +- .../query/reports/ReportsController.java | 8 +- .../getdata/JSONReportDataRenderer.java | 2 +- .../reports/model/DataViewEditForm.java | 2 +- .../labkey/query}/reports/model/ViewInfo.java | 2 +- .../report/InternalScriptEngineReport.java | 4 +- .../ModuleJavaScriptReportDescriptor.java | 8 +- ...ModuleQueryJavaScriptReportDescriptor.java | 4 +- .../report/ModuleQueryReportDescriptor.java | 7 +- .../report/ModuleQueryReportResource.java | 4 +- .../ModuleReportDependenciesResource.java | 4 +- .../python/ModuleIpynbReportDescriptor.java | 4 +- .../r/ModuleQueryRReportDescriptor.java | 5 +- .../report/r/ModuleRReportResource.java | 5 +- .../view/RenderBackgroundRReportView.java | 6 +- .../view/ajaxReportRenderBackground.jsp | 0 .../query/reports/view/ReportUIProvider.java | 4 +- .../query/reports/view/ReportsWebPart.java | 4 +- .../query/reports/view/attachmentReport.jsp | 2 +- .../labkey/query/reports/view/linkReport.jsp | 2 +- query/src/org/labkey/query/sql/Query.java | 20 +- .../query/suggestions/ColumnFactsCache.java | 1 - .../query/suggestions/FilterSuggestion.java | 3 +- .../suggestions/FilterSuggestionRanker.java | 7 +- .../suggestions/FilterSuggestionService.java | 1 - .../query}/thumbnail/BaseThumbnailAction.java | 6 +- .../src/org/labkey/query}/util/DOMUtil.java | 2 +- .../labkey/query}/util/IdentifierString.java | 2 +- .../search/SearchMisconfiguredException.java | 2 +- .../search/model/AbstractSearchService.java | 2 +- .../search/model/NoopWritableIndex.java | 2 +- .../search}/util/MultisetRateAccumulator.java | 3 +- search/src/org/labkey/search/view/search.jsp | 2 +- .../org/labkey/api/data/TableInfoGetter.java | 0 .../assay/AssayPublishConfirmAction.java | 4 +- .../study/assay/AssayPublishStartAction.java | 4 +- .../assay/SampleParticipantVisitResolver.java | 6 +- .../study/assay/StudyPublishManager.java | 2 +- .../SampleTypePublishConfirmAction.java | 4 +- .../publish/SampleTypePublishStartAction.java | 4 +- .../src/org/labkey/study}/data/IndexInfo.java | 3 +- .../study}/dataiterator/BeanDataIterator.java | 6 +- .../dataset/DatasetSnapshotProvider.java | 2 +- .../src/org/labkey/study/model/StudyImpl.java | 2 +- .../org/labkey/study/model/StudyManager.java | 2 +- .../publish/AbstractPublishConfirmAction.java | 8 +- .../publish/AbstractPublishStartAction.java | 9 +- .../labkey}/study/publish/PublishBean.java | 7 +- .../study/publish/PublishConfirmForm.java | 2 +- .../study/publish/PublishStartForm.java | 2 +- .../study/publish/publishChooseStudy.jsp | 8 +- .../labkey}/study/publish/publishHeader.jsp | 2 +- .../labkey}/study/query/DataInputColumn.java | 2 +- .../labkey/study/query/ParticipantTable.java | 1 - .../study/query/PublishResultsQueryView.java | 4 +- .../query/SourceDataLinkDisplayColumn.java | 2 +- .../labkey/study}/query/TitleForeignKey.java | 3 +- .../ValidParticipantVisitDisplayColumn.java | 2 +- .../snapshot/AbstractSnapshotProvider.java | 5 +- .../study}/util/HTMLContentExtractor.java | 2 +- .../study/writer/DatasetDataWriter.java | 2 +- .../labkey/study/writer/SchemaXmlWriter.java | 2 +- .../org/labkey/survey/SurveyController.java | 7 +- .../src/org/labkey/survey/SurveyManager.java | 6 +- .../src/org/labkey/survey/SurveyModule.java | 5 +- .../src/org/labkey}/survey/SurveyService.java | 8 +- .../src/org/labkey}/survey/SurveyUrls.java | 2 +- .../src/org/labkey}/survey/model/Survey.java | 2 +- .../labkey}/survey/model/SurveyDesign.java | 2 +- .../labkey}/survey/model/SurveyListener.java | 2 +- .../survey/model/SurveyServiceImpl.java | 5 +- .../labkey}/survey/model/SurveyStatus.java | 2 +- .../org/labkey/survey/query/SurveysTable.java | 2 +- .../org/labkey/survey/view/surveyWizard.jsp | 2 +- .../visualization/SvgThumbnailGenerator.java | 2 +- .../VisualizationController.java | 1 - .../report/GenericChartReportImpl.java | 2 +- .../report/TimeChartReportImpl.java | 2 +- wiki/src/org/labkey/wiki/WikiController.java | 2 +- .../view/PermanentRedirectException.java | 3 +- 242 files changed, 552 insertions(+), 6248 deletions(-) delete mode 100644 api/src/org/labkey/api/action/SimpleForwardAction.java delete mode 100644 api/src/org/labkey/api/arrays/FloatArray.java delete mode 100644 api/src/org/labkey/api/collections/ArrayListValuedTreeMap.java delete mode 100644 api/src/org/labkey/api/data/AtomicDatabaseInteger.java delete mode 100644 api/src/org/labkey/api/data/ConnectionPool.java delete mode 100644 api/src/org/labkey/api/data/HighlightingDisplayColumn.java delete mode 100644 api/src/org/labkey/api/data/InlineInClauseGenerator.java delete mode 100644 api/src/org/labkey/api/data/InputColumn.java delete mode 100644 api/src/org/labkey/api/data/LazyForeignKey.java delete mode 100644 api/src/org/labkey/api/data/ResultSetMetaDataWrapper.java delete mode 100644 api/src/org/labkey/api/data/RowTrackingResultSetWrapper.java delete mode 100644 api/src/org/labkey/api/data/TableExtension.java delete mode 100644 api/src/org/labkey/api/data/WhitespacePreservingDisplayColumnFactory.java delete mode 100644 api/src/org/labkey/api/data/bigiron/AbstractClrInstallationManager.java delete mode 100644 api/src/org/labkey/api/data/bigiron/ClrAssemblyManager.java delete mode 100644 api/src/org/labkey/api/dataiterator/AsyncDataIterator.java delete mode 100644 api/src/org/labkey/api/dataiterator/FilterDataIterator.java delete mode 100644 api/src/org/labkey/api/dataiterator/NameExpressionDataIteratorBuilder.java delete mode 100644 api/src/org/labkey/api/docker/DockerSessionListener.java delete mode 100644 api/src/org/labkey/api/exp/api/ExpProtocolAttachmentParent.java delete mode 100644 api/src/org/labkey/api/exp/property/PropertyUtil.java delete mode 100644 api/src/org/labkey/api/flow/api/FlowService.java delete mode 100644 api/src/org/labkey/api/pipeline/AbstractSpecimenTransformTask.java delete mode 100644 api/src/org/labkey/api/query/QcAwarePropertyForeignKey.java delete mode 100644 api/src/org/labkey/api/reader/SimpleXMLStreamReader.java delete mode 100644 api/src/org/labkey/api/reader/XMLStreamReaderWrapper.java delete mode 100644 api/src/org/labkey/api/reports/report/r/CustomRReport.java delete mode 100644 api/src/org/labkey/api/search/AbstractXMLDocumentParser.java delete mode 100644 api/src/org/labkey/api/security/FixedHtmlField.java delete mode 100644 api/src/org/labkey/api/security/SectionHeader.java delete mode 100644 api/src/org/labkey/api/settings/AbstractCustomLabelProvider.java delete mode 100644 api/src/org/labkey/api/settings/PreferenceService.java delete mode 100644 api/src/org/labkey/api/study/AssaySpecimenVisit.java delete mode 100644 api/src/org/labkey/api/study/ProductAntigen.java delete mode 100644 api/src/org/labkey/api/study/TreatmentProduct.java delete mode 100644 api/src/org/labkey/api/util/FileLoggerWriter.java delete mode 100644 api/src/org/labkey/api/util/MatrixUtil.java delete mode 100644 api/src/org/labkey/api/util/OutputStreamWrapper.java delete mode 100644 api/src/org/labkey/api/util/PossiblyGZIPpedFileInputStreamFactory.java delete mode 100644 api/src/org/labkey/api/util/Result.java delete mode 100644 api/src/org/labkey/api/view/ColorPickerDisplayColumn.java delete mode 100644 api/src/org/labkey/api/view/Overview.java delete mode 100644 api/src/org/labkey/api/visualization/ColorGradient.java delete mode 100644 api/src/org/labkey/api/visualization/Stats.java delete mode 100644 api/src/org/mitre/dsmiley/httpproxy/ProxyServletUtils.java rename {api/src => assay/api-src}/org/labkey/api/study/PropertySet.java (96%) rename {api/src/org/labkey/api => assay/src/org/labkey/assay}/data/ArrayExcelWriter.java (90%) rename {api/src/org/labkey/api => assay/src/org/labkey/assay}/data/TSVArrayWriter.java (96%) rename {api/src/org/labkey/api => assay/src/org/labkey/assay}/module/ModuleResourceLoadException.java (93%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/admin/ActionsHelper.java (96%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/collections/CaseInsensitiveHashSetValuedMap.java (88%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/data/ColumnInfoTests.jsp (100%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/data/ContainerServiceImpl.java (85%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/files/FileBrowserConfigImporter.java (96%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/files/FileBrowserConfigWriter.java (94%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/query/CacheClearingQueryUpdateService.java (93%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/reader/HTMLDataLoader.java (98%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/reports/report/python/PythonScriptEngine.java (98%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/reports/report/r/RDockerScriptEngine.java (95%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/reports/report/r/RDockerScriptEngineFactory.java (97%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/reports/report/r/RserveScriptEngineFactory.java (92%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/security/AuthenticationLogoAttachmentParent.java (92%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/security/PasswordExpiration.java (96%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/settings/LookAndFeelPropertiesManager.java (99%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/util/CountLimiter.java (96%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/view/PopupAdminView.java (92%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/view/PopupHelpView.java (89%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/view/PopupUserView.java (90%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/view/URLException.java (95%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/view/menu/ContainerMenu.java (94%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/view/menu/FolderMenu.java (95%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/view/menu/ProjectAdminMenu.java (93%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/view/menu/ProjectsMenu.java (92%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/view/menu/SiteAdminMenu.java (95%) rename {api/src/org/labkey/api => core/src/org/labkey/core}/webdav/WebdavResourceReadOnly.java (98%) rename {api/src/org/labkey/api => experiment/src/org/labkey/experiment}/data/TSVJSONWriter.java (96%) rename {api/src/org/labkey/api => experiment/src/org/labkey/experiment}/data/UniqueValueCounterDefinition.java (95%) rename {api/src/org/labkey/api => experiment/src/org/labkey/experiment}/dataiterator/DropColumnsDataIterator.java (93%) rename {api/src/org/labkey/api => experiment/src/org/labkey/experiment}/exp/ExperimentRunForm.java (98%) rename {api/src/org/labkey/api => experiment/src/org/labkey/experiment}/exp/api/DomainKindDesign.java (97%) rename {api/src/org/labkey/api => experiment/src/org/labkey/experiment}/exp/api/ExpProtocolAttachmentType.java (94%) rename {api/src/org/labkey/api => experiment/src/org/labkey/experiment}/exp/api/FilterProtocolInputCriteria.java (91%) rename {api/src/org/labkey/api => experiment/src/org/labkey/experiment}/exp/property/DomainPropertyAuditProvider.java (98%) rename {api/src/org/labkey/api => experiment/src/org/labkey/experiment}/exp/xar/XarReaderDelegate.java (96%) rename {api/src/org/labkey/api => experiment/src/org/labkey/experiment}/exp/xar/XarReaderRegistry.java (98%) rename {api/src/org/labkey/api => experiment/src/org/labkey/experiment}/util/SessionTempFileHolder.java (98%) rename {api/src/org/labkey/api => experiment/src/org/labkey/experiment}/view/SimpleRenderableDisplayElement.java (93%) rename {api/src/org/labkey/api => filecontent/src/org/labkey/filecontent}/files/FileRoot.java (91%) rename {api/src/org/labkey/api => filecontent/src/org/labkey/filecontent}/files/MissingRootDirectoryException.java (93%) rename {api/src/org/labkey/api => pipeline/src/org/labkey}/pipeline/AbstractRemoteExecutionEngineConfig.java (92%) rename {api/src/org/labkey/api => pipeline/src/org/labkey/pipeline}/formSchema/NumberField.java (94%) rename {api/src/org/labkey/api => pipeline/src/org/labkey/pipeline}/formSchema/SelectField.java (93%) rename {api/src/org/labkey/api => pipeline/src/org/labkey/pipeline}/formSchema/TextareaField.java (94%) rename {api/src/org/labkey/api => pipeline/src/org/labkey/pipeline}/util/LimitedSizeInputStream.java (98%) rename {api/src/org/labkey/api => query/src/org/labkey}/query/JavaExportScriptFactory.java (83%) rename {api/src/org/labkey/api => query/src/org/labkey}/query/JavaExportScriptModel.java (95%) rename {api/src/org/labkey/api => query/src/org/labkey}/query/PerlExportScriptFactory.java (83%) rename {api/src/org/labkey/api => query/src/org/labkey}/query/PerlExportScriptModel.java (95%) rename {api/src/org/labkey/api => query/src/org/labkey}/query/PythonExportScriptFactory.java (86%) rename {api/src/org/labkey/api => query/src/org/labkey}/query/PythonExportScriptModel.java (97%) rename {api/src/org/labkey/api => query/src/org/labkey}/query/QuerySchemaWrapper.java (96%) rename {api/src/org/labkey/api => query/src/org/labkey}/query/RExportScriptFactory.java (83%) rename {api/src/org/labkey/api => query/src/org/labkey}/query/RExportScriptModel.java (95%) rename {api/src/org/labkey/api => query/src/org/labkey}/query/SasExportScriptFactory.java (83%) rename {api/src/org/labkey/api => query/src/org/labkey}/query/SasExportScriptModel.java (94%) rename {api/src/org/labkey/api => query/src/org/labkey}/query/SchemaTreeWalker.java (93%) rename {api/src/org/labkey/api => query/src/org/labkey}/query/TempQuerySettings.java (92%) rename {api/src/org/labkey/api => query/src/org/labkey}/query/URLExportScriptFactory.java (83%) rename {api/src/org/labkey/api => query/src/org/labkey}/query/URLExportScriptModel.java (91%) rename {api/src/org/labkey/api => query/src/org/labkey/query}/action/ReportingApiQueryResponse.java (94%) rename {api/src/org/labkey/api => query/src/org/labkey/query}/concurrent/CountingSemaphore.java (97%) rename {api/src/org/labkey/api => query/src/org/labkey/query}/data/ReportingWriter.java (94%) rename {api/src/org/labkey/api => query/src/org/labkey/query}/data/SQLParameterException.java (91%) rename {api/src/org/labkey/api => query/src/org/labkey/query}/reports/model/DataViewEditForm.java (94%) rename {api/src/org/labkey/api => query/src/org/labkey/query}/reports/model/ViewInfo.java (95%) rename {api/src/org/labkey/api => query/src/org/labkey/query}/reports/report/InternalScriptEngineReport.java (95%) rename {api/src/org/labkey/api => query/src/org/labkey/query}/reports/report/ModuleJavaScriptReportDescriptor.java (85%) rename {api/src/org/labkey/api => query/src/org/labkey/query}/reports/report/ModuleQueryJavaScriptReportDescriptor.java (89%) rename {api/src/org/labkey/api => query/src/org/labkey/query}/reports/report/ModuleQueryReportDescriptor.java (89%) rename {api/src/org/labkey/api => query/src/org/labkey/query}/reports/report/ModuleQueryReportResource.java (92%) rename {api/src/org/labkey/api => query/src/org/labkey/query}/reports/report/ModuleReportDependenciesResource.java (91%) rename {api/src/org/labkey/api => query/src/org/labkey/query}/reports/report/python/ModuleIpynbReportDescriptor.java (95%) rename {api/src/org/labkey/api => query/src/org/labkey/query}/reports/report/r/ModuleQueryRReportDescriptor.java (94%) rename {api/src/org/labkey/api => query/src/org/labkey/query}/reports/report/r/ModuleRReportResource.java (96%) rename {api/src/org/labkey/api => query/src/org/labkey/query}/reports/report/view/RenderBackgroundRReportView.java (89%) rename {api/src/org/labkey/api => query/src/org/labkey/query}/reports/report/view/ajaxReportRenderBackground.jsp (100%) rename {api/src/org/labkey/api => query/src/org/labkey}/query/suggestions/FilterSuggestion.java (97%) rename {api/src/org/labkey/api => query/src/org/labkey/query}/thumbnail/BaseThumbnailAction.java (92%) rename {api/src/org/labkey/api => query/src/org/labkey/query}/util/DOMUtil.java (96%) rename {api/src/org/labkey/api => query/src/org/labkey/query}/util/IdentifierString.java (94%) rename {api/src/org/labkey/api => search/src/org/labkey}/search/SearchMisconfiguredException.java (93%) rename {api/src/org/labkey/api => search/src/org/labkey/search}/util/MultisetRateAccumulator.java (92%) rename {api/src => study/api-src}/org/labkey/api/data/TableInfoGetter.java (100%) rename {api/src/org/labkey/api => study/src/org/labkey}/study/assay/SampleParticipantVisitResolver.java (98%) rename {api/src/org/labkey/api => study/src/org/labkey/study}/data/IndexInfo.java (95%) rename {api/src/org/labkey/api => study/src/org/labkey/study}/dataiterator/BeanDataIterator.java (93%) rename {api/src/org/labkey/api => study/src/org/labkey}/study/publish/AbstractPublishConfirmAction.java (98%) rename {api/src/org/labkey/api => study/src/org/labkey}/study/publish/AbstractPublishStartAction.java (95%) rename {api/src/org/labkey/api => study/src/org/labkey}/study/publish/PublishBean.java (98%) rename {api/src/org/labkey/api => study/src/org/labkey}/study/publish/PublishConfirmForm.java (99%) rename {api/src/org/labkey/api => study/src/org/labkey}/study/publish/PublishStartForm.java (95%) rename {api/src/org/labkey/api => study/src/org/labkey}/study/publish/publishChooseStudy.jsp (98%) rename {api/src/org/labkey/api => study/src/org/labkey}/study/publish/publishHeader.jsp (96%) rename {api/src/org/labkey/api => study/src/org/labkey}/study/query/DataInputColumn.java (94%) rename {api/src/org/labkey/api => study/src/org/labkey}/study/query/PublishResultsQueryView.java (97%) rename {api/src/org/labkey/api => study/src/org/labkey}/study/query/SourceDataLinkDisplayColumn.java (99%) rename {api/src/org/labkey/api => study/src/org/labkey/study}/query/TitleForeignKey.java (93%) rename {api/src/org/labkey/api => study/src/org/labkey}/study/query/ValidParticipantVisitDisplayColumn.java (95%) rename {api/src/org/labkey/api => study/src/org/labkey/study}/query/snapshot/AbstractSnapshotProvider.java (94%) rename {api/src/org/labkey/api => study/src/org/labkey/study}/util/HTMLContentExtractor.java (95%) rename {api/src/org/labkey/api => survey/src/org/labkey}/survey/SurveyService.java (89%) rename {api/src/org/labkey/api => survey/src/org/labkey}/survey/SurveyUrls.java (94%) rename {api/src/org/labkey/api => survey/src/org/labkey}/survey/model/Survey.java (93%) rename {api/src/org/labkey/api => survey/src/org/labkey}/survey/model/SurveyDesign.java (94%) rename {api/src/org/labkey/api => survey/src/org/labkey}/survey/model/SurveyListener.java (95%) rename {api/src/org/labkey/api => survey/src/org/labkey}/survey/model/SurveyStatus.java (91%) rename {api/src/org/labkey/api => visualization/src/org/labkey}/visualization/SvgThumbnailGenerator.java (93%) rename {api/src/org/labkey/api => wiki/src/org/labkey/wiki}/view/PermanentRedirectException.java (93%) diff --git a/api/src/org/labkey/api/ApiModule.java b/api/src/org/labkey/api/ApiModule.java index ce7c9b7bc82..976ebf46848 100644 --- a/api/src/org/labkey/api/ApiModule.java +++ b/api/src/org/labkey/api/ApiModule.java @@ -55,7 +55,6 @@ import org.labkey.api.data.AccumulatingCommitTask; import org.labkey.api.data.Aggregate; import org.labkey.api.data.AsyncQueryRequest; -import org.labkey.api.data.AtomicDatabaseInteger; import org.labkey.api.data.BatchSize; import org.labkey.api.data.BindingTestCase; import org.labkey.api.data.BooleanFormat; @@ -74,7 +73,6 @@ import org.labkey.api.data.DisplayColumn; import org.labkey.api.data.ExcelColumn; import org.labkey.api.data.ExcelWriter; -import org.labkey.api.data.InlineInClauseGenerator; import org.labkey.api.data.JsonTest; import org.labkey.api.data.MaterializedQueryHelper; import org.labkey.api.data.MultiValuedRenderContext; @@ -84,7 +82,6 @@ import org.labkey.api.data.RequestCancellation; import org.labkey.api.data.RepeatedCommitTaskMonitor; import org.labkey.api.data.ResultSetSelectorTestCase; -import org.labkey.api.data.RowTrackingResultSetWrapper; import org.labkey.api.data.SQLFragment; import org.labkey.api.data.SimpleFilter; import org.labkey.api.data.SqlExecutingSelector; @@ -162,7 +159,6 @@ import org.labkey.api.security.GroupManager; import org.labkey.api.security.LimitedUser; import org.labkey.api.security.NestedGroupsTest; -import org.labkey.api.security.PasswordExpiration; import org.labkey.api.security.RoleSet; import org.labkey.api.security.SecurityManager; import org.labkey.api.security.UserManager; @@ -455,7 +451,6 @@ public void registerServlets(ServletContext servletCtx) GUID.TestCase.class, HelpTopic.TestCase.class, ImpersonationTestCase.class, - InlineInClauseGenerator.TestCase.class, JSONDataLoader.HeaderMatchTest.class, JSONDataLoader.MetadataTest.class, JSONDataLoader.RowTest.class, @@ -479,7 +474,6 @@ public void registerServlets(ServletContext servletCtx) NumberUtilsLabKey.TestCase.class, PageFlowUtil.TestCase.class, Pair.TestCase.class, - PasswordExpiration.TestCase.class, Path.TestCase.class, Query.TestCase.class, QueryProfiler.TestCase.class, @@ -548,7 +542,6 @@ public void registerServlets(ServletContext servletCtx) ApiQueryResponse.TestCase.class, AppPropsTestCase.class, AsyncQueryRequest.TestCase.class, - AtomicDatabaseInteger.TestCase.class, BindingTestCase.class, BlockingCache.BlockingCacheTest.class, CompareType.TestCase.class, @@ -599,7 +592,6 @@ public void registerServlets(ServletContext servletCtx) ResultSetDataIterator.TestCase.class, ResultSetSelectorTestCase.class, RoleSet.TestCase.class, - RowTrackingResultSetWrapper.TestCase.class, SearchScope.TestCase.class, SecurityManager.TestCase.class, SimpleQueryUpdateService.TestCase.class, diff --git a/api/src/org/labkey/api/action/SimpleForwardAction.java b/api/src/org/labkey/api/action/SimpleForwardAction.java deleted file mode 100644 index 6d6bff2c2d3..00000000000 --- a/api/src/org/labkey/api/action/SimpleForwardAction.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2008-2026 LabKey Corporation - * - * 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 org.labkey.api.action; - -import org.labkey.api.view.ActionURL; -import org.labkey.api.view.NavTree; -import org.labkey.api.view.ViewServlet; -import org.springframework.validation.BindException; -import org.springframework.web.servlet.ModelAndView; - -/** - * Similar to {@link org.labkey.api.action.SimpleRedirectAction}, but forwards to the URL instead of redirecting. - * This preserves post data, etc because it's handled internally within the web server instead of asking the browser - * to send the request to a different URL - */ -public abstract class SimpleForwardAction
extends SimpleViewAction -{ - @Override - public ModelAndView getView(FORM form, BindException errors) throws Exception - { - ViewServlet.forwardActionURL(getViewContext().getRequest(), getViewContext().getResponse(), getForwardURL(form)); - return null; - } - - @Override - public void addNavTrail(NavTree root) - { - } - - public abstract ActionURL getForwardURL(FORM form) throws Exception; - - @Override - protected String getCommandClassMethodName() - { - return "getForwardURL"; - } -} \ No newline at end of file diff --git a/api/src/org/labkey/api/arrays/FloatArray.java b/api/src/org/labkey/api/arrays/FloatArray.java deleted file mode 100644 index 9fe400af345..00000000000 --- a/api/src/org/labkey/api/arrays/FloatArray.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2004-2026 Fred Hutchinson Cancer Research Center - * - * 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 org.labkey.api.arrays; - -import java.util.ArrayList; - - -/** - * Alternative to ArrayList - * User: mbellew - * Date: May 24, 2004 - */ -public class FloatArray -{ - private static final int ARRAY_LEN = 1024; - - int _lenSegment = ARRAY_LEN; - ArrayList _list = new ArrayList<>(); - float[] _arrayLast; - int _lenLast = 0; - int _size = 0; - - - public FloatArray() - { - _arrayLast = new float[_lenSegment]; - _list.add(_arrayLast); - } - - - private FloatArray(float[] a) - { - _list = new ArrayList<>(1); - _arrayLast = a; - _list.add(a); - _size = a.length; - _lenSegment = _size; - _lenLast = _size; - } - - - public void add(float f) - { - if (_arrayLast.length <= _lenLast) - { - _arrayLast = new float[_lenSegment]; - _list.add(_arrayLast); - _lenLast = 0; - } - _arrayLast[_lenLast++] = f; - _size++; - } - - - public float get(int i) - { - return _list.get(i / _lenSegment)[i % _lenSegment]; - } - - - public int size() - { - return _size; - } - - public void setSize(int newSize) - { - _size=newSize; - } - - - public float[] toArray(float[] dst) - { -// assert null == "not tested"; - if (null == dst || dst.length < _size) - dst = new float[_size]; - int end=0, i=0; - float[] src; - for (; i<_list.size()-1 ; i++) - { - src = _list.get(i); - System.arraycopy(src, 0, dst, end, src.length); - end += src.length; - } - src = _list.get(i); - System.arraycopy(src, 0, dst, end, _lenLast); - return dst; -} - - - public static FloatArray asFloatArray(float[] a) - { - return new FloatArray(a) - { - @Override - public void add(float f) - { - throw new java.lang.UnsupportedOperationException(); - } - }; - } -} diff --git a/api/src/org/labkey/api/collections/ArrayListValuedTreeMap.java b/api/src/org/labkey/api/collections/ArrayListValuedTreeMap.java deleted file mode 100644 index c9baf42c097..00000000000 --- a/api/src/org/labkey/api/collections/ArrayListValuedTreeMap.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2025-2026 LabKey Corporation - * - * 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 org.labkey.api.collections; - -import org.apache.commons.collections4.multimap.AbstractListValuedMap; - -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; -import java.util.TreeMap; - -public class ArrayListValuedTreeMap extends AbstractListValuedMap -{ - public ArrayListValuedTreeMap(Comparator comparator) - { - super(new TreeMap<>(comparator)); - } - - @Override - protected List createCollection() - { - return new ArrayList<>(); - } -} diff --git a/api/src/org/labkey/api/data/AtomicDatabaseInteger.java b/api/src/org/labkey/api/data/AtomicDatabaseInteger.java deleted file mode 100644 index 4f7137e3da8..00000000000 --- a/api/src/org/labkey/api/data/AtomicDatabaseInteger.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright (c) 2010-2026 LabKey Corporation - * - * 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 org.labkey.api.data; - -import org.jetbrains.annotations.Nullable; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.labkey.api.security.User; -import org.labkey.api.util.JunitUtil; -import org.labkey.api.util.TestContext; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static org.labkey.api.util.IntegerUtils.asInteger; - -public class AtomicDatabaseInteger -{ - private final TableInfo _table; - private final ColumnInfo _targetColumn; - private final Container _container; - private final Object _rowId; - - // Acts like an AtomicInteger, but uses the database for synchronization. This is convenient for scenarios where - // multiple threads (eventually, even different servers) might attempt an update but only one should succeed. - public AtomicDatabaseInteger(ColumnInfo targetColumn, @Nullable Container container, Object rowId) - { - if (targetColumn.getJavaObjectClass() != Integer.class) - throw new IllegalArgumentException("Target column must be type integer"); - - _table = targetColumn.getParentTable(); - List pks = _table.getPkColumns(); - - if (pks.size() != 1) - throw new IllegalArgumentException("Target table must have a single primary key column"); - - _targetColumn = targetColumn; - _container = container; - _rowId = rowId; - } - - // TODO: Need to explicitly pass in a Connection (in both get() and compareAndSet()) that is NOT involved in the - // current thread's transaction; this will protect against race conditions between transactions and issues with - // rollbacks. This also allows us to mimic the behavior of database sequences (e.g., incrementing a sequence - // inside a transaction always survives a rollback), which is one of the possible use cases. - - // Get the current value - public int get() - { - SimpleFilter filter = (null != _container ? SimpleFilter.createContainerFilter(_container) : null); - Integer currentValue = new TableSelector(_targetColumn, filter, null).getObject(_rowId, Integer.class); - - if (null == currentValue) - throw new IllegalStateException("Can't find row " + _rowId); - - return currentValue; - } - - // Atomically sets the value to the given update value if the current value == the expected value. - public boolean compareAndSet(int expect, int update) - { - var targetColumnName = _targetColumn.getSelectIdentifier(); - // NOTE: we're not really using _ts column for optimistic concurrency, don't need to update - SQLFragment sqlf = new SQLFragment() - .unsafeAppend("UPDATE ").append(_table.getSQLName()) - .unsafeAppend(" SET ").appendIdentifier(targetColumnName).unsafeAppend("=?\n").add(update) - .unsafeAppend(" WHERE (").appendIdentifier(targetColumnName).unsafeAppend("=?) AND (rowid=?)").add(expect).add(_rowId); - if (null != _container) - sqlf.unsafeAppend(" AND (container=?)").add(_container.getEntityId()); - int rowsAffected = new SqlExecutor(_table.getSchema()).execute(sqlf); - return rowsAffected == 1; - } - - public int incrementAndGet() - { - for (;;) - { - int current = get(); - int next = current + 1; - if (compareAndSet(current, next)) - return next; - } - } - - public int decrementAndGet() - { - for (;;) - { - int current = get(); - int next = current - 1; - if (compareAndSet(current, next)) - return next; - } - } - - public int addAndGet(int delta) - { - for (;;) - { - int current = get(); - int next = current + delta; - if (compareAndSet(current, next)) - return next; - } - } - - public static class TestCase extends Assert - { - private AtomicDatabaseInteger _adi; - private Integer _rowId = null; - - @Before - public void setup() - { - Container c = JunitUtil.getTestContainer(); - User user = TestContext.get().getUser(); - TableInfo table = TestSchema.getInstance().getTableInfoTestTable(); - - Map map = new HashMap<>(); - map.put("Container", c); - map.put("IntNotNull", 0); - map.put("DateTimeNotNull", new Date()); - map.put("BitNotNull", true); - - map = Table.insert(user, table, map); - - _rowId = asInteger(map.get("RowId")); - _adi = new AtomicDatabaseInteger(table.getColumn("IntNotNull"), c, _rowId); - } - - @Test - public void testBasicOperations() - { - assertEquals(0, _adi.get()); - - assertTrue(_adi.compareAndSet(0, 4)); - assertTrue(_adi.compareAndSet(4, 2)); - assertFalse(_adi.compareAndSet(0, 3)); - assertFalse(_adi.compareAndSet(3, 2)); - - assertEquals(3, _adi.incrementAndGet()); - assertEquals(4, _adi.incrementAndGet()); - assertEquals(5, _adi.incrementAndGet()); - assertEquals(4, _adi.decrementAndGet()); - assertEquals(5, _adi.incrementAndGet()); - assertEquals(6, _adi.incrementAndGet()); - - assertEquals(6, _adi.addAndGet(0)); - assertEquals(12, _adi.addAndGet(6)); - assertEquals(24, _adi.addAndGet(12)); - assertEquals(14, _adi.addAndGet(-10)); - assertEquals(-4, _adi.addAndGet(-18)); - assertEquals(0, _adi.addAndGet(4)); - } - - @Test - public void testPerformance() - { - final int n = 1000; - final long start = System.currentTimeMillis(); - - long currentGetStart; - long currentGetDuration; - long longestGet = -1; - - for (int i = 0; i < n; i++) - { - currentGetStart = System.currentTimeMillis(); - _adi.incrementAndGet(); - currentGetDuration = System.currentTimeMillis() - currentGetStart; - if (currentGetDuration > longestGet) - longestGet = currentGetDuration; - } - - final long elapsed = System.currentTimeMillis() - start; - - double perSecond = n / (elapsed / 1000.0); - - assertTrue(String.format("Performance measured less than 75 increments per second: %d increments in %dms; slowest get %dms", n, elapsed, longestGet), perSecond > 75); // A very low bar - } - - @After - public void cleanup() - { - if (null != _rowId) - { - TableInfo table = TestSchema.getInstance().getTableInfoTestTable(); - Table.delete(table, _rowId); - } - } - } -} diff --git a/api/src/org/labkey/api/data/ConnectionPool.java b/api/src/org/labkey/api/data/ConnectionPool.java deleted file mode 100644 index 0c32bd5fd6b..00000000000 --- a/api/src/org/labkey/api/data/ConnectionPool.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2018-2026 LabKey Corporation - * - * 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 org.labkey.api.data; - -import org.apache.commons.dbcp.ConnectionFactory; -import org.apache.commons.dbcp.PoolableConnectionFactory; -import org.apache.commons.dbcp.PoolingDataSource; -import org.apache.commons.pool.impl.GenericObjectPool; -import org.jetbrains.annotations.NotNull; - -import javax.sql.DataSource; -import java.sql.Connection; -import java.sql.SQLException; - -public class ConnectionPool implements AutoCloseable -{ - private final DataSource _dataSource; - private final @NotNull GenericObjectPool _connectionPool; - - public ConnectionPool(DbScope scope, int maxActive, String validationQuery) - { - // Create an ObjectPool that serves as the pool of connections. - _connectionPool = new GenericObjectPool(); - _connectionPool.setMaxActive(maxActive); - _connectionPool.setTestOnBorrow(true); - - // Create a ConnectionFactory that the pool will use to create Connections. - ConnectionFactory connectionFactory = scope::getUnpooledConnection; - - // Create a PoolableConnectionFactory that wraps the "real" Connections created by the - // ConnectionFactory with the classes that implement the pooling functionality. - new PoolableConnectionFactory(connectionFactory, - _connectionPool, - null, - validationQuery, // validationQuery - true, // defaultReadOnly - true) // defaultAutoCommit - { - @Override - public boolean validateObject(Object obj) - { - return ConnectionPool.this.validateConnection((Connection)obj) && super.validateObject(obj); - } - }; - - // Create the PoolingDataSource - _dataSource = new PoolingDataSource(_connectionPool); - } - - public Connection getConnection() throws SQLException - { - return _dataSource.getConnection(); - } - - protected boolean validateConnection(Connection conn) - { - return true; - } - - @Override - public void close() - { - _connectionPool.clear(); - try - { - _connectionPool.close(); - } - catch(Exception ignored) - { - } - } -} diff --git a/api/src/org/labkey/api/data/HighlightingDisplayColumn.java b/api/src/org/labkey/api/data/HighlightingDisplayColumn.java deleted file mode 100644 index 509c14a4fdf..00000000000 --- a/api/src/org/labkey/api/data/HighlightingDisplayColumn.java +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Copyright (c) 2010-2026 LabKey Corporation - * - * 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 org.labkey.api.data; - -import org.labkey.api.query.FieldKey; -import org.labkey.api.util.DOM; -import org.labkey.api.util.UniqueID; -import org.labkey.api.view.HttpView; -import org.labkey.api.view.template.PageConfig; -import org.labkey.api.writer.HtmlWriter; - -import java.io.IOException; -import java.io.Writer; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; - -import static org.labkey.api.util.DOM.SPAN; -import static org.labkey.api.util.DOM.cl; - -public class HighlightingDisplayColumn extends DisplayColumnDecorator -{ - private final LinkedHashMap, String> _distinctValuesToClass = new LinkedHashMap<>(); - private final FieldKey[] _fields; - - protected int _uid; - - private String _hoverFunctionName; - private String _unhoverFunctionName; - private String _clickFunctionName; - private String _cssEventSelector; - private String _highlightColor = "yellow"; - private boolean _locking = true; - - private boolean handlersAdded = false; - - public HighlightingDisplayColumn(DisplayColumn column, FieldKey... distinguishingFields) - { - super(column); - _fields = distinguishingFields; - } - - // Call to set a different highlight color (yellow is the default) - @SuppressWarnings({"UnusedDeclaration"}) - public HighlightingDisplayColumn setHighlightColor(String color) - { - _highlightColor = color; - return this; - } - - // Call to enable locking/unlocking (click on a span to lock the style in place, click again to unlock it) - @SuppressWarnings({"UnusedDeclaration"}) - public HighlightingDisplayColumn setLocking(boolean locking) - { - _locking = locking; - return this; - } - - // Override to provide custom javascript that sets the span style on hover - public String getHoverStyleCode() - { - return "\t\tstyle.backgroundColor = '" + _highlightColor + "';\n"; - } - - // Override to provide custom javascript that resets the span style on unhover - public String getUnhoverStyleCode() - { - // Note: Setting backgroundColor = null works in every browser except IE; blank string seems to work universally. - return "\t\tstyle.backgroundColor = '';\n"; - } - - protected String getStyleClass(RenderContext ctx) - { - List values = new ArrayList<>(_fields.length); - - for (FieldKey _field : _fields) - values.add(ctx.get(_field)); - - String className = _distinctValuesToClass.get(values); - - if (null == className) - { - className = "c" + UniqueID.getRequestScopedUID(ctx.getRequest()); - _distinctValuesToClass.put(values, className); - } - - return className; - } - - @Override - public void renderGridHeaderCell(RenderContext ctx, HtmlWriter out) - { - super.renderGridHeaderCell(ctx, out); - - _uid = UniqueID.getRequestScopedUID(ctx.getRequest()); - _hoverFunctionName = "hover" + _uid; - _unhoverFunctionName = "unhover" + _uid; - _clickFunctionName = "click" + _uid; - _cssEventSelector = "highlightColumn" + _uid; - } - - @Override - public void renderGridCellContents(RenderContext ctx, HtmlWriter out) - { - if (!handlersAdded) - { - // use css selector to wire up event handlers - PageConfig config = HttpView.currentPageConfig(); - if (null != _hoverFunctionName) - config.addHandlerForQuerySelector("SPAN." + _cssEventSelector, "mouseover", "return " + _hoverFunctionName + "(this);"); - if (null != _unhoverFunctionName) - config.addHandlerForQuerySelector("SPAN." + _cssEventSelector, "mouseout", "return " + _unhoverFunctionName + "(this);"); - if (_locking && null != _clickFunctionName) - config.addHandlerForQuerySelector("SPAN." + _cssEventSelector, "click", "return " + _clickFunctionName + "(this);"); - handlersAdded = true; - } - - String styleClass = getStyleClass(ctx); - SPAN( - cl(styleClass, _cssEventSelector), - (DOM.Renderable) ret -> { - super.renderGridCellContents(ctx, out); - return ret; - } - ).appendTo(out); - } - - // Note: Nobody calls this method! It must have been orphaned in DisplayColumn / DataColumn a while back. - // I'm leaving the code in place in case we want to restore it... - public void renderGridEnd(RenderContext ctx, Writer out) throws IOException - { - String styleMapName = "styleMap" + _uid; - String lockedStylesName = "lockedStyles" + _uid; - - out.write("\n"); - } -} diff --git a/api/src/org/labkey/api/data/InlineInClauseGenerator.java b/api/src/org/labkey/api/data/InlineInClauseGenerator.java deleted file mode 100644 index ef77b4d0fbe..00000000000 --- a/api/src/org/labkey/api/data/InlineInClauseGenerator.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Copyright (c) 2014-2026 LabKey Corporation - * - * 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 org.labkey.api.data; - -import org.jetbrains.annotations.NotNull; -import org.jmock.Expectations; -import org.jmock.Mockery; -import org.jmock.lib.legacy.ClassImposteriser; -import org.junit.Assert; -import org.junit.Test; -import org.labkey.api.data.dialect.SqlDialect; -import org.labkey.api.data.dialect.StandardDialectStringHandler; -import org.labkey.api.util.GUID; - -import java.util.Arrays; -import java.util.Collection; - -/** - * For longer IN clauses, passes the values as in-line SQL instead of JDBC parameters. This works around - * a SQLServer limitation of 2000 JDBC parameters. - * - * User: jeckels - * Date: 6/10/14 - */ -public class InlineInClauseGenerator implements InClauseGenerator -{ - private static final int IN_LINE_MINIMUM_COUNT = 10; - - private static final InClauseGenerator FALLBACK_GENERATOR = new ParameterMarkerInClauseGenerator(); - - private final SqlDialect _dialect; - - public InlineInClauseGenerator(SqlDialect dialect) - { - _dialect = dialect; - } - - @Override - public SQLFragment appendInClauseSql(SQLFragment sql, @NotNull Collection params) - { - // Don't bother in-lining for shorter IN clauses so that we have a chance of reusing a pre-compiled - // prepared statement - if (params.size() >= IN_LINE_MINIMUM_COUNT) - return createInlineInClause(sql, params); - - return FALLBACK_GENERATOR.appendInClauseSql(sql, params); - } - - private SQLFragment createInlineInClause(SQLFragment sql, Collection params) - { - String separator = ""; - sql.unsafeAppend(" IN ("); - - for (Object param : params) - { - sql.append(separator); - separator = ", "; - if (param instanceof Number) - { - sql.appendValue((Number)param); - } - else if (param instanceof GUID guidParam) - { - // No need to escape any characters in true GUIDs - sql.appendValue(guidParam); - } - else if (param instanceof String stringParam) - { - sql.appendValue(stringParam, _dialect); - } - else - { - sql.unsafeAppend("?"); - sql.add(param); - } - } - return sql.unsafeAppend(")"); - } - - public static class TestCase - { - private final SqlDialect _dialect; - - public TestCase() - { - Mockery mockery = new Mockery(); - mockery.setImposteriser(ClassImposteriser.INSTANCE); - _dialect = mockery.mock(SqlDialect.class); - mockery.checking(new Expectations() {{ - allowing(_dialect).getStringHandler(); - will(returnValue(new StandardDialectStringHandler())); - }}); - } - - @Test - public void testTooShortToInline() - { - Assert.assertEquals( - new SQLFragment(" IN (?, ?, ?)", 1, 2, 3), - new InlineInClauseGenerator(_dialect).appendInClauseSql(new SQLFragment(), Arrays.asList(1, 2, 3))); - } - - @Test - public void testInline() - { - Assert.assertEquals( - new SQLFragment(" IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)"), - new InlineInClauseGenerator(_dialect).appendInClauseSql(new SQLFragment(), Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))); - } - - @Test //(expected = IllegalArgumentException.class) - public void testMixedTypesInline() - { - GUID g = new GUID(); - Assert.assertEquals( - new SQLFragment(" IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, ").appendValue(g).unsafeAppend(")"), - new InlineInClauseGenerator(_dialect).appendInClauseSql(new SQLFragment(), Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, g))); - } - - @Test - public void testUnsupportedTypes() - { - // We don't bother in-lining booleans - Assert.assertEquals( - new SQLFragment(" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", true, false, true, false, true, false, true, false, true, false, true), - new InlineInClauseGenerator(_dialect).appendInClauseSql(new SQLFragment(), Arrays.asList(true, false, true, false, true, false, true, false, true, false, true))); - } - - @Test - public void testStringEscaping() - { - // We now inline arbitrary strings - Assert.assertEquals( - SQLFragment.unsafe(" IN ('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', 'nasty'';DROP SCHEMA core')"), - new InlineInClauseGenerator(_dialect).appendInClauseSql(new SQLFragment(), Arrays.asList("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "nasty';DROP SCHEMA core"))); - } - } -} diff --git a/api/src/org/labkey/api/data/InputColumn.java b/api/src/org/labkey/api/data/InputColumn.java deleted file mode 100644 index 130071cefe6..00000000000 --- a/api/src/org/labkey/api/data/InputColumn.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2012-2026 LabKey Corporation - * - * 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 org.labkey.api.data; - -import org.labkey.api.writer.HtmlWriter; - -/** - * Renders a bound ColumnInfo as an HTML form input in a grid view. - */ -public class InputColumn extends DataColumn -{ - public InputColumn(ColumnInfo col) - { - super(col); - } - - @Override - public void renderGridCellContents(RenderContext ctx, HtmlWriter out) - { - renderInputHtml(ctx, out, getInputValue(ctx)); - } - - @Override - public void render(RenderContext ctx, HtmlWriter out) - { - renderInputHtml(ctx, out, getInputValue(ctx)); - } -} diff --git a/api/src/org/labkey/api/data/LazyForeignKey.java b/api/src/org/labkey/api/data/LazyForeignKey.java deleted file mode 100644 index e8d0be31a74..00000000000 --- a/api/src/org/labkey/api/data/LazyForeignKey.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2021-2026 LabKey Corporation - * - * 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 org.labkey.api.data; - -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.labkey.api.collections.NamedObjectList; -import org.labkey.api.query.FieldKey; -import org.labkey.api.query.SchemaKey; -import org.labkey.api.util.StringExpression; - -import java.util.Map; -import java.util.Set; -import java.util.function.Supplier; - -/** - * A foreign key implementation that waits until it's asked for something and then uses the Supplier to create the - * real foreign key. This lets us postpone potentially expensive initialization of the lookup, and in many cases - * avoid needing to do it at all if the lookup isn't being actively used in a given codepath. - */ -public class LazyForeignKey implements ForeignKey -{ - private final Supplier _supplier; - private final boolean _suggestColumns; - - private boolean _delegateCreationAttempted = false; - private ForeignKey _delegate; - - public LazyForeignKey(Supplier supplier, boolean suggestColumns) - { - _supplier = supplier; - _suggestColumns = suggestColumns; - } - - private ForeignKey getDelegate() - { - if (!_delegateCreationAttempted) - { - _delegate = _supplier.get(); - _delegateCreationAttempted = true; - } - return _delegate; - } - - @Override - public @Nullable ColumnInfo createLookupColumn(ColumnInfo parent, String displayField) - { - return getDelegate() == null ? null : getDelegate().createLookupColumn(parent, displayField); - } - - @Override - public @Nullable TableInfo getLookupTableInfo() - { - return getDelegate() == null ? null : getDelegate().getLookupTableInfo(); - } - - @Override - public StringExpression getURL(ColumnInfo parent) - { - return getDelegate() == null ? null : getDelegate().getURL(parent); - } - - @Override - public @NotNull NamedObjectList getSelectList(RenderContext ctx) - { - return getDelegate() == null ? new NamedObjectList() : getDelegate().getSelectList(ctx); - } - - @Override - public Container getLookupContainer() - { - return getDelegate() == null ? null : getDelegate().getLookupContainer(); - } - - @Override - public String getLookupTableName() - { - return getDelegate() == null ? null : getDelegate().getLookupTableName(); - } - - @Override - public String getLookupSchemaName() - { - return getDelegate() == null ? null : getDelegate().getLookupSchemaName(); - } - - @Override - public SchemaKey getLookupSchemaKey() - { - return getDelegate() == null ? null : getDelegate().getLookupSchemaKey(); - } - - @Override - public String getLookupColumnName() - { - return getDelegate() == null ? null : getDelegate().getLookupColumnName(); - } - - @Override - public String getLookupDisplayName() - { - return getDelegate() == null ? null : getDelegate().getLookupDisplayName(); - } - - @Override - public @Nullable ForeignKey remapFieldKeys(@Nullable FieldKey parent, @Nullable Map mapping) - { - return getDelegate() == null ? null : getDelegate().remapFieldKeys(parent, mapping); - } - - @Override - public @Nullable Set getSuggestedColumns() - { - if (!_suggestColumns) - { - return null; - } - return getDelegate() == null ? null : getDelegate().getSuggestedColumns(); - } -} diff --git a/api/src/org/labkey/api/data/ResultSetMetaDataWrapper.java b/api/src/org/labkey/api/data/ResultSetMetaDataWrapper.java deleted file mode 100644 index 9ef2ca8195f..00000000000 --- a/api/src/org/labkey/api/data/ResultSetMetaDataWrapper.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (c) 2014 LabKey Corporation - * - * 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 org.labkey.api.data; - -import java.sql.ResultSetMetaData; -import java.sql.SQLException; - -/** - * User: adam - * Date: 9/17/2014 - * Time: 10:39 PM - */ -public class ResultSetMetaDataWrapper implements ResultSetMetaData -{ - private final ResultSetMetaData _rsmd; - - public ResultSetMetaDataWrapper(ResultSetMetaData rsmd) - { - _rsmd = rsmd; - } - - @Override - public int getColumnCount() throws SQLException - { - return _rsmd.getColumnCount(); - } - - @Override - public boolean isAutoIncrement(int column) throws SQLException - { - return _rsmd.isAutoIncrement(column); - } - - @Override - public boolean isCaseSensitive(int column) throws SQLException - { - return _rsmd.isCaseSensitive(column); - } - - @Override - public boolean isSearchable(int column) throws SQLException - { - return _rsmd.isSearchable(column); - } - - @Override - public boolean isCurrency(int column) throws SQLException - { - return _rsmd.isCurrency(column); - } - - @Override - public int isNullable(int column) throws SQLException - { - return _rsmd.isNullable(column); - } - - @Override - public boolean isSigned(int column) throws SQLException - { - return _rsmd.isSigned(column); - } - - @Override - public int getColumnDisplaySize(int column) throws SQLException - { - return _rsmd.getColumnDisplaySize(column); - } - - @Override - public String getColumnLabel(int column) throws SQLException - { - return _rsmd.getColumnLabel(column); - } - - @Override - public String getColumnName(int column) throws SQLException - { - return _rsmd.getColumnName(column); - } - - @Override - public String getSchemaName(int column) throws SQLException - { - return _rsmd.getSchemaName(column); - } - - @Override - public int getPrecision(int column) throws SQLException - { - return _rsmd.getPrecision(column); - } - - @Override - public int getScale(int column) throws SQLException - { - return _rsmd.getScale(column); - } - - @Override - public String getTableName(int column) throws SQLException - { - return _rsmd.getTableName(column); - } - - @Override - public String getCatalogName(int column) throws SQLException - { - return _rsmd.getCatalogName(column); - } - - @Override - public int getColumnType(int column) throws SQLException - { - return _rsmd.getColumnType(column); - } - - @Override - public String getColumnTypeName(int column) throws SQLException - { - return _rsmd.getColumnTypeName(column); - } - - @Override - public boolean isReadOnly(int column) throws SQLException - { - return _rsmd.isReadOnly(column); - } - - @Override - public boolean isWritable(int column) throws SQLException - { - return _rsmd.isWritable(column); - } - - @Override - public boolean isDefinitelyWritable(int column) throws SQLException - { - return _rsmd.isDefinitelyWritable(column); - } - - @Override - public String getColumnClassName(int column) throws SQLException - { - return _rsmd.getColumnClassName(column); - } - - @Override - public T unwrap(Class iface) throws SQLException - { - return _rsmd.unwrap(iface); - } - - @Override - public boolean isWrapperFor(Class iface) throws SQLException - { - return _rsmd.isWrapperFor(iface); - } -} diff --git a/api/src/org/labkey/api/data/RowTrackingResultSetWrapper.java b/api/src/org/labkey/api/data/RowTrackingResultSetWrapper.java deleted file mode 100644 index 1d84665ecd9..00000000000 --- a/api/src/org/labkey/api/data/RowTrackingResultSetWrapper.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) 2015-2018 LabKey Corporation - * - * 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 org.labkey.api.data; - -import org.junit.Assert; -import org.junit.Test; - -import java.sql.ResultSet; -import java.sql.SQLException; - -/** - * ResultSet wrapper that tracks the current row based on navigation operations. This is needed for JDBC drivers that don't - * correctly implement getRow(), most notably, the SAS JDBC driver. - * - * User: adam - * Date: 2/21/2015 - * Time: 1:17 PM - */ - -public class RowTrackingResultSetWrapper extends ResultSetWrapper -{ - private int _currentRow = 0; - - public RowTrackingResultSetWrapper(ResultSet rs) - { - super(rs); - } - - @Override - public int getRow() - { - return _currentRow; - } - - // These are the absolute positioning methods that we support - - @Override - public boolean first() throws SQLException - { - _currentRow = 1; - return resultset.first(); - } - - @Override - public boolean absolute(int i) throws SQLException - { - _currentRow = i; - return resultset.absolute(i); - } - - @Override - public void beforeFirst() throws SQLException - { - _currentRow = 0; - resultset.beforeFirst(); - } - - @Override - public void afterLast() throws SQLException - { - _currentRow = 0; - resultset.afterLast(); - } - - // These are the relative positioning methods that we support - - @Override - public boolean next() throws SQLException - { - _currentRow++; - return resultset.next(); - } - - @Override - public boolean previous() throws SQLException - { - _currentRow--; - return resultset.previous(); - } - - @Override - public boolean relative(int i) throws SQLException - { - _currentRow += i; - return resultset.relative(i); - } - - // We don't support this method - - @Override - public boolean last() throws SQLException - { - // We can't set _currentRow correctly, unless we enumerate every row, so just throw for now - throw new SQLException("Not supported"); - } - - - // Test basic operations. This doesn't test edge conditions like previous() when before first, next when after last, absolute(-3), etc. - public static class TestCase extends Assert - { - @Test - public void test() throws SQLException - { - TableSelector selector = new TableSelector(CoreSchema.getInstance().getTableInfoModules()); - - try (ResultSet rs = selector.getResultSet(); ResultSet wrapper = new RowTrackingResultSetWrapper(rs)) - { - assertEquals(rs.getRow(), wrapper.getRow()); - wrapper.next(); - assertEquals(rs.getRow(), wrapper.getRow()); - wrapper.next(); - assertEquals(rs.getRow(), wrapper.getRow()); - wrapper.previous(); - assertEquals(rs.getRow(), wrapper.getRow()); - wrapper.absolute(7); - assertEquals(rs.getRow(), wrapper.getRow()); - wrapper.absolute(5); - assertEquals(rs.getRow(), wrapper.getRow()); - wrapper.relative(2); - assertEquals(rs.getRow(), wrapper.getRow()); - wrapper.relative(-2); - assertEquals(rs.getRow(), wrapper.getRow()); - wrapper.first(); - assertEquals(rs.getRow(), wrapper.getRow()); - wrapper.beforeFirst(); - assertEquals(rs.getRow(), wrapper.getRow()); - wrapper.afterLast(); - assertEquals(rs.getRow(), wrapper.getRow()); - } - } - } -} diff --git a/api/src/org/labkey/api/data/TableExtension.java b/api/src/org/labkey/api/data/TableExtension.java deleted file mode 100644 index 8e39004619c..00000000000 --- a/api/src/org/labkey/api/data/TableExtension.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2014-2026 LabKey Corporation - * - * 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 org.labkey.api.data; - -import org.jetbrains.annotations.Nullable; -import org.labkey.api.query.AliasedColumn; -import org.labkey.api.query.QueryForeignKey; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Objects; - -/** - * User: kevink - * Date: 4/4/14 - * - * Convenience class to add columns from the extension table to the primary table. - */ -public final class TableExtension -{ - private final AbstractTableInfo _primaryTable; - private final TableInfo _extensionTable; - private final ColumnInfo _extensionCol; - private final QueryForeignKey _extensionFK; - - private TableExtension(AbstractTableInfo primaryTable, TableInfo extensionTable, ColumnInfo extensionCol, QueryForeignKey extensionFK) - { - _primaryTable = primaryTable; - _extensionTable = extensionTable; - _extensionCol = extensionCol; - _extensionFK = extensionFK; - } - - public static TableExtension create(AbstractTableInfo primaryTable, TableInfo extensionTable) - { - String pkColumn = extensionTable.getPkColumnNames().getFirst(); // Note this only works for simple primary keys, not compound. - String fkColumn = extensionTable.getColumn(pkColumn).getFk().getLookupColumnName(); - - return create(primaryTable, extensionTable, fkColumn, pkColumn, LookupColumn.JoinType.leftOuter); - } - - public static TableExtension create(AbstractTableInfo primaryTable, TableInfo extensionTable, String foreignKey, String lookupKey, LookupColumn.JoinType joinType) - { - ColumnInfo extensionCol = primaryTable.getColumn(foreignKey); - assert extensionCol != null; - - QueryForeignKey extensionFK = (QueryForeignKey)QueryForeignKey - .from(primaryTable.getUserSchema(), primaryTable.getContainerFilter()) - .table(extensionTable).key(lookupKey) - .build(); - extensionFK.setJoinType(joinType); - - return new TableExtension(primaryTable, extensionTable, extensionCol, extensionFK); - } - - public TableInfo getExtensionTable() - { - return _extensionTable; - } - - public Collection addAllColumns() - { - String lookupKey = getLookupColumnName(); - List baseColumns = _extensionTable.getColumns(); - Collection columns = new ArrayList<>(baseColumns.size()); - for (ColumnInfo col : baseColumns) - { - // Skip the lookup column itself - if (col.getName().equalsIgnoreCase(lookupKey)) - continue; - - ColumnInfo lookupCol = addExtensionColumn(col, col.getName()); - columns.add(lookupCol); - } - - return columns; - } - - public MutableColumnInfo addExtensionColumn(String baseColName, @Nullable String newColName) - { - ColumnInfo baseCol = _extensionTable.getColumn(baseColName); - return addExtensionColumn(baseCol, newColName); - } - - public MutableColumnInfo addExtensionColumn(ColumnInfo baseCol, @Nullable String newColName) - { - var aliased = wrapExtensionColumn(baseCol, newColName); - return _primaryTable.addColumn(aliased); - } - - public ColumnInfo wrapExtensionColumn(String baseColName, @Nullable String newColName) - { - ColumnInfo baseCol = _extensionTable.getColumn(baseColName); - return wrapExtensionColumn(baseCol, newColName); - } - - public BaseColumnInfo wrapExtensionColumn(ColumnInfo baseCol, @Nullable String newColName) - { - newColName = Objects.toString(newColName, baseCol.getName()); - - ColumnInfo lookupCol = _extensionFK.createLookupColumn(_extensionCol, baseCol.getName()); - AliasedColumn aliased = new AliasedColumn(_primaryTable, newColName, lookupCol); - if (lookupCol.isHidden() || baseCol.isHidden()) - aliased.setHidden(true); - - return aliased; - } - - public String getLookupColumnName() - { - return _extensionFK.getLookupColumnName(); - } - -} diff --git a/api/src/org/labkey/api/data/WhitespacePreservingDisplayColumnFactory.java b/api/src/org/labkey/api/data/WhitespacePreservingDisplayColumnFactory.java deleted file mode 100644 index b4182ab2f23..00000000000 --- a/api/src/org/labkey/api/data/WhitespacePreservingDisplayColumnFactory.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2015-2026 LabKey Corporation - * - * 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 org.labkey.api.data; - -import org.jetbrains.annotations.NotNull; -import org.labkey.api.util.HtmlString; - -/** - * Renders the value in HTML preserving whitespace, including spaces and newlines. - * - * User: jeckels - * Date: 10/9/2015 - */ -public class WhitespacePreservingDisplayColumnFactory implements DisplayColumnFactory -{ - @Override - public DisplayColumn createRenderer(ColumnInfo col) - { - return new WhitespacePreservingDisplayColumn(col); - } - - public static class WhitespacePreservingDisplayColumn extends DataColumn - { - public WhitespacePreservingDisplayColumn(ColumnInfo col) - { - super(col); - } - - @NotNull - @Override - public HtmlString getFormattedHtml(RenderContext ctx) - { - Object value = ctx.get(getDisplayColumn().getFieldKey()); - if (value == null) - { - // If we couldn't find it by FieldKey, check by alias as well - value = getDisplayColumn().getValue(ctx); - } - - if (value == null) - { - return HtmlString.NBSP; - } - return HtmlString.of(value.toString(), true); - } - } -} diff --git a/api/src/org/labkey/api/data/bigiron/AbstractClrInstallationManager.java b/api/src/org/labkey/api/data/bigiron/AbstractClrInstallationManager.java deleted file mode 100644 index 1e7dad71e55..00000000000 --- a/api/src/org/labkey/api/data/bigiron/AbstractClrInstallationManager.java +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright (c) 2017-2026 LabKey Corporation - * - * 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 org.labkey.api.data.bigiron; - -import org.apache.logging.log4j.Level; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.labkey.api.data.ContainerManager; -import org.labkey.api.data.DbSchema; -import org.labkey.api.data.DbScope; -import org.labkey.api.data.FileSqlScriptProvider; -import org.labkey.api.data.SQLFragment; -import org.labkey.api.data.SqlExecutor; -import org.labkey.api.data.SqlScriptManager; -import org.labkey.api.data.SqlScriptRunner.SqlScript; -import org.labkey.api.data.SqlScriptRunner.SqlScriptException; -import org.labkey.api.data.SqlSelector; -import org.labkey.api.data.dialect.SqlDialect; -import org.labkey.api.module.Module; -import org.labkey.api.module.ModuleContext; -import org.labkey.api.module.ModuleLoader; -import org.labkey.api.resource.Resource; -import org.labkey.api.util.ExceptionUtil; -import org.labkey.api.util.HelpTopic; -import org.labkey.api.util.HtmlStringBuilder; -import org.labkey.api.util.LinkBuilder; -import org.labkey.api.util.PageFlowUtil; -import org.labkey.api.util.Path; -import org.labkey.api.view.ActionURL; -import org.labkey.api.view.template.Warnings; -import org.springframework.web.servlet.mvc.Controller; - -import java.io.IOException; -import java.sql.Connection; - -/** - * Base class for handling installation of CLR Assemblies on SQL Server. Most methods/logic - * were abstracted from what used to be in GroupConcatInstallationManager. - */ -public abstract class AbstractClrInstallationManager -{ - private static final Logger LOG = LogManager.getLogger(AbstractClrInstallationManager.class); - - @Nullable - private String _installedVersion = null; - - @Nullable - protected String determineInstalledVersion() - { - return isInstalled() ? getVersion() : null; - } - - @NotNull - protected String getVersion() - { - try - { - SqlSelector selector = new SqlSelector(getSchema(), getVersionCheckSql()); - selector.setLogLevel(Level.OFF); - - return selector.getObject(String.class); - } - catch (Exception e) - { - return getInitialVersion(); - } - } - - protected boolean isInstalled() - { - return isInstalled(getSchema().getScope()); - } - - @Nullable - protected String getInstalledVersion() - { - if (_installedVersion == null) - { - _installedVersion = determineInstalledVersion(); - } - return _installedVersion; - } - - private boolean uninstallPrevious(ModuleContext context) - { - FileSqlScriptProvider provider = new FileSqlScriptProvider(ModuleLoader.getInstance().getModule(getModuleName())); - SqlScript script = new FileSqlScriptProvider.FileSqlScript(provider, getSchema(), getBaseScriptName() + "_uninstall.sql", getSchema().getName()); - - try - { - SqlScriptManager.get(provider, script.getSchema()).runScript(context.getUpgradeUser(), script, context, null); - return true; - } - catch (Throwable t) - { - // The uninstall script can fail if the database user lacks sufficient permissions. If the uninstall - // fails then log and display the exception to admins, but continue upgrading. Leaving the old version in place - // is not the end of the world - - // Wrap the exception to provide an explanation to the admin - Exception wrap = new Exception(getUninstallationExceptionMsg(), t); - ExceptionUtil.logExceptionToMothership(null, wrap); - ModuleLoader.getInstance().addModuleFailure(getModuleName(), wrap); - - return false; - } - } - - private void install(ModuleContext context) - { - boolean rds = getSchema().getScope().isRds(); - SqlScript script = getInstallScript(!rds); - - try (Connection conn = getSchema().getScope().getUnpooledConnection()) - { - LOG.info("Executing {} against {} database", script.getDescription(), rds ? "an RDS" : "a non-RDS"); - SqlScriptManager.get(script.getProvider(), script.getSchema()).runScript(context.getUpgradeUser(), script, context, conn); - } - catch (Throwable t) - { - // The install script can fail for a variety of reasons, e.g., the database user lacks sufficient - // permissions. If the automatic install fails then log and display the exception to admins, but continue - // upgrading. Not having the assembly is not a disaster; admin can install the function manually later. - - // Wrap the exception to provide an explanation to the admin - Exception wrap = new Exception(getInstallationExceptionMsg(), t); - ExceptionUtil.logExceptionToMothership(null, wrap); - ModuleLoader.getInstance().addModuleFailure(getModuleName(), wrap); - } - } - - @NotNull - public SqlScript getInstallScript() - { - return getInstallScript(true); - } - - @NotNull - public SqlScript getInstallScript(boolean includeEnableClrStatements) - { - String scriptName = getBaseScriptName() + "_install_" + getCurrentVersion() + ".sql"; - FileSqlScriptProvider provider = new ClrInstallationScriptProvider(ModuleLoader.getInstance().getModule(getModuleName()), includeEnableClrStatements); - return new FileSqlScriptProvider.FileSqlScript(provider, getSchema(), scriptName, getSchema().getName()); - } - - protected boolean isInstalled(String version) - { - return version.equals(getInstalledVersion()); - } - - public boolean isInstalled(DbScope scope) - { - boolean result = true; - try - { - // Attempt to use a function in the assembly. If this succeeds, we know it's installed. - SqlExecutor executor = new SqlExecutor(scope); - executor.setLogLevel(Level.OFF); // We expect this to fail in many cases... shut off data layer logging - executor.execute(getInstallationCheckSql()); - } - catch (Exception e) - { - result = false; - } - return result; - } - - public void ensureInstalled(ModuleContext context) - { - getInstalledVersion(); - // Return if newest version is already present... - if (isInstalled(getCurrentVersion())) - return; - - boolean success = uninstallPrevious(context); - - // If we can't uninstall the old version then give up; error has already been logged - if (!success) - return; - - // Attempt to install the new version - install(context); - } - - // Helper to generate standard warning message - protected void addAdminWarningMessage(Warnings warnings, String text, Class downloadActionClass, @Nullable String helpTopic) - { - ActionURL downloadURL = new ActionURL(downloadActionClass, ContainerManager.getRoot()); - HtmlStringBuilder builder = HtmlStringBuilder.of(text + " "); - builder.append(LinkBuilder.simpleLink("Download installation script.", downloadURL)); - - if (null != helpTopic) - builder.append(" ").append(new HelpTopic(helpTopic).getSimpleLinkHtml("View installation instructions.")); - - warnings.add(builder); - } - - private static class ClrInstallationScriptProvider extends FileSqlScriptProvider - { - private final boolean _includeEnableClrStatements; - - public ClrInstallationScriptProvider(Module module, boolean includeEnableClrStatements) - { - super(module); - _includeEnableClrStatements = includeEnableClrStatements; - } - - @Override - protected String getContents(DbSchema schema, String filename) throws SqlScriptException - { - String substitution = _includeEnableClrStatements ? getEnableClrStatements(schema.getSqlDialect()) : ""; - return super.getContents(schema, filename).replace("@@ENABLE_CLR_STATEMENTS@@", substitution); - } - - private String getEnableClrStatements(SqlDialect dialect) throws SqlScriptException - { - Module core = ModuleLoader.getInstance().getCoreModule(); - String enableClrFilename = "enable_clr.sql"; - Path path = core.getSqlScriptsPath(dialect).append(enableClrFilename); - Resource r = core.getModuleResource(path); - - try - { - return PageFlowUtil.getStreamContentsAsString(r.getInputStream()); - } - catch (IOException e) - { - throw new SqlScriptException(e, enableClrFilename); - } - } - } - - protected abstract DbSchema getSchema(); - protected abstract String getModuleName(); - protected abstract String getBaseScriptName(); - protected abstract String getInitialVersion(); - protected abstract String getCurrentVersion(); - protected abstract String getInstallationExceptionMsg(); - protected abstract String getUninstallationExceptionMsg(); - protected abstract SQLFragment getInstallationCheckSql(); - protected abstract String getVersionCheckSql(); - protected abstract void addAdminWarningMessages(Warnings warnings); -} diff --git a/api/src/org/labkey/api/data/bigiron/ClrAssemblyManager.java b/api/src/org/labkey/api/data/bigiron/ClrAssemblyManager.java deleted file mode 100644 index 02bba18cad9..00000000000 --- a/api/src/org/labkey/api/data/bigiron/ClrAssemblyManager.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2017-2026 LabKey Corporation - * - * 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 org.labkey.api.data.bigiron; - -import org.labkey.api.data.DbScope; -import org.labkey.api.view.template.WarningService; -import org.labkey.api.view.template.Warnings; - -import java.util.Set; -import java.util.concurrent.CopyOnWriteArraySet; - -/** - * User: tgaluhn - * Date: 1/16/2017 - * - * Central registration of individual assembly installation managers. Mainly so BaseMicrosoftSQLServerDialect doesn't need to know - * about all of them in order to gather any appropriate admin warning messages. It would be nice to also centralize the calls to - * ensureInstalled(), but a) GroupConcat is a special case that has to be checked as part of the core upgrade (as other upgrades - * depend on it), and b) there's only one other assembly at the moment. - */ -public class ClrAssemblyManager -{ - private static final Set _managers = new CopyOnWriteArraySet<>(); - - private ClrAssemblyManager() - { - } - - public static void registerInstallationManager(AbstractClrInstallationManager manager) - { - _managers.add(manager); - } - - public static void addAdminWarningMessages(Warnings warnings) - { - for (AbstractClrInstallationManager manager : _managers) - { - if (WarningService.get().showAllWarnings() || !manager.isInstalled(DbScope.getLabKeyScope())) - { - manager.addAdminWarningMessages(warnings); - } - } - } -} diff --git a/api/src/org/labkey/api/dataiterator/AsyncDataIterator.java b/api/src/org/labkey/api/dataiterator/AsyncDataIterator.java deleted file mode 100644 index 1369f1dd657..00000000000 --- a/api/src/org/labkey/api/dataiterator/AsyncDataIterator.java +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright (c) 2013-2026 LabKey Corporation - * - * 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 org.labkey.api.dataiterator; - -import org.labkey.api.data.ColumnInfo; -import org.labkey.api.query.BatchValidationException; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.atomic.AtomicInteger; - - -/** - * User: matthew - * Date: 5/4/13 - * Time: 9:21 AM - */ -public class AsyncDataIterator implements DataIterator -{ - public static class Builder implements DataIteratorBuilder - { - final DataIteratorBuilder _in; - public Builder(DataIteratorBuilder in) - { - _in = in; - } - - @Override - public DataIterator getDataIterator(DataIteratorContext context) - { - DataIterator it = _in.getDataIterator(context); - if (null == it) - return null; - return new AsyncDataIterator(it,context); - } - } - - // DataIterator instances are not usually thread safe, so use a lock for pass through calls - final Object _itLock; - DataIterator _it; - int _columnCount; - DataIteratorContext _context; - - Thread _reader; - -// ArrayListMap.FindMap _findMap; -// static ArrayListMap eof = new ArrayListMap(); -// protected LinkedBlockingQueue> _queue; - protected LinkedBlockingQueue _queue; - static Object[] eof = new Object[0]; - - ArrayList _buffer = new ArrayList<>(100); - int _currentRow = -1; - - AtomicInteger _partnerCount = new AtomicInteger(1); - - - public AsyncDataIterator(DataIterator it, DataIteratorContext context) - { - this(it,context,true); - } - - - public AsyncDataIterator(DataIterator it, DataIteratorContext context, boolean autostart) - { - _queue = new LinkedBlockingQueue<>(1000); - _itLock = new Object(); - _it = it; - _columnCount = it.getColumnCount(); - _context = context; -// _findMap = new ArrayListMap.FindMap(new CaseInsensitiveHashMap()); -// for (int i=0 ; i<= it.getColumnCount() ; i++) -// _findMap.put(it.getColumnInfo(i).getName(), i); - if (autostart) - start(); - } - - - - protected AsyncDataIterator(AsyncDataIterator partner) - { - synchronized (partner._itLock) - { - _itLock = partner._itLock; - _it = partner._it; - _queue = partner._queue; - _partnerCount = partner._partnerCount; - int count = _partnerCount.incrementAndGet(); - assert count > 1; - } - } - - - public AsyncDataIterator fork() - { - return new AsyncDataIterator(this); - } - - - - private void start() - { - _reader = new Thread(new ReadRunnable(), "AsyncDataIterator"); - _reader.start(); - } - - - private class ReadRunnable implements Runnable - { - @Override - public void run() - { - try - { - while (!Thread.interrupted() && _it.next()) - { - Object[] row = new Object[_columnCount+1]; - for (int i=0 ; i<=_columnCount ; i++) - row[i] = _it.get(i); - _queue.put(row); - } - } - catch (BatchValidationException x) - { - assert x.hasErrors(); - } - catch (InterruptedException x) - { - } - try { _queue.put(eof); } catch (InterruptedException x) { } - // don't close _it from background thread, this causes DbScope/Transaction problems - // try {_it.close(); } catch (IOException x) {} - } - } - - - @Override - public int getColumnCount() - { - synchronized (_itLock) - { - return _it.getColumnCount(); - } - } - - - @Override - public ColumnInfo getColumnInfo(int i) - { - synchronized (_itLock) - { - return _it.getColumnInfo(i); - } - } - - - @Override - public boolean next() - { - Object[] row=null; - if (_currentRow+1 >= _buffer.size()) - { - _buffer.clear(); - _currentRow = -1; - while (_buffer.isEmpty()) - { - int count = _queue.drainTo(_buffer, 100); - if (count == 0) - { - try { row = _queue.take(); } catch (InterruptedException x) { } - if (null != row) - _buffer.add(row); - if (eof == row) - break; - } - } - } - _currentRow++; - row = _buffer.get(_currentRow); - if (eof == row) - { - try { _queue.put(eof); } catch (InterruptedException x) { } - return false; - } - return true; - } - - - @Override - public String getDebugName() - { - return this.getClass().getName(); - } - - - @Override - public boolean isConstant(int i) - { - synchronized (_itLock) - { - return _it.isConstant(i); - } - } - - - @Override - public Object getConstantValue(int i) - { - synchronized (_itLock) - { - return _it.getConstantValue(i); - } - } - - - @Override - public Object get(int i) - { - if (i == 0) - return _currentRow+1; - return _buffer.get(_currentRow)[i]; - } - - - @Override - public void close() throws IOException - { - synchronized (_itLock) - { - if (0 == _partnerCount.decrementAndGet()) - { - _reader.interrupt(); - try {_reader.join();} catch (InterruptedException x) {} - _it.close(); - } - } - } - - @Override - public void debugLogInfo(StringBuilder sb) - { - sb.append(" " + getDebugName() + ": " + this.getClass().getName() + "\n"); - if (null != _it) - _it.debugLogInfo(sb); - } - -} diff --git a/api/src/org/labkey/api/dataiterator/FilterDataIterator.java b/api/src/org/labkey/api/dataiterator/FilterDataIterator.java deleted file mode 100644 index 37e6fad7b5d..00000000000 --- a/api/src/org/labkey/api/dataiterator/FilterDataIterator.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2011-2026 LabKey Corporation - * - * 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 org.labkey.api.dataiterator; - -import org.labkey.api.query.BatchValidationException; - -import java.util.function.Predicate; - -/** - * DataIterator implementation that skips over selected rows in its incoming data stream, based on either - * overriding the accept() method, or passing in a Predicate to make the decision. - * User: matthewb - * Date: 2011-05-31 - */ -public class FilterDataIterator extends WrapperDataIterator -{ - final Predicate predicate; - - // you can use this method if you override accept() - protected FilterDataIterator(DataIterator in) - { - super(in); - predicate = (di) -> accept(); - } - - public FilterDataIterator(DataIterator in, Predicate p) - { - super(in); - this.predicate = p; - } - - @Override - public boolean next() throws BatchValidationException - { - while (super.next()) - { - if (predicate.test(_delegate)) - return true; - } - return false; - } - - protected boolean accept() - { - return true; - } -} diff --git a/api/src/org/labkey/api/dataiterator/NameExpressionDataIteratorBuilder.java b/api/src/org/labkey/api/dataiterator/NameExpressionDataIteratorBuilder.java deleted file mode 100644 index fdcc8092ed8..00000000000 --- a/api/src/org/labkey/api/dataiterator/NameExpressionDataIteratorBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2018-2026 LabKey Corporation - * - * 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 org.labkey.api.dataiterator; - -import org.labkey.api.data.TableInfo; - -public class NameExpressionDataIteratorBuilder implements DataIteratorBuilder -{ - final DataIteratorBuilder _pre; - private final TableInfo _parentTable; - private final String _nameColumnName; - private final String _nameExpressionColumnName; - - public NameExpressionDataIteratorBuilder(DataIteratorBuilder pre, TableInfo parentTable) - { - this(pre, parentTable, "name", "nameExpression"); - } - - public NameExpressionDataIteratorBuilder(DataIteratorBuilder pre, TableInfo parentTable, String nameColumn, String nameExpressionColumn) - { - _pre = pre; - _parentTable = parentTable; - _nameColumnName = nameColumn; - _nameExpressionColumnName = nameExpressionColumn; - } - - @Override - public DataIterator getDataIterator(DataIteratorContext context) - { - DataIterator pre = _pre.getDataIterator(context); - return LoggingDataIterator.wrap(new NameExpressionDataIterator(pre, context, _parentTable, null, null, null, null, _nameColumnName, _nameExpressionColumnName)); - } -} diff --git a/api/src/org/labkey/api/docker/DockerSessionListener.java b/api/src/org/labkey/api/docker/DockerSessionListener.java deleted file mode 100644 index 9ef9db74141..00000000000 --- a/api/src/org/labkey/api/docker/DockerSessionListener.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2018-2026 LabKey Corporation - * - * 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 org.labkey.api.docker; - -import org.jetbrains.annotations.NotNull; - -import jakarta.servlet.http.HttpSessionBindingEvent; -import jakarta.servlet.http.HttpSessionBindingListener; - -// Moved from git, see history at https://github.com/LabKey/docker/commits/release18.1/api-src/org/labkey/api/docker/DockerSessionListener.java - -/** - * User: tgaluhn - * Date: 6/13/2016 - */ -public class DockerSessionListener implements HttpSessionBindingListener -{ - private final String _containerId; - - public DockerSessionListener(@NotNull String containerId) - { - _containerId = containerId; - } - - @Override - public void valueBound(HttpSessionBindingEvent httpSessionBindingEvent) - { - // Nothing to do - } - - @Override - public void valueUnbound(HttpSessionBindingEvent httpSessionBindingEvent) - { - preStop(); - - try - { - stopContainer(_containerId); - } - catch (Exception ex) - { - // oh well - } - } - - protected void preStop() {} - - /** - * Override to route the stop through a service-specific manager (e.g. DockerRStudioManager) when one tracks - * its own cache of containers; the default here stops via DockerService directly, leaving such a cache stale. - */ - protected void stopContainer(@NotNull String containerId) - { - DockerService.get().stop(containerId); - } -} diff --git a/api/src/org/labkey/api/exp/api/ExpProtocolAttachmentParent.java b/api/src/org/labkey/api/exp/api/ExpProtocolAttachmentParent.java deleted file mode 100644 index fe888629d03..00000000000 --- a/api/src/org/labkey/api/exp/api/ExpProtocolAttachmentParent.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2019-2026 LabKey Corporation - * - * 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 org.labkey.api.exp.api; - -import org.jetbrains.annotations.NotNull; -import org.labkey.api.attachments.AttachmentParent; -import org.labkey.api.attachments.AttachmentParentType; - -public class ExpProtocolAttachmentParent implements AttachmentParent -{ - private final ExpProtocol _protocol; - - public ExpProtocolAttachmentParent(ExpProtocol protocol) - { - _protocol = protocol; - } - - @Override - public String getEntityId() - { - return _protocol.getEntityId(); - } - - @Override - public String getContainerId() - { - return _protocol.getContainer().getId(); - } - - @Override - public @NotNull AttachmentParentType getAttachmentParentType() - { - return ExpProtocolAttachmentType.get(); - } -} diff --git a/api/src/org/labkey/api/exp/property/PropertyUtil.java b/api/src/org/labkey/api/exp/property/PropertyUtil.java deleted file mode 100644 index 70fc89fda84..00000000000 --- a/api/src/org/labkey/api/exp/property/PropertyUtil.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2008-2012 LabKey Corporation - * - * 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 org.labkey.api.exp.property; - -import org.apache.commons.lang3.math.NumberUtils; -import org.apache.commons.lang3.time.FastDateFormat; -import org.labkey.api.exp.PropertyType; - -import java.text.DecimalFormat; - -/* -* User: Karl Lum -* Date: Sep 9, 2008 -* Time: 1:40:16 PM -*/ -public class PropertyUtil -{ - public static Object formatValue(PropertyType type, String formatString, Object value, String defaultFormat) - { - if (formatString == null) - formatString = defaultFormat; - - if (formatString != null) - { - if (type == PropertyType.DATE_TIME) - return FastDateFormat.getInstance(formatString).format(value); - - else if (type == PropertyType.DOUBLE || type == PropertyType.INTEGER) - { - if (!(value instanceof Number)) - value = NumberUtils.createNumber(String.valueOf(value)); - return new DecimalFormat(formatString).format(value); - } - } - return value; - } -} \ No newline at end of file diff --git a/api/src/org/labkey/api/flow/api/FlowService.java b/api/src/org/labkey/api/flow/api/FlowService.java deleted file mode 100644 index 20ab517eabb..00000000000 --- a/api/src/org/labkey/api/flow/api/FlowService.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2010-2026 LabKey Corporation - * - * 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 org.labkey.api.flow.api; - -import org.jetbrains.annotations.Nullable; -import org.labkey.api.services.ServiceRegistry; -import org.labkey.api.webdav.WebdavResourceExpDataProvider; - -/** - * User: matthewb - * Date: Oct 25, 2010 - * Time: 10:18:04 AM - */ -public interface FlowService extends WebdavResourceExpDataProvider -{ - static @Nullable FlowService get() - { - return ServiceRegistry.get().getService(FlowService.class); - } - - static void setInstance(FlowService impl) - { - ServiceRegistry.get().registerService(FlowService.class, impl); - } -} diff --git a/api/src/org/labkey/api/pipeline/AbstractSpecimenTransformTask.java b/api/src/org/labkey/api/pipeline/AbstractSpecimenTransformTask.java deleted file mode 100644 index 7c86b088cc4..00000000000 --- a/api/src/org/labkey/api/pipeline/AbstractSpecimenTransformTask.java +++ /dev/null @@ -1,391 +0,0 @@ -/* - * Copyright (c) 2013-2026 LabKey Corporation - * - * 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 org.labkey.api.pipeline; - -import org.apache.commons.beanutils.ConversionException; -import org.jetbrains.annotations.Nullable; -import org.labkey.api.collections.ArrayListMap; -import org.labkey.api.data.TSVMapWriter; -import org.labkey.api.util.DateUtil; -import org.labkey.api.util.FileUtil; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.function.Predicate; -import java.util.function.UnaryOperator; -import java.util.stream.Collectors; -import java.util.zip.ZipEntry; -import java.util.zip.ZipOutputStream; - -import static org.labkey.api.util.IntegerUtils.asIntegerElseNull; - -/** - * User: klum - * Date: 11/12/13 - */ -public abstract class AbstractSpecimenTransformTask -{ - protected final PipelineJob _job; - - public AbstractSpecimenTransformTask(PipelineJob job) - { - _job = job; - } - - /** - * Transform a row of data from the parsed input data file the transformed specimen row - * During the transform, it's expected that any lab, primary, derivative and additive - * information would be extracted. - * - * @return the transformed specimen row - */ - protected abstract Map transformRow(Map inputRow, int rowIndex, Map labIds, Map primaryIds, Map derivativeIds); - - protected abstract Set getIgnoredHashColumns(); - protected abstract Map getLabIds(); - protected abstract Map getPrimaryIds(); - protected abstract Map getDerivativeIds(); - protected abstract Map getAdditiveIds(); - private int rowIndex = 0; - private final Set hashes = new HashSet<>(); - - protected List> transformRows(List> inputRows) - { - return inputRows - .stream() - .filter(MapFilter.getMapFilter(this)) - .map(MapTransformer.getMapTransformer(this, getLabIds(), getPrimaryIds(), getDerivativeIds())) - .collect(Collectors.toList()); - } - - protected interface MapFilter extends Predicate> - { - static MapFilter getMapFilter(AbstractSpecimenTransformTask task) - { - return row -> { - try - { - return task.hashes.add(task.hashRow(row)); - } - catch (IOException e) - { - return true; // Keep row - } - }; - } - } - - protected interface MapTransformer extends UnaryOperator> - { - static MapTransformer getMapTransformer(AbstractSpecimenTransformTask task, Map labIds, Map primaryIds, Map derivativeIds) - { - return row -> task.transformRow(row, task.rowIndex++, labIds, primaryIds, derivativeIds); - } - } - - /** Write out an empty additives.tsv, since we aren't using them */ - protected void writeAdditives(Map additiveIds, ZipOutputStream file) throws IOException - { - if (additiveIds.isEmpty()) - { - file.putNextEntry(new ZipEntry("additives.tsv")); - - try (PrintWriter writer = new PrintWriter(file)) - { - writer.write("# additives\n"); - writer.write("additive_id\tldms_additive_code\tlabware_additive_code\tadditive\n"); - } - } - else - { - List> rows = new ArrayList<>(); - for (Map.Entry entry : additiveIds.entrySet()) - { - Map row = new HashMap<>(); - - // We know the id and the type name - row.put("additive_id", entry.getValue()); - row.put("additive", entry.getKey()); - // All the other columns are blank - row.put("ldms_additive_code", null); - row.put("labware_additive_code", null); - - rows.add(row); - } - writeTSV(file, rows, "additives"); - } - } - - protected void writePrimaries(Map primaryIds, ZipOutputStream file) throws IOException - { - List> rows = new ArrayList<>(); - for (Map.Entry entry : primaryIds.entrySet()) - { - Map row = new HashMap<>(); - // We know the id and the type name - row.put("primary_type_id", entry.getValue()); - row.put("primary_type", entry.getKey()); - // All the other columns are blank - row.put("primary_type_ldms_code", null); - row.put("primary_type_labware_code", null); - rows.add(row); - } - - writeTSV(file, rows, "primary_types"); - } - - protected void writeDerivatives(Map derivatives, ZipOutputStream file) throws IOException - { - List> rows = new ArrayList<>(); - for (Map.Entry entry : derivatives.entrySet()) - { - Map row = new HashMap<>(); - // We know the id and the name - row.put("derivative_id", entry.getValue()); - row.put("derivative", entry.getKey()); - // Everything else is left blank - row.put("ldms_derivative_code", null); - row.put("labware_derivative_code", null); - rows.add(row); - } - - writeTSV(file, rows, "derivatives"); - } - - protected void writeLabs(Map labIds, ZipOutputStream file) throws IOException - { - List> rows = new ArrayList<>(); - for (Map.Entry entry : labIds.entrySet()) - { - Map row = new HashMap<>(); - // We know the id and the name - row.put("lab_id", entry.getValue()); - row.put("lab_name", entry.getKey()); - row.put("ldms_lab_code", -1); // ldms code required : issue #22217 - // Everything else is left blank - row.put("lab_upload_code", null); - row.put("is_sal", null); - row.put("is_repository", null); - row.put("is_clinic", null); - row.put("is_endpoint", null); - rows.add(row); - } - - writeTSV(file, rows, "labs"); - } - - protected String hashRow(Map inputRow) throws IOException - { - // Check that Map is a type that has consistent key ordering - if (!(inputRow instanceof ArrayListMap)) - throw new IllegalStateException(); - - StringBuilder sb = new StringBuilder(); - for (String key : inputRow.keySet()) - { - if (!getIgnoredHashColumns().contains(key)) - { - sb.append(key); - sb.append(": "); - sb.append(String.valueOf(inputRow.get(key))); - sb.append(";"); - } - } - - // Hash the row to reduce the size in memory - return FileUtil.sha1sum(sb.toString().getBytes()); - } - - protected void writeTSV(ZipOutputStream zOut, List> outputRows, String baseName) throws IOException - { - // Add a new file to the ZIP - zOut.putNextEntry(new ZipEntry(baseName + ".tsv")); - PrintWriter writer = new PrintWriter(zOut); - try - { - TSVMapWriter tsvWriter = new TSVMapWriter(outputRows); - // Write a comment into the header - tsvWriter.setFileHeader(Collections.singletonList("# " + baseName)); - // Set the writer separately from the call to write() so that the underlying stream doesn't get closed - // when it's finished writing the TSV - we need to keep writing to the ZIP - if (!outputRows.isEmpty()) - { - tsvWriter.setPrintWriter(writer); - tsvWriter.write(); - } - } - finally - { - writer.flush(); - zOut.closeEntry(); - } - } - - protected static class SpecimenTransformTSVWriter extends TSVMapWriter - { - private int _rowCount; - public SpecimenTransformTSVWriter(Iterable> rows) - { - super(new ArrayList<>(), rows); // start with empty column list - } - - @Override - public void writeRow(Map row) - { - if (null != row) - { - if (_rowCount == 0) - { - writeFileHeader(); - setColumns(row.keySet()); - writeColumnHeaders(); - - } - super.writeRow(row); - _rowCount++; - } - } - - public int getRowCount() - { - return _rowCount; - } - } - - protected void toDate(String key, Map row) - { - Object d = row.get(key); - if (null == d || d instanceof Date) - return; - try - { - Date date = new Date(DateUtil.parseDateTime(String.valueOf(d))); - row.put(key,date); - } - catch (ConversionException x) - { - /* */ - } - } - - @Nullable - protected Date parseDateTime(String keyDate, @Nullable String keyTime, Map row) - { - Object d = row.get(keyDate); - if (null == d) - return null; - try - { - Date date = d instanceof Date ? (Date)d : new Date(DateUtil.parseDateTime(String.valueOf(d))); - if (keyTime != null) - { - Object t = row.get(keyTime); - if (t != null) - { - long time = DateUtil.parseTimeToMillis(String.valueOf(t)); - date = new Date(date.getTime() + time); - } - } - return date; - } - catch (ConversionException x) - { - /* */ - } - return null; - } - - protected Date parseDate(String keyDate, Map row) - { - Object d = row.get(keyDate); - if (null == d) - return null; - try - { - Date date = d instanceof Date ? (Date)d : new Date(DateUtil.parseDateTime(String.valueOf(d))); - return date; - } - catch (ConversionException x) - { - /* */ - } - return null; - } - - protected void toInt(String key, Map row) - { - Object o = row.get(key); - if (null == o || o instanceof Integer) - return; - try - { - if (asIntegerElseNull(o) instanceof Integer i) - o = i; - else - o = Integer.parseInt(String.valueOf(o)); - row.put(key,o); - } - catch (NumberFormatException x) - { - /* */ - } - } - - protected String getNonNullValue(Map inputRow, String name) - { - return inputRow.get(name) == null ? "" : inputRow.get(name).toString(); - } - - protected String removeNonNullValue(Map inputRow, String name) - { - Object o = inputRow.remove(name); - return o == null ? "" : o.toString(); - } - - protected void debug(String msg) - { - if (null != _job) - _job.debug(msg); - } - - - protected void info(String msg) - { - if (null != _job) - _job.info(msg); - } - - - protected void warn(String msg) - { - if (null != _job) - _job.warn(msg); - } - - protected void error(String msg) - { - if (null != _job) - _job.error(msg); - } -} diff --git a/api/src/org/labkey/api/query/QcAwarePropertyForeignKey.java b/api/src/org/labkey/api/query/QcAwarePropertyForeignKey.java deleted file mode 100644 index 0069ae876ac..00000000000 --- a/api/src/org/labkey/api/query/QcAwarePropertyForeignKey.java +++ /dev/null @@ -1,417 +0,0 @@ -/* - * Copyright (c) 2009-2026 LabKey Corporation - * - * 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 org.labkey.api.query; - -import org.labkey.api.data.BaseColumnInfo; -import org.labkey.api.data.ColumnInfo; -import org.labkey.api.data.DisplayColumn; -import org.labkey.api.data.DisplayColumnFactory; -import org.labkey.api.data.JdbcType; -import org.labkey.api.data.MVDisplayColumnFactory; -import org.labkey.api.data.OORDisplayColumnFactory; -import org.labkey.api.data.OutOfRangeDisplayColumn; -import org.labkey.api.data.SQLFragment; -import org.labkey.api.data.TableInfo; -import org.labkey.api.exp.MvColumn; -import org.labkey.api.exp.PropertyColumn; -import org.labkey.api.exp.PropertyDescriptor; -import org.labkey.api.exp.PropertyType; -import org.labkey.api.exp.RawValueColumn; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * User: brittp - * Date: Oct 25, 2007 - * Time: 10:06:18 AM - */ -public class QcAwarePropertyForeignKey extends PropertyForeignKey -{ - private final TableInfo _baseTable; - private final QcMetadata _metadata; - - public QcAwarePropertyForeignKey(QuerySchema schema, TableInfo baseTable, Collection pds) - { - this(getDisplayPds(pds), baseTable, schema); - } - - private QcAwarePropertyForeignKey(QcMetadata metadata, TableInfo baseTable, QuerySchema schema) - { - super(schema, null, metadata.getDisplayProperties()); - _baseTable = baseTable; - _metadata = metadata; - } - - - private static QcMetadata getDisplayPds(Collection pds) - { - final Map nameToPropertyMap = new HashMap<>(); - for (PropertyDescriptor pd : pds) - nameToPropertyMap.put(pd.getName(), pd); - QcMetadata metadata = new QcMetadata(); - - for (PropertyDescriptor displayPd : pds) - { - PropertyDescriptor oorIndicatorPd = nameToPropertyMap.get(displayPd.getName() + OORDisplayColumnFactory.OOR_INDICATOR_COLUMN_SUFFIX); - if (oorIndicatorPd != null) - { - metadata.addOORPropertyDescriptor(displayPd, oorIndicatorPd); - } - else if (!(displayPd.getName().toLowerCase().endsWith(OORDisplayColumnFactory.OOR_INDICATOR_COLUMN_SUFFIX.toLowerCase()) && - nameToPropertyMap.containsKey(displayPd.getName().substring(0, displayPd.getName().length() - OORDisplayColumnFactory.OOR_INDICATOR_COLUMN_SUFFIX.length())))) - { - metadata.addNonOORPropertyDescriptor(displayPd); - } - } - return metadata; - } - - @Override - protected BaseColumnInfo constructColumnInfo(ColumnInfo parent, FieldKey name, PropertyDescriptor pd) - { - OORColumnGroup group = _metadata.getOORGroupByDisplayColumn(pd); - if (group != null) - { - BaseColumnInfo col = super.constructColumnInfo(parent, name, pd); - col.setDisplayColumnFactory(new LateBoundOORDisplayColumnFactory(group.getBaseName())); - return col; - } - - group = _metadata.getOORGroupByInRangeColumn(pd); - if (group != null) - { - BaseColumnInfo inRangeColumn = new InRangeExprColumn(_baseTable, name, group.getBaseName()); - inRangeColumn.setLabel(group.getInRangePd().getLabel()); - inRangeColumn.setFormat(group.getNumberPd().getFormat()); - return inRangeColumn; - } - - if (pd.isMvEnabled()) - { - // Just need to set the display column factory - BaseColumnInfo col = super.constructColumnInfo(parent, name, pd); - col.setMvColumnName(new FieldKey(null, pd.getName() + MvColumn.MV_INDICATOR_SUFFIX)); - col.setDisplayColumnFactory(new MVDisplayColumnFactory()); - return col; - } - - QcColumnGroup qcGroup = _metadata.getQcColumnGroupByIndicator(pd); - if (qcGroup != null) - { - if (parent == null) - { - return new BaseColumnInfo(pd.getName(), pd.getJdbcType()); - } - PropertyColumn qcColumn = new PropertyColumn(pd, parent, _schema.getContainer(), _schema.getUser(), false); - qcColumn.setParentIsObjectId(_parentIsObjectId); - qcColumn.setMvIndicatorColumn(true); - qcColumn.setNullable(true); - qcColumn.setUserEditable(false); - return qcColumn; - } - - return super.constructColumnInfo(parent, name, pd); - } - - public Collection getDefaultHiddenProperties() - { - return _metadata.getDefaultHiddenProperties(); - } - - private static ColumnInfo getIndicatorColumn(String baseName, ColumnInfo colInfo) - { - return getNamedColumn(baseName, colInfo, OORDisplayColumnFactory.OOR_INDICATOR_COLUMN_SUFFIX); - } - - private static ColumnInfo getNamedColumn(String baseName, ColumnInfo colInfo, String suffix) - { - FieldKey thisFieldKey = FieldKey.fromString(colInfo.getName()); - List keys = new ArrayList<>(); - - FieldKey otherKey = new FieldKey(thisFieldKey.getParent(), baseName + suffix); - keys.add(otherKey); - Map cols = QueryService.get().getColumns(colInfo.getParentTable(), keys); - return cols.get(otherKey); - } - - private static class LateBoundOORDisplayColumnFactory implements DisplayColumnFactory - { - private final String _baseName; - - public LateBoundOORDisplayColumnFactory(String baseName) - { - _baseName = baseName; - } - - @Override - public DisplayColumn createRenderer(ColumnInfo colInfo) - { - ColumnInfo oorIndicator = getIndicatorColumn(_baseName, colInfo); - return new OutOfRangeDisplayColumn(colInfo, oorIndicator); - } - } - - private static class InRangeExprColumn extends ExprColumn - { - private final String _baseName; - - private InRangeExprColumn(TableInfo parent, FieldKey name, String baseName) - { - super(parent, name, null, JdbcType.INTEGER); - _baseName = baseName; - } - - @Override - public SQLFragment getValueSql(String tableAlias) - { - ColumnInfo indicatorCol = getIndicatorColumn(_baseName, this); - ColumnInfo numberCol = getNumberColumn(_baseName, this); - - SQLFragment inRangeSQL = new SQLFragment("CASE WHEN ("); - inRangeSQL.append(indicatorCol.getValueSql(tableAlias)); - inRangeSQL.unsafeAppend(") IS NULL THEN ("); - inRangeSQL.append(numberCol.getValueSql(tableAlias)); - inRangeSQL.unsafeAppend(") ELSE NULL END"); - return inRangeSQL; - } - - @Override - public void declareJoins(String parentAlias, Map map) - { - ColumnInfo indicatorCol = getIndicatorColumn(_baseName, this); - if (indicatorCol == null) - { - throw new IllegalStateException("Could not find " + _baseName + OORDisplayColumnFactory.OOR_INDICATOR_COLUMN_SUFFIX + " column"); - } - indicatorCol.declareJoins(parentAlias, map); - ColumnInfo numberCol = getNumberColumn(_baseName, this); - if (numberCol == null) - { - throw new IllegalStateException("Could not find " + _baseName + OORDisplayColumnFactory.NUMBER_COLUMN_SUFFIX + " column"); - } - numberCol.declareJoins(parentAlias, map); - } - - private ColumnInfo getNumberColumn(String baseName, ColumnInfo colInfo) - { - return getNamedColumn(baseName, colInfo, OORDisplayColumnFactory.NUMBER_COLUMN_SUFFIX); - } - } - - private static class OORColumnGroup - { - private final String _baseName; - private final PropertyDescriptor _displayPd; - private final PropertyDescriptor _indicatorPd; - private final PropertyDescriptor _numberPd; - private final PropertyDescriptor _inRangePd; - - private OORColumnGroup(PropertyDescriptor displayPd, PropertyDescriptor indicatorPd, - PropertyDescriptor numberPd, PropertyDescriptor inRangePd) - { - _baseName = displayPd.getName(); - _displayPd = displayPd; - _indicatorPd = indicatorPd; - _numberPd = numberPd; - _inRangePd = inRangePd; - } - - private PropertyDescriptor getDisplayPd() - { - return _displayPd; - } - - private PropertyDescriptor getIndicatorPd() - { - return _indicatorPd; - } - - private PropertyDescriptor getNumberPd() - { - return _numberPd; - } - - private PropertyDescriptor getInRangePd() - { - return _inRangePd; - } - - private String getBaseName() - { - return _baseName; - } - } - - private static class QcColumnGroup - { - private final String _baseName; - private final PropertyDescriptor _displayPd; - private final PropertyDescriptor _indicatorPd; - private final PropertyDescriptor _rawValuePd; - - private QcColumnGroup(PropertyDescriptor displayPd, PropertyDescriptor indicatorPd, PropertyDescriptor rawValuePd) - { - _baseName = displayPd.getName(); - _displayPd = displayPd; - _indicatorPd = indicatorPd; - _rawValuePd = rawValuePd; - } - - private PropertyDescriptor getDisplayPd() - { - return _displayPd; - } - - private PropertyDescriptor getIndicatorPd() - { - return _indicatorPd; - } - - private PropertyDescriptor getRawValuePd() - { - return _rawValuePd; - } - - private String getBaseName() - { - return _baseName; - } - } - - private static class QcMetadata - { - private final List _oorGroups = new ArrayList<>(); - private final List _qcGroups = new ArrayList<>(); - private final List _additionalDisplayPds = new ArrayList<>(); - - private void addOORPropertyDescriptor(PropertyDescriptor displayPd, PropertyDescriptor indicatorPd) - { - PropertyDescriptor numberPd = displayPd.clone(); - numberPd.setName(displayPd.getName() + OORDisplayColumnFactory.NUMBER_COLUMN_SUFFIX); - numberPd.setLabel(displayPd.getName() + " Number"); - - PropertyDescriptor inRangePd = displayPd.clone(); - inRangePd.setName(displayPd.getName() + OORDisplayColumnFactory.IN_RANGE_COLUMN_SUFFIX); - inRangePd.setLabel(displayPd.getName() + " In Range"); - _oorGroups.add(new OORColumnGroup(displayPd, indicatorPd, numberPd, inRangePd)); - } - - private void addNonOORPropertyDescriptor(PropertyDescriptor pd) - { - // May be a MV PD, but not OOR specifically - if (pd.isMvEnabled()) - { - PropertyDescriptor indicatorPd = pd.clone(); - indicatorPd.setName(pd.getName() + MvColumn.MV_INDICATOR_SUFFIX); - indicatorPd.setLabel(pd.getName() + " MV Indicator"); - indicatorPd.setRangeURI(PropertyType.STRING.getTypeUri()); - indicatorPd.setMvEnabled(false); - - PropertyDescriptor rawValuePd = pd.clone(); - rawValuePd.setName(pd.getName() + RawValueColumn.RAW_VALUE_SUFFIX); - rawValuePd.setLabel(pd.getName() + " Raw Value"); - rawValuePd.setMvEnabled(false); - - _qcGroups.add(new QcColumnGroup(pd, indicatorPd, rawValuePd)); - } - else - { - _additionalDisplayPds.add(pd); - } - } - - private List getDisplayProperties() - { - List pds = new ArrayList<>(_additionalDisplayPds); - for (OORColumnGroup group : _oorGroups) - { - pds.add(group.getDisplayPd()); - pds.add(group.getIndicatorPd()); - pds.add(group.getInRangePd()); - pds.add(group.getNumberPd()); - } - for (QcColumnGroup group : _qcGroups) - { - pds.add(group.getDisplayPd()); - pds.add(group.getIndicatorPd()); - pds.add(group.getRawValuePd()); - } - return pds; - } - - private Collection getDefaultHiddenProperties() - { - List pds = new ArrayList<>(); - for (OORColumnGroup group : _oorGroups) - { - pds.add(group.getIndicatorPd()); - pds.add(group.getInRangePd()); - pds.add(group.getNumberPd()); - } - for (QcColumnGroup group : _qcGroups) - { - pds.add(group.getIndicatorPd()); - pds.add(group.getRawValuePd()); - } - return pds; - } - - private OORColumnGroup getOORGroupByDisplayColumn(PropertyDescriptor pd) - { - for (OORColumnGroup group : _oorGroups) - { - if (pd.getName().equals(group.getDisplayPd().getName())) - return group; - } - return null; - } - - private OORColumnGroup getOORGroupByInRangeColumn(PropertyDescriptor pd) - { - for (OORColumnGroup group : _oorGroups) - { - if (pd.getName().equals(group.getInRangePd().getName())) - return group; - } - return null; - } - - private QcColumnGroup getQcColumnGroup(PropertyDescriptor pd) - { - for (QcColumnGroup group : _qcGroups) - { - if (pd.getName().equals(group.getDisplayPd().getName())) - return group; - } - return null; - } - - private QcColumnGroup getQcColumnGroupByIndicator(PropertyDescriptor pd) - { - for (QcColumnGroup group : _qcGroups) - { - if (pd.getName().equals(group.getIndicatorPd().getName())) - return group; - } - return null; - } - } -} diff --git a/api/src/org/labkey/api/reader/SimpleXMLStreamReader.java b/api/src/org/labkey/api/reader/SimpleXMLStreamReader.java deleted file mode 100644 index 57809e3a69f..00000000000 --- a/api/src/org/labkey/api/reader/SimpleXMLStreamReader.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2008-2026 LabKey Corporation - * - * 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 org.labkey.api.reader; - -import org.labkey.api.util.XmlBeansUtil; - -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamException; -import java.io.InputStream; - -/** - * User: arauch - * Date: May 25, 2005 - * Time: 12:16:40 PM - */ -public class SimpleXMLStreamReader extends XMLStreamReaderWrapper -{ - public SimpleXMLStreamReader(InputStream stream) throws XMLStreamException - { - super(XmlBeansUtil.XML_INPUT_FACTORY.createXMLStreamReader(stream)); - } - - - public boolean skipToStart(String element) throws XMLStreamException - { - return skipTo(element, true); - } - - - public boolean skipToEnd(String element) throws XMLStreamException - { - return skipTo(element, false); - } - - - private boolean skipTo(String element, boolean start) throws XMLStreamException - { - while (hasNext()) - { - next(); - - if ((start ? isStartElement() : isEndElement()) && getLocalName().equals(element)) - return true; - } - - return false; - } - - - public String getHref() - throws XMLStreamException - { - while (hasNext()) - { - int event = next(); - - if (event == XMLStreamConstants.START_ELEMENT && "A".equals(getLocalName())) - return getAttributeValue("", "HREF"); - } - // UNDONE: Raise exception instead of returning null - return null; - } -} diff --git a/api/src/org/labkey/api/reader/XMLStreamReaderWrapper.java b/api/src/org/labkey/api/reader/XMLStreamReaderWrapper.java deleted file mode 100644 index 258f48dcc08..00000000000 --- a/api/src/org/labkey/api/reader/XMLStreamReaderWrapper.java +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Copyright (c) 2005-2026 Fred Hutchinson Cancer Research Center - * - * 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 org.labkey.api.reader; - -import javax.xml.namespace.NamespaceContext; -import javax.xml.namespace.QName; -import javax.xml.stream.Location; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -/** - * User: arauch - * Date: May 25, 2005 - * Time: 11:34:10 AM - */ -public class XMLStreamReaderWrapper implements XMLStreamReader -{ - private final XMLStreamReader streamReader; - - public XMLStreamReaderWrapper(XMLStreamReader streamReader) - { - this.streamReader = streamReader; - } - - @Override - public void close() throws XMLStreamException - { - streamReader.close(); - } - - @Override - public int getAttributeCount() - { - return streamReader.getAttributeCount(); - } - - @Override - public String getAttributeLocalName(int i) - { - return streamReader.getAttributeLocalName(i); - } - - @Override - public QName getAttributeName(int i) - { - return streamReader.getAttributeName(i); - } - - @Override - public String getAttributeNamespace(int i) - { - return streamReader.getAttributeNamespace(i); - } - - @Override - public String getAttributePrefix(int i) - { - return streamReader.getAttributePrefix(i); - } - - @Override - public String getAttributeType(int i) - { - return streamReader.getAttributeType(i); - } - - @Override - public String getAttributeValue(int i) - { - return streamReader.getAttributeValue(i); - } - - @Override - public String getAttributeValue(String s, String s1) - { - return streamReader.getAttributeValue(s, s1); - } - - @Override - public String getCharacterEncodingScheme() - { - return streamReader.getCharacterEncodingScheme(); - } - - @Override - public String getElementText() throws XMLStreamException - { - return streamReader.getElementText(); - } - - @Override - public String getEncoding() - { - return streamReader.getEncoding(); - } - - @Override - public int getEventType() - { - return streamReader.getEventType(); - } - - @Override - public String getLocalName() - { - return streamReader.getLocalName(); - } - - @Override - public Location getLocation() - { - return streamReader.getLocation(); - } - - @Override - public QName getName() - { - return streamReader.getName(); - } - - @Override - public NamespaceContext getNamespaceContext() - { - return streamReader.getNamespaceContext(); - } - - @Override - public int getNamespaceCount() - { - return streamReader.getNamespaceCount(); - } - - @Override - public String getNamespacePrefix(int i) - { - return streamReader.getNamespacePrefix(i); - } - - @Override - public String getNamespaceURI() - { - return streamReader.getNamespaceURI(); - } - - @Override - public String getNamespaceURI(int i) - { - return streamReader.getNamespaceURI(i); - } - - @Override - public String getNamespaceURI(String s) - { - return streamReader.getNamespaceURI(s); - } - - @Override - public String getPIData() - { - return streamReader.getPIData(); - } - - @Override - public String getPITarget() - { - return streamReader.getPITarget(); - } - - @Override - public String getPrefix() - { - return streamReader.getPrefix(); - } - - @Override - public Object getProperty(String s) throws IllegalArgumentException - { - return streamReader.getProperty(s); - } - - @Override - public String getText() - { - return streamReader.getText(); - } - - @Override - public char[] getTextCharacters() - { - return streamReader.getTextCharacters(); - } - - @Override - public int getTextCharacters(int i, char[] chars, int i1, int i2) throws XMLStreamException - { - return streamReader.getTextCharacters(i, chars, i1, i2); - } - - @Override - public int getTextLength() - { - return streamReader.getTextLength(); - } - - @Override - public int getTextStart() - { - return streamReader.getTextStart(); - } - - @Override - public String getVersion() - { - return streamReader.getVersion(); - } - - @Override - public boolean hasName() - { - return streamReader.hasName(); - } - - @Override - public boolean hasNext() throws XMLStreamException - { - return streamReader.hasNext(); - } - - @Override - public boolean hasText() - { - return streamReader.hasText(); - } - - @Override - public boolean isAttributeSpecified(int i) - { - return streamReader.isAttributeSpecified(i); - } - - @Override - public boolean isCharacters() - { - return streamReader.isCharacters(); - } - - @Override - public boolean isEndElement() - { - return streamReader.isEndElement(); - } - - @Override - public boolean isStandalone() - { - return streamReader.isStandalone(); - } - - @Override - public boolean isStartElement() - { - return streamReader.isStartElement(); - } - - @Override - public boolean isWhiteSpace() - { - return streamReader.isWhiteSpace(); - } - - @Override - public int next() throws XMLStreamException - { - return streamReader.next(); - } - - @Override - public int nextTag() throws XMLStreamException - { - return streamReader.nextTag(); - } - - @Override - public void require(int i, String s, String s1) throws XMLStreamException - { - streamReader.require(i, s, s1); - } - - @Override - public boolean standaloneSet() - { - return streamReader.standaloneSet(); - } -} diff --git a/api/src/org/labkey/api/reports/report/r/CustomRReport.java b/api/src/org/labkey/api/reports/report/r/CustomRReport.java deleted file mode 100644 index 1ff7d516a99..00000000000 --- a/api/src/org/labkey/api/reports/report/r/CustomRReport.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2008-2026 LabKey Corporation - * - * 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 org.labkey.api.reports.report.r; - -import org.labkey.api.data.DataRegion; -import org.labkey.api.query.QueryView; -import org.labkey.api.reports.report.ReportDescriptor; -import org.labkey.api.reports.report.r.RReport; -import org.labkey.api.view.ActionURL; -import org.labkey.api.view.HttpView; -import org.labkey.api.view.ViewContext; - -/* -* User: Dave -* Date: Sep 5, 2008 -* Time: 1:31:51 PM -*/ -public abstract class CustomRReport extends RReport -{ - private String[] _forwardParams; - private String _type; - - protected CustomRReport(String[] forwardParams, String type) - { - _forwardParams = forwardParams; - _type = type; - } - - protected String[] getForwardParams() - { - return _forwardParams; - } - - protected abstract QueryView getQueryView(ViewContext context); - protected abstract boolean hasRequiredParams(ViewContext context); - - @Override - public String getType() - { - return _type; - } - - @Override - public ActionURL getEditReportURL(ViewContext context) - { - return null; //no editing from manage page - } - - @Override - protected QueryView createQueryView(ViewContext context, ReportDescriptor descriptor) - { - QueryView view = getQueryView(context); - - //need to apply view name if defined in the descriptor - //the URL to run the report does not contain the viewName parameter in the query string - //so QuerySettings.init() won't automatically apply it - String customViewName = descriptor.getProperty(ReportDescriptor.Prop.viewName); - if(null != customViewName) - view.setCustomView(customViewName); - - return view; - } - - @Override - public ActionURL getDownloadDataURL(ViewContext context) - { - ActionURL url = super.getDownloadDataURL(context); - return hasRequiredParams(context) ? addForwardParams(url, context) : null; - } - - @Override - public HttpView renderDataView(ViewContext context) throws Exception - { - QueryView view = createQueryView(context, getDescriptor()); - view.getSettings().setReportId(null); - view.setButtonBarPosition(DataRegion.ButtonBarPosition.NONE); - return view; - } - - @Override - public ActionURL getRunReportURL(ViewContext context) - { - ActionURL url = super.getRunReportURL(context); - return hasRequiredParams(context) ? addForwardParams(url, context) : null; - } - - - protected ActionURL addForwardParams(ActionURL url, ViewContext context) - { - for(String name : getForwardParams()) - { - String value = context.getActionURL().getParameter(name); - if(null != value) - url.replaceParameter(name, value); - } - return url; - } -} diff --git a/api/src/org/labkey/api/search/AbstractXMLDocumentParser.java b/api/src/org/labkey/api/search/AbstractXMLDocumentParser.java deleted file mode 100644 index 3114e02aaa7..00000000000 --- a/api/src/org/labkey/api/search/AbstractXMLDocumentParser.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) 2010-2026 LabKey Corporation - * - * 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 org.labkey.api.search; - -import org.labkey.api.util.XmlBeansUtil; -import org.xml.sax.Attributes; -import org.xml.sax.ContentHandler; -import org.xml.sax.SAXException; -import org.xml.sax.helpers.DefaultHandler; - -import javax.xml.parsers.ParserConfigurationException; -import java.io.BufferedInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.HashSet; -import java.util.Set; - -/** - * Base class that parses XML files and passes a subset of their content on to Lucene for indexing - * User: jeckels - * Date: Jul 15, 2010 - */ -public abstract class AbstractXMLDocumentParser extends AbstractDocumentParser -{ - - /** Fires off a SAX parse that doesn't do schema validation */ - @Override - public void parseContent(InputStream stream, ContentHandler handler) throws IOException, SAXException - { - try (BufferedInputStream buffered = new BufferedInputStream(stream)) - { - XmlBeansUtil.SAX_PARSER_FACTORY.newSAXParser().parse(buffered, createSAXHandler(handler)); - } - catch (ParserConfigurationException e) - { - throw new SAXException(e); - } - } - - /** Creates a SAX callback handler that passes the appropriate subset of data on to Lucene */ - protected abstract DefaultHandler createSAXHandler(ContentHandler xhtmlHandler); - - public static class SAXHandler extends DefaultHandler - { - /** Suggested default is 1 MB */ - public static final long DEFAULT_MAX_INDEXABLE_SIZE = 1024 * 1024; - - private final ContentHandler _xhtmlHandler; - private final boolean _includeElementNames; - private final boolean _includeAttributeNames; - private final boolean _includeAttributeValues; - private final boolean _includeText; - private final long _maxIndexableSize; - - private final Set _stopElements = new HashSet<>(); - - /** How many characters have been included in document to be indexed so far */ - private long _indexedSize = 0; - - /** - * @param handler Lucene listener for content - * @param includeElementNames whether to include the names of XML elements in the index - * @param includeAttributeNames whether to include the names of XML attributes in the index - * @param includeAttributeValues whether to include the values of XML attributes in the index - * @param includeText whether to XML character data in the index - * @param maxIndexableSize maximum number of characters to add to index. -1 to have no limit. Parsing - * stops once the max has been reached. - */ - public SAXHandler(ContentHandler handler, boolean includeElementNames, boolean includeAttributeNames, - boolean includeAttributeValues, boolean includeText, long maxIndexableSize) - { - _xhtmlHandler = handler; - _includeElementNames = includeElementNames; - _includeAttributeNames = includeAttributeNames; - _includeAttributeValues = includeAttributeValues; - _includeText = includeText; - _maxIndexableSize = maxIndexableSize; - } - - /** Element name at which the parsing should stop completely */ - public void addStopElement(String elementName) - { - _stopElements.add(elementName); - } - - @Override - public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException - { - if (_stopElements.contains(localName) || _stopElements.contains(qName)) - { - throw new ParseFinishedException(); - } - - StringBuilder sb = new StringBuilder(); - if (_includeElementNames) - { - sb.append(localName); - sb.append(" "); - } - for (int i = 0; i < attributes.getLength(); i++) - { - String attributeName = attributes.getLocalName(i); - String attributeQName = attributes.getQName(i); - // Don't include some of the XML overhead - if (!attributeQName.equals("xmlns") && !attributeQName.startsWith("xmlns:") && !attributeQName.equals("xsi:schemaLocation")) - { - if (_includeAttributeNames) - { - sb.append(attributeName); - sb.append(" "); - } - if (_includeAttributeValues) - { - sb.append(attributes.getValue(i)); - sb.append(" "); - } - } - } - sb.append("\n"); - _xhtmlHandler.characters(sb.toString().toCharArray(), 0, sb.length()); - - contentAdded(sb.length()); - } - - private void contentAdded(int length) throws ParseFinishedException - { - _indexedSize += length; - if (_maxIndexableSize >= 0 && _indexedSize > _maxIndexableSize) - { - throw new ParseFinishedException(); - } - } - - @Override - public void characters(char[] ch, int start, int length) throws SAXException - { - if (_includeText) - { - _xhtmlHandler.characters(ch, start, length); - contentAdded(length); - } - } - } -} diff --git a/api/src/org/labkey/api/security/FixedHtmlField.java b/api/src/org/labkey/api/security/FixedHtmlField.java deleted file mode 100644 index 025609c329d..00000000000 --- a/api/src/org/labkey/api/security/FixedHtmlField.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2020-2026 LabKey Corporation - * - * 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 org.labkey.api.security; - -import org.jetbrains.annotations.NotNull; -import org.labkey.api.util.HtmlString; - -public class FixedHtmlField extends SettingsField -{ - /** - * Displays a server-supplied fixed HTML field on an authentication dialog - * @param caption Label for field - * @param html Well-formed, properly encoded HTML to display. The html parameter supports string substitution of the - * current configuration's property values. For example: "configuration=${configuration} description=${description}". - * These substitutions are case-sensitive. - * @return The field - */ - public static FixedHtmlField of(@NotNull String caption, @NotNull HtmlString html) - { - FixedHtmlField field = new FixedHtmlField(); - field.put("type", FieldType.fixedHtml); - field.put("caption", caption); - field.put("html", html.toString()); // JSONObject doesn't know how to serialize HtmlString - - return field; - } - - /** - * Displays a server-supplied fixed HTML field on an authentication dialog - * @param caption Label for field - * @param html Well-formed, properly encoded HTML to display. The html parameter supports string substitution of the - * current configuration's property values. For example: "configuration=${configuration} description=${description}". - * These substitutions are case-sensitive. - * @param description Text for the tooltip - * @return The field - */ - public static FixedHtmlField of(@NotNull String caption, @NotNull HtmlString html, String description) - { - FixedHtmlField field = of(caption, html); - field.put("description", description); - - return field; - } -} diff --git a/api/src/org/labkey/api/security/SectionHeader.java b/api/src/org/labkey/api/security/SectionHeader.java deleted file mode 100644 index f4bc18f74c4..00000000000 --- a/api/src/org/labkey/api/security/SectionHeader.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2024-2026 LabKey Corporation - * - * 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 org.labkey.api.security; - -import org.jetbrains.annotations.NotNull; - -public class SectionHeader extends SettingsField -{ - public static SectionHeader of(@NotNull String caption) - { - SectionHeader of = new SectionHeader(); - of.put("type", FieldType.section); - of.put("caption", caption); - - return of; - } -} diff --git a/api/src/org/labkey/api/settings/AbstractCustomLabelProvider.java b/api/src/org/labkey/api/settings/AbstractCustomLabelProvider.java deleted file mode 100644 index 039643509aa..00000000000 --- a/api/src/org/labkey/api/settings/AbstractCustomLabelProvider.java +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright (c) 2024-2026 LabKey Corporation - * - * 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 org.labkey.api.settings; - -import org.apache.commons.lang3.StringUtils; -import org.jetbrains.annotations.Nullable; -import org.labkey.api.audit.AuditLogService; -import org.labkey.api.audit.AuditTypeEvent; -import org.labkey.api.audit.provider.SiteSettingsAuditProvider; -import org.labkey.api.data.Container; -import org.labkey.api.data.ContainerManager; -import org.labkey.api.data.PropertyManager; -import org.labkey.api.data.PropertyManager.WritablePropertyMap; -import org.labkey.api.data.PropertyStore; -import org.labkey.api.query.ValidationException; -import org.labkey.api.security.User; -import org.labkey.api.util.PageFlowUtil; -import org.labkey.api.util.Pair; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public abstract class AbstractCustomLabelProvider implements CustomLabelProvider -{ - public static final PropertyStore _normalStore = PropertyManager.getNormalStore(); - - public record CustomLabel(String key, String defaultLabel, String description, String tooltip) - {} - - public Map getLabels(@Nullable Container container) - { - Container labelContainer = getLabelContainer(container); - Map consolidatedLabels = new HashMap<>(); - Map savedLabels = labelContainer == null ? _normalStore.getProperties(getLabelGroup()) : _normalStore.getProperties(labelContainer, getLabelGroup()); - for (CustomLabel defaultLabel : getDefaultLabels()) - { - if (defaultLabel != null) - { - String key = defaultLabel.key(); - String consolidatedLabel = savedLabels.containsKey(key) && !StringUtils.isEmpty(savedLabels.get(key))? savedLabels.get(key) : defaultLabel.defaultLabel(); - if (!StringUtils.isEmpty(consolidatedLabel)) - consolidatedLabels.put(key, consolidatedLabel); - } - } - return consolidatedLabels; - } - - public int getUpdatedLabelCount(@Nullable Container container) - { - Container labelContainer = getLabelContainer(container); - Map savedLabels = labelContainer == null ? _normalStore.getProperties(getLabelGroup()) : _normalStore.getProperties(labelContainer, getLabelGroup()); - int updatedLabelsCount = 0; - if (savedLabels.isEmpty()) - return updatedLabelsCount; - - for (CustomLabel defaultLabel : getDefaultLabels()) - { - if (defaultLabel != null) - { - String key = defaultLabel.key(); - boolean isUpdated = savedLabels.containsKey(key) && !StringUtils.isEmpty(savedLabels.get(key)) && !defaultLabel.defaultLabel().equals(savedLabels.get(key)); - if (isUpdated) - updatedLabelsCount++; - } - } - return updatedLabelsCount; - } - - protected abstract String getLabelGroup(); - - protected abstract List getDefaultLabels(); - - - public @Nullable Container getLabelContainer(@Nullable Container container) - { - return container; - } - - public void saveLabels(HashMap updatedLabels, @Nullable Container container) throws ValidationException - { - saveLabels(updatedLabels, container, null); - } - - @Override - public void saveLabels(HashMap updatedLabels, @Nullable Container container, @Nullable User auditUser) throws ValidationException - { - Map sanitizedLabels = new HashMap<>(); - for (Map.Entry labelEntry: updatedLabels.entrySet()) - { - String rawLabel = labelEntry.getValue(); - if (rawLabel == null) - sanitizedLabels.put(labelEntry.getKey(), ""); - else - { - String label = rawLabel.trim(); - if (label.length() > 400) - throw new ValidationException("Label cannot be longer than 400 characters."); - sanitizedLabels.put(labelEntry.getKey(), label); - } - } - if (sanitizedLabels.isEmpty()) - return; - - Container labelContainer = getLabelContainer(container); - - AuditTypeEvent event = null; - if (auditUser != null) - event = getUpdateLabelEvent(labelContainer, sanitizedLabels); - - WritablePropertyMap labelStore = labelContainer == null ? _normalStore.getWritableProperties(getLabelGroup(), true) : _normalStore.getWritableProperties(labelContainer, getLabelGroup(), true); - labelStore.putAll(sanitizedLabels); - labelStore.save(); - - if (event != null) - AuditLogService.get().addEvent(auditUser, event); - } - - public void resetLabels(@Nullable Container container) - { - resetLabels(container, null); - } - - @Override - public void resetLabels(@Nullable Container container, @Nullable User auditUser) - { - Container labelContainer = getLabelContainer(container); - if (labelContainer == null) - _normalStore.deletePropertySet(getLabelGroup()); - else - _normalStore.deletePropertySet(labelContainer, getLabelGroup()); - - if (auditUser != null) - { - SiteSettingsAuditProvider.SiteSettingsAuditEvent event = new SiteSettingsAuditProvider.SiteSettingsAuditEvent(labelContainer == null ? ContainerManager.getRoot() : labelContainer, getProviderLabel() + " labels have been reset to default."); - AuditLogService.get().addEvent(auditUser, event); - } - } - - private AuditTypeEvent getUpdateLabelEvent(Container labelContainer, Map sanitizedLabels) - { - Map defaultLabels = new HashMap<>(); - for(CustomLabel defaultLabel : getDefaultLabels()) - defaultLabels.put(defaultLabel.key(), defaultLabel.defaultLabel()); - Map existingLabels = getCustomLabels(labelContainer); - Map> changedLabels = new HashMap<>(); - for (Map.Entry entry : sanitizedLabels.entrySet()) - { - String updatedLabel = entry.getValue(); - String existingLabel = existingLabels.get(entry.getKey()); - if (StringUtils.isEmpty(updatedLabel)) - updatedLabel = defaultLabels.get(entry.getKey()); - if (updatedLabel != null && !updatedLabel.equals(existingLabel)) - changedLabels.put(entry.getKey(), new Pair<>(existingLabel, updatedLabel)); - } - - if (changedLabels.isEmpty()) - return null; - - StringBuilder html = new StringBuilder(""); - for (Map.Entry> entry : changedLabels.entrySet()) - { - html.append(""); - } - html.append("
"); - html.append(PageFlowUtil.filter(entry.getKey())); - html.append(""); - html.append(PageFlowUtil.filter(entry.getValue().first)); - html.append(" » "); - html.append(PageFlowUtil.filter(entry.getValue().second)); - html.append("
"); - - SiteSettingsAuditProvider.SiteSettingsAuditEvent event = new SiteSettingsAuditProvider.SiteSettingsAuditEvent(labelContainer, getProviderLabel() + " labels have been updated."); - event.setChanges(html.toString()); - - return event; - } - - public String getProviderLabel() - { - return getName(); - } - -} diff --git a/api/src/org/labkey/api/settings/PreferenceService.java b/api/src/org/labkey/api/settings/PreferenceService.java deleted file mode 100644 index eaf49e2a44b..00000000000 --- a/api/src/org/labkey/api/settings/PreferenceService.java +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright (c) 2008-2026 LabKey Corporation - * - * 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 org.labkey.api.settings; - -import jakarta.servlet.http.HttpSession; -import org.labkey.api.data.Container; -import org.labkey.api.data.ContainerManager; -import org.labkey.api.data.PropertyManager; -import org.labkey.api.data.PropertyManager.WritablePropertyMap; -import org.labkey.api.security.User; -import org.labkey.api.view.HttpView; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Stack; - -/** - * User: Karl Lum - * Date: Jan 19, 2007 - */ -public class PreferenceService -{ - private static final String PREFERENCE_SERVICE_MAP_KEY = "PreferenceServiceMap"; - private static final PreferenceService _instance = new PreferenceService(); - - private final Map> _nullPreferenceMap = Collections.synchronizedMap(new HashMap<>()); - - public static PreferenceService get() - { - return _instance; - } - - private PreferenceService() - { - } - - public Object getProperty(String name, Container container) - { - return getPreferences(container).get(name); - } - - /** Uses a session-based set of properties if the user is a guest, and a database-backed set if authenticated */ - public String getProperty(String name, User user) - { - if (user == null || user.isGuest()) - return getSessionPreferences().get(name); - - return getPreferences(user).get(name); - } - - /** - * Returns the container that the specified property is set on. Will return the - * first container matching the property name in the inheritance chain, from - * most specific to least specific. - * - * @param initialScope - the container of interest (to start the search from) - */ - public Container findContainerFor(String name, Container initialScope) - { - if (initialScope == null) - throw new IllegalArgumentException("Initial container scope cannot be null"); - - if(initialScope.isRoot()) - return initialScope; - - Container c = initialScope; - while (c != null) - { - Map p = getReadOnlyPreferences(c); - if (p != null) - { - if (p.containsKey(name)) - return c; - } - if (c.isRoot()) - break; - c = c.getParent(); - } - return null; - } - - public boolean isInherited(String name, Container container) - { - if (container == null || container.isRoot()) - return false; - - Container owningContainer = findContainerFor(name, container); - return (owningContainer != null && !container.equals(owningContainer)); - } - - public void setProperty(String name, String value, Container container) - { - WritablePropertyMap prefs = getWritablePreferences(container); - prefs.put(name, value); - - prefs.save(); - _nullPreferenceMap.remove(container.getId()); - } - - /** Uses a session-based set of properties if the user is a guest, and a database-backed set if authenticated */ - public void setProperty(String name, String value, User user) - { - if (user.isGuest()) - { - Map prefs = getSessionPreferences(); - prefs.put(name, value); - } - else - { - WritablePropertyMap prefs = getWritablePreferences(user); - prefs.put(name, value); - prefs.save(); - } - } - - public void deleteProperty(String name, Container container) - { - WritablePropertyMap prefs = getWritablePreferences(container); - prefs.remove(name); - - prefs.save(); - _nullPreferenceMap.remove(container.getId()); - } - - public void deleteProperty(String name, User user) - { - if (user.isGuest()) - { - Map prefs = getSessionPreferences(); - prefs.remove(name); - } - else - { - WritablePropertyMap prefs = getWritablePreferences(user); - prefs.remove(name); - prefs.save(); - } - } - - private Map getPreferences(Container container) - { - Stack stack = new Stack<>(); - stack.push(container); - while (!container.isRoot()) - { - stack.push(container.getParent()); - container = container.getParent(); - } - - Map prefs = new HashMap<>(); - while (!stack.isEmpty()) - { - Container c = stack.pop(); - Map p = getReadOnlyPreferences(c); - if (p != null) - { - prefs.putAll(p); - } - } - return Collections.unmodifiableMap(prefs); - } - - private Map getSessionPreferences() - { - HttpSession session = HttpView.currentRequest().getSession(true); - Map prefs = (Map) session.getAttribute(PREFERENCE_SERVICE_MAP_KEY); - - if (null == prefs) - { - prefs = new HashMap<>(); - session.setAttribute(PREFERENCE_SERVICE_MAP_KEY, prefs); - } - - return prefs; - } - - private PropertyManager.PropertyMap getPreferences(User user) - { - return PropertyManager.getProperties(user, ContainerManager.getRoot(), PREFERENCE_SERVICE_MAP_KEY); - } - - private WritablePropertyMap getWritablePreferences(Container container) - { - return PropertyManager.getWritableProperties(container, PREFERENCE_SERVICE_MAP_KEY, true); - } - - private WritablePropertyMap getWritablePreferences(User user) - { - return PropertyManager.getWritableProperties(user, ContainerManager.getRoot(), PREFERENCE_SERVICE_MAP_KEY, true); - } - - private PropertyManager.PropertyMap getReadOnlyPreferences(Container container) - { - String containerId = container.getId(); - if (_nullPreferenceMap.containsKey(containerId)) - return null; - PropertyManager.PropertyMap prefs = PropertyManager.getProperties(container, PREFERENCE_SERVICE_MAP_KEY); - if (prefs.isEmpty()) - { - _nullPreferenceMap.put(containerId, null); - } - return prefs; - } -} diff --git a/api/src/org/labkey/api/study/AssaySpecimenVisit.java b/api/src/org/labkey/api/study/AssaySpecimenVisit.java deleted file mode 100644 index 7a2c8d021bb..00000000000 --- a/api/src/org/labkey/api/study/AssaySpecimenVisit.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2014 LabKey Corporation - * - * 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 org.labkey.api.study; - -/** - * Created by cnathe on 2/3/14. - */ -public interface AssaySpecimenVisit -{ - int getAssaySpecimenId(); - int getVisitId(); -} \ No newline at end of file diff --git a/api/src/org/labkey/api/study/ProductAntigen.java b/api/src/org/labkey/api/study/ProductAntigen.java deleted file mode 100644 index c131807fa01..00000000000 --- a/api/src/org/labkey/api/study/ProductAntigen.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2013 LabKey Corporation - * - * 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 org.labkey.api.study; - -/** - * User: cnathe - * Date: 12/26/13 - */ -public interface ProductAntigen -{ - int getRowId(); - int getProductId(); - String getGene(); - String getSubType(); - String getGenBankId(); - String getSequence(); -} diff --git a/api/src/org/labkey/api/study/TreatmentProduct.java b/api/src/org/labkey/api/study/TreatmentProduct.java deleted file mode 100644 index 773d66e7492..00000000000 --- a/api/src/org/labkey/api/study/TreatmentProduct.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2013 LabKey Corporation - * - * 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 org.labkey.api.study; - -/** - * User: cnathe - * Date: 12/27/13 - */ -public interface TreatmentProduct -{ - int getRowId(); - int getTreatmentId(); - int getProductId(); - String getDose(); - String getRoute(); -} diff --git a/api/src/org/labkey/api/util/FileLoggerWriter.java b/api/src/org/labkey/api/util/FileLoggerWriter.java deleted file mode 100644 index f5c36c692ee..00000000000 --- a/api/src/org/labkey/api/util/FileLoggerWriter.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright (c) 2020-2026 LabKey Corporation - * - * 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 org.labkey.api.util; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.jetbrains.annotations.Nullable; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; - -/** - * This loggerWriter will log the contents in a file. - * */ -public class FileLoggerWriter implements LoggerWriter, AutoCloseable -{ - private final String LINE_SEP = System.lineSeparator(); - private static final Logger LOG = LogManager.getLogger(FileLoggerWriter.class); - - private final File _file; - private BufferedWriter _writer; - - public FileLoggerWriter(File file) - { - _file = file; - // Make sure that we try to mount the drive (if needed) before using the file - NetworkDrive.exists(_file); - try - { - _writer = new BufferedWriter(new FileWriter(_file, true)); - } - catch (IOException e) - { - LOG.error("Failed opening the file - {}", _file.getName(), e); - } - - } - - @Override - public void close() - { - try - { - _writer.close(); - } - catch (IOException e) - { - LOG.error("Unable to close the file - {}", _file.getName(), e); - } - } - - private boolean isFilePresent() - { - return _file != null; - } - - @Override - public void write(String message, @Nullable Throwable t) - { - if (isFilePresent()) - { - try - { - _writer.write(message); - _writer.write(LINE_SEP); - - if (null != t) - { - StackTraceElement[] stackTraceElements = t.getStackTrace(); - if (stackTraceElements != null) - { - for (StackTraceElement stackTraceElement : stackTraceElements) - { - _writer.write(stackTraceElement.toString()); - _writer.write(LINE_SEP); - } - } - } - } - catch (IOException e) - { - LOG.error("Failed appending to file - {}", _file.getName(), e); - } - } - else - { - LOG.error("File not provided to write logs."); - } - - } - - @Override - public void debug(String message) - { - write(message, null); - } - - @Override - public void debug(String message, Throwable t) - { - write(message, t); - } - - @Override - public void error(String message) - { - write(message, null); - } - - @Override - public void error(String message, Throwable t) - { - write(message, t); - } - - @Override - public void info(String message) - { - write(message, null); - } - - @Override - public void info(String message, Throwable t) - { - write(message, t); - } - - @Override - public void fatal(String message) - { - write(message, null); - } - - @Override - public void fatal(String message, Throwable t) - { - write(message, t); - } - - @Override - public void trace(String message) - { - write(message, null); - } - - @Override - public void trace(String message, Throwable t) - { - write(message, t); - } -} diff --git a/api/src/org/labkey/api/util/MatrixUtil.java b/api/src/org/labkey/api/util/MatrixUtil.java deleted file mode 100644 index 2c0c2eea09c..00000000000 --- a/api/src/org/labkey/api/util/MatrixUtil.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (c) 2004-2016 Fred Hutchinson Cancer Research Center - * - * 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 org.labkey.api.util; - -import Jama.Matrix; - -public class MatrixUtil -{ - // Takes Matrix X and Matrix Y and returns Matrix containing b values - public static Matrix linearRegression(Matrix X, Matrix Y) - { - Matrix XTrans = X.transpose(); - - return XTrans.times(X).inverse().times(XTrans).times(Y); - } - - - // Java-friendly version that takes an array of arrays of x values, and an array of y values - // Returns array of b values - public static double[] linearRegression(double[][] xArray, double[] yArray) - { - int pointCount = yArray.length; - int independentCount = xArray.length; - double[][] x = new double[pointCount][independentCount + 1]; - double[][] y = new double[pointCount][1]; - - // Transpose into new arrays and add column of 1s to x - for (int i = 0; i < pointCount; i++) - { - y[i][0] = yArray[i]; - x[i][0] = 1; - - for (int j = 0; j < independentCount; j++) - x[i][j + 1] = xArray[j][i]; - } - - return linearRegression(new Matrix(x), new Matrix(y)).getRowPackedCopy(); - } - - - // Simple version for single independent variable: y = a + bx - public static double[] linearRegression(double[] xArray, double[] yArray) - { - return linearRegression(new double[][]{xArray}, yArray); - } - - - // Takes Matrix X and Matrix Y and returns Matrix containing R-squared - public static Matrix r2(Matrix X, Matrix Y) - { - Matrix XTrans = X.transpose(); - Matrix YTrans = Y.transpose(); - - return YTrans.times(X).times( - XTrans.times(X).inverse() - ).times(XTrans).times(Y).times( - YTrans.times(Y).inverse()); - } - - - public static double r2(double[][] xArray, double[] yArray) - { - int pointCount = yArray.length; - int independentCount = xArray.length; - - double[][] x = new double[pointCount][independentCount]; - double[][] y = new double[pointCount][1]; - double[] xTotal = new double[independentCount]; - double[] xAvg = new double[independentCount]; - double yTotal = 0; - - // Calculate average of x columns, y - for (int i = 0; i < pointCount; i++) - { - yTotal += yArray[i]; - - for (int j = 0; j < independentCount; j++) - xTotal[j] += xArray[j][i]; - } - - for (int i = 0; i < independentCount; i++) - xAvg[i] = xTotal[i] / pointCount; - - double yAvg = yTotal / pointCount; - - // Create deviation score form, transpose into new arrays - for (int i = 0; i < pointCount; i++) - { - y[i][0] = yArray[i] - yAvg; - - for (int j = 0; j < independentCount; j++) - x[i][j] = xArray[j][i] - xAvg[j]; - } - - return r2(new Matrix(x), new Matrix(y)).get(0, 0); - } - - - // Simple version for single independent variable: y = a + bx - public static double r2(double[] xArray, double[] yArray) - { - return r2(new double[][]{xArray}, yArray); - } - - - public static double r2(float[] xArray, float[] yArray) - { - return r2(toDoubleArray(xArray), toDoubleArray(yArray)); - } - - - private static double[] toDoubleArray(float[] array) - { - double[] dArray = new double[array.length]; - - for (int i = 0; i < array.length; i++) - dArray[i] = array[i]; - - return dArray; - } - - - public static double sigma(double[] x, double[] y, double[] b) - { - double errorTotal = 0; - - for (int i = 0; i < y.length; i++) - { - errorTotal += Math.pow(y[i] - (b[0] + b[1] * x[i]), 2); - } - - return Math.sqrt(errorTotal / (y.length - 2)); - } -} diff --git a/api/src/org/labkey/api/util/OutputStreamWrapper.java b/api/src/org/labkey/api/util/OutputStreamWrapper.java deleted file mode 100644 index 16f85050ba6..00000000000 --- a/api/src/org/labkey/api/util/OutputStreamWrapper.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2009-2026 LabKey Corporation - * - * 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 org.labkey.api.util; - -import org.jetbrains.annotations.NotNull; - -import java.io.IOException; -import java.io.OutputStream; - -/** - * Allows overriding arbitrary OutputStreams. A little strange, since OutputStream is an abstract class not an interface... - */ -public class OutputStreamWrapper extends OutputStream -{ - private final OutputStream _out; - - public OutputStreamWrapper(OutputStream out) - { - _out = out; - } - - @Override - public void write(int b) throws IOException - { - _out.write(b); - } - - @Override - public void write(byte @NotNull[] b) throws IOException - { - _out.write(b); - } - - @Override - public void write(byte @NotNull[] b, int off, int len) throws IOException - { - _out.write(b, off, len); - } - - @Override - public void flush() throws IOException - { - _out.flush(); - } - - @Override - public void close() throws IOException - { - _out.close(); - } - - @Override - public int hashCode() - { - return _out.hashCode(); - } - - @Override - public boolean equals(Object obj) - { - return _out.equals(obj); - } - - @Override - protected Object clone() throws CloneNotSupportedException - { - throw new CloneNotSupportedException(); - } - - @Override - public String toString() - { - return _out.toString(); - } -} diff --git a/api/src/org/labkey/api/util/PossiblyGZIPpedFileInputStreamFactory.java b/api/src/org/labkey/api/util/PossiblyGZIPpedFileInputStreamFactory.java deleted file mode 100644 index 5743f328382..00000000000 --- a/api/src/org/labkey/api/util/PossiblyGZIPpedFileInputStreamFactory.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2010-2026 LabKey Corporation - * - * 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 org.labkey.api.util; - -import org.labkey.vfs.FileLike; - -import java.io.IOException; -import java.io.InputStream; -import java.util.zip.GZIPInputStream; - - -/** - * examine a file and access as a gzip file if appropriate - * - * note this would be tidier as "public class PossiblyGZIPpedFileInputStream extends InputStream" but - * I worry about performance since the read() call gets hit a lot and would rather not insert - * another deeply loop nested function call PossiblyGZIPpedFileInputStream.read->_iStream.read() - * - * bpratt, Insilicos - * - */ -abstract public class PossiblyGZIPpedFileInputStreamFactory -{ - private static final int STREAM_BUFFER_SIZE = 128 * 1024; - - static public InputStream getStream(FileLike f) throws IOException - { - InputStream fis = f.openInputStream(); - try - { - return new GZIPInputStream(fis, STREAM_BUFFER_SIZE); - } - catch (java.io.IOException e) - { - // not a gzip file - reopen since we ate a couple of bytes - try - { - fis.close(); - } - catch (java.io.IOException ee) - { - // seems unlikely at this point - } - return f.openInputStream(); - } - } -} diff --git a/api/src/org/labkey/api/util/Result.java b/api/src/org/labkey/api/util/Result.java deleted file mode 100644 index ddda8500733..00000000000 --- a/api/src/org/labkey/api/util/Result.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) 2016-2026 LabKey Corporation - * - * 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 org.labkey.api.util; - -import java.util.NoSuchElementException; -import java.util.function.Supplier; - -/** - * Basically, this is a lot like java.util.Optional. - * Unlike Optional, it can array along an exception (or exception message) - * - * If you get really inspired, this could be extended along the lines of - * https://github.com/benjiman/expressions/blob/master/src/main/java/uk/co/benjiweber/expressions/exceptions/Result.java - * - * isPresent() implies success() - * !success() implies !isPresent() - * success() does not necessarily imply isPresent() - * - * @see java.util.Optional - */ - -public interface Result extends Supplier -{ - @Override - T get(); - boolean isPresent(); - boolean success(); - - class Success implements Result - { - final T value; - - Success(T value) - { - this.value = value; - } - - @Override - public T get() - { - return value; - } - - @Override - public boolean isPresent() - { - return null != value; - } - - @Override - public boolean success() - { - return true; - } - } - - class Failure implements Result - { - private final String _message; - private final Exception _exception; - - Failure(String s) - { - _message = s; - _exception = null; - } - - Failure(Exception x) - { - _message = null; - _exception = x; - } - - @Override - public T get() - { - if (null != _exception) - throw _exception instanceof RuntimeException ? - (RuntimeException) _exception : - new RuntimeException(_exception); - if (null != _message) - throw new NoSuchElementException(_message); - throw new NoSuchElementException(); - } - - @Override - public boolean isPresent() - { - return false; - } - - @Override - public boolean success() - { - return false; - } - } - - static Result success(T t) - { - return new Success<>(t); - } - - static Result failure(String s) - { - return new Failure<>(s); - } - - static Result failure(Exception x) - { - return new Failure<>(x); - } -} diff --git a/api/src/org/labkey/api/view/ColorPickerDisplayColumn.java b/api/src/org/labkey/api/view/ColorPickerDisplayColumn.java deleted file mode 100644 index 004993857b0..00000000000 --- a/api/src/org/labkey/api/view/ColorPickerDisplayColumn.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2014-2026 LabKey Corporation - * - * 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 org.labkey.api.view; - -import org.labkey.api.data.ColumnInfo; -import org.labkey.api.data.DataColumn; -import org.labkey.api.data.RenderContext; -import org.labkey.api.util.JavaScriptFragment; -import org.labkey.api.util.PageFlowUtil; -import org.labkey.api.util.UniqueID; -import org.labkey.api.writer.HtmlWriter; - -import static org.labkey.api.util.DOM.Attribute.style; -import static org.labkey.api.util.DOM.DIV; -import static org.labkey.api.util.DOM.SCRIPT; -import static org.labkey.api.util.DOM.at; -import static org.labkey.api.util.DOM.id; - -/** - * {@link org.labkey.api.data.DisplayColumn} that shows an ExtJS-based color picker component for insert/update forms - * and a small square of the color in grid views. - */ -public class ColorPickerDisplayColumn extends DataColumn -{ - public ColorPickerDisplayColumn(ColumnInfo col) - { - super(col); - } - - @Override - public void renderGridCellContents(RenderContext ctx, HtmlWriter out) - { - Object value = getValue(ctx); - if (value != null) - { - DIV( - at(style, "height: 20px; width: 20px; background: #" + value) - ).appendTo(out); - } - } - - @Override - public void renderInputHtml(RenderContext ctx, HtmlWriter out, Object value) - { - String name = getFormFieldName(ctx); - renderHiddenFormInput(out, name, value); - - String renderId = "color-picker-div-" + UniqueID.getRequestScopedUID(ctx.getRequest()); - - SCRIPT( - JavaScriptFragment.unsafe( - " LABKEY.requiresExt4Sandbox(function(){\n" + - " Ext4.onReady(function(){\n" + - " Ext4.create('Ext.picker.Color', {\n" + - " renderTo : " + PageFlowUtil.jsString(renderId) + ",\n" + - " value : " + PageFlowUtil.jsString(value == null ? null : value.toString()) + ",\n" + - " listeners: { \n" + - " select: function(picker, selColor) {\n" + - " document.getElementsByName(" + PageFlowUtil.jsString(name) + ")[0].value = selColor;\n" + - " }\n" + - " }\n" + - " });\n" + - " });\n" + - " });\n") - ).appendTo(out); - - DIV(id(renderId)).appendTo(out); - } -} diff --git a/api/src/org/labkey/api/view/Overview.java b/api/src/org/labkey/api/view/Overview.java deleted file mode 100644 index 9a6103f9b65..00000000000 --- a/api/src/org/labkey/api/view/Overview.java +++ /dev/null @@ -1,313 +0,0 @@ -/* - * Copyright (c) 2008-2026 LabKey Corporation - * - * 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 org.labkey.api.view; - -import org.apache.commons.lang3.StringUtils; -import org.labkey.api.data.Container; -import org.labkey.api.security.User; -import org.labkey.api.security.permissions.Permission; -import org.labkey.api.util.HasHtmlString; -import org.labkey.api.util.HtmlString; -import org.labkey.api.util.HtmlStringBuilder; -import org.labkey.api.util.LinkBuilder; -import org.labkey.api.util.PageFlowUtil; - -import java.util.ArrayList; -import java.util.List; - -/** - * Class for rendering a series of steps involved with setting something up. - * Steps may be enabled or disabled. If disabled, they are shown as grey. - */ -public class Overview implements HasHtmlString -{ - private final User _user; - private final Container _container; - private final List _steps; - private final List _actions; - - private String _title; - private HtmlString _explanatoryHTML; - private HtmlString _statusHTML; - - public Overview(User user, Container container) - { - _user = user; - _container = container; - _steps = new ArrayList<>(); - _actions = new ArrayList<>(); - } - - static protected String h(Object text) - { - return PageFlowUtil.filter(text); - } - - @Override - public HtmlString getHtmlString() - { - HtmlStringBuilder ret = HtmlStringBuilder.of(); - ret.unsafeAppend("
\n"); - if (!StringUtils.isEmpty(_title)) - { - ret.unsafeAppend(""); - ret.append(_title); - ret.unsafeAppend("
\n"); - } - if (!HtmlString.isEmpty(_explanatoryHTML)) - { - ret.unsafeAppend(""); - ret.append(_explanatoryHTML); - ret.unsafeAppend("
\n"); - } - - if (!HtmlString.isEmpty(_statusHTML)) - { - ret.append(_statusHTML); - ret.unsafeAppend("
"); - } - if (!_steps.isEmpty()) - { - ret.unsafeAppend("
    "); - for (Step step : _steps) - { - ret.append(step); - } - ret.unsafeAppend("
"); - } - for (Action miscAction : _actions) - { - ret.append(miscAction); - ret.unsafeAppend("
"); - } - ret.unsafeAppend("
"); - return ret.getHtmlString(); - } - - @Override - public String toString() - { - return getHtmlString().toString(); - } - - - public void addStep(Step step) - { - _steps.add(step); - } - - public void addAction(Action action) - { - _actions.add(action); - } - - public boolean hasPermission(Class perm) - { - return _container.hasPermission(_user, perm); - } - - public User getUser() - { - return _user; - } - - public Container getContainer() - { - return _container; - } - - /** - * Sets the title. The title appears at the top. - */ - public void setTitle(String title) - { - _title = title; - } - - /** - * Set the explanatory text which appears at the top. - * Explanatory text is text that is intended to be ignored by users that know what they're doing. It is - * rendered in italics. - */ - public void setExplanatoryHTML(HtmlString html) - { - _explanatoryHTML = html; - } - - /** - * Set the status text which appears at the top. - * Status text sometimes changes and contains information that may be useful even to people who know how to use the product. - */ - public void setStatusHTML(HtmlString html) - { - _statusHTML = html; - } - - public static class Step implements HasHtmlString - { - public enum Status - { - normal, - required, - optional, - disabled, - completed, - } - - private final String _title; - private final Status _status; - private final List _actions; - - private HtmlString _expanatoryHTML; - private HtmlString _statusHTML; - - public Step(String title, Status status) - { - _title = title; - _status = status; - _actions = new ArrayList<>(); - } - - public void setExplanatoryHTML(HtmlString html) - { - _expanatoryHTML = html; - } - - public void setStatusHTML(HtmlString html) - { - _statusHTML = html; - } - - public void addAction(Action action) - { - if (action == null) - return; - _actions.add(action); - } - - @Override - public HtmlString getHtmlString() - { - HtmlStringBuilder ret = HtmlStringBuilder.of(); - ret.unsafeAppend("
  • "); - ret.unsafeAppend(""); - ret.append(_title); - ret.unsafeAppend(""); - if (_status == Status.optional) - { - ret.append(" (optional)"); - } - if (_status == Status.completed) - { - ret.append(" (completed)"); - } - if (_status == Status.required) - { - ret.append(" (required)"); - } - if (!HtmlString.isEmpty(_expanatoryHTML)) - { - ret.unsafeAppend("
    "); - ret.append(_expanatoryHTML); - ret.unsafeAppend(""); - } - if (!(HtmlString.isEmpty(_statusHTML))) - { - ret.unsafeAppend("
    "); - ret.append(_statusHTML); - } - for (Action action : _actions) - { - ret.unsafeAppend("
    \n"); - ret.append(action); - } - ret.unsafeAppend("
  • "); - return ret.getHtmlString(); - } - - @Override - public String toString() - { - return getHtmlString().toString(); - } - } - - public static class Action implements HasHtmlString - { - private final String _label; - private final ActionURL _url; - - private HtmlString _explanatoryHTML; - private HtmlString _descriptionHTML; - - public Action(String label, ActionURL url) - { - _label = label; - _url = url; - } - - public void setExplanatoryHTML(HtmlString html) - { - _explanatoryHTML = html; - } - - public void setDescriptionHTML(HtmlString html) - { - _descriptionHTML = html; - } - - @Override - public HtmlString getHtmlString() - { - HtmlStringBuilder ret = HtmlStringBuilder.of(); - ret.unsafeAppend(""); - if (!HtmlString.isEmpty(_explanatoryHTML)) - { - ret.unsafeAppend(""); - ret.append(_explanatoryHTML); - ret.unsafeAppend("
    "); - } - if (!HtmlString.isEmpty(_descriptionHTML)) - { - ret.append(_descriptionHTML); - ret.unsafeAppend("
    "); - } - ret.unsafeAppend(""); - if (_url != null) - { - ret.append(LinkBuilder.labkeyLink(_label, _url)); - } - else - { - ret.append(_label); - } - ret.unsafeAppend("
    "); - return ret.getHtmlString(); - } - - @Override - public String toString() - { - return getHtmlString().toString(); - } - } -} diff --git a/api/src/org/labkey/api/visualization/ColorGradient.java b/api/src/org/labkey/api/visualization/ColorGradient.java deleted file mode 100644 index 42671b9ad3e..00000000000 --- a/api/src/org/labkey/api/visualization/ColorGradient.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2022-2026 LabKey Corporation - * - * 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 org.labkey.api.visualization; - -import java.awt.Color; -import java.util.ArrayList; -import java.util.List; - -public class ColorGradient -{ - - /** - * inspired from https://github.com/matthewbeckler/HeatMap/blob/master/Gradient.java - * - * Creates an array of Color objects for use as a gradient, using a linear - * interpolation between the two specified colors. - * - * @param one Color used for the bottom of the gradient - * @param two Color used for the top of the gradient - * @param numSteps The number of steps in the gradient. 250 is a good number. - */ - public static List createGradient(final Color one, final Color two, final int numSteps) - { - int r1 = one.getRed(); - int g1 = one.getGreen(); - int b1 = one.getBlue(); - int a1 = one.getAlpha(); - - int r2 = two.getRed(); - int g2 = two.getGreen(); - int b2 = two.getBlue(); - int a2 = two.getAlpha(); - - int newR; - int newG; - int newB; - int newA; - - List gradient = new ArrayList<>(); - double iNorm; - for (int i = 0; i < numSteps; i++) - { - iNorm = i / (double) numSteps; //a normalized [0:1] variable - newR = (int) (r1 + iNorm * (r2 - r1)); - newG = (int) (g1 + iNorm * (g2 - g1)); - newB = (int) (b1 + iNorm * (b2 - b1)); - newA = (int) (a1 + iNorm * (a2 - a1)); - gradient.add(new Color(newR, newG, newB, newA)); - } - - return gradient; - } - - - public static float calculateLuminance(Color color) - { - return (float) (0.2126 * color.getRed() + 0.7152 * color.getGreen() + 0.0722 * color.getBlue()); - } - public static String getContrastingForegroundColor(Color color) - { - float luminance = calculateLuminance(color); - return (luminance < 140) ? "#fff" : "#000"; - } -} \ No newline at end of file diff --git a/api/src/org/labkey/api/visualization/Stats.java b/api/src/org/labkey/api/visualization/Stats.java deleted file mode 100644 index 569dec6fbc4..00000000000 --- a/api/src/org/labkey/api/visualization/Stats.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Copyright (c) 2019-2026 LabKey Corporation - * - * 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 org.labkey.api.visualization; - -import java.util.Arrays; -import java.util.Objects; - -public class Stats -{ - - public static final double MOVING_RANG_EPSILON = 0.0000001; - public static final int CUSUM_CONTROL_LIMIT = 5; - public static final double MOVING_RANGE_UPPER_LIMIT_WEIGHT = 3.268; - - - /** - * CUSUM_WEIGHT_FACTOR of 0.5 and CUSUM_CONTROL_LIMIT of 5 to achieve a 3*stdDev boundary - */ - public static final double CUSUM_WEIGHT_FACTOR = 0.5; - public static final double CUSUM_EPSILON = 0.0000001; - - /** - * Returns the average value. - * - * @param values An array of double. - * @returns {double} - */ - public static double getMean(Double[] values) - { - if (values == null || values.length == 0) - return 0; - - double sum = Arrays.stream(values).filter(Objects::nonNull).mapToDouble(i -> i).sum(); - return sum / values.length; - } - - /** - * Returns the standard deviation. - * - * @param values An array of values. Nulls are ignored. - */ - public static double getStdDev(Double[] values, boolean isBiasCorrected) - { - if (values == null || values.length == 0) - return 0; - - double mean = getMean(values); - double sumSquareDiffs = 0.0; - int count = 0; - - for (Double value : values) - { - if (value != null) - { - double diff = value - mean; - sumSquareDiffs += diff * diff; - count++; - } - } - - return Math.sqrt(sumSquareDiffs / (double)(count - (isBiasCorrected ? 1 : 0))); - } - - /** - * Calculates a variety of cumulative sums for a data array. - * - * @param values Array of data values to calculate from - * @param negative True to calculate CUSUM-, false to calculate CUSUM+. (default to false) - * @param transform True to calculate CUSUMv (Variability CUSUM), false to calculate CUSUMm (Mean CUSUM). (default to false) - * @param forcePositiveResult True to force all result values to be no less than a specified positive value, usually used for log scale. (default to false) - * @param epsilon The smallest value that all returned value can be, only used if forcePositiveResult is true. (default to LABKEY.vis.Stat.CUSUM_EPSILON) - * @returns {number[]} - */ - public static double[] getCUSUMS(Double[] values, boolean negative, boolean transform, boolean forcePositiveResult, Double epsilon) - { - if (values == null || values.length < 2) - return new double[0]; - - double mean = getMean(values); - double stdDEV = getStdDev(values, false); - if (stdDEV == 0) // in the case when all values are equal, calculation has to abort, special case CUSUM to all be 0 - { - return new double[values.length]; - } - - double[] cusums = new double[values.length+1]; - cusums[0] = 0; - for (int i = 1; i <= values.length; i++) - { - if(values[i-1] != null) - { - double standardized = (values[i-1] - mean) / stdDEV; //standard value (z-score) - if (transform) - standardized = (Math.sqrt(Math.abs(standardized)) - 0.822) / 0.349; //the transformed standardize normal quantity value so that it is sensitive to variability changes - if (negative) - standardized = standardized * -1; - double cusum = Math.max(0, standardized - CUSUM_WEIGHT_FACTOR + cusums[i - 1]); - cusums[i] = cusum; - } - } - int n = cusums.length-1; - double[] shiftCusums = new double[n]; - System.arraycopy(cusums, 1, shiftCusums, 0, n); - if (forcePositiveResult) - { - double lowerBound = epsilon != null ? epsilon : CUSUM_EPSILON; - for (int j = 0; j < cusums.length; j++) - { - cusums[j] = Math.max(cusums[j], lowerBound); - } - } - return shiftCusums; - } - - /** - * Calculate the moving range values for a data array, which are sequential differences between two successive values. - * - * @param values Array of data values to calculate from - * @param forcePositiveResult True to force all result values to be no less than a specified positive value, usually used for log scale. (default to false) - * @param epsilon The smallest value that all returned value can be, only used if forcePositiveResult is true. (default to LABKEY.vis.Stat.MOVING_RANGE_EPSILON) - * @returns {double[]} - */ - public static Double[] getMovingRanges(Double[] values, boolean forcePositiveResult, Double epsilon) - { - if (values == null || values.length <= 1) - return new Double[0]; - - Double[] mR = new Double[values.length]; - mR[0] = Double.valueOf(0); // mR[0] is always 0 - for (int i = 1; i < values.length; i++) - { - if(values[i] != null && values[i-1] != null) - mR[i] = Math.abs(values[i] - values[i - 1]); - } - - if (forcePositiveResult) - { - double lowerBound = epsilon != null ? epsilon : MOVING_RANG_EPSILON; - for (int j = 0; j < mR.length; j++) - { - mR[j] = Math.max(lowerBound, mR[j]); - } - } - return mR; - } - - /** - * Calculate the trailing mean values for a data array, which is a series of averages of different subsets of the full data set. - * - * @param values Array of data values to calculate from - * @param N The subset size for the averages - * @returns {double[]} - */ - public static Double[] getTrailingMeans(Double[] values, int N) - { - if (values == null || values.length <= 1) - return new Double[0]; - - Double[] trailingMeans = new Double[values.length]; - int start = 0; - int end = 1; - trailingMeans[0] = values[0]; - for (int i = 1; i < values.length; i++) - { - // Issue 49131: At the very beginning of the folder's date range, always calculate the values for the first N-1 samples, - // based on their sequence. And so on until you hit N, when we start using the moving window. - if (i >= N) - { - start++; - } - trailingMeans[i] = getMean(getValuesFromRange(values, start, end)); - end++; - } - - return trailingMeans; - } - - /** - * Calculate the trailing CV values for a data array, which is calculated by taking the standard deviation of the values over a certain period, - * - * @param values Array of data values to calculate from - * @param N The subset size for the cv - * @returns {double[]} - */ - public static Double[] getTrailingCVs(Double[] values, int N) - { - if (values == null || values.length <= 1) - return new Double[0]; - - Double[] trailingCVs = new Double[values.length]; - int start = 0; - int end = 1; - trailingCVs[0] = 0.0; - for (int i = 1; i < values.length; i++) - { - // Issue 49131: At the very beginning of the folder's date range, always calculate the values for the first N-1 samples, - // based on their sequence. And so on until you hit N, when we start using the moving window. - if (i >= N) - { - start++; - } - calcCV(values, trailingCVs, start, end, i); - end++; - } - - return trailingCVs; - } - - private static void calcCV(Double[] values, Double[] trailingCVs, int start, int end, int i) - { - Double[] vals = getValuesFromRange(values, start, end); - double sd = getStdDev(vals, false); - double mean = getMean(vals); - if (mean == 0) - { - trailingCVs[i] = null; - } - else - { - trailingCVs[i] = sd / mean * 100; - } - } - - private static Double[] getValuesFromRange(Double[] values, int start, int end) - { - Double[] valuesFromRange = new Double[end-start+1]; - if (end - start >= 0) System.arraycopy(values, start, valuesFromRange, 0, end - start + 1); - return valuesFromRange; - } -} diff --git a/api/src/org/mitre/dsmiley/httpproxy/ProxyServletUtils.java b/api/src/org/mitre/dsmiley/httpproxy/ProxyServletUtils.java deleted file mode 100644 index af6b2b7f03e..00000000000 --- a/api/src/org/mitre/dsmiley/httpproxy/ProxyServletUtils.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.mitre.dsmiley.httpproxy; - -import org.springframework.web.servlet.mvc.ServletWrappingController; - -import jakarta.servlet.ServletContext; -import java.util.Properties; - -public class ProxyServletUtils -{ - public static ServletWrappingController initProxy(ServletContext servletContext, String servletName, Properties properties) throws Exception - { - ServletWrappingController proxy = new ServletWrappingController(); - proxy.setServletClass(LabKeyProxyServlet.class); - proxy.setServletName(servletName); - proxy.setInitParameters(properties); - proxy.setServletContext(servletContext); - proxy.afterPropertiesSet(); - return proxy; - } -} diff --git a/api/src/org/labkey/api/study/PropertySet.java b/assay/api-src/org/labkey/api/study/PropertySet.java similarity index 96% rename from api/src/org/labkey/api/study/PropertySet.java rename to assay/api-src/org/labkey/api/study/PropertySet.java index b6bb87f3564..bffceef8cc5 100644 --- a/api/src/org/labkey/api/study/PropertySet.java +++ b/assay/api-src/org/labkey/api/study/PropertySet.java @@ -16,10 +16,10 @@ package org.labkey.api.study; -import org.labkey.api.data.Container; import java.util.Map; import java.util.Set; +import org.labkey.api.data.Container; /** * User: brittp diff --git a/assay/src/org/labkey/assay/ModuleAssayCacheHandler.java b/assay/src/org/labkey/assay/ModuleAssayCacheHandler.java index 4707acfa6e8..2b1a23db1fb 100644 --- a/assay/src/org/labkey/assay/ModuleAssayCacheHandler.java +++ b/assay/src/org/labkey/assay/ModuleAssayCacheHandler.java @@ -21,9 +21,9 @@ import org.labkey.api.module.Module; import org.labkey.api.module.ModuleResourceCacheHandler; import org.labkey.api.module.ModuleResourceCacheListener; -import org.labkey.api.module.ModuleResourceLoadException; import org.labkey.api.resource.Resource; import org.labkey.api.util.ExceptionUtil; +import org.labkey.assay.module.ModuleResourceLoadException; import org.labkey.study.assay.xml.ProviderDocument; import org.labkey.study.assay.xml.ProviderType; diff --git a/api/src/org/labkey/api/data/ArrayExcelWriter.java b/assay/src/org/labkey/assay/data/ArrayExcelWriter.java similarity index 90% rename from api/src/org/labkey/api/data/ArrayExcelWriter.java rename to assay/src/org/labkey/assay/data/ArrayExcelWriter.java index 9953ea358e0..3befd52e881 100644 --- a/api/src/org/labkey/api/data/ArrayExcelWriter.java +++ b/assay/src/org/labkey/assay/data/ArrayExcelWriter.java @@ -13,9 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.data; +package org.labkey.assay.data; import org.apache.poi.ss.usermodel.Sheet; +import org.labkey.api.data.AbstractExcelDisplayColumn; +import org.labkey.api.data.DisplayColumn; +import org.labkey.api.data.ExcelColumn; +import org.labkey.api.data.ExcelWriter; +import org.labkey.api.data.RenderContext; import org.labkey.api.reader.ColumnDescriptor; import java.util.ArrayList; diff --git a/api/src/org/labkey/api/data/TSVArrayWriter.java b/assay/src/org/labkey/assay/data/TSVArrayWriter.java similarity index 96% rename from api/src/org/labkey/api/data/TSVArrayWriter.java rename to assay/src/org/labkey/assay/data/TSVArrayWriter.java index 2fc34db8351..752278e7b6a 100644 --- a/api/src/org/labkey/api/data/TSVArrayWriter.java +++ b/assay/src/org/labkey/assay/data/TSVArrayWriter.java @@ -13,8 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.data; +package org.labkey.assay.data; +import org.labkey.api.data.TSVWriter; import org.labkey.api.reader.ColumnDescriptor; import org.labkey.api.util.FileUtil; diff --git a/api/src/org/labkey/api/module/ModuleResourceLoadException.java b/assay/src/org/labkey/assay/module/ModuleResourceLoadException.java similarity index 93% rename from api/src/org/labkey/api/module/ModuleResourceLoadException.java rename to assay/src/org/labkey/assay/module/ModuleResourceLoadException.java index db31f39c421..e2c21334e7c 100644 --- a/api/src/org/labkey/api/module/ModuleResourceLoadException.java +++ b/assay/src/org/labkey/assay/module/ModuleResourceLoadException.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.module; +package org.labkey.assay.module; /* * User: Dave diff --git a/assay/src/org/labkey/assay/plate/PlateManager.java b/assay/src/org/labkey/assay/plate/PlateManager.java index 6a30be41ac4..504f9e88ed9 100644 --- a/assay/src/org/labkey/assay/plate/PlateManager.java +++ b/assay/src/org/labkey/assay/plate/PlateManager.java @@ -53,7 +53,6 @@ import org.labkey.api.collections.LongArrayList; import org.labkey.api.collections.LongHashMap; import org.labkey.api.collections.LongHashSet; -import org.labkey.api.data.ArrayExcelWriter; import org.labkey.api.data.ColumnHeaderType; import org.labkey.api.data.ColumnInfo; import org.labkey.api.data.CompareType; @@ -73,7 +72,6 @@ import org.labkey.api.data.Sort; import org.labkey.api.data.SqlExecutor; import org.labkey.api.data.SqlSelector; -import org.labkey.api.data.TSVArrayWriter; import org.labkey.api.data.TSVGridWriter; import org.labkey.api.data.TSVWriter; import org.labkey.api.data.Table; @@ -137,6 +135,8 @@ import org.labkey.assay.AssayManager; import org.labkey.assay.PlateController; import org.labkey.assay.TsvAssayProvider; +import org.labkey.assay.data.ArrayExcelWriter; +import org.labkey.assay.data.TSVArrayWriter; import org.labkey.assay.plate.audit.PlateAuditEvent; import org.labkey.assay.plate.audit.PlateAuditProvider; import org.labkey.assay.plate.audit.PlateSetAuditEvent; diff --git a/core/src/org/labkey/core/CoreModule.java b/core/src/org/labkey/core/CoreModule.java index d36729785a5..8d6734456c2 100644 --- a/core/src/org/labkey/core/CoreModule.java +++ b/core/src/org/labkey/core/CoreModule.java @@ -53,7 +53,6 @@ import org.labkey.api.data.ContainerFilter; import org.labkey.api.data.ContainerManager; import org.labkey.api.data.ContainerService; -import org.labkey.api.data.ContainerServiceImpl; import org.labkey.api.data.ContainerTypeRegistry; import org.labkey.api.data.CoreSchema; import org.labkey.api.data.DataRegion; @@ -85,8 +84,6 @@ import org.labkey.api.exp.property.PropertyService; import org.labkey.api.exp.property.TestDomainKind; import org.labkey.api.external.tools.ExternalToolsViewService; -import org.labkey.api.files.FileBrowserConfigImporter; -import org.labkey.api.files.FileBrowserConfigWriter; import org.labkey.api.files.FileContentService; import org.labkey.api.markdown.MarkdownService; import org.labkey.api.mbean.LabKeyManagement; @@ -119,7 +116,6 @@ import org.labkey.api.reader.DataLoaderService; import org.labkey.api.reader.ExcelLoader; import org.labkey.api.reader.FastaDataLoader; -import org.labkey.api.reader.HTMLDataLoader; import org.labkey.api.reader.JSONDataLoader; import org.labkey.api.reader.TabLoader; import org.labkey.api.reports.LabKeyScriptEngineManager; @@ -155,9 +151,6 @@ import org.labkey.api.settings.CustomLabelService.CustomLabelServiceImpl; import org.labkey.api.settings.FolderSettingsCache.FolderSettingsCacheListener; import org.labkey.api.settings.LookAndFeelProperties; -import org.labkey.api.settings.LookAndFeelPropertiesManager; -import org.labkey.api.settings.LookAndFeelPropertiesManager.ResourceType; -import org.labkey.api.settings.LookAndFeelPropertiesManager.SiteResourceHandler; import org.labkey.api.settings.OptionalFeatureFlag; import org.labkey.api.settings.OptionalFeatureService; import org.labkey.api.settings.OptionalFeatureService.FeatureType; @@ -208,7 +201,6 @@ import org.labkey.api.view.ViewService; import org.labkey.api.view.WebPartFactory; import org.labkey.api.view.WebPartView; -import org.labkey.api.view.menu.FolderMenu; import org.labkey.api.view.template.WarningService; import org.labkey.api.webdav.SimpleDocumentResource; import org.labkey.api.webdav.WebdavResolverImpl; @@ -258,8 +250,11 @@ import org.labkey.core.analytics.AnalyticsServiceImpl; import org.labkey.core.attachment.AttachmentContainerListener; import org.labkey.core.attachment.AttachmentServiceImpl; +import org.labkey.core.data.ContainerServiceImpl; import org.labkey.core.dialect.PostgreSqlDialectFactory; import org.labkey.core.dialect.PostgreSqlVersion; +import org.labkey.core.files.FileBrowserConfigImporter; +import org.labkey.core.files.FileBrowserConfigWriter; import org.labkey.core.junit.JunitController; import org.labkey.core.login.DbLoginAuthenticationProvider; import org.labkey.core.login.DbLoginManager; @@ -291,16 +286,21 @@ import org.labkey.core.query.UserAuditProvider; import org.labkey.core.query.UsersDomainKind; import org.labkey.core.reader.DataLoaderServiceImpl; +import org.labkey.core.reader.HTMLDataLoader; import org.labkey.core.reports.DocumentConversionServiceImpl; import org.labkey.core.reports.ScriptEngineManagerImpl; import org.labkey.core.script.RhinoService; import org.labkey.core.secrets.SecretServiceImpl; import org.labkey.core.security.AllowedExternalResourceHosts; import org.labkey.core.security.ApiKeyViewProvider; +import org.labkey.core.security.PasswordExpiration; import org.labkey.core.security.SecurityApiActions; import org.labkey.core.security.SecurityController; import org.labkey.core.security.SecurityPointcutServiceImpl; import org.labkey.core.security.validators.PermissionsValidatorFactory; +import org.labkey.core.settings.LookAndFeelPropertiesManager; +import org.labkey.core.settings.LookAndFeelPropertiesManager.ResourceType; +import org.labkey.core.settings.LookAndFeelPropertiesManager.SiteResourceHandler; import org.labkey.core.statistics.AnalyticsProviderRegistryImpl; import org.labkey.core.statistics.StatsServiceImpl; import org.labkey.core.statistics.SummaryStatisticRegistryImpl; @@ -311,6 +311,7 @@ import org.labkey.core.view.ShortURLServiceImpl; import org.labkey.core.view.TableViewFormTestCase; import org.labkey.core.view.external.tools.ExternalToolsViewServiceImpl; +import org.labkey.core.view.menu.FolderMenu; import org.labkey.core.view.template.bootstrap.CoreWarningProvider; import org.labkey.core.view.template.bootstrap.PageTemplate; import org.labkey.core.view.template.bootstrap.ViewServiceImpl; @@ -1550,7 +1551,7 @@ public TabDisplayMode getTabDisplayMode() public @NotNull Collection>> getIntegrationTestFactories() { List>> ret = new ArrayList<>(super.getIntegrationTestFactories()); - ret.add(new JspTestCase("/org/labkey/api/data/ColumnInfoTests.jsp")); + ret.add(new JspTestCase("/org/labkey/core/data/ColumnInfoTests.jsp")); return ret; } @@ -1565,6 +1566,7 @@ public TabDisplayMode getTabDisplayMode() LabKeyProxyServlet.TestCase.class, MultiChoice.TestCase.class, OutOfRangeDisplayColumn.TestCase.class, + PasswordExpiration.TestCase.class, PostgreSqlVersion.TestCase.class, QuartzShutdown.TestCase.class, ScriptEngineManagerImpl.TestCase.class, diff --git a/core/src/org/labkey/core/admin/ActionsExceptionsView.java b/core/src/org/labkey/core/admin/ActionsExceptionsView.java index 892b9442c6b..38e89183311 100644 --- a/core/src/org/labkey/core/admin/ActionsExceptionsView.java +++ b/core/src/org/labkey/core/admin/ActionsExceptionsView.java @@ -17,7 +17,6 @@ import org.apache.commons.lang3.StringUtils; import org.labkey.api.action.SpringActionController; -import org.labkey.api.admin.ActionsHelper; import org.labkey.api.util.CSRFException; import org.labkey.api.util.PageFlowUtil; import org.labkey.api.view.HttpView; diff --git a/api/src/org/labkey/api/admin/ActionsHelper.java b/core/src/org/labkey/core/admin/ActionsHelper.java similarity index 96% rename from api/src/org/labkey/api/admin/ActionsHelper.java rename to core/src/org/labkey/core/admin/ActionsHelper.java index 6e498ce8b75..72acf44b52c 100644 --- a/api/src/org/labkey/api/admin/ActionsHelper.java +++ b/core/src/org/labkey/core/admin/ActionsHelper.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.labkey.api.admin; +package org.labkey.core.admin; import org.labkey.api.action.SpringActionController; import org.labkey.api.module.Module; diff --git a/core/src/org/labkey/core/admin/ActionsTsvWriter.java b/core/src/org/labkey/core/admin/ActionsTsvWriter.java index c5ad8baee35..39a8ead1292 100644 --- a/core/src/org/labkey/core/admin/ActionsTsvWriter.java +++ b/core/src/org/labkey/core/admin/ActionsTsvWriter.java @@ -18,7 +18,6 @@ import org.labkey.api.action.ActionType; import org.labkey.api.action.SpringActionController; -import org.labkey.api.admin.ActionsHelper; import org.labkey.api.data.TSVWriter; import org.labkey.api.util.UnexpectedException; diff --git a/core/src/org/labkey/core/admin/ActionsView.java b/core/src/org/labkey/core/admin/ActionsView.java index 5f35158d6b2..407216c9680 100644 --- a/core/src/org/labkey/core/admin/ActionsView.java +++ b/core/src/org/labkey/core/admin/ActionsView.java @@ -18,7 +18,6 @@ import org.labkey.api.action.ActionType; import org.labkey.api.action.SpringActionController; -import org.labkey.api.admin.ActionsHelper; import org.labkey.api.data.ConnectionUsage; import org.labkey.api.data.ContainerManager; import org.labkey.api.util.Formats; diff --git a/core/src/org/labkey/core/admin/AdminController.java b/core/src/org/labkey/core/admin/AdminController.java index 5951aeb02f0..cfcee92a5f4 100644 --- a/core/src/org/labkey/core/admin/AdminController.java +++ b/core/src/org/labkey/core/admin/AdminController.java @@ -101,7 +101,6 @@ import org.labkey.api.cloud.CloudStoreService; import org.labkey.api.collections.CaseInsensitiveHashMap; import org.labkey.api.collections.CaseInsensitiveHashSet; -import org.labkey.api.collections.CaseInsensitiveHashSetValuedMap; import org.labkey.api.collections.LabKeyCollectors; import org.labkey.api.compliance.ComplianceFolderSettings; import org.labkey.api.compliance.ComplianceService; @@ -252,7 +251,6 @@ import org.labkey.api.settings.ConceptURIProperties; import org.labkey.api.settings.DateParsingMode; import org.labkey.api.settings.LookAndFeelProperties; -import org.labkey.api.settings.LookAndFeelPropertiesManager.ResourceType; import org.labkey.api.settings.NetworkDriveProps; import org.labkey.api.settings.OptionalFeatureService; import org.labkey.api.settings.OptionalFeatureService.FeatureType; @@ -320,7 +318,6 @@ import org.labkey.api.view.ShortURLRecord; import org.labkey.api.view.ShortURLService; import org.labkey.api.view.TabStripView; -import org.labkey.api.view.URLException; import org.labkey.api.view.UnauthorizedException; import org.labkey.api.view.VBox; import org.labkey.api.view.ViewBackgroundInfo; @@ -341,6 +338,7 @@ import org.labkey.core.admin.miniprofiler.MiniProfilerController; import org.labkey.core.admin.sitevalidation.SiteValidationJob; import org.labkey.core.admin.sql.SqlScriptController; +import org.labkey.core.collections.CaseInsensitiveHashSetValuedMap; import org.labkey.core.login.LoginController; import org.labkey.core.portal.CollaborationFolderType; import org.labkey.core.portal.ProjectController; @@ -351,6 +349,8 @@ import org.labkey.core.security.AllowedExternalResourceHosts.AllowedHost; import org.labkey.core.security.BlockListFilter; import org.labkey.core.security.SecurityController; +import org.labkey.core.settings.LookAndFeelPropertiesManager.ResourceType; +import org.labkey.core.view.URLException; import org.labkey.data.xml.TablesDocument; import org.labkey.filters.ContentSecurityPolicyFilter; import org.labkey.filters.ContentSecurityPolicyFilter.ContentSecurityPolicyType; diff --git a/core/src/org/labkey/core/admin/ConnectionUsageTsvWriter.java b/core/src/org/labkey/core/admin/ConnectionUsageTsvWriter.java index cdf0b36e4f0..de86b5ce831 100644 --- a/core/src/org/labkey/core/admin/ConnectionUsageTsvWriter.java +++ b/core/src/org/labkey/core/admin/ConnectionUsageTsvWriter.java @@ -17,7 +17,6 @@ package org.labkey.core.admin; import org.labkey.api.action.SpringActionController.ActionStats; -import org.labkey.api.admin.ActionsHelper; import org.labkey.api.data.TSVWriter; import org.labkey.api.util.UnexpectedException; diff --git a/core/src/org/labkey/core/admin/lookAndFeelResources.jsp b/core/src/org/labkey/core/admin/lookAndFeelResources.jsp index df33a92f5b0..e90c6887fa5 100644 --- a/core/src/org/labkey/core/admin/lookAndFeelResources.jsp +++ b/core/src/org/labkey/core/admin/lookAndFeelResources.jsp @@ -18,7 +18,7 @@ <%@ page import="org.labkey.api.admin.AdminUrls"%> <%@ page import="org.labkey.api.data.Container" %> <%@ page import="org.labkey.api.security.permissions.ApplicationAdminPermission" %> -<%@ page import="org.labkey.api.settings.LookAndFeelPropertiesManager.ResourceType" %> +<%@ page import="org.labkey.core.settings.LookAndFeelPropertiesManager.ResourceType" %> <%@ page import="org.labkey.api.util.HtmlString" %> <%@ page import="org.labkey.api.view.HttpView" %> <%@ page import="org.labkey.api.view.JspView" %> diff --git a/core/src/org/labkey/core/attachment/AttachmentServiceImpl.java b/core/src/org/labkey/core/attachment/AttachmentServiceImpl.java index dc87f83726d..d283a85274a 100644 --- a/core/src/org/labkey/core/attachment/AttachmentServiceImpl.java +++ b/core/src/org/labkey/core/attachment/AttachmentServiceImpl.java @@ -77,7 +77,6 @@ import org.labkey.api.query.QueryView; import org.labkey.api.query.UserSchema; import org.labkey.api.search.SearchService; -import org.labkey.api.security.AuthenticationLogoAttachmentParent; import org.labkey.api.security.ElevatedUser; import org.labkey.api.security.SecurableResource; import org.labkey.api.security.SecurityManager; @@ -117,6 +116,7 @@ import org.labkey.core.query.AttachmentAuditProvider; import org.labkey.core.query.AttachmentAuditProvider.AttachmentAuditEvent; import org.labkey.core.query.CoreQuerySchema; +import org.labkey.core.security.AuthenticationLogoAttachmentParent; import org.springframework.http.ContentDisposition; import org.springframework.mock.web.MockMultipartFile; import org.springframework.validation.BindException; diff --git a/api/src/org/labkey/api/collections/CaseInsensitiveHashSetValuedMap.java b/core/src/org/labkey/core/collections/CaseInsensitiveHashSetValuedMap.java similarity index 88% rename from api/src/org/labkey/api/collections/CaseInsensitiveHashSetValuedMap.java rename to core/src/org/labkey/core/collections/CaseInsensitiveHashSetValuedMap.java index 8dbb37ad81a..0cde809cc42 100644 --- a/api/src/org/labkey/api/collections/CaseInsensitiveHashSetValuedMap.java +++ b/core/src/org/labkey/core/collections/CaseInsensitiveHashSetValuedMap.java @@ -13,9 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.collections; +package org.labkey.core.collections; import org.apache.commons.collections4.multimap.AbstractSetValuedMap; +import org.labkey.api.collections.CaseInsensitiveCollection; +import org.labkey.api.collections.CaseInsensitiveHashSet; import java.util.HashMap; import java.util.Set; diff --git a/api/src/org/labkey/api/data/ColumnInfoTests.jsp b/core/src/org/labkey/core/data/ColumnInfoTests.jsp similarity index 100% rename from api/src/org/labkey/api/data/ColumnInfoTests.jsp rename to core/src/org/labkey/core/data/ColumnInfoTests.jsp diff --git a/api/src/org/labkey/api/data/ContainerServiceImpl.java b/core/src/org/labkey/core/data/ContainerServiceImpl.java similarity index 85% rename from api/src/org/labkey/api/data/ContainerServiceImpl.java rename to core/src/org/labkey/core/data/ContainerServiceImpl.java index 8187a3b851a..caf873a2ede 100644 --- a/api/src/org/labkey/api/data/ContainerServiceImpl.java +++ b/core/src/org/labkey/core/data/ContainerServiceImpl.java @@ -13,8 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.data; +package org.labkey.core.data; +import org.labkey.api.data.Container; +import org.labkey.api.data.ContainerManager; +import org.labkey.api.data.ContainerService; import org.labkey.api.util.GUID; import org.labkey.api.util.Path; diff --git a/api/src/org/labkey/api/files/FileBrowserConfigImporter.java b/core/src/org/labkey/core/files/FileBrowserConfigImporter.java similarity index 96% rename from api/src/org/labkey/api/files/FileBrowserConfigImporter.java rename to core/src/org/labkey/core/files/FileBrowserConfigImporter.java index 3d62e3a5765..115aa2ca777 100644 --- a/api/src/org/labkey/api/files/FileBrowserConfigImporter.java +++ b/core/src/org/labkey/core/files/FileBrowserConfigImporter.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.files; +package org.labkey.core.files; import org.apache.xmlbeans.XmlObject; import org.jetbrains.annotations.Nullable; @@ -21,6 +21,8 @@ import org.labkey.api.admin.FolderImportContext; import org.labkey.api.admin.FolderImporter; import org.labkey.api.data.Container; +import org.labkey.api.files.FileContentService; +import org.labkey.api.files.FilesAdminOptions; import org.labkey.api.pipeline.PipelineJob; import org.labkey.api.writer.VirtualFile; import org.labkey.data.xml.PipelineOptionsDocument; diff --git a/api/src/org/labkey/api/files/FileBrowserConfigWriter.java b/core/src/org/labkey/core/files/FileBrowserConfigWriter.java similarity index 94% rename from api/src/org/labkey/api/files/FileBrowserConfigWriter.java rename to core/src/org/labkey/core/files/FileBrowserConfigWriter.java index ddb87f6dc16..056d9eb7143 100644 --- a/api/src/org/labkey/api/files/FileBrowserConfigWriter.java +++ b/core/src/org/labkey/core/files/FileBrowserConfigWriter.java @@ -13,13 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.files; +package org.labkey.core.files; import org.labkey.api.admin.BaseFolderWriter; import org.labkey.api.admin.FolderExportContext; import org.labkey.api.admin.FolderWriter; import org.labkey.api.admin.FolderWriterFactory; import org.labkey.api.data.Container; +import org.labkey.api.files.FileContentService; +import org.labkey.api.files.FilesAdminOptions; import org.labkey.api.writer.VirtualFile; import org.labkey.folder.xml.FolderDocument; diff --git a/core/src/org/labkey/core/login/DbLoginAuthenticationProvider.java b/core/src/org/labkey/core/login/DbLoginAuthenticationProvider.java index c0fac6455e6..9b03494486c 100644 --- a/core/src/org/labkey/core/login/DbLoginAuthenticationProvider.java +++ b/core/src/org/labkey/core/login/DbLoginAuthenticationProvider.java @@ -30,7 +30,6 @@ import org.labkey.api.security.ConfigurationSettings; import org.labkey.api.security.LoginManager; import org.labkey.api.security.LoginUrls; -import org.labkey.api.security.PasswordExpiration; import org.labkey.api.security.PasswordRule; import org.labkey.api.security.User; import org.labkey.api.security.UserManager; @@ -45,6 +44,7 @@ import org.labkey.api.view.HttpView; import org.labkey.api.view.ViewContext; import org.labkey.core.login.DbLoginManager.Key; +import org.labkey.core.security.PasswordExpiration; import java.util.Collection; import java.util.EmptyStackException; diff --git a/core/src/org/labkey/core/login/DbLoginConfiguration.java b/core/src/org/labkey/core/login/DbLoginConfiguration.java index 99aca4cb32e..1f578dbd8fd 100644 --- a/core/src/org/labkey/core/login/DbLoginConfiguration.java +++ b/core/src/org/labkey/core/login/DbLoginConfiguration.java @@ -18,8 +18,8 @@ import org.jetbrains.annotations.NotNull; import org.labkey.api.security.AuthenticationConfiguration; import org.labkey.api.security.BaseAuthenticationConfiguration; -import org.labkey.api.security.PasswordExpiration; import org.labkey.api.security.PasswordRule; +import org.labkey.core.security.PasswordExpiration; import java.util.Map; diff --git a/core/src/org/labkey/core/login/DbLoginManager.java b/core/src/org/labkey/core/login/DbLoginManager.java index 48b068934c5..ed0d90499bd 100644 --- a/core/src/org/labkey/core/login/DbLoginManager.java +++ b/core/src/org/labkey/core/login/DbLoginManager.java @@ -34,7 +34,6 @@ import org.labkey.api.security.AuthenticationSettingsAuditTypeProvider.AuthSettingsAuditEvent; import org.labkey.api.security.DbLoginService; import org.labkey.api.security.LoginManager; -import org.labkey.api.security.PasswordExpiration; import org.labkey.api.security.PasswordRule; import org.labkey.api.security.SecurityManager; import org.labkey.api.security.User; @@ -48,6 +47,7 @@ import org.labkey.api.util.URLHelper; import org.labkey.api.util.logging.LogHelper; import org.labkey.core.login.LoginController.SaveDbLoginPropertiesForm; +import org.labkey.core.security.PasswordExpiration; import org.springframework.validation.BindException; import java.util.Arrays; diff --git a/core/src/org/labkey/core/login/LoginAttemptDisableLoginProvider.java b/core/src/org/labkey/core/login/LoginAttemptDisableLoginProvider.java index 18e800e4899..b49230312b4 100644 --- a/core/src/org/labkey/core/login/LoginAttemptDisableLoginProvider.java +++ b/core/src/org/labkey/core/login/LoginAttemptDisableLoginProvider.java @@ -29,9 +29,9 @@ import org.labkey.api.security.UserManager; import org.labkey.api.security.ValidEmail; import org.labkey.api.security.ValidEmail.InvalidEmailException; -import org.labkey.api.util.CountLimiter; import org.labkey.api.util.StringUtilsLabKey; import org.labkey.api.util.logging.LogHelper; +import org.labkey.core.util.CountLimiter; import java.util.concurrent.TimeUnit; diff --git a/core/src/org/labkey/core/login/LoginController.java b/core/src/org/labkey/core/login/LoginController.java index cae977fb4db..a2724985e76 100644 --- a/core/src/org/labkey/core/login/LoginController.java +++ b/core/src/org/labkey/core/login/LoginController.java @@ -71,7 +71,6 @@ import org.labkey.api.security.LoginManager; import org.labkey.api.security.LoginUrls; import org.labkey.api.security.MutableSecurityPolicy; -import org.labkey.api.security.PasswordExpiration; import org.labkey.api.security.PasswordRule; import org.labkey.api.security.RequiresLogin; import org.labkey.api.security.RequiresNoPermission; @@ -122,6 +121,7 @@ import org.labkey.api.wiki.WikiRendererType; import org.labkey.api.wiki.WikiRenderingService; import org.labkey.core.admin.AdminController; +import org.labkey.core.security.PasswordExpiration; import org.springframework.validation.BindException; import org.springframework.validation.Errors; import org.springframework.web.servlet.ModelAndView; diff --git a/core/src/org/labkey/core/project/FolderNavigationForm.java b/core/src/org/labkey/core/project/FolderNavigationForm.java index 0064b948b22..5334746106a 100644 --- a/core/src/org/labkey/core/project/FolderNavigationForm.java +++ b/core/src/org/labkey/core/project/FolderNavigationForm.java @@ -16,7 +16,7 @@ package org.labkey.core.project; import org.labkey.api.view.ViewContext; -import org.labkey.api.view.menu.FolderMenu; +import org.labkey.core.view.menu.FolderMenu; /** * User: Nick diff --git a/api/src/org/labkey/api/query/CacheClearingQueryUpdateService.java b/core/src/org/labkey/core/query/CacheClearingQueryUpdateService.java similarity index 93% rename from api/src/org/labkey/api/query/CacheClearingQueryUpdateService.java rename to core/src/org/labkey/core/query/CacheClearingQueryUpdateService.java index 4c8906d7fb8..673fd4589f8 100644 --- a/api/src/org/labkey/api/query/CacheClearingQueryUpdateService.java +++ b/core/src/org/labkey/core/query/CacheClearingQueryUpdateService.java @@ -13,13 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.query; +package org.labkey.core.query; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.NotNull; import org.labkey.api.data.Container; import org.labkey.api.dataiterator.DataIteratorBuilder; import org.labkey.api.dataiterator.DataIteratorContext; +import org.labkey.api.query.BatchValidationException; +import org.labkey.api.query.DuplicateKeyException; +import org.labkey.api.query.InvalidKeyException; +import org.labkey.api.query.QueryUpdateService; +import org.labkey.api.query.QueryUpdateServiceException; import org.labkey.api.security.User; import org.labkey.api.security.UserPrincipal; import org.labkey.api.security.permissions.Permission; diff --git a/core/src/org/labkey/core/query/UsersTable.java b/core/src/org/labkey/core/query/UsersTable.java index b3bc3d9cff4..f3a4eb66342 100644 --- a/core/src/org/labkey/core/query/UsersTable.java +++ b/core/src/org/labkey/core/query/UsersTable.java @@ -36,7 +36,6 @@ import org.labkey.api.exp.property.Domain; import org.labkey.api.exp.property.DomainProperty; import org.labkey.api.exp.property.PropertyService; -import org.labkey.api.query.CacheClearingQueryUpdateService; import org.labkey.api.query.DefaultQueryUpdateService; import org.labkey.api.query.DetailsURL; import org.labkey.api.query.FieldKey; diff --git a/api/src/org/labkey/api/reader/HTMLDataLoader.java b/core/src/org/labkey/core/reader/HTMLDataLoader.java similarity index 98% rename from api/src/org/labkey/api/reader/HTMLDataLoader.java rename to core/src/org/labkey/core/reader/HTMLDataLoader.java index 4b4301a9d27..8da3bcbc167 100644 --- a/api/src/org/labkey/api/reader/HTMLDataLoader.java +++ b/core/src/org/labkey/core/reader/HTMLDataLoader.java @@ -13,11 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.reader; +package org.labkey.core.reader; import org.jetbrains.annotations.NotNull; import org.labkey.api.data.Container; import org.labkey.api.iterator.CloseableIterator; +import org.labkey.api.reader.AbstractDataLoaderFactory; +import org.labkey.api.reader.DataLoader; import org.labkey.api.util.FileType; import org.labkey.api.util.StringUtilsLabKey; import org.labkey.api.util.JSoupUtil; diff --git a/core/src/org/labkey/core/reports/ScriptEngineManagerImpl.java b/core/src/org/labkey/core/reports/ScriptEngineManagerImpl.java index ff8b8674251..724676204f2 100644 --- a/core/src/org/labkey/core/reports/ScriptEngineManagerImpl.java +++ b/core/src/org/labkey/core/reports/ScriptEngineManagerImpl.java @@ -47,11 +47,8 @@ import org.labkey.api.reports.ExternalScriptEngineDefinition; import org.labkey.api.reports.ExternalScriptEngineFactory; import org.labkey.api.reports.LabKeyScriptEngineManager; -import org.labkey.api.reports.report.python.PythonScriptEngine; -import org.labkey.api.reports.report.r.RDockerScriptEngineFactory; import org.labkey.api.reports.report.r.RScriptEngineFactory; import org.labkey.api.reports.report.r.RemoteRNotEnabledException; -import org.labkey.api.reports.report.r.RserveScriptEngineFactory; import org.labkey.api.script.ScriptService; import org.labkey.api.security.Encryption; import org.labkey.api.security.Encryption.AESConfig; @@ -66,6 +63,9 @@ import org.labkey.api.util.ConfigurationException; import org.labkey.api.util.PageFlowUtil; import org.labkey.api.util.logging.LogHelper; +import org.labkey.core.reports.report.python.PythonScriptEngine; +import org.labkey.core.reports.report.r.RDockerScriptEngineFactory; +import org.labkey.core.reports.report.r.RserveScriptEngineFactory; import org.labkey.core.script.RhinoScriptEngine; import javax.script.ScriptEngine; diff --git a/api/src/org/labkey/api/reports/report/python/PythonScriptEngine.java b/core/src/org/labkey/core/reports/report/python/PythonScriptEngine.java similarity index 98% rename from api/src/org/labkey/api/reports/report/python/PythonScriptEngine.java rename to core/src/org/labkey/core/reports/report/python/PythonScriptEngine.java index 3189b6193d4..9b11933c231 100644 --- a/api/src/org/labkey/api/reports/report/python/PythonScriptEngine.java +++ b/core/src/org/labkey/core/reports/report/python/PythonScriptEngine.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.reports.report.python; +package org.labkey.core.reports.report.python; import org.jetbrains.annotations.Nullable; import org.labkey.api.reports.ExternalScriptEngine; diff --git a/api/src/org/labkey/api/reports/report/r/RDockerScriptEngine.java b/core/src/org/labkey/core/reports/report/r/RDockerScriptEngine.java similarity index 95% rename from api/src/org/labkey/api/reports/report/r/RDockerScriptEngine.java rename to core/src/org/labkey/core/reports/report/r/RDockerScriptEngine.java index 7211d9b5ef4..ad91b495067 100644 --- a/api/src/org/labkey/api/reports/report/r/RDockerScriptEngine.java +++ b/core/src/org/labkey/core/reports/report/r/RDockerScriptEngine.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.reports.report.r; +package org.labkey.core.reports.report.r; import org.apache.commons.io.FilenameUtils; import org.jetbrains.annotations.NotNull; @@ -26,6 +26,10 @@ import org.labkey.api.query.ValidationException; import org.labkey.api.reports.ExternalScriptEngineDefinition; import org.labkey.api.reports.LabKeyScriptEngineManager; +import org.labkey.api.reports.report.r.RReport; +import org.labkey.api.reports.report.r.RScriptEngine; +import org.labkey.api.reports.report.r.RScriptEngineFactory; +import org.labkey.api.reports.report.r.RserveScriptEngine; import org.labkey.api.util.FileUtil; import org.labkey.api.util.UnexpectedException; import org.labkey.vfs.FileLike; diff --git a/api/src/org/labkey/api/reports/report/r/RDockerScriptEngineFactory.java b/core/src/org/labkey/core/reports/report/r/RDockerScriptEngineFactory.java similarity index 97% rename from api/src/org/labkey/api/reports/report/r/RDockerScriptEngineFactory.java rename to core/src/org/labkey/core/reports/report/r/RDockerScriptEngineFactory.java index b21264593c1..97dbe96513f 100644 --- a/api/src/org/labkey/api/reports/report/r/RDockerScriptEngineFactory.java +++ b/core/src/org/labkey/core/reports/report/r/RDockerScriptEngineFactory.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.reports.report.r; +package org.labkey.core.reports.report.r; import org.labkey.api.docker.DockerService; import org.labkey.api.reports.ExternalScriptEngineDefinition; diff --git a/api/src/org/labkey/api/reports/report/r/RserveScriptEngineFactory.java b/core/src/org/labkey/core/reports/report/r/RserveScriptEngineFactory.java similarity index 92% rename from api/src/org/labkey/api/reports/report/r/RserveScriptEngineFactory.java rename to core/src/org/labkey/core/reports/report/r/RserveScriptEngineFactory.java index a80f9dcf9c0..ca43248f114 100644 --- a/api/src/org/labkey/api/reports/report/r/RserveScriptEngineFactory.java +++ b/core/src/org/labkey/core/reports/report/r/RserveScriptEngineFactory.java @@ -13,10 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.reports.report.r; +package org.labkey.core.reports.report.r; import org.labkey.api.reports.ExternalScriptEngineDefinition; import org.labkey.api.reports.ExternalScriptEngineFactory; +import org.labkey.api.reports.report.r.RserveScriptEngine; import javax.script.ScriptEngine; diff --git a/core/src/org/labkey/core/security/ApiKeyViewProvider.java b/core/src/org/labkey/core/security/ApiKeyViewProvider.java index 40d965835c2..e64266d2e4b 100644 --- a/core/src/org/labkey/core/security/ApiKeyViewProvider.java +++ b/core/src/org/labkey/core/security/ApiKeyViewProvider.java @@ -19,7 +19,7 @@ import org.labkey.api.module.ModuleHtmlView; import org.labkey.api.module.ModuleLoader; import org.labkey.api.security.User; -import org.labkey.api.view.PopupUserView; +import org.labkey.core.view.PopupUserView; import org.springframework.web.servlet.ModelAndView; import java.util.LinkedList; diff --git a/api/src/org/labkey/api/security/AuthenticationLogoAttachmentParent.java b/core/src/org/labkey/core/security/AuthenticationLogoAttachmentParent.java similarity index 92% rename from api/src/org/labkey/api/security/AuthenticationLogoAttachmentParent.java rename to core/src/org/labkey/core/security/AuthenticationLogoAttachmentParent.java index bcd241d0f85..3e1fac36f3b 100644 --- a/api/src/org/labkey/api/security/AuthenticationLogoAttachmentParent.java +++ b/core/src/org/labkey/core/security/AuthenticationLogoAttachmentParent.java @@ -13,13 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.security; +package org.labkey.core.security; import org.jetbrains.annotations.NotNull; import org.labkey.api.attachments.AttachmentParentType; import org.labkey.api.data.Container; import org.labkey.api.data.ContainerManager; import org.labkey.api.data.ContainerManager.ContainerParent; +import org.labkey.api.security.AuthenticationLogoType; // Used for attaching SSO authentication logos to the root container // TODO: Previous comment is a lie... SSO logos are now attached to each authentication configuration. (We can have diff --git a/api/src/org/labkey/api/security/PasswordExpiration.java b/core/src/org/labkey/core/security/PasswordExpiration.java similarity index 96% rename from api/src/org/labkey/api/security/PasswordExpiration.java rename to core/src/org/labkey/core/security/PasswordExpiration.java index e8169015a20..2571b326205 100644 --- a/api/src/org/labkey/api/security/PasswordExpiration.java +++ b/core/src/org/labkey/core/security/PasswordExpiration.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.security; +package org.labkey.core.security; import org.junit.Assert; import org.junit.Test; diff --git a/api/src/org/labkey/api/settings/LookAndFeelPropertiesManager.java b/core/src/org/labkey/core/settings/LookAndFeelPropertiesManager.java similarity index 99% rename from api/src/org/labkey/api/settings/LookAndFeelPropertiesManager.java rename to core/src/org/labkey/core/settings/LookAndFeelPropertiesManager.java index 388253c218a..5ef0885f381 100644 --- a/api/src/org/labkey/api/settings/LookAndFeelPropertiesManager.java +++ b/core/src/org/labkey/core/settings/LookAndFeelPropertiesManager.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.settings; +package org.labkey.core.settings; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -28,13 +28,15 @@ import org.labkey.api.data.Container; import org.labkey.api.resource.Resource; import org.labkey.api.security.User; +import org.labkey.api.settings.StartupProperty; +import org.labkey.api.settings.TemplateResourceHandler; import org.labkey.api.util.HtmlString; import org.labkey.api.util.LinkBuilder; import org.labkey.api.util.PageFlowUtil; import org.labkey.api.util.SafeToRenderEnum; import org.springframework.web.multipart.MultipartFile; - import jakarta.servlet.ServletException; + import java.io.IOException; import java.util.Collections; diff --git a/api/src/org/labkey/api/util/CountLimiter.java b/core/src/org/labkey/core/util/CountLimiter.java similarity index 96% rename from api/src/org/labkey/api/util/CountLimiter.java rename to core/src/org/labkey/core/util/CountLimiter.java index 359cf8c016a..d1dcbcae2c5 100644 --- a/api/src/org/labkey/api/util/CountLimiter.java +++ b/core/src/org/labkey/core/util/CountLimiter.java @@ -13,10 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.util; +package org.labkey.core.util; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.labkey.api.util.HeartBeat; +import org.labkey.api.util.RateAccumulator; +import org.labkey.api.util.SimpleRateAccumulator; import java.util.ArrayList; import java.util.concurrent.TimeUnit; diff --git a/api/src/org/labkey/api/view/PopupAdminView.java b/core/src/org/labkey/core/view/PopupAdminView.java similarity index 92% rename from api/src/org/labkey/api/view/PopupAdminView.java rename to core/src/org/labkey/core/view/PopupAdminView.java index e80f9f94d18..530ae1660f3 100644 --- a/api/src/org/labkey/api/view/PopupAdminView.java +++ b/core/src/org/labkey/core/view/PopupAdminView.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.labkey.api.view; +package org.labkey.core.view; import org.jetbrains.annotations.Nullable; import org.labkey.api.data.Container; @@ -25,9 +25,14 @@ import org.labkey.api.security.User; import org.labkey.api.security.permissions.AdminPermission; import org.labkey.api.util.PageFlowUtil; +import org.labkey.api.view.ActionURL; +import org.labkey.api.view.DeveloperMenu; +import org.labkey.api.view.NavTree; +import org.labkey.api.view.PopupMenuView; +import org.labkey.api.view.ViewContext; import org.labkey.api.view.menu.FolderAdminMenu; -import org.labkey.api.view.menu.ProjectAdminMenu; -import org.labkey.api.view.menu.SiteAdminMenu; +import org.labkey.core.view.menu.ProjectAdminMenu; +import org.labkey.core.view.menu.SiteAdminMenu; import java.util.ArrayList; import java.util.Comparator; diff --git a/api/src/org/labkey/api/view/PopupHelpView.java b/core/src/org/labkey/core/view/PopupHelpView.java similarity index 89% rename from api/src/org/labkey/api/view/PopupHelpView.java rename to core/src/org/labkey/core/view/PopupHelpView.java index 1d870910603..e698c110339 100644 --- a/api/src/org/labkey/api/view/PopupHelpView.java +++ b/core/src/org/labkey/core/view/PopupHelpView.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.labkey.api.view; +package org.labkey.core.view; import org.labkey.api.data.Container; import org.labkey.api.module.ModuleLoader; @@ -22,6 +22,10 @@ import org.labkey.api.settings.AppProps; import org.labkey.api.settings.LookAndFeelProperties; import org.labkey.api.util.HelpTopic; +import org.labkey.api.view.NavTree; +import org.labkey.api.view.PopupMenu; +import org.labkey.api.view.PopupMenuView; +import org.labkey.api.view.ViewContext; /** * The Help menu item that appears in the user menu and lets the user navigate to relevant documentation and other resources. diff --git a/api/src/org/labkey/api/view/PopupUserView.java b/core/src/org/labkey/core/view/PopupUserView.java similarity index 90% rename from api/src/org/labkey/api/view/PopupUserView.java rename to core/src/org/labkey/core/view/PopupUserView.java index 954018ab47b..ce82ca8975f 100644 --- a/api/src/org/labkey/api/view/PopupUserView.java +++ b/core/src/org/labkey/core/view/PopupUserView.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.view; +package org.labkey.core.view; import org.labkey.api.data.Container; import org.labkey.api.module.ModuleLoader; @@ -23,6 +23,11 @@ import org.labkey.api.security.UserUrls; import org.labkey.api.settings.AppProps; import org.labkey.api.util.PageFlowUtil; +import org.labkey.api.view.ActionURL; +import org.labkey.api.view.NavTree; +import org.labkey.api.view.PopupMenu; +import org.labkey.api.view.PopupMenuView; +import org.labkey.api.view.ViewContext; import org.labkey.api.view.template.PageConfig; /** diff --git a/api/src/org/labkey/api/view/URLException.java b/core/src/org/labkey/core/view/URLException.java similarity index 95% rename from api/src/org/labkey/api/view/URLException.java rename to core/src/org/labkey/core/view/URLException.java index 869f9bcf568..7da815e20e3 100644 --- a/api/src/org/labkey/api/view/URLException.java +++ b/core/src/org/labkey/core/view/URLException.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.view; +package org.labkey.core.view; import org.labkey.api.util.SkipMothershipLogging; diff --git a/api/src/org/labkey/api/view/menu/ContainerMenu.java b/core/src/org/labkey/core/view/menu/ContainerMenu.java similarity index 94% rename from api/src/org/labkey/api/view/menu/ContainerMenu.java rename to core/src/org/labkey/core/view/menu/ContainerMenu.java index 36311b09afb..29ede991488 100644 --- a/api/src/org/labkey/api/view/menu/ContainerMenu.java +++ b/core/src/org/labkey/core/view/menu/ContainerMenu.java @@ -14,13 +14,14 @@ * limitations under the License. */ -package org.labkey.api.view.menu; +package org.labkey.core.view.menu; import org.labkey.api.data.Container; import org.labkey.api.data.ContainerManager; import org.labkey.api.view.NavTree; import org.labkey.api.view.NavTreeManager; import org.labkey.api.view.ViewContext; +import org.labkey.api.view.menu.NavTreeMenu; import java.util.Set; diff --git a/api/src/org/labkey/api/view/menu/FolderMenu.java b/core/src/org/labkey/core/view/menu/FolderMenu.java similarity index 95% rename from api/src/org/labkey/api/view/menu/FolderMenu.java rename to core/src/org/labkey/core/view/menu/FolderMenu.java index 4d339919d6b..a0dbfb3279f 100644 --- a/api/src/org/labkey/api/view/menu/FolderMenu.java +++ b/core/src/org/labkey/core/view/menu/FolderMenu.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.view.menu; +package org.labkey.core.view.menu; import org.jetbrains.annotations.Nullable; import org.labkey.api.data.Container; @@ -23,6 +23,7 @@ import org.labkey.api.util.LinkBuilder; import org.labkey.api.view.NavTree; import org.labkey.api.view.ViewContext; +import org.labkey.api.view.menu.NavTreeMenu; import org.labkey.api.writer.HtmlWriter; import java.util.ArrayList; diff --git a/api/src/org/labkey/api/view/menu/ProjectAdminMenu.java b/core/src/org/labkey/core/view/menu/ProjectAdminMenu.java similarity index 93% rename from api/src/org/labkey/api/view/menu/ProjectAdminMenu.java rename to core/src/org/labkey/core/view/menu/ProjectAdminMenu.java index a9345856ee9..269a7ebaff3 100644 --- a/api/src/org/labkey/api/view/menu/ProjectAdminMenu.java +++ b/core/src/org/labkey/core/view/menu/ProjectAdminMenu.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.labkey.api.view.menu; +package org.labkey.core.view.menu; import org.labkey.api.admin.AdminUrls; import org.labkey.api.data.Container; @@ -24,6 +24,7 @@ import org.labkey.api.util.PageFlowUtil; import org.labkey.api.view.NavTree; import org.labkey.api.view.ViewContext; +import org.labkey.api.view.menu.NavTreeMenu; import java.util.ArrayList; import java.util.List; diff --git a/api/src/org/labkey/api/view/menu/ProjectsMenu.java b/core/src/org/labkey/core/view/menu/ProjectsMenu.java similarity index 92% rename from api/src/org/labkey/api/view/menu/ProjectsMenu.java rename to core/src/org/labkey/core/view/menu/ProjectsMenu.java index e065527547a..07565e15ede 100644 --- a/api/src/org/labkey/api/view/menu/ProjectsMenu.java +++ b/core/src/org/labkey/core/view/menu/ProjectsMenu.java @@ -14,16 +14,18 @@ * limitations under the License. */ -package org.labkey.api.view.menu; +package org.labkey.core.view.menu; + + +import java.util.Collections; +import java.util.List; import org.labkey.api.data.Container; import org.labkey.api.data.ContainerManager; import org.labkey.api.view.ActionURL; import org.labkey.api.view.NavTree; import org.labkey.api.view.ViewContext; - -import java.util.Collections; -import java.util.List; +import org.labkey.api.view.menu.NavTreeMenu; public class ProjectsMenu extends NavTreeMenu { diff --git a/api/src/org/labkey/api/view/menu/SiteAdminMenu.java b/core/src/org/labkey/core/view/menu/SiteAdminMenu.java similarity index 95% rename from api/src/org/labkey/api/view/menu/SiteAdminMenu.java rename to core/src/org/labkey/core/view/menu/SiteAdminMenu.java index 0a8d19b8393..f79b650b13d 100644 --- a/api/src/org/labkey/api/view/menu/SiteAdminMenu.java +++ b/core/src/org/labkey/core/view/menu/SiteAdminMenu.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.labkey.api.view.menu; +package org.labkey.core.view.menu; import org.jetbrains.annotations.NotNull; import org.labkey.api.admin.AdminUrls; @@ -29,6 +29,7 @@ import org.labkey.api.view.ActionURL; import org.labkey.api.view.NavTree; import org.labkey.api.view.ViewContext; +import org.labkey.api.view.menu.NavTreeMenu; import java.util.ArrayList; import java.util.List; diff --git a/core/src/org/labkey/core/view/template/bootstrap/header.jsp b/core/src/org/labkey/core/view/template/bootstrap/header.jsp index c43d52c28f5..bbe79115b78 100644 --- a/core/src/org/labkey/core/view/template/bootstrap/header.jsp +++ b/core/src/org/labkey/core/view/template/bootstrap/header.jsp @@ -39,19 +39,19 @@ <%@ page import="org.labkey.api.view.HtmlView" %> <%@ page import="org.labkey.api.view.HttpView" %> <%@ page import="org.labkey.api.view.NavTree" %> -<%@ page import="org.labkey.api.view.PopupAdminView" %> <%@ page import="org.labkey.api.view.PopupMenuView" %> -<%@ page import="org.labkey.api.view.PopupUserView" %> <%@ page import="org.labkey.api.view.ViewContext" %> <%@ page import="org.labkey.api.view.template.ClientDependencies" %> <%@ page import="org.labkey.api.view.template.PageConfig" %> +<%@ page import="org.labkey.core.view.PopupAdminView" %> +<%@ page import="org.labkey.core.view.PopupUserView" %> <%@ page import="org.labkey.core.view.template.bootstrap.Header" %> -<%@ page import="static org.labkey.api.view.template.WarningService.SESSION_WARNINGS_BANNER_KEY" %> -<%@ page import="static org.labkey.api.util.DOM.IMG" %> -<%@ page import="static org.labkey.api.util.DOM.Attribute.src" %> -<%@ page import="static org.labkey.api.util.DOM.Attribute.alt" %> <%@ page import="static org.labkey.api.util.DOM.A" %> +<%@ page import="static org.labkey.api.util.DOM.Attribute.alt" %> <%@ page import="static org.labkey.api.util.DOM.Attribute.href" %> +<%@ page import="static org.labkey.api.util.DOM.Attribute.src" %> +<%@ page import="static org.labkey.api.util.DOM.IMG" %> +<%@ page import="static org.labkey.api.view.template.WarningService.SESSION_WARNINGS_BANNER_KEY" %> <%@ taglib prefix="labkey" uri="http://www.labkey.org/taglib" %> <%@ page extends="org.labkey.api.jsp.JspBase" %> <%! diff --git a/core/src/org/labkey/core/webdav/ModuleStaticResolverImpl.java b/core/src/org/labkey/core/webdav/ModuleStaticResolverImpl.java index 7383f2d0562..aef62e4967b 100644 --- a/core/src/org/labkey/core/webdav/ModuleStaticResolverImpl.java +++ b/core/src/org/labkey/core/webdav/ModuleStaticResolverImpl.java @@ -49,7 +49,6 @@ import org.labkey.api.webdav.AbstractWebdavResourceCollection; import org.labkey.api.webdav.WebdavResolver; import org.labkey.api.webdav.WebdavResource; -import org.labkey.api.webdav.WebdavResourceReadOnly; import org.labkey.api.webdav.WebdavService; import org.labkey.vfs.FileLike; diff --git a/api/src/org/labkey/api/webdav/WebdavResourceReadOnly.java b/core/src/org/labkey/core/webdav/WebdavResourceReadOnly.java similarity index 98% rename from api/src/org/labkey/api/webdav/WebdavResourceReadOnly.java rename to core/src/org/labkey/core/webdav/WebdavResourceReadOnly.java index 834fa0100b8..019f1a4ed05 100644 --- a/api/src/org/labkey/api/webdav/WebdavResourceReadOnly.java +++ b/core/src/org/labkey/core/webdav/WebdavResourceReadOnly.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.webdav; +package org.labkey.core.webdav; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -25,6 +25,9 @@ import org.labkey.api.util.Path; import org.labkey.api.view.NavTree; import org.labkey.api.view.ViewContext; +import org.labkey.api.webdav.DirectRequest; +import org.labkey.api.webdav.WebdavResolver; +import org.labkey.api.webdav.WebdavResource; import org.labkey.api.writer.ContainerUser; import java.io.File; diff --git a/core/src/org/labkey/core/wiki/RadeoxRenderer.java b/core/src/org/labkey/core/wiki/RadeoxRenderer.java index f669f6c856e..cf8a8753fbd 100644 --- a/core/src/org/labkey/core/wiki/RadeoxRenderer.java +++ b/core/src/org/labkey/core/wiki/RadeoxRenderer.java @@ -32,16 +32,16 @@ import org.labkey.api.view.HttpView; import org.labkey.api.view.NavTreeManager; import org.labkey.api.view.ViewContext; -import org.labkey.api.view.menu.ContainerMenu; import org.labkey.api.view.menu.FolderAdminMenu; import org.labkey.api.view.menu.NavTreeMenu; -import org.labkey.api.view.menu.ProjectAdminMenu; -import org.labkey.api.view.menu.ProjectsMenu; -import org.labkey.api.view.menu.SiteAdminMenu; import org.labkey.api.wiki.FormattedHtml; import org.labkey.api.wiki.WikiRenderer; import org.labkey.api.wiki.WikiRendererType; import org.labkey.api.wiki.WikiRenderingService; +import org.labkey.core.view.menu.ContainerMenu; +import org.labkey.core.view.menu.ProjectAdminMenu; +import org.labkey.core.view.menu.ProjectsMenu; +import org.labkey.core.view.menu.SiteAdminMenu; import org.radeox.api.engine.RenderEngine; import org.radeox.api.engine.WikiRenderEngine; import org.radeox.api.engine.context.InitialRenderContext; diff --git a/experiment/src/org/labkey/experiment/ExperimentMigrationSchemaHandler.java b/experiment/src/org/labkey/experiment/ExperimentMigrationSchemaHandler.java index dd85aeca39f..628c5353f3e 100644 --- a/experiment/src/org/labkey/experiment/ExperimentMigrationSchemaHandler.java +++ b/experiment/src/org/labkey/experiment/ExperimentMigrationSchemaHandler.java @@ -37,7 +37,6 @@ import org.labkey.api.data.TableSelector; import org.labkey.api.data.dialect.SqlDialect; import org.labkey.api.exp.OntologyManager; -import org.labkey.api.exp.api.ExpProtocolAttachmentType; import org.labkey.api.exp.api.ExpRunAttachmentType; import org.labkey.api.migration.AssaySkipContainers; import org.labkey.api.migration.DatabaseMigrationConfiguration; @@ -47,6 +46,7 @@ import org.labkey.api.util.StringUtilsLabKey; import org.labkey.api.util.logging.LogHelper; import org.labkey.experiment.api.ExperimentServiceImpl; +import org.labkey.experiment.exp.api.ExpProtocolAttachmentType; import java.util.Collection; import java.util.List; diff --git a/experiment/src/org/labkey/experiment/ExperimentModule.java b/experiment/src/org/labkey/experiment/ExperimentModule.java index 559b913b484..7197dc73fc0 100644 --- a/experiment/src/org/labkey/experiment/ExperimentModule.java +++ b/experiment/src/org/labkey/experiment/ExperimentModule.java @@ -54,17 +54,14 @@ import org.labkey.api.exp.api.ExpLineageService; import org.labkey.api.exp.api.ExpMaterial; import org.labkey.api.exp.api.ExpProtocol; -import org.labkey.api.exp.api.ExpProtocolAttachmentType; import org.labkey.api.exp.api.ExpRunAttachmentType; import org.labkey.api.exp.api.ExpSampleType; import org.labkey.api.exp.api.ExperimentJSONConverter; import org.labkey.api.exp.api.ExperimentService; -import org.labkey.api.exp.api.FilterProtocolInputCriteria; import org.labkey.api.exp.api.SampleTypeDomainKind; import org.labkey.api.exp.api.SampleTypeService; import org.labkey.api.exp.api.StorageProvisioner; import org.labkey.api.exp.property.DomainAuditProvider; -import org.labkey.api.exp.property.DomainPropertyAuditProvider; import org.labkey.api.exp.property.DomainUtil; import org.labkey.api.exp.property.ExperimentProperty; import org.labkey.api.exp.property.PropertyService; @@ -162,6 +159,9 @@ import org.labkey.experiment.controllers.exp.ExperimentController; import org.labkey.experiment.controllers.property.PropertyController; import org.labkey.experiment.defaults.DefaultValueServiceImpl; +import org.labkey.experiment.exp.api.ExpProtocolAttachmentType; +import org.labkey.experiment.exp.api.FilterProtocolInputCriteria; +import org.labkey.experiment.exp.property.DomainPropertyAuditProvider; import org.labkey.experiment.lineage.ExpLineageServiceImpl; import org.labkey.experiment.lineage.LineagePerfTest; import org.labkey.experiment.pipeline.ExperimentPipelineProvider; diff --git a/experiment/src/org/labkey/experiment/XarReader.java b/experiment/src/org/labkey/experiment/XarReader.java index b059261cdca..80d7da7c202 100644 --- a/experiment/src/org/labkey/experiment/XarReader.java +++ b/experiment/src/org/labkey/experiment/XarReader.java @@ -103,7 +103,6 @@ import org.labkey.api.exp.query.ExpMaterialTable; import org.labkey.api.exp.query.ExpSchema; import org.labkey.api.exp.xar.LsidUtils; -import org.labkey.api.exp.xar.XarReaderRegistry; import org.labkey.api.gwt.client.AuditBehaviorType; import org.labkey.api.pipeline.PipelineJob; import org.labkey.api.pipeline.PipelineService; @@ -144,6 +143,7 @@ import org.labkey.experiment.api.RunItem; import org.labkey.experiment.api.SampleTypeServiceImpl; import org.labkey.experiment.api.property.DomainImpl; +import org.labkey.experiment.exp.xar.XarReaderRegistry; import org.labkey.experiment.pipeline.MoveRunsPipelineJob; import org.labkey.experiment.xar.AbstractXarImporter; import org.labkey.experiment.xar.AutoFileLSIDReplacer; diff --git a/experiment/src/org/labkey/experiment/api/CountOfUniqueValueTableCustomizer.java b/experiment/src/org/labkey/experiment/api/CountOfUniqueValueTableCustomizer.java index b092a613cdc..cc824a4a822 100644 --- a/experiment/src/org/labkey/experiment/api/CountOfUniqueValueTableCustomizer.java +++ b/experiment/src/org/labkey/experiment/api/CountOfUniqueValueTableCustomizer.java @@ -40,7 +40,7 @@ * // Name of this customizer * * SampleCounter // Name of counter (required) - * org.labkey.api.data.UniqueValueCounterDefinition // Name of implementation of CounterDefinition (required) + * org.labkey.experiment.data.UniqueValueCounterDefinition // Name of implementation of CounterDefinition (required) * * vessel // Zero or more pairedColumns (whose values are used to uniquify the DB sequence) * one diff --git a/experiment/src/org/labkey/experiment/api/ExpDataClassDataTableImpl.java b/experiment/src/org/labkey/experiment/api/ExpDataClassDataTableImpl.java index f6c19969997..9917dbce0d9 100644 --- a/experiment/src/org/labkey/experiment/api/ExpDataClassDataTableImpl.java +++ b/experiment/src/org/labkey/experiment/api/ExpDataClassDataTableImpl.java @@ -59,7 +59,6 @@ import org.labkey.api.dataiterator.DataIteratorContext; import org.labkey.api.dataiterator.DataIteratorUtil; import org.labkey.api.dataiterator.DetailedAuditLogDataIterator; -import org.labkey.api.dataiterator.DropColumnsDataIterator; import org.labkey.api.dataiterator.LoggingDataIterator; import org.labkey.api.dataiterator.NameExpressionDataIterator; import org.labkey.api.dataiterator.SimpleTranslator; @@ -129,6 +128,7 @@ import org.labkey.experiment.ExpDataIterators.AliasDataIteratorBuilder; import org.labkey.experiment.ExpDataIterators.PersistDataIteratorBuilder; import org.labkey.experiment.controllers.exp.ExperimentController; +import org.labkey.experiment.dataiterator.DropColumnsDataIterator; import org.labkey.experiment.lineage.LineageMethod; import java.io.IOException; diff --git a/experiment/src/org/labkey/experiment/api/SampleTypeUpdateServiceDI.java b/experiment/src/org/labkey/experiment/api/SampleTypeUpdateServiceDI.java index 6e56ac2592c..08bcd1c33dc 100644 --- a/experiment/src/org/labkey/experiment/api/SampleTypeUpdateServiceDI.java +++ b/experiment/src/org/labkey/experiment/api/SampleTypeUpdateServiceDI.java @@ -60,7 +60,6 @@ import org.labkey.api.dataiterator.DataIteratorContext; import org.labkey.api.dataiterator.DataIteratorUtil; import org.labkey.api.dataiterator.DetailedAuditLogDataIterator; -import org.labkey.api.dataiterator.DropColumnsDataIterator; import org.labkey.api.dataiterator.LoggingDataIterator; import org.labkey.api.dataiterator.MapDataIterator; import org.labkey.api.dataiterator.Pump; @@ -118,6 +117,7 @@ import org.labkey.api.workflow.WorkflowService; import org.labkey.experiment.ExpDataIterators; import org.labkey.experiment.SampleTypeAuditProvider; +import org.labkey.experiment.dataiterator.DropColumnsDataIterator; import java.io.IOException; import java.sql.SQLException; diff --git a/experiment/src/org/labkey/experiment/api/UniqueValueCounterTestCase.java b/experiment/src/org/labkey/experiment/api/UniqueValueCounterTestCase.java index 76023538e3e..88536baeb71 100644 --- a/experiment/src/org/labkey/experiment/api/UniqueValueCounterTestCase.java +++ b/experiment/src/org/labkey/experiment/api/UniqueValueCounterTestCase.java @@ -74,7 +74,7 @@ public void tearDown() " \n" + " \n" + " " + counterName + "\n" + - " org.labkey.api.data.UniqueValueCounterDefinition\n" + + " org.labkey.experiment.data.UniqueValueCounterDefinition\n" + " vessel \n" + " one\n" + " two\n" + @@ -219,7 +219,7 @@ sampTypeName, null, props, emptyList(), " \n" + " \n" + " " + counterName + "\n" + - " org.labkey.api.data.UniqueValueCounterDefinition\n" + + " org.labkey.experiment.data.UniqueValueCounterDefinition\n" + " one \n" + " two" + diff --git a/experiment/src/org/labkey/experiment/api/property/DomainImpl.java b/experiment/src/org/labkey/experiment/api/property/DomainImpl.java index b52d36d86f2..986089c3a6c 100644 --- a/experiment/src/org/labkey/experiment/api/property/DomainImpl.java +++ b/experiment/src/org/labkey/experiment/api/property/DomainImpl.java @@ -80,7 +80,6 @@ import org.labkey.api.exp.property.DomainAuditProvider; import org.labkey.api.exp.property.DomainKind; import org.labkey.api.exp.property.DomainProperty; -import org.labkey.api.exp.property.DomainPropertyAuditProvider; import org.labkey.api.exp.property.DomainTemplate; import org.labkey.api.exp.property.DomainUtil; import org.labkey.api.exp.query.ExpSchema; @@ -107,6 +106,7 @@ import org.labkey.api.util.TestContext; import org.labkey.api.view.ActionURL; import org.labkey.api.writer.ContainerUser; +import org.labkey.experiment.exp.property.DomainPropertyAuditProvider; import java.sql.SQLException; import java.text.DecimalFormat; diff --git a/experiment/src/org/labkey/experiment/controllers/exp/ExperimentController.java b/experiment/src/org/labkey/experiment/controllers/exp/ExperimentController.java index 0ad11b2e8bb..a488b421cf6 100644 --- a/experiment/src/org/labkey/experiment/controllers/exp/ExperimentController.java +++ b/experiment/src/org/labkey/experiment/controllers/exp/ExperimentController.java @@ -91,7 +91,6 @@ import org.labkey.api.data.SimpleFilter; import org.labkey.api.data.Sort; import org.labkey.api.data.SqlSelector; -import org.labkey.api.data.TSVJSONWriter; import org.labkey.api.data.TSVWriter; import org.labkey.api.data.TableInfo; import org.labkey.api.data.TableSelector; @@ -100,7 +99,6 @@ import org.labkey.api.exp.DeleteForm; import org.labkey.api.exp.ExperimentDataHandler; import org.labkey.api.exp.ExperimentException; -import org.labkey.api.exp.ExperimentRunForm; import org.labkey.api.exp.ExperimentRunListView; import org.labkey.api.exp.ExperimentRunType; import org.labkey.api.exp.Identifiable; @@ -301,6 +299,8 @@ import org.labkey.experiment.api.SampleTypeServiceImpl; import org.labkey.experiment.api.SampleTypeUpdateServiceDI; import org.labkey.experiment.controllers.property.PropertyController; +import org.labkey.experiment.data.TSVJSONWriter; +import org.labkey.experiment.exp.ExperimentRunForm; import org.labkey.experiment.lineage.ExpLineageServiceImpl; import org.labkey.experiment.pipeline.ExperimentPipelineJob; import org.labkey.experiment.types.TypesController; diff --git a/experiment/src/org/labkey/experiment/controllers/exp/ExperimentRunGroupsView.java b/experiment/src/org/labkey/experiment/controllers/exp/ExperimentRunGroupsView.java index f4446e0e461..38402d5cb8a 100644 --- a/experiment/src/org/labkey/experiment/controllers/exp/ExperimentRunGroupsView.java +++ b/experiment/src/org/labkey/experiment/controllers/exp/ExperimentRunGroupsView.java @@ -31,8 +31,8 @@ import org.labkey.api.view.Collapsible; import org.labkey.api.view.DataView; import org.labkey.api.view.NavTreeManager; -import org.labkey.api.view.SimpleRenderableDisplayElement; import org.labkey.api.view.VBox; +import org.labkey.experiment.view.SimpleRenderableDisplayElement; import org.springframework.validation.BindException; import static org.labkey.api.util.DOM.SPAN; diff --git a/experiment/src/org/labkey/experiment/controllers/property/PropertyController.java b/experiment/src/org/labkey/experiment/controllers/property/PropertyController.java index 9d59b9009d2..03afa2eb655 100644 --- a/experiment/src/org/labkey/experiment/controllers/property/PropertyController.java +++ b/experiment/src/org/labkey/experiment/controllers/property/PropertyController.java @@ -58,7 +58,6 @@ import org.labkey.api.exp.ObjectProperty; import org.labkey.api.exp.OntologyManager; import org.labkey.api.exp.TemplateInfo; -import org.labkey.api.exp.api.DomainKindDesign; import org.labkey.api.exp.api.ExperimentJSONConverter; import org.labkey.api.exp.api.ExperimentUrls; import org.labkey.api.exp.property.Domain; @@ -96,7 +95,6 @@ import org.labkey.api.util.JsonUtil; import org.labkey.api.util.JunitUtil; import org.labkey.api.util.Pair; -import org.labkey.api.util.SessionTempFileHolder; import org.labkey.api.util.TestContext; import org.labkey.api.util.URLHelper; import org.labkey.api.util.UnexpectedException; @@ -108,6 +106,8 @@ import org.labkey.api.view.UnauthorizedException; import org.labkey.api.writer.PrintWriters; import org.labkey.experiment.api.VocabularyDomainKind; +import org.labkey.experiment.exp.api.DomainKindDesign; +import org.labkey.experiment.util.SessionTempFileHolder; import org.labkey.vfs.FileLike; import org.labkey.vfs.FileSystemLike; import org.springframework.validation.BindException; diff --git a/api/src/org/labkey/api/data/TSVJSONWriter.java b/experiment/src/org/labkey/experiment/data/TSVJSONWriter.java similarity index 96% rename from api/src/org/labkey/api/data/TSVJSONWriter.java rename to experiment/src/org/labkey/experiment/data/TSVJSONWriter.java index 506d3c3d30b..bdaa3cbd86a 100644 --- a/api/src/org/labkey/api/data/TSVJSONWriter.java +++ b/experiment/src/org/labkey/experiment/data/TSVJSONWriter.java @@ -13,9 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.data; +package org.labkey.experiment.data; import org.json.JSONArray; +import org.labkey.api.data.TSVWriter; import org.labkey.api.util.FileUtil; import java.util.List; diff --git a/api/src/org/labkey/api/data/UniqueValueCounterDefinition.java b/experiment/src/org/labkey/experiment/data/UniqueValueCounterDefinition.java similarity index 95% rename from api/src/org/labkey/api/data/UniqueValueCounterDefinition.java rename to experiment/src/org/labkey/experiment/data/UniqueValueCounterDefinition.java index 9be7351773d..44b1c059daa 100644 --- a/api/src/org/labkey/api/data/UniqueValueCounterDefinition.java +++ b/experiment/src/org/labkey/experiment/data/UniqueValueCounterDefinition.java @@ -13,11 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.data; +package org.labkey.experiment.data; + import java.util.List; import java.util.Set; import java.util.stream.Collectors; +import org.labkey.api.data.CounterDefinition; public class UniqueValueCounterDefinition implements CounterDefinition { diff --git a/api/src/org/labkey/api/dataiterator/DropColumnsDataIterator.java b/experiment/src/org/labkey/experiment/dataiterator/DropColumnsDataIterator.java similarity index 93% rename from api/src/org/labkey/api/dataiterator/DropColumnsDataIterator.java rename to experiment/src/org/labkey/experiment/dataiterator/DropColumnsDataIterator.java index 966c7432e3c..6e162cd4b9f 100644 --- a/api/src/org/labkey/api/dataiterator/DropColumnsDataIterator.java +++ b/experiment/src/org/labkey/experiment/dataiterator/DropColumnsDataIterator.java @@ -13,12 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.dataiterator; +package org.labkey.experiment.dataiterator; + -import org.labkey.api.data.ColumnInfo; import java.util.Set; import java.util.function.Supplier; +import org.labkey.api.data.ColumnInfo; +import org.labkey.api.dataiterator.DataIterator; +import org.labkey.api.dataiterator.WrapperDataIterator; /* * See SimpleTranslator.selectAll(@NotNull Set skipColumns) for similar functionality, but SampleTranslator diff --git a/api/src/org/labkey/api/exp/ExperimentRunForm.java b/experiment/src/org/labkey/experiment/exp/ExperimentRunForm.java similarity index 98% rename from api/src/org/labkey/api/exp/ExperimentRunForm.java rename to experiment/src/org/labkey/experiment/exp/ExperimentRunForm.java index 9ed01645d17..0135e53e177 100644 --- a/api/src/org/labkey/api/exp/ExperimentRunForm.java +++ b/experiment/src/org/labkey/experiment/exp/ExperimentRunForm.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.labkey.api.exp; +package org.labkey.experiment.exp; import org.labkey.api.exp.api.ExpRun; import org.labkey.api.exp.api.ExperimentService; diff --git a/api/src/org/labkey/api/exp/api/DomainKindDesign.java b/experiment/src/org/labkey/experiment/exp/api/DomainKindDesign.java similarity index 97% rename from api/src/org/labkey/api/exp/api/DomainKindDesign.java rename to experiment/src/org/labkey/experiment/exp/api/DomainKindDesign.java index d617bf718a5..72f61c2d5e2 100644 --- a/api/src/org/labkey/api/exp/api/DomainKindDesign.java +++ b/experiment/src/org/labkey/experiment/exp/api/DomainKindDesign.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.exp.api; +package org.labkey.experiment.exp.api; import org.labkey.api.gwt.client.model.GWTDomain; import org.labkey.api.util.JsonUtil; diff --git a/api/src/org/labkey/api/exp/api/ExpProtocolAttachmentType.java b/experiment/src/org/labkey/experiment/exp/api/ExpProtocolAttachmentType.java similarity index 94% rename from api/src/org/labkey/api/exp/api/ExpProtocolAttachmentType.java rename to experiment/src/org/labkey/experiment/exp/api/ExpProtocolAttachmentType.java index 7814e0ee245..b454857f510 100644 --- a/api/src/org/labkey/api/exp/api/ExpProtocolAttachmentType.java +++ b/experiment/src/org/labkey/experiment/exp/api/ExpProtocolAttachmentType.java @@ -13,11 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.exp.api; +package org.labkey.experiment.exp.api; import org.jetbrains.annotations.NotNull; import org.labkey.api.attachments.AttachmentParentType; import org.labkey.api.data.SQLFragment; +import org.labkey.api.exp.api.ExperimentService; public class ExpProtocolAttachmentType implements AttachmentParentType { diff --git a/api/src/org/labkey/api/exp/api/FilterProtocolInputCriteria.java b/experiment/src/org/labkey/experiment/exp/api/FilterProtocolInputCriteria.java similarity index 91% rename from api/src/org/labkey/api/exp/api/FilterProtocolInputCriteria.java rename to experiment/src/org/labkey/experiment/exp/api/FilterProtocolInputCriteria.java index 6f30a950302..ad7c4f821eb 100644 --- a/api/src/org/labkey/api/exp/api/FilterProtocolInputCriteria.java +++ b/experiment/src/org/labkey/experiment/exp/api/FilterProtocolInputCriteria.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.exp.api; +package org.labkey.experiment.exp.api; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -22,6 +22,15 @@ import org.labkey.api.data.SimpleFilter; import org.labkey.api.data.TableInfo; import org.labkey.api.data.TableSelector; +import org.labkey.api.exp.api.AbstractProtocolInputCriteria; +import org.labkey.api.exp.api.ExpDataClass; +import org.labkey.api.exp.api.ExpDataProtocolInput; +import org.labkey.api.exp.api.ExpMaterialProtocolInput; +import org.labkey.api.exp.api.ExpProtocolInput; +import org.labkey.api.exp.api.ExpProtocolInputCriteria; +import org.labkey.api.exp.api.ExpRunItem; +import org.labkey.api.exp.api.ExpSampleType; +import org.labkey.api.exp.api.ExperimentService; import org.labkey.api.exp.query.ExpSchema; import org.labkey.api.exp.query.SamplesSchema; import org.labkey.api.query.CustomViewInfo; diff --git a/api/src/org/labkey/api/exp/property/DomainPropertyAuditProvider.java b/experiment/src/org/labkey/experiment/exp/property/DomainPropertyAuditProvider.java similarity index 98% rename from api/src/org/labkey/api/exp/property/DomainPropertyAuditProvider.java rename to experiment/src/org/labkey/experiment/exp/property/DomainPropertyAuditProvider.java index 731b12d26d8..b58236fbdf2 100644 --- a/api/src/org/labkey/api/exp/property/DomainPropertyAuditProvider.java +++ b/experiment/src/org/labkey/experiment/exp/property/DomainPropertyAuditProvider.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.exp.property; +package org.labkey.experiment.exp.property; import org.labkey.api.audit.AbstractAuditTypeProvider; import org.labkey.api.audit.AuditTypeEvent; @@ -27,6 +27,7 @@ import org.labkey.api.data.TableInfo; import org.labkey.api.exp.PropertyDescriptor; import org.labkey.api.exp.PropertyType; +import org.labkey.api.exp.property.DomainAuditProvider; import org.labkey.api.query.DetailsURL; import org.labkey.api.query.FieldKey; import org.labkey.api.query.LookupForeignKey; diff --git a/api/src/org/labkey/api/exp/xar/XarReaderDelegate.java b/experiment/src/org/labkey/experiment/exp/xar/XarReaderDelegate.java similarity index 96% rename from api/src/org/labkey/api/exp/xar/XarReaderDelegate.java rename to experiment/src/org/labkey/experiment/exp/xar/XarReaderDelegate.java index 8f973e1a450..623babe19b2 100644 --- a/api/src/org/labkey/api/exp/xar/XarReaderDelegate.java +++ b/experiment/src/org/labkey/experiment/exp/xar/XarReaderDelegate.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.exp.xar; +package org.labkey.experiment.exp.xar; import org.apache.logging.log4j.Logger; import org.labkey.api.data.Container; diff --git a/api/src/org/labkey/api/exp/xar/XarReaderRegistry.java b/experiment/src/org/labkey/experiment/exp/xar/XarReaderRegistry.java similarity index 98% rename from api/src/org/labkey/api/exp/xar/XarReaderRegistry.java rename to experiment/src/org/labkey/experiment/exp/xar/XarReaderRegistry.java index c45ee4135f6..ae5c2f176af 100644 --- a/api/src/org/labkey/api/exp/xar/XarReaderRegistry.java +++ b/experiment/src/org/labkey/experiment/exp/xar/XarReaderRegistry.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.exp.xar; +package org.labkey.experiment.exp.xar; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/api/src/org/labkey/api/util/SessionTempFileHolder.java b/experiment/src/org/labkey/experiment/util/SessionTempFileHolder.java similarity index 98% rename from api/src/org/labkey/api/util/SessionTempFileHolder.java rename to experiment/src/org/labkey/experiment/util/SessionTempFileHolder.java index db650246ac0..15ced0bfe65 100644 --- a/api/src/org/labkey/api/util/SessionTempFileHolder.java +++ b/experiment/src/org/labkey/experiment/util/SessionTempFileHolder.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.util; +package org.labkey.experiment.util; import jakarta.servlet.http.HttpSessionBindingEvent; import jakarta.servlet.http.HttpSessionBindingListener; diff --git a/api/src/org/labkey/api/view/SimpleRenderableDisplayElement.java b/experiment/src/org/labkey/experiment/view/SimpleRenderableDisplayElement.java similarity index 93% rename from api/src/org/labkey/api/view/SimpleRenderableDisplayElement.java rename to experiment/src/org/labkey/experiment/view/SimpleRenderableDisplayElement.java index 0d2f1e44841..ac407de73fa 100644 --- a/api/src/org/labkey/api/view/SimpleRenderableDisplayElement.java +++ b/experiment/src/org/labkey/experiment/view/SimpleRenderableDisplayElement.java @@ -14,10 +14,11 @@ * limitations under the License. */ -package org.labkey.api.view; +package org.labkey.experiment.view; import org.labkey.api.data.RenderContext; import org.labkey.api.util.DOM.Renderable; +import org.labkey.api.view.DisplayElement; import org.labkey.api.writer.HtmlWriter; /** diff --git a/filecontent/src/org/labkey/filecontent/FileContentServiceImpl.java b/filecontent/src/org/labkey/filecontent/FileContentServiceImpl.java index ca6ef515ee3..652da57feb1 100644 --- a/filecontent/src/org/labkey/filecontent/FileContentServiceImpl.java +++ b/filecontent/src/org/labkey/filecontent/FileContentServiceImpl.java @@ -57,9 +57,7 @@ import org.labkey.api.files.DirectoryPattern; import org.labkey.api.files.FileContentService; import org.labkey.api.files.FileListener; -import org.labkey.api.files.FileRoot; import org.labkey.api.files.FilesAdminOptions; -import org.labkey.api.files.MissingRootDirectoryException; import org.labkey.api.files.UnsetRootDirectoryException; import org.labkey.api.files.view.FilesWebPart; import org.labkey.api.module.Module; @@ -96,6 +94,8 @@ import org.labkey.api.view.template.Warnings; import org.labkey.api.webdav.WebdavResource; import org.labkey.api.webdav.WebdavService; +import org.labkey.filecontent.files.FileRoot; +import org.labkey.filecontent.files.MissingRootDirectoryException; import org.labkey.vfs.FileLike; import java.beans.PropertyChangeEvent; diff --git a/filecontent/src/org/labkey/filecontent/FileRootManager.java b/filecontent/src/org/labkey/filecontent/FileRootManager.java index 03eec39df27..ee3e0dca6a9 100644 --- a/filecontent/src/org/labkey/filecontent/FileRootManager.java +++ b/filecontent/src/org/labkey/filecontent/FileRootManager.java @@ -25,8 +25,8 @@ import org.labkey.api.data.Table; import org.labkey.api.data.TableInfo; import org.labkey.api.data.TableSelector; -import org.labkey.api.files.FileRoot; import org.labkey.api.security.User; +import org.labkey.filecontent.files.FileRoot; import java.util.Collections; import java.util.HashMap; diff --git a/filecontent/src/org/labkey/filecontent/FileWriter.java b/filecontent/src/org/labkey/filecontent/FileWriter.java index b72b1e4a491..8da82aa7f14 100644 --- a/filecontent/src/org/labkey/filecontent/FileWriter.java +++ b/filecontent/src/org/labkey/filecontent/FileWriter.java @@ -24,13 +24,13 @@ import org.labkey.api.admin.FolderWriterFactory; import org.labkey.api.data.Container; import org.labkey.api.files.FileContentService; -import org.labkey.api.files.FileRoot; import org.labkey.api.pipeline.PipelineService; import org.labkey.api.util.FileUtil; import org.labkey.api.util.Path; import org.labkey.api.webdav.WebdavResource; import org.labkey.api.webdav.WebdavService; import org.labkey.api.writer.VirtualFile; +import org.labkey.filecontent.files.FileRoot; import java.io.IOException; import java.io.InputStream; diff --git a/api/src/org/labkey/api/files/FileRoot.java b/filecontent/src/org/labkey/filecontent/files/FileRoot.java similarity index 91% rename from api/src/org/labkey/api/files/FileRoot.java rename to filecontent/src/org/labkey/filecontent/files/FileRoot.java index db2f8e77975..967ee8cf0f6 100644 --- a/api/src/org/labkey/api/files/FileRoot.java +++ b/filecontent/src/org/labkey/filecontent/files/FileRoot.java @@ -14,11 +14,13 @@ * limitations under the License. */ -package org.labkey.api.files; +package org.labkey.filecontent.files; + -import org.labkey.api.data.Container; import java.io.Serializable; +import org.labkey.api.data.Container; +import org.labkey.api.files.FileContentService; /** * Bean class that holds a file root definition, pointing to a path available on the web server and bound to a container. diff --git a/api/src/org/labkey/api/files/MissingRootDirectoryException.java b/filecontent/src/org/labkey/filecontent/files/MissingRootDirectoryException.java similarity index 93% rename from api/src/org/labkey/api/files/MissingRootDirectoryException.java rename to filecontent/src/org/labkey/filecontent/files/MissingRootDirectoryException.java index f64970885b4..48f9acbe204 100644 --- a/api/src/org/labkey/api/files/MissingRootDirectoryException.java +++ b/filecontent/src/org/labkey/filecontent/files/MissingRootDirectoryException.java @@ -14,11 +14,12 @@ * limitations under the License. */ -package org.labkey.api.files; +package org.labkey.filecontent.files; + -import org.labkey.api.data.Container; import java.nio.file.Path; +import org.labkey.api.data.Container; /** * User: klum diff --git a/api/src/org/labkey/api/pipeline/AbstractRemoteExecutionEngineConfig.java b/pipeline/src/org/labkey/pipeline/AbstractRemoteExecutionEngineConfig.java similarity index 92% rename from api/src/org/labkey/api/pipeline/AbstractRemoteExecutionEngineConfig.java rename to pipeline/src/org/labkey/pipeline/AbstractRemoteExecutionEngineConfig.java index fc8e862ef90..18e241bba0c 100644 --- a/api/src/org/labkey/api/pipeline/AbstractRemoteExecutionEngineConfig.java +++ b/pipeline/src/org/labkey/pipeline/AbstractRemoteExecutionEngineConfig.java @@ -13,62 +13,63 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.pipeline; - -import org.jetbrains.annotations.NotNull; -import org.labkey.api.pipeline.file.PathMapper; -import org.labkey.api.pipeline.file.PathMapperImpl; - -import java.util.Collections; -import java.util.Set; - -/** - * Created by: jeckels - * Date: 11/18/15 - */ -public class AbstractRemoteExecutionEngineConfig implements PipelineJobService.RemoteExecutionEngineConfig -{ - @NotNull - private final String _type; - @NotNull - private final String _location; - @NotNull - private final Set _queues; - @NotNull - private final PathMapper _mapper; - - protected AbstractRemoteExecutionEngineConfig(@NotNull String type, @NotNull String location) - { - this(type, location, Collections.emptySet(), new PathMapperImpl()); - } - - protected AbstractRemoteExecutionEngineConfig(@NotNull String type, @NotNull String location, @NotNull Set queues, @NotNull PathMapper mapper) - { - _type = type; - _location = location; - _queues = Collections.unmodifiableSet(queues); - _mapper = mapper; - } - - @NotNull - @Override - public String getLocation() - { - return _location; - } - - @NotNull - @Override - public String getType() - { - return _type; - } - - @NotNull - @Override - public PathMapper getPathMapper() - { - return _mapper; - } - -} +package org.labkey.pipeline; + +import org.jetbrains.annotations.NotNull; +import org.labkey.api.pipeline.PipelineJobService; +import org.labkey.api.pipeline.file.PathMapper; +import org.labkey.api.pipeline.file.PathMapperImpl; + +import java.util.Collections; +import java.util.Set; + +/** + * Created by: jeckels + * Date: 11/18/15 + */ +public class AbstractRemoteExecutionEngineConfig implements PipelineJobService.RemoteExecutionEngineConfig +{ + @NotNull + private final String _type; + @NotNull + private final String _location; + @NotNull + private final Set _queues; + @NotNull + private final PathMapper _mapper; + + protected AbstractRemoteExecutionEngineConfig(@NotNull String type, @NotNull String location) + { + this(type, location, Collections.emptySet(), new PathMapperImpl()); + } + + protected AbstractRemoteExecutionEngineConfig(@NotNull String type, @NotNull String location, @NotNull Set queues, @NotNull PathMapper mapper) + { + _type = type; + _location = location; + _queues = Collections.unmodifiableSet(queues); + _mapper = mapper; + } + + @NotNull + @Override + public String getLocation() + { + return _location; + } + + @NotNull + @Override + public String getType() + { + return _type; + } + + @NotNull + @Override + public PathMapper getPathMapper() + { + return _mapper; + } + +} diff --git a/pipeline/src/org/labkey/pipeline/analysis/FileAnalysisTaskPipelineImpl.java b/pipeline/src/org/labkey/pipeline/analysis/FileAnalysisTaskPipelineImpl.java index 9a804c5efa5..20945e0e2fa 100644 --- a/pipeline/src/org/labkey/pipeline/analysis/FileAnalysisTaskPipelineImpl.java +++ b/pipeline/src/org/labkey/pipeline/analysis/FileAnalysisTaskPipelineImpl.java @@ -25,12 +25,9 @@ import org.labkey.api.formSchema.CheckboxField; import org.labkey.api.formSchema.Field; import org.labkey.api.formSchema.FormSchema; -import org.labkey.api.formSchema.NumberField; import org.labkey.api.formSchema.Option; import org.labkey.api.formSchema.RadioField; -import org.labkey.api.formSchema.SelectField; import org.labkey.api.formSchema.TextField; -import org.labkey.api.formSchema.TextareaField; import org.labkey.api.module.Module; import org.labkey.api.pipeline.PipelineActionConfig; import org.labkey.api.pipeline.PipelineJobService; @@ -56,6 +53,9 @@ import org.labkey.api.view.ViewContext; import org.labkey.pipeline.api.PipelineJobServiceImpl; import org.labkey.pipeline.api.TaskPipelineImpl; +import org.labkey.pipeline.formSchema.NumberField; +import org.labkey.pipeline.formSchema.SelectField; +import org.labkey.pipeline.formSchema.TextareaField; import org.labkey.pipeline.xml.PipelineDocument; import org.labkey.pipeline.xml.TaskPipelineType; import org.labkey.pipeline.xml.TaskRefType; diff --git a/pipeline/src/org/labkey/pipeline/api/PipelineJobServiceImpl.java b/pipeline/src/org/labkey/pipeline/api/PipelineJobServiceImpl.java index cde1a0af903..f3c5cf35d3b 100644 --- a/pipeline/src/org/labkey/pipeline/api/PipelineJobServiceImpl.java +++ b/pipeline/src/org/labkey/pipeline/api/PipelineJobServiceImpl.java @@ -38,9 +38,7 @@ import org.labkey.api.formSchema.Field; import org.labkey.api.formSchema.FormSchema; import org.labkey.api.formSchema.Option; -import org.labkey.api.formSchema.SelectField; import org.labkey.api.formSchema.TextField; -import org.labkey.api.formSchema.TextareaField; import org.labkey.api.module.Module; import org.labkey.api.module.ModuleLoader; import org.labkey.api.module.ModuleResourceCache; @@ -88,6 +86,8 @@ import org.labkey.pipeline.api.properties.ApplicationPropertiesImpl; import org.labkey.pipeline.api.properties.ConfigPropertiesImpl; import org.labkey.pipeline.cluster.NoOpPipelineStatusWriter; +import org.labkey.pipeline.formSchema.SelectField; +import org.labkey.pipeline.formSchema.TextareaField; import org.labkey.pipeline.mule.JMSStatusWriter; import org.labkey.pipeline.mule.test.DummyPipelineJob; import org.labkey.pipeline.mule.test.DummyRemoteExecutionEngine; diff --git a/api/src/org/labkey/api/formSchema/NumberField.java b/pipeline/src/org/labkey/pipeline/formSchema/NumberField.java similarity index 94% rename from api/src/org/labkey/api/formSchema/NumberField.java rename to pipeline/src/org/labkey/pipeline/formSchema/NumberField.java index 15dcc8377cf..8d9aee11f1f 100644 --- a/api/src/org/labkey/api/formSchema/NumberField.java +++ b/pipeline/src/org/labkey/pipeline/formSchema/NumberField.java @@ -13,7 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.labkey.api.formSchema; +package org.labkey.pipeline.formSchema; + +import org.labkey.api.formSchema.AbstractField; /** * Used to render a number input in the client. diff --git a/api/src/org/labkey/api/formSchema/SelectField.java b/pipeline/src/org/labkey/pipeline/formSchema/SelectField.java similarity index 93% rename from api/src/org/labkey/api/formSchema/SelectField.java rename to pipeline/src/org/labkey/pipeline/formSchema/SelectField.java index badd7306ca9..e1465997593 100644 --- a/api/src/org/labkey/api/formSchema/SelectField.java +++ b/pipeline/src/org/labkey/pipeline/formSchema/SelectField.java @@ -14,9 +14,12 @@ * limitations under the License. */ -package org.labkey.api.formSchema; +package org.labkey.pipeline.formSchema; + import java.util.List; +import org.labkey.api.formSchema.AbstractField; +import org.labkey.api.formSchema.Option; /** * Used to render a