├── .editorconfig ├── .gitignore ├── CHANGELOG.mdown ├── CODEOWNERS ├── CONTRIBUTING.md ├── Jenkinsfile ├── LICENSE ├── NOTICE.txt ├── README.md ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── pom.xml └── src ├── main └── java │ └── com │ └── marklogic │ ├── appdeployer │ ├── AppConfig.java │ ├── AppConfigFactory.java │ ├── AppDeployer.java │ ├── CmaConfig.java │ ├── ConfigDir.java │ ├── DataConfig.java │ ├── DefaultAppConfigFactory.java │ ├── PluginConfig.java │ ├── cli │ │ ├── CommandArray.java │ │ ├── CommandWrapper.java │ │ ├── DeployCommand.java │ │ ├── Main.java │ │ └── Options.java │ ├── command │ │ ├── AbstractCommand.java │ │ ├── AbstractResourceCommand.java │ │ ├── AbstractUndoableCommand.java │ │ ├── Command.java │ │ ├── CommandContext.java │ │ ├── CommandMapBuilder.java │ │ ├── DefaultPayloadTokenReplacer.java │ │ ├── IncrementalFilenameFilter.java │ │ ├── PayloadTokenReplacer.java │ │ ├── ResourceDirFinder.java │ │ ├── ResourceFileManager.java │ │ ├── ResourceFileManagerImpl.java │ │ ├── ResourceFilenameFilter.java │ │ ├── ResourceReference.java │ │ ├── SortOrderConstants.java │ │ ├── SupportsCmaCommand.java │ │ ├── TestConnectionsCommand.java │ │ ├── UndoableCommand.java │ │ ├── admin │ │ │ ├── RequireAtLeastMl8Command.java │ │ │ └── SetSslFipsEnabledCommand.java │ │ ├── alert │ │ │ ├── DeployAlertActionsCommand.java │ │ │ ├── DeployAlertConfigsCommand.java │ │ │ └── DeployAlertRulesCommand.java │ │ ├── appservers │ │ │ ├── DeployOtherServersCommand.java │ │ │ └── UpdateRestApiServersCommand.java │ │ ├── clusters │ │ │ └── ModifyLocalClusterCommand.java │ │ ├── cma │ │ │ └── DeployConfigurationsCommand.java │ │ ├── cpf │ │ │ ├── AbstractCpfResourceCommand.java │ │ │ ├── DeployCpfConfigsCommand.java │ │ │ ├── DeployDefaultPipelinesCommand.java │ │ │ ├── DeployDomainsCommand.java │ │ │ └── DeployPipelinesCommand.java │ │ ├── data │ │ │ └── LoadDataCommand.java │ │ ├── databases │ │ │ ├── DatabasePlan.java │ │ │ ├── DefaultDeployDatabaseCommandFactory.java │ │ │ ├── DeployDatabaseCommand.java │ │ │ ├── DeployDatabaseCommandFactory.java │ │ │ ├── DeployOtherDatabasesCommand.java │ │ │ └── DeploySubDatabasesCommand.java │ │ ├── es │ │ │ └── GenerateModelArtifactsCommand.java │ │ ├── flexrep │ │ │ ├── DeployConfigsCommand.java │ │ │ ├── DeployFlexrepCommand.java │ │ │ ├── DeployPullsCommand.java │ │ │ └── DeployTargetsCommand.java │ │ ├── forests │ │ │ ├── AbstractReplicaBuilderStrategy.java │ │ │ ├── ConfigureForestReplicasCommand.java │ │ │ ├── DefaultForestNamingStrategy.java │ │ │ ├── DefaultHostCalculator.java │ │ │ ├── DeployCustomForestsCommand.java │ │ │ ├── DeployForestsCommand.java │ │ │ ├── DistributedReplicaBuilderStrategy.java │ │ │ ├── ForestBuilder.java │ │ │ ├── ForestHostNames.java │ │ │ ├── ForestNamingStrategy.java │ │ │ ├── ForestPlan.java │ │ │ ├── HostCalculator.java │ │ │ └── ReplicaBuilderStrategy.java │ │ ├── groups │ │ │ └── DeployGroupsCommand.java │ │ ├── hosts │ │ │ └── AssignHostsToGroupsCommand.java │ │ ├── mimetypes │ │ │ └── DeployMimetypesCommand.java │ │ ├── modules │ │ │ ├── AllButAssetsModulesFinder.java │ │ │ ├── AssetModulesFinder.java │ │ │ ├── DefaultModulesLoaderFactory.java │ │ │ ├── DeleteModulesCommand.java │ │ │ ├── DeleteTestModulesCommand.java │ │ │ ├── LoadModulesCommand.java │ │ │ └── ModulesLoaderFactory.java │ │ ├── plugins │ │ │ └── InstallPluginsCommand.java │ │ ├── rebalancer │ │ │ ├── DeployPartitionQueriesCommand.java │ │ │ └── DeployPartitionsCommand.java │ │ ├── restapis │ │ │ └── DeployRestApiServersCommand.java │ │ ├── schemas │ │ │ └── LoadSchemasCommand.java │ │ ├── security │ │ │ ├── DeployAmpsCommand.java │ │ │ ├── DeployCertificateAuthoritiesCommand.java │ │ │ ├── DeployCertificateTemplatesCommand.java │ │ │ ├── DeployCredentialsCommand.java │ │ │ ├── DeployExternalSecurityCommand.java │ │ │ ├── DeployPrivilegeRolesCommand.java │ │ │ ├── DeployPrivilegesCommand.java │ │ │ ├── DeployProtectedCollectionsCommand.java │ │ │ ├── DeployProtectedPathsCommand.java │ │ │ ├── DeployQueryRolesetsCommand.java │ │ │ ├── DeployRolesCommand.java │ │ │ ├── DeploySecureCredentialsCommand.java │ │ │ ├── DeployUsersCommand.java │ │ │ ├── GenerateTemporaryCertificateCommand.java │ │ │ └── InsertCertificateHostsTemplateCommand.java │ │ ├── tasks │ │ │ ├── DeployScheduledTasksCommand.java │ │ │ └── WaitForTaskServerCommand.java │ │ ├── taskservers │ │ │ └── UpdateTaskServerCommand.java │ │ ├── temporal │ │ │ ├── DeployTemporalAxesCommand.java │ │ │ ├── DeployTemporalCollectionsCommand.java │ │ │ └── DeployTemporalCollectionsLSQTCommand.java │ │ ├── triggers │ │ │ └── DeployTriggersCommand.java │ │ └── viewschemas │ │ │ └── DeployViewSchemasCommand.java │ ├── export │ │ ├── ExportedResources.java │ │ ├── Exporter.java │ │ ├── ResourceExporter.java │ │ ├── appservers │ │ │ └── ServerExporter.java │ │ ├── cpf │ │ │ ├── CpfConfigExporter.java │ │ │ ├── DomainExporter.java │ │ │ └── PipelineExporter.java │ │ ├── databases │ │ │ └── DatabaseExporter.java │ │ ├── forests │ │ │ └── ForestExporter.java │ │ ├── groups │ │ │ └── GroupExporter.java │ │ ├── impl │ │ │ ├── AbstractNamedResourceExporter.java │ │ │ ├── AbstractResourceExporter.java │ │ │ ├── CompositeResourceExporter.java │ │ │ ├── ExportInputs.java │ │ │ └── SimpleExportInputs.java │ │ ├── security │ │ │ ├── AmpExporter.java │ │ │ ├── PrivilegeExporter.java │ │ │ ├── RoleExporter.java │ │ │ └── UserExporter.java │ │ ├── tasks │ │ │ └── TaskExporter.java │ │ └── triggers │ │ │ └── TriggerExporter.java │ ├── impl │ │ ├── AbstractAppDeployer.java │ │ ├── AddHostNameTokensDeployerListener.java │ │ ├── CmaDeployerListener.java │ │ ├── DeployerListener.java │ │ ├── DeployerListenerSupport.java │ │ ├── DeploymentContext.java │ │ ├── PrepareCommandListener.java │ │ └── SimpleAppDeployer.java │ ├── scaffold │ │ ├── DefaultResourceWriter.java │ │ ├── ResourceWriter.java │ │ └── ScaffoldGenerator.java │ └── util │ │ ├── JavaClientUtil.java │ │ ├── MapPropertiesSource.java │ │ ├── ModulesWatcher.java │ │ ├── RestApiUtil.java │ │ └── SimplePropertiesSource.java │ ├── mgmt │ ├── AbstractManager.java │ ├── DefaultManageConfigFactory.java │ ├── DeleteReceipt.java │ ├── ManageClient.java │ ├── ManageConfig.java │ ├── ManageConfigFactory.java │ ├── PayloadParser.java │ ├── SaveReceipt.java │ ├── admin │ │ ├── ActionRequiringRestart.java │ │ ├── AdminConfig.java │ │ ├── AdminConfigFactory.java │ │ ├── AdminManager.java │ │ └── DefaultAdminConfigFactory.java │ ├── api │ │ ├── API.java │ │ ├── APIUtil.java │ │ ├── ApiObject.java │ │ ├── LowerCaseWithHyphensStrategy.java │ │ ├── Resource.java │ │ ├── cluster │ │ │ └── Cluster.java │ │ ├── configuration │ │ │ ├── Configuration.java │ │ │ └── Configurations.java │ │ ├── database │ │ │ ├── AssignmentPolicy.java │ │ │ ├── Database.java │ │ │ ├── DatabaseBackup.java │ │ │ ├── DatabaseReference.java │ │ │ ├── DatabaseReplication.java │ │ │ ├── DatabaseSorter.java │ │ │ ├── DefaultRuleset.java │ │ │ ├── Element.java │ │ │ ├── ElementAttributeIndex.java │ │ │ ├── ElementAttributeWordLexicon.java │ │ │ ├── ElementIndex.java │ │ │ ├── ElementWordLexicon.java │ │ │ ├── ExcludedElement.java │ │ │ ├── Field.java │ │ │ ├── FieldIndex.java │ │ │ ├── FieldPath.java │ │ │ ├── ForeignMaster.java │ │ │ ├── ForeignReplica.java │ │ │ ├── ForestDatabaseReplication.java │ │ │ ├── ForestForeignReplica.java │ │ │ ├── FragmentParent.java │ │ │ ├── FragmentRoot.java │ │ │ ├── GeospatialElementChildIndex.java │ │ │ ├── GeospatialElementIndex.java │ │ │ ├── GeospatialElementPairIndex.java │ │ │ ├── GeospatialIndex.java │ │ │ ├── GeospatialPathIndex.java │ │ │ ├── GeospatialRegionPathIndex.java │ │ │ ├── IncludedElement.java │ │ │ ├── Index.java │ │ │ ├── MergeBlackout.java │ │ │ ├── MergePeriod.java │ │ │ ├── PathIndex.java │ │ │ ├── PathNamespace.java │ │ │ ├── TokenizerOverride.java │ │ │ └── package-info.java │ │ ├── forest │ │ │ ├── Forest.java │ │ │ ├── ForestBackup.java │ │ │ ├── ForestReplica.java │ │ │ ├── Range.java │ │ │ └── package-info.java │ │ ├── group │ │ │ ├── Audit.java │ │ │ ├── AuditEvent.java │ │ │ ├── AuditRestriction.java │ │ │ ├── Group.java │ │ │ ├── ModuleLocation.java │ │ │ ├── Namespace.java │ │ │ ├── Schema.java │ │ │ └── package-info.java │ │ ├── mimetypes │ │ │ ├── Mimetype.java │ │ │ └── package-info.java │ │ ├── restapi │ │ │ └── RestApi.java │ │ ├── security │ │ │ ├── Amp.java │ │ │ ├── CapabilityQuery.java │ │ │ ├── ExternalSecurity.java │ │ │ ├── LdapServer.java │ │ │ ├── Permission.java │ │ │ ├── Privilege.java │ │ │ ├── ProtectedCollection.java │ │ │ ├── Role.java │ │ │ ├── RoleObjectNodesSorter.java │ │ │ ├── RolePrivilege.java │ │ │ ├── User.java │ │ │ ├── package-info.java │ │ │ ├── protectedpath │ │ │ │ ├── PathNamespace.java │ │ │ │ ├── Permission.java │ │ │ │ ├── ProtectedPath.java │ │ │ │ └── package-info.java │ │ │ └── queryroleset │ │ │ │ ├── QueryRoleset.java │ │ │ │ └── package-info.java │ │ ├── server │ │ │ ├── AppServicesServer.java │ │ │ ├── HttpServer.java │ │ │ ├── ManageServer.java │ │ │ ├── OdbcServer.java │ │ │ ├── RequestBlackout.java │ │ │ ├── Server.java │ │ │ ├── UsingNamespace.java │ │ │ ├── XdbcServer.java │ │ │ └── package-info.java │ │ ├── task │ │ │ └── Task.java │ │ └── trigger │ │ │ ├── CollectionScope.java │ │ │ ├── DataEvent.java │ │ │ ├── DatabaseOnlineEvent.java │ │ │ ├── DirectoryScope.java │ │ │ ├── DocumentContent.java │ │ │ ├── DocumentScope.java │ │ │ ├── Event.java │ │ │ ├── Permission.java │ │ │ ├── PropertyContent.java │ │ │ ├── PropertyName.java │ │ │ ├── Trigger.java │ │ │ └── package-info.java │ ├── cma │ │ └── ConfigurationManager.java │ ├── mapper │ │ ├── DefaultResourceMapper.java │ │ └── ResourceMapper.java │ ├── resource │ │ ├── AbstractResourceManager.java │ │ ├── ResourceManager.java │ │ ├── alert │ │ │ ├── AlertActionManager.java │ │ │ ├── AlertConfigManager.java │ │ │ └── AlertRuleManager.java │ │ ├── appservers │ │ │ └── ServerManager.java │ │ ├── clusters │ │ │ └── ClusterManager.java │ │ ├── cpf │ │ │ ├── AbstractCpfResourceManager.java │ │ │ ├── CpfConfigManager.java │ │ │ ├── DomainManager.java │ │ │ └── PipelineManager.java │ │ ├── databases │ │ │ └── DatabaseManager.java │ │ ├── flexrep │ │ │ ├── ConfigManager.java │ │ │ ├── PullManager.java │ │ │ └── TargetManager.java │ │ ├── forests │ │ │ ├── ForestManager.java │ │ │ └── ForestStatus.java │ │ ├── groups │ │ │ └── GroupManager.java │ │ ├── hosts │ │ │ ├── DefaultHostNameProvider.java │ │ │ ├── HostManager.java │ │ │ └── HostNameProvider.java │ │ ├── mimetypes │ │ │ └── MimetypeManager.java │ │ ├── rebalancer │ │ │ ├── PartitionManager.java │ │ │ ├── PartitionProperties.java │ │ │ └── PartitionQueryManager.java │ │ ├── requests │ │ │ └── RequestManager.java │ │ ├── restapis │ │ │ ├── RestApiDeletionRequest.java │ │ │ └── RestApiManager.java │ │ ├── security │ │ │ ├── AmpManager.java │ │ │ ├── CertificateAuthorityManager.java │ │ │ ├── CertificateTemplateManager.java │ │ │ ├── CredentialsManager.java │ │ │ ├── ExternalSecurityManager.java │ │ │ ├── PrivilegeManager.java │ │ │ ├── ProtectedCollectionsManager.java │ │ │ ├── ProtectedPathManager.java │ │ │ ├── QueryRolesetManager.java │ │ │ ├── RoleManager.java │ │ │ ├── SecureCredentialsManager.java │ │ │ └── UserManager.java │ │ ├── tasks │ │ │ └── TaskManager.java │ │ ├── taskservers │ │ │ └── TaskServerManager.java │ │ ├── temporal │ │ │ ├── TemporalAxesManager.java │ │ │ ├── TemporalCollectionLSQTManager.java │ │ │ └── TemporalCollectionManager.java │ │ ├── triggers │ │ │ └── TriggerManager.java │ │ └── viewschemas │ │ │ ├── ViewManager.java │ │ │ └── ViewSchemaManager.java │ ├── selector │ │ ├── AbstractNameMatchingResourceSelector.java │ │ ├── MapResourceSelection.java │ │ ├── PrefixResourceSelector.java │ │ ├── PropertiesResourceSelector.java │ │ ├── RegexResourceSelector.java │ │ ├── ResourceSelection.java │ │ └── ResourceSelector.java │ ├── template │ │ ├── GenericTemplateBuilder.java │ │ ├── TemplateBuilder.java │ │ ├── database │ │ │ └── DatabaseTemplateBuilder.java │ │ ├── group │ │ │ └── GroupTemplateBuilder.java │ │ ├── security │ │ │ ├── AmpTemplateBuilder.java │ │ │ ├── ExternalSecurityTemplateBuilder.java │ │ │ ├── PrivilegeTemplateBuilder.java │ │ │ ├── ProtectedCollectionTemplateBuilder.java │ │ │ ├── RoleTemplateBuilder.java │ │ │ └── UserTemplateBuilder.java │ │ ├── server │ │ │ └── ServerTemplateBuilder.java │ │ ├── task │ │ │ └── TaskTemplateBuilder.java │ │ └── trigger │ │ │ └── TriggerTemplateBuilder.java │ └── util │ │ ├── ObjectMapperFactory.java │ │ ├── ObjectNodesSorter.java │ │ ├── PropertySource.java │ │ ├── PropertySourceFactory.java │ │ ├── SimplePropertySource.java │ │ ├── SystemPropertySource.java │ │ └── TopologicalSorter.java │ └── rest │ └── util │ ├── Fragment.java │ ├── HttpClientBuilderConfigurer.java │ ├── JsonNodeUtil.java │ ├── MgmtResponseErrorHandler.java │ ├── PreviewInterceptor.java │ ├── PropertyBasedBiPredicate.java │ ├── ResourcesFragment.java │ ├── RestConfig.java │ ├── RestTemplateUtil.java │ └── configurer │ ├── BasicAuthConfigurer.java │ ├── NoConnectionReuseConfigurer.java │ ├── SslConfigurer.java │ └── UseSystemPropertiesConfigurer.java └── test ├── java └── com │ └── marklogic │ ├── appdeployer │ ├── AbstractAppDeployerTest.java │ ├── DefaultAppConfigFactoryTest.java │ ├── MergeResourcesWhileDeployingTest.java │ ├── PopulateCustomTokensTest.java │ ├── cli │ │ └── DeployerDebug.java │ ├── command │ │ ├── AbstractIncrementalDeployTest.java │ │ ├── AbstractManageResourceTest.java │ │ ├── CommandMapBuilderTest.java │ │ ├── PayloadPropertiesTest.java │ │ ├── ReplaceTokensTest.java │ │ ├── SortOrderConstantsTest.java │ │ ├── TestConnectionsTest.java │ │ ├── admin │ │ │ ├── RequireAtLeastMl8Test.java │ │ │ └── SetSslFipsEnabledDebug.java │ │ ├── alert │ │ │ ├── ManageAlertActionsAndRulesTest.java │ │ │ └── ManageAlertConfigsTest.java │ │ ├── clusters │ │ │ └── ModifyLocalClusterTest.java │ │ ├── cma │ │ │ ├── DeployAmpsWithCmaTest.java │ │ │ ├── DeployCombinedRequestsWithCmaTest.java │ │ │ ├── DeployConfigurationsTest.java │ │ │ ├── DeployForestsWithCmaTest.java │ │ │ ├── DeployPrivilegesWithCmaTest.java │ │ │ ├── DeployProtectedPathsWithCmaTest.java │ │ │ └── DeployServersWithCmaTest.java │ │ ├── cpf │ │ │ ├── LoadDefaultCpfPipelinesTest.java │ │ │ └── ManageCpfTest.java │ │ ├── data │ │ │ └── LoadDataTest.java │ │ ├── databases │ │ │ ├── ClearDatabaseTest.java │ │ │ ├── CreateAndUpdateDatabaseTest.java │ │ │ ├── CreateDatabaseWithCustomForestsTest.java │ │ │ ├── DeployDatabasesAndSubDatabasesTest.java │ │ │ ├── DeployDatabasesFromMultipleConfigDirsTest.java │ │ │ ├── DeployDatabasesInOrderTest.java │ │ │ ├── DeployOtherDatabasesTest.java │ │ │ ├── DeployTriggersToMultipleDatabasesTest.java │ │ │ ├── DeployWithCustomNamesTest.java │ │ │ ├── DontUndeployDefaultDatabasesTest.java │ │ │ ├── InvokeDatabaseOperationsTest.java │ │ │ ├── SetUpdatesAllowedOnDatabaseForestsTest.java │ │ │ ├── UndeployDatabasesWithIgnoredContentDatabaseTest.java │ │ │ ├── UpdateContentDatabasesTest.java │ │ │ └── UpdateForestCountTest.java │ │ ├── es │ │ │ └── GenerateModelArtifactsTest.java │ │ ├── flexrep │ │ │ └── DeployFlexrepTest.java │ │ ├── forests │ │ │ ├── BuildForestReplicaTest.java │ │ │ ├── BuildForestTest.java │ │ │ ├── CalculateForestHostsTest.java │ │ │ ├── ConfigureForestReplicasDebug.java │ │ │ ├── ConfigureForestReplicasOnSpecificGroupsTest.java │ │ │ ├── CreateForestsOnOneHostDebug.java │ │ │ ├── CreateForestsOnOneHostTest.java │ │ │ ├── CreateForestsOnSpecificHostsTest.java │ │ │ ├── DeployCustomForestsTest.java │ │ │ ├── TestHostNameProvider.java │ │ │ └── UndeployModuleReplicaForestsDebug.java │ │ ├── groups │ │ │ └── ManageGroupsTest.java │ │ ├── hosts │ │ │ └── AssignHostsToGroupsTest.java │ │ ├── mimetypes │ │ │ ├── DontRestartWhenMimetypePropertiesArentUpdatedTest.java │ │ │ └── ManageMimetypesTest.java │ │ ├── modules │ │ │ ├── DefaultsModulesLoaderFactoryTest.java │ │ │ ├── LoadInvalidRestModulesTest.java │ │ │ └── LoadModulesTest.java │ │ ├── plugins │ │ │ └── InstallPluginsTest.java │ │ ├── rebalancer │ │ │ ├── ManagePartitionQueriesTest.java │ │ │ └── ManagePartitionsTest.java │ │ ├── restapis │ │ │ ├── CreateRestApiAsNonAdminUserTest.java │ │ │ ├── CreateRestApiInOtherGroupTest.java │ │ │ ├── CreateRestApiUsingDefaultModulesDatabaseTest.java │ │ │ ├── CreateRestApiWithCustomFilenameTest.java │ │ │ ├── CreateRestApiWithCustomRewriterTest.java │ │ │ ├── DeleteRestApiTest.java │ │ │ ├── DeployRestApiTest.java │ │ │ └── DontCreateRestApiTest.java │ │ ├── schemas │ │ │ └── LoadSchemasTest.java │ │ ├── security │ │ │ ├── DeployCredentialsTest.java │ │ │ ├── DeployRoleThatRefersToItselfTest.java │ │ │ ├── DeployRoleWithCapabilityQueryTest.java │ │ │ ├── DeployRolesWithDependenciesTest.java │ │ │ ├── DeployRolesWithDependenciesViaCmaTest.java │ │ │ ├── DeploySecureCredentialsTest.java │ │ │ ├── DontUndeployCertainRolesTest.java │ │ │ ├── DontUndeployDefaultUsersTest.java │ │ │ ├── IgnoreRoleTest.java │ │ │ ├── IncrementallyDeployRolesTest.java │ │ │ ├── IncrementallyDeployUsersTest.java │ │ │ ├── InsertHostCertificateTest.java │ │ │ ├── ManageAmpsTest.java │ │ │ ├── ManageCertificateAuthoritiesTest.java │ │ │ ├── ManageCertificateTemplatesTest.java │ │ │ ├── ManageExternalSecurityTest.java │ │ │ ├── ManagePrivilegesTest.java │ │ │ ├── ManageProtectedCollectionsTest.java │ │ │ ├── ManageProtectedPathsTest.java │ │ │ ├── ManageQueryRolesetsTest.java │ │ │ ├── ManageRolesTest.java │ │ │ └── ManageUsersTest.java │ │ ├── servers │ │ │ ├── DeployServerWithExternalSecurityTest.java │ │ │ ├── DontUndeployDefaultServersTest.java │ │ │ ├── ManageOtherServerTest.java │ │ │ ├── UpdateRestApiServersTest.java │ │ │ ├── UpdateRestApiServersWithCustomFilenameTest.java │ │ │ ├── UpdateServerInOtherGroupTest.java │ │ │ └── WaitForRestartWhenUpdatingServerTest.java │ │ ├── tasks │ │ │ ├── DeployDisabledTaskTest.java │ │ │ ├── DeployTasksWithSamePathTest.java │ │ │ └── ManageScheduledTasksTest.java │ │ ├── taskservers │ │ │ └── UpdateTaskServerTest.java │ │ ├── temporal │ │ │ ├── DeployTemporalTest.java │ │ │ └── DeployUniTemporalTest.java │ │ ├── triggers │ │ │ └── ManageTriggersTest.java │ │ └── viewschemas │ │ │ └── ManageViewSchemasTest.java │ ├── export │ │ ├── AbstractExportTest.java │ │ ├── ExportAmpsTest.java │ │ ├── ExportCpfTest.java │ │ ├── ExportDatabaseTest.java │ │ ├── ExportPrivilegesTest.java │ │ ├── ExportServerTest.java │ │ ├── ExportTasksTest.java │ │ ├── ExportTriggersTest.java │ │ └── ExportUsersTest.java │ ├── impl │ │ ├── AddHostNameTokensTest.java │ │ ├── IgnoreCommandErrorTest.java │ │ └── SimpleAppDeployerTest.java │ ├── scaffold │ │ ├── AbstractResourceWriterTest.java │ │ ├── GenerateScaffoldTest.java │ │ ├── WriteAmpTest.java │ │ ├── WriteDatabaseTest.java │ │ ├── WriteExternalSecurityTest.java │ │ ├── WriteGroupTest.java │ │ ├── WritePrivilegeTest.java │ │ ├── WriteProtectedCollectionTest.java │ │ ├── WriteRoleTest.java │ │ ├── WriteServerTest.java │ │ ├── WriteTaskTest.java │ │ ├── WriteTriggerTest.java │ │ └── WriteUserTest.java │ └── util │ │ └── MapPropertiesSourceTest.java │ ├── junit │ ├── BaseTestHelper.java │ ├── CustomDifferenceListener.java │ ├── Fragment.java │ ├── MarkLogicNamespaceProvider.java │ ├── NamespaceProvider.java │ ├── PermissionsFragment.java │ ├── README.md │ └── XmlHelper.java │ ├── mgmt │ ├── AbstractMgmtTest.java │ ├── DefaultManageConfigFactoryTest.java │ ├── InvalidResourcePayloadTest.java │ ├── ManageClientTest.java │ ├── ManageConfigTest.java │ ├── PayloadParserTest.java │ ├── TestConfig.java │ ├── admin │ │ ├── AdminConfigTest.java │ │ ├── AdminManagerTest.java │ │ ├── DefaultAdminConfigFactoryTest.java │ │ ├── InitializeMarkLogicTest.java │ │ └── InstallAdminTest.java │ ├── api │ │ ├── AbstractApiTest.java │ │ ├── ConnectTest.java │ │ ├── database │ │ │ ├── SortDatabasesTest.java │ │ │ └── UnmarshalDatabaseTest.java │ │ ├── forest │ │ │ ├── AttachAndDetachForestsTest.java │ │ │ ├── GetForestPropertyNamesTest.java │ │ │ └── UnmarshalForestTest.java │ │ ├── group │ │ │ └── TraceTest.java │ │ ├── mimetypes │ │ │ └── MimetypeTest.java │ │ ├── security │ │ │ ├── RoleTest.java │ │ │ ├── SortRolesTest.java │ │ │ ├── UnmarshalAmpTest.java │ │ │ ├── UnmarshalRoleTest.java │ │ │ └── UnmarshalUserTest.java │ │ ├── server │ │ │ ├── ServerTest.java │ │ │ └── UnmarshalServerTest.java │ │ └── trigger │ │ │ └── TriggerTest.java │ ├── cma │ │ └── SubmitConfigurationWithRoleDependenciesTest.java │ ├── resource │ │ ├── clusters │ │ │ └── AddAndRemoveHostDebug.java │ │ ├── forests │ │ │ └── GetMapOfPrimaryForestsTest.java │ │ ├── hosts │ │ │ └── ManageHostsTest.java │ │ └── security │ │ │ ├── PreviewUserDeploymentTest.java │ │ │ ├── QueryRolesetManagerTest.java │ │ │ ├── TestManager.java │ │ │ └── UseSecurityUserTest.java │ └── util │ │ └── TopologicalSorterTest.java │ └── rest │ └── util │ ├── JsonNodeUtilTest.java │ ├── PreviewInterceptorTest.java │ ├── RestConfigTest.java │ └── RestTemplateUtilTest.java └── resources ├── cma-project ├── databases │ ├── content-database.json │ ├── modules-database.json │ ├── schema-database.json │ └── triggers-database.json ├── security │ ├── amps │ │ ├── amp-1.json │ │ └── amp-2.xml │ ├── privileges │ │ ├── privilege1.json │ │ └── privilege2.json │ ├── protected-paths │ │ └── path-1.json │ ├── query-rolesets │ │ └── roleset1.json │ ├── roles │ │ ├── role1.xml │ │ ├── role2.json │ │ └── role3.json │ └── users │ │ ├── jane.json │ │ └── john.xml └── servers │ ├── http1.json │ ├── http2.json │ └── http3.json ├── entity-services-project └── data │ └── entity-services │ └── race.json ├── logback.xml ├── non-admin-test ├── ml-config │ └── security │ │ ├── roles │ │ └── sample-app-role.json │ │ └── users │ │ ├── sample-app-manage-admin.json │ │ └── sample-app-rest-admin.json └── ml-modules │ └── ext │ └── hello-lib.xqy ├── payload-properties-test ├── json │ └── ml-config │ │ └── databases │ │ └── content-database.json └── xml │ └── content-database.xml ├── plugin-project └── src │ └── main │ ├── ml-config │ └── databases │ │ └── content-database.json │ └── ml-plugins │ └── variance │ ├── .gitignore │ ├── Makefile │ └── VariancePlugin.cpp ├── sample-app ├── alert-config │ ├── alert │ │ └── configs │ │ │ ├── my-alert-config-actions │ │ │ └── my-alert-action.json │ │ │ ├── my-alert-config-rules │ │ │ └── my-rule.xml │ │ │ └── my-alert-config.json │ └── databases │ │ ├── content-database.json │ │ ├── other-database.json │ │ ├── other-sample-app-content │ │ └── alert │ │ │ └── configs │ │ │ ├── other-alert-config-actions │ │ │ └── other-alert-action.json │ │ │ ├── other-alert-config-rules │ │ │ └── other-rule.xml │ │ │ └── other-alert-config.json │ │ └── unknown-database │ │ └── alert │ │ └── configs │ │ └── should-be-ignored-alert-config.json ├── bad-modules │ └── options │ │ └── invalid-options.xml ├── cluster-test │ └── clusters │ │ └── local-cluster.json ├── cma │ └── configurations │ │ ├── config1.json │ │ └── config1.xml ├── custom-forests │ ├── databases │ │ └── content-database.json │ └── forests │ │ └── sample-app-content │ │ ├── custom-forests.json │ │ └── single-custom-forest.json ├── databases-in-order-xml │ └── databases │ │ ├── database-A.xml │ │ ├── database-B.xml │ │ └── database-C.xml ├── databases-in-order │ └── databases │ │ ├── database-A.json │ │ ├── database-B.json │ │ └── database-C.json ├── db-only-config │ └── databases │ │ └── content-database.json ├── default-databases │ └── databases │ │ ├── content-database.json │ │ └── fab-database.json ├── default-modules-database-config │ ├── databases │ │ └── content-database.json │ └── rest-api.json ├── default-servers │ └── servers │ │ ├── manage-server.json │ │ └── xdbc-server.json ├── dhf-db-ordering │ └── databases │ │ ├── final-database.json │ │ ├── final-schemas-database.json │ │ ├── final-triggers-database.json │ │ ├── modules-database.json │ │ └── test-database.json ├── even-more-roles-with-dependencies │ └── security │ │ └── roles │ │ ├── abc-login-role.json │ │ ├── abc-sss-ui-role.json │ │ ├── abc-ui-admin.json │ │ ├── abc-ui-developer.json │ │ ├── abc-ui-offline-admin.json │ │ ├── abc-ui-offline-user.json │ │ ├── xyz-admin.json │ │ ├── xyz-reader.json │ │ └── xyz-writer.json ├── flexrep-combined │ ├── databases │ │ ├── content-database.json │ │ └── triggers-database.json │ └── flexrep │ │ ├── master │ │ ├── cpf │ │ │ ├── cpf-configs │ │ │ │ └── master-cpf-config.json │ │ │ ├── domains │ │ │ │ └── master-domain.json │ │ │ └── pipelines │ │ │ │ ├── flexrep.xml │ │ │ │ └── status-change-handling.xml │ │ ├── flexrep │ │ │ └── configs │ │ │ │ ├── master-config.xml │ │ │ │ └── master-domain-targets │ │ │ │ └── master-target.xml │ │ └── servers │ │ │ └── master-flexrep-server.xml │ │ └── replica │ │ ├── cpf │ │ ├── cpf-configs │ │ │ └── replica-cpf-config.json │ │ ├── domains │ │ │ └── replica-domain.json │ │ └── pipelines │ │ │ ├── flexrep.xml │ │ │ └── status-change-handling.xml │ │ ├── flexrep │ │ └── configs │ │ │ ├── replica-config.xml │ │ │ └── replica-domain-targets │ │ │ └── replica-target.xml │ │ └── servers │ │ └── replica-flexrep-server.xml ├── flexrep-config │ ├── cpf │ │ ├── cpf-configs │ │ │ └── sample-app-cpf-config.json │ │ ├── domains │ │ │ └── domain-1.json │ │ └── pipelines │ │ │ ├── flexrep.xml │ │ │ └── status-change-handling.xml │ ├── databases │ │ ├── content-database.json │ │ ├── other-database.json │ │ ├── other-sample-app-content │ │ │ └── flexrep │ │ │ │ ├── configs │ │ │ │ ├── flexrep-config-1.xml │ │ │ │ └── sample-app-domain-1-targets │ │ │ │ │ └── target-1.xml │ │ │ │ └── pulls │ │ │ │ └── test-pull.json │ │ └── triggers-database.json │ └── flexrep │ │ └── configs │ │ ├── flexrep-config-1.xml │ │ └── sample-app-domain-1-targets │ │ └── target-1.xml ├── host-certificates │ └── security │ │ ├── certificate-authorities │ │ └── MarkLogicBogusCA.crt │ │ └── certificate-templates │ │ ├── host-certificates │ │ └── sample-app-certificate-template │ │ │ ├── README.md │ │ │ ├── host1.marklogic.com.crt │ │ │ ├── host1.marklogic.com.key │ │ │ └── host2.marklogic.com.crt │ │ └── template-1.xml ├── lots-of-databases │ ├── databases │ │ ├── content-database.json │ │ ├── ignored-database.json │ │ ├── more-content-db-config.json │ │ ├── other-content-database.json │ │ ├── other-schemas-database.json │ │ ├── other-triggers-database.json │ │ ├── schemas-database.json │ │ └── triggers-database.json │ └── rest-api.json ├── more-roles-with-dependencies │ └── security │ │ └── roles │ │ ├── role0.json │ │ ├── role1.json │ │ ├── role2.json │ │ └── role3.json ├── multiple-config-paths │ ├── path1 │ │ ├── databases │ │ │ ├── one-database.json │ │ │ ├── other-content-database.json │ │ │ └── z-schemas-database.json │ │ ├── security │ │ │ ├── privileges │ │ │ │ └── privilege1.json │ │ │ ├── roles │ │ │ │ ├── role1.json │ │ │ │ └── role2.json │ │ │ └── users │ │ │ │ └── xml-jane.xml │ │ └── servers │ │ │ └── server.json │ └── path2 │ │ ├── databases │ │ ├── another-one-database.json │ │ ├── content-database.json │ │ ├── subdatabases │ │ │ └── sample-app-one-database │ │ │ │ ├── subdb01.json │ │ │ │ └── subdb02.json │ │ ├── two-database.json │ │ └── z-triggers-database.json │ │ ├── security │ │ ├── privileges │ │ │ └── other-privilege1.json │ │ ├── roles │ │ │ ├── other-role1.xml │ │ │ └── other-role2.json │ │ └── users │ │ │ └── jane.json │ │ └── servers │ │ └── same-server.json ├── multiple-schema-databases │ ├── ml-config │ │ └── databases │ │ │ ├── sample-app-schemas1.json │ │ │ ├── sample-app-schemas1 │ │ │ └── schemas │ │ │ │ └── schema1.xsd │ │ │ ├── sample-app-schemas2.json │ │ │ └── sample-app-schemas2 │ │ │ └── schemas │ │ │ └── schema2.xsd │ └── ml-schemas │ │ └── default-schema.xsd ├── multiple-triggers-databases │ ├── databases │ │ ├── content-database.json │ │ ├── other-content-database.json │ │ ├── other-sample-app-triggers │ │ │ └── triggers │ │ │ │ └── other-trigger.json │ │ ├── other-triggers-database.json │ │ ├── third-triggers-database.json │ │ ├── third-triggers-database │ │ │ └── triggers │ │ │ │ └── third-trigger.json │ │ └── triggers-database.json │ └── triggers │ │ └── my-trigger.json ├── other-group │ ├── groups │ │ └── sample-app-other-group.json │ └── servers │ │ ├── http-server.json │ │ └── other-http-server.json ├── other-modules │ └── root │ │ └── other-lib.xqy ├── other-servers │ └── servers │ │ ├── odbc-server.json │ │ ├── rest-api-server.json │ │ └── xdbc-server.json ├── partition-queries │ └── databases │ │ ├── content-database.json │ │ ├── sample-app-content │ │ ├── partition-queries │ │ │ ├── partition-query1.xml │ │ │ └── partition-query2.xml │ │ └── partitions │ │ │ ├── partition1.json │ │ │ └── partition2.json │ │ └── schemas-database.json ├── partitions │ └── databases │ │ ├── content-database.json │ │ ├── sample-app-content │ │ └── partitions │ │ │ ├── partition1.xml │ │ │ └── partition2.xml │ │ └── schemas-database.json ├── privileges-with-roles │ └── security │ │ ├── privileges │ │ ├── privilege-1.json │ │ ├── privilege-2.xml │ │ └── privilege-3.json │ │ └── roles │ │ └── sample-app-role1.json ├── qbac-json-role │ └── security │ │ └── roles │ │ └── a-qbac-role.json ├── qbac-xml-role │ └── security │ │ └── roles │ │ └── a-qbac-xml-role.xml ├── real-amp │ └── security │ │ ├── amps │ │ └── get-host-status.json │ │ └── users │ │ └── jane.xml ├── rest-api-custom-filename │ ├── my-custom-rest-api-update.json │ └── my-custom-rest-api.json ├── rest-api-different-rewriter │ ├── rest-api.json │ └── servers │ │ └── rest-api-server.json ├── rest-api-other-group │ ├── groups │ │ └── group.json │ └── rest-api.json ├── role-refers-to-itself │ └── security │ │ └── roles │ │ ├── sample-json-role.json │ │ └── sample-xml-role.xml ├── role-with-privilege-config │ └── security │ │ ├── privileges │ │ └── privilege-1.json │ │ └── roles │ │ └── sample-app-role1.json ├── roles-with-circular-dependencies │ └── security │ │ └── roles │ │ ├── role0.json │ │ └── role1.json ├── roles-with-dependencies │ └── security │ │ └── roles │ │ ├── role0.json │ │ ├── role1.json │ │ ├── role2.xml │ │ ├── role3.json │ │ ├── role4.xml │ │ └── role5.json ├── roles-with-permissions │ └── security │ │ └── roles │ │ ├── sampleapp-install.json │ │ └── sampleapp-modules.json ├── single-server │ └── servers │ │ └── http-server.json ├── src │ └── main │ │ ├── ml-config │ │ ├── cpf │ │ │ ├── cpf-configs │ │ │ │ └── sample-app-cpf-config.json │ │ │ ├── domains │ │ │ │ ├── domain-1.json │ │ │ │ └── domain-2.xml │ │ │ └── pipelines │ │ │ │ └── pipeline-1.json │ │ ├── databases │ │ │ ├── content-database.json │ │ │ ├── schemas-database.json │ │ │ └── triggers-database.json │ │ ├── forests │ │ │ └── content-forest.json │ │ ├── groups │ │ │ └── sample-app-group.json │ │ ├── mimetypes │ │ │ └── ditamap.json │ │ ├── rest-api.json │ │ ├── security │ │ │ ├── amps │ │ │ │ ├── amp-1.json │ │ │ │ └── amp-2.xml │ │ │ ├── certificate-authorities │ │ │ │ └── server.crt │ │ │ ├── certificate-templates │ │ │ │ └── template-1.xml │ │ │ ├── credentials │ │ │ │ ├── credentials-aws.json │ │ │ │ └── credentials-azure.xml │ │ │ ├── external-security │ │ │ │ └── external-security-1.xml │ │ │ ├── privileges │ │ │ │ ├── privilege-1.json │ │ │ │ └── privilege-2.json │ │ │ ├── protected-collections │ │ │ │ ├── collection-1.json │ │ │ │ └── collection-2.xml │ │ │ ├── protected-paths │ │ │ │ └── path-1.json │ │ │ ├── query-rolesets │ │ │ │ └── queryset-1.json │ │ │ ├── roles │ │ │ │ ├── sample-app-role1.json │ │ │ │ └── sample-app-role2.xml │ │ │ ├── secure-credentials │ │ │ │ └── secure-credentials-1.json │ │ │ └── users │ │ │ │ ├── jane.json │ │ │ │ └── john.json │ │ ├── servers │ │ │ ├── odbc-server.json │ │ │ └── rest-api-server.json │ │ ├── task-servers │ │ │ └── task-server.json │ │ ├── tasks │ │ │ └── task-1.json │ │ ├── temporal │ │ │ ├── axis │ │ │ │ ├── temporal-system-axis.json │ │ │ │ └── temporal-valid-axis.json │ │ │ └── collections │ │ │ │ ├── lsqt │ │ │ │ └── temporal-collection-lsqt.json │ │ │ │ └── temporal-collection.json │ │ └── triggers │ │ │ └── my-trigger.json │ │ ├── ml-data │ │ ├── child │ │ │ ├── collections.properties │ │ │ ├── permissions.properties │ │ │ ├── test2.xml │ │ │ └── test3.txt │ │ └── test1.json │ │ ├── ml-modules │ │ ├── ext │ │ │ ├── lib │ │ │ │ ├── test.xqy │ │ │ │ └── test2.xqy │ │ │ └── sample-lib.xqy │ │ ├── options │ │ │ └── sample-app-options.xml │ │ └── services │ │ │ └── sql.xqy │ │ ├── ml-schemas │ │ ├── .do-not-load │ │ ├── my.rules │ │ └── x.xsd │ │ └── more-data │ │ └── test4.json ├── static-check-modules │ └── ext │ │ └── bad.xqy ├── subdatabases │ └── databases │ │ ├── content-database.json │ │ ├── my-super-db.json │ │ ├── schemas-database.json │ │ ├── subdatabases │ │ ├── mysuperdb │ │ │ ├── mysuperdb-subdb01.json │ │ │ └── mysuperdb-subdb02.json │ │ └── sample-app-content │ │ │ ├── sample-app-content-subdb01.json │ │ │ └── sample-app-content-subdb02.json │ │ └── triggers-database.json ├── tasks-disabled │ └── tasks │ │ └── disabled-task.json ├── tasks-in-child-dir │ ├── groups │ │ └── group1-task.json │ └── tasks │ │ ├── default-group-task.json │ │ └── sampleAppGroup1 │ │ └── group1-task.json ├── tasks-with-same-path │ └── tasks │ │ ├── task-1.json │ │ ├── task-2.json │ │ ├── task-3.json │ │ └── task-4.json ├── tde-validation │ └── databases │ │ ├── content-database.json │ │ ├── sample-app-schemas │ │ └── schemas │ │ │ └── tde │ │ │ └── bad-template.json │ │ └── schemas-database.json ├── temporal-config-with-lsqt │ ├── databases │ │ ├── content-database.json │ │ ├── other-database.json │ │ ├── other-sample-app-content │ │ │ └── temporal │ │ │ │ ├── axes │ │ │ │ ├── temporal-system-axis.json │ │ │ │ └── temporal-valid-axis.json │ │ │ │ └── collections │ │ │ │ ├── lsqt │ │ │ │ └── temporal-collection.json │ │ │ │ └── temporal-collection.json │ │ ├── other-schemas-database.json │ │ └── schemas-database.json │ └── temporal │ │ ├── axes │ │ ├── temporal-system-axis.json │ │ └── temporal-valid-axis.json │ │ └── collections │ │ ├── lsqt │ │ └── temporal-collection.json │ │ └── temporal-collection.json ├── temporal-config │ ├── databases │ │ ├── content-database.json │ │ └── schemas-database.json │ └── temporal │ │ ├── axes │ │ ├── temporal-system-axis.json │ │ └── temporal-valid-axis.json │ │ └── collections │ │ └── temporal-collection.json ├── uni-temporal-config │ ├── databases │ │ ├── content-database.json │ │ └── schemas-database.json │ └── temporal │ │ ├── axes │ │ └── temporal-system-axis.json │ │ └── collections │ │ └── uni-temporal-collection.json ├── users-to-not-undeploy │ └── security │ │ ├── roles │ │ ├── admin.json │ │ └── testRole.json │ │ └── users │ │ ├── custom-user.json │ │ └── nobody-user.json └── view-schemas │ ├── databases │ ├── content-database.json │ ├── other-database.json │ ├── other-sample-app-content │ │ └── view-schemas │ │ │ ├── main-views │ │ │ └── view-1.json │ │ │ └── view-schema-1.json │ └── schemas-database.json │ └── view-schemas │ ├── main-views │ └── view-1.json │ └── view-schema-1.json ├── schemas-marklogic9 ├── to-be-ignored │ └── test.xml ├── x.tdej └── x.tdex ├── schemas-project └── src │ └── main │ ├── ml-config │ └── databases │ │ ├── content-database.json │ │ └── schemas-database.json │ ├── ml-schemas │ └── tde │ │ └── template1.json │ └── more-schemas │ ├── qbv │ └── example.sjs │ └── tde │ └── template2.json ├── test.properties └── token-test ├── ml-config └── rest-api.json └── ml-modules └── root └── hello.xqy /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = tab 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | 15 | [*.java] 16 | indent_size = 4 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | .gradle 3 | .settings 4 | /build/ 5 | /out/ 6 | .project 7 | .classpath 8 | .idea 9 | src/test/resources/user.properties 10 | setenv.bat 11 | src/test/resources/scaffold-test/ 12 | .DS_Store 13 | src/test/resources/entity-services-project/src 14 | *.iml 15 | target 16 | gradle-local.properties 17 | snyk 18 | .vscode 19 | src/test/resources/sample-app/build 20 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Lines starting with '#' are comments. 2 | # Each line is a file pattern followed by one or more owners. 3 | 4 | # These owners will be the default owners for everything in the repo. 5 | * @anu3990 @billfarber @rjrudin 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Archive notice 2 | 3 | This repository has been archived as the code has been migrated to the 4 | [ml-gradle repository](https://github.com/marklogic/ml-gradle/tree/dev/ml-app-deployer) as part of the 5 | ml-gradle 5.0.0 release. 6 | 7 | The [Wiki pages in this repository](https://github.com/marklogic/ml-app-deployer/wiki) are still valid as 8 | documentation but may soon be folded into the ml-gradle documentation. 9 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Define this via gradle-local.properties or on the command line when running snyk-test 2 | snykToken= 3 | 4 | # Define these on the command line to publish to OSSRH 5 | # See https://central.sonatype.org/publish/publish-gradle/#credentials for more information 6 | mavenCentralUsername= 7 | mavenCentralPassword= 8 | mavenCentralUrl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ 9 | #signing.keyId=YourKeyId 10 | #signing.password=YourPublicKeyPassword 11 | #signing.secretKeyRingFile=PathToYourKeyRingFile 12 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marklogic/ml-app-deployer/416e792f144e4bcf3ec0f307892e74fe4e069de6/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Mar 22 14:27:38 EDT 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip 7 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/appdeployer/AppConfigFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.appdeployer; 17 | 18 | public interface AppConfigFactory { 19 | 20 | public AppConfig newAppConfig(); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/appdeployer/cli/CommandArray.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.appdeployer.cli; 17 | 18 | import com.marklogic.appdeployer.command.Command; 19 | 20 | public interface CommandArray { 21 | 22 | Command[] getCommands(); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/appdeployer/command/AbstractUndoableCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.appdeployer.command; 17 | 18 | /** 19 | * Useful base class for implementing UndoableCommand, allowing you to configure the undo sort order easily. 20 | */ 21 | public abstract class AbstractUndoableCommand extends AbstractCommand implements UndoableCommand { 22 | 23 | private int undoSortOrder = Integer.MAX_VALUE; 24 | 25 | @Override 26 | public Integer getUndoSortOrder() { 27 | return undoSortOrder; 28 | } 29 | 30 | public void setUndoSortOrder(int undoSortOrder) { 31 | this.undoSortOrder = undoSortOrder; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/appdeployer/command/IncrementalFilenameFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.appdeployer.command; 17 | 18 | import java.io.FilenameFilter; 19 | 20 | /** 21 | * Extends FilenameFilter to add support for incremental deployments, where only resources that are new or modified since 22 | * a previous deployment will be deployed. 23 | */ 24 | public interface IncrementalFilenameFilter extends FilenameFilter { 25 | 26 | /** 27 | * Toggle whether this file performs any incremental check. 28 | * 29 | * @param incrementalMode 30 | */ 31 | void setIncrementalMode(boolean incrementalMode); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/appdeployer/command/PayloadTokenReplacer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.appdeployer.command; 17 | 18 | import com.marklogic.appdeployer.AppConfig; 19 | 20 | /** 21 | * Used by commands to replace tokens in configuration files that are dependent on names of resources in the application. 22 | * Typically, the tokens are replaced by values in the AppConfig instance. This allows for configuration files to be 23 | * reused across applications with different names. 24 | */ 25 | public interface PayloadTokenReplacer { 26 | 27 | String replaceTokens(String payload, AppConfig appConfig, boolean isTestResource); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/appdeployer/command/ResourceDirFinder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.appdeployer.command; 17 | 18 | import com.marklogic.appdeployer.ConfigDir; 19 | 20 | import java.io.File; 21 | 22 | /** 23 | * Exists solely for the "findResourceDirs" method in AbstractResourceCommand. 24 | */ 25 | public interface ResourceDirFinder { 26 | File getResourceDir(ConfigDir configDir); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/appdeployer/command/ResourceFileManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.appdeployer.command; 17 | 18 | import java.io.File; 19 | 20 | /** 21 | * Defines operations for whether a resource file should be processed or not during a deployment. 22 | */ 23 | public interface ResourceFileManager { 24 | 25 | /** 26 | * Give the implementor a chance to initialize itself - e.g. loading data from a properties file or other resource. 27 | */ 28 | void initialize(); 29 | 30 | /** 31 | * @param file 32 | * @return 33 | */ 34 | boolean shouldResourceFileBeProcessed(File file); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/appdeployer/command/databases/DefaultDeployDatabaseCommandFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.appdeployer.command.databases; 17 | 18 | import java.io.File; 19 | 20 | public class DefaultDeployDatabaseCommandFactory implements DeployDatabaseCommandFactory { 21 | 22 | @Override 23 | public DeployDatabaseCommand newDeployDatabaseCommand(File databaseFile) { 24 | return new DeployDatabaseCommand(databaseFile); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/appdeployer/command/databases/DeployDatabaseCommandFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.appdeployer.command.databases; 17 | 18 | import java.io.File; 19 | 20 | /** 21 | * Abstracts how a DeployDatabaseCommand is instantiated so that Data Hub Framework can provide in its 22 | * own implementation with DHF-specific functionality in it. 23 | */ 24 | public interface DeployDatabaseCommandFactory { 25 | 26 | /** 27 | * @param databaseFile can be null 28 | * @return 29 | */ 30 | DeployDatabaseCommand newDeployDatabaseCommand(File databaseFile); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/appdeployer/command/forests/DefaultForestNamingStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.appdeployer.command.forests; 17 | 18 | import com.marklogic.appdeployer.AppConfig; 19 | 20 | public class DefaultForestNamingStrategy implements ForestNamingStrategy { 21 | 22 | @Override 23 | public String getForestName(String databaseName, int forestNumber, AppConfig appConfig) { 24 | return databaseName + "-" + forestNumber; 25 | } 26 | 27 | @Override 28 | public String getReplicaName(String databaseName, String forestName, int forestReplicaNumber, AppConfig appConfig) { 29 | return forestName + "-replica-" + forestReplicaNumber; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/appdeployer/command/modules/AssetModulesFinder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.appdeployer.command.modules; 17 | 18 | import com.marklogic.client.ext.modulesloader.Modules; 19 | import com.marklogic.client.ext.modulesloader.impl.BaseModulesFinder; 20 | 21 | public class AssetModulesFinder extends BaseModulesFinder { 22 | 23 | @Override 24 | protected Modules findModulesWithResolvedBaseDir(String baseDir) { 25 | Modules modules = new Modules(); 26 | addAssetDirectories(modules, baseDir); 27 | return modules; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/appdeployer/command/modules/ModulesLoaderFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.appdeployer.command.modules; 17 | 18 | import com.marklogic.appdeployer.AppConfig; 19 | import com.marklogic.client.ext.modulesloader.ModulesLoader; 20 | 21 | /** 22 | * Interface for objects that can construct a ModulesLoader based on the configuration information in the given 23 | * AppConfig instance. 24 | */ 25 | public interface ModulesLoaderFactory { 26 | 27 | ModulesLoader newModulesLoader(AppConfig appConfig); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/appdeployer/export/ResourceExporter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.appdeployer.export; 17 | 18 | import java.io.File; 19 | 20 | /** 21 | * Interface for exporting one or more MarkLogic resources via the Management API to disk. 22 | * 23 | * This is located in the appdeployer package because of an assumed dependency on the ConfigDir class, which defines 24 | * where resources should be exported to. 25 | */ 26 | public interface ResourceExporter { 27 | 28 | String FORMAT_XML = "xml"; 29 | String FORMAT_JSON = "json"; 30 | 31 | /** 32 | * @param baseDir 33 | * @return 34 | */ 35 | ExportedResources exportResources(File baseDir); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/appdeployer/util/SimplePropertiesSource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.appdeployer.util; 17 | 18 | import com.marklogic.client.ext.tokenreplacer.PropertiesSource; 19 | 20 | import java.util.Properties; 21 | 22 | public class SimplePropertiesSource implements PropertiesSource { 23 | 24 | private Properties props; 25 | 26 | public SimplePropertiesSource(Properties props) { 27 | this.props = props; 28 | } 29 | 30 | @Override 31 | public Properties getProperties() { 32 | return props; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/DeleteReceipt.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt; 17 | 18 | public class DeleteReceipt { 19 | 20 | private String resourceId; 21 | private String path; 22 | private boolean deleted; 23 | 24 | public DeleteReceipt(String resourceId, String path, boolean deleted) { 25 | this.resourceId = resourceId; 26 | this.path = path; 27 | this.deleted = deleted; 28 | } 29 | 30 | public String getResourceId() { 31 | return resourceId; 32 | } 33 | 34 | public String getPath() { 35 | return path; 36 | } 37 | 38 | public boolean isDeleted() { 39 | return deleted; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/ManageConfigFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt; 17 | 18 | public interface ManageConfigFactory { 19 | 20 | public ManageConfig newManageConfig(); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/admin/ActionRequiringRestart.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.admin; 17 | 18 | public interface ActionRequiringRestart { 19 | 20 | public boolean execute(); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/admin/AdminConfigFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.admin; 17 | 18 | public interface AdminConfigFactory { 19 | 20 | public AdminConfig newAdminConfig(); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/api/database/DefaultRuleset.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.api.database; 17 | 18 | import javax.xml.bind.annotation.XmlAccessType; 19 | import javax.xml.bind.annotation.XmlAccessorType; 20 | 21 | @XmlAccessorType(XmlAccessType.FIELD) 22 | public class DefaultRuleset { 23 | 24 | private String location; 25 | 26 | public String getLocation() { 27 | return location; 28 | } 29 | 30 | public void setLocation(String location) { 31 | this.location = location; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/api/database/FieldIndex.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.api.database; 17 | 18 | import javax.xml.bind.annotation.XmlAccessType; 19 | import javax.xml.bind.annotation.XmlAccessorType; 20 | import javax.xml.bind.annotation.XmlElement; 21 | 22 | @XmlAccessorType(XmlAccessType.FIELD) 23 | public class FieldIndex extends Index { 24 | 25 | @XmlElement(name = "field-name") 26 | private String fieldName; 27 | 28 | public String getFieldName() { 29 | return fieldName; 30 | } 31 | 32 | public void setFieldName(String fieldName) { 33 | this.fieldName = fieldName; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/api/database/IncludedElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.api.database; 17 | 18 | import javax.xml.bind.annotation.XmlAccessType; 19 | import javax.xml.bind.annotation.XmlAccessorType; 20 | 21 | @XmlAccessorType(XmlAccessType.FIELD) 22 | public class IncludedElement extends ExcludedElement { 23 | 24 | private Double weight; 25 | 26 | public Double getWeight() { 27 | return weight; 28 | } 29 | 30 | public void setWeight(Double weight) { 31 | this.weight = weight; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/api/database/PathIndex.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.api.database; 17 | 18 | import javax.xml.bind.annotation.XmlAccessType; 19 | import javax.xml.bind.annotation.XmlAccessorType; 20 | import javax.xml.bind.annotation.XmlElement; 21 | 22 | @XmlAccessorType(XmlAccessType.FIELD) 23 | public class PathIndex extends Index { 24 | 25 | @XmlElement(name = "path-expression") 26 | private String pathExpression; 27 | 28 | public String getPathExpression() { 29 | return pathExpression; 30 | } 31 | 32 | public void setPathExpression(String pathExpression) { 33 | this.pathExpression = pathExpression; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/api/database/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @XmlSchema( 17 | namespace = "http://marklogic.com/manage/database/properties", 18 | elementFormDefault = XmlNsForm.QUALIFIED, 19 | xmlns = { 20 | @XmlNs(prefix = "m", namespaceURI = "http://marklogic.com/manage/database/properties") 21 | } 22 | ) 23 | package com.marklogic.mgmt.api.database; 24 | 25 | import javax.xml.bind.annotation.XmlNs; 26 | import javax.xml.bind.annotation.XmlNsForm; 27 | import javax.xml.bind.annotation.XmlSchema; 28 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/api/forest/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @XmlSchema( 17 | namespace = "http://marklogic.com/manage", 18 | elementFormDefault = XmlNsForm.QUALIFIED, 19 | xmlns = { 20 | @XmlNs(prefix = "m", namespaceURI = "http://marklogic.com/manage") 21 | } 22 | ) 23 | package com.marklogic.mgmt.api.forest; 24 | 25 | import javax.xml.bind.annotation.XmlNs; 26 | import javax.xml.bind.annotation.XmlNsForm; 27 | import javax.xml.bind.annotation.XmlSchema; 28 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/api/group/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @XmlSchema( 17 | namespace = "http://marklogic.com/manage", 18 | elementFormDefault = XmlNsForm.QUALIFIED, 19 | xmlns = { 20 | @XmlNs(prefix = "m", namespaceURI = "http://marklogic.com/manage") 21 | } 22 | ) 23 | package com.marklogic.mgmt.api.group; 24 | 25 | import javax.xml.bind.annotation.XmlNs; 26 | import javax.xml.bind.annotation.XmlNsForm; 27 | import javax.xml.bind.annotation.XmlSchema; 28 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/api/mimetypes/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @XmlSchema( 17 | namespace = "http://marklogic.com/manage", 18 | elementFormDefault = XmlNsForm.QUALIFIED, 19 | xmlns = { 20 | @XmlNs(prefix = "m", namespaceURI = "http://marklogic.com/manage") 21 | } 22 | ) 23 | package com.marklogic.mgmt.api.mimetypes; 24 | 25 | import javax.xml.bind.annotation.XmlNs; 26 | import javax.xml.bind.annotation.XmlNsForm; 27 | import javax.xml.bind.annotation.XmlSchema; 28 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/api/security/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @XmlSchema( 17 | namespace = "http://marklogic.com/manage", 18 | elementFormDefault = XmlNsForm.QUALIFIED, 19 | xmlns = { 20 | @XmlNs(prefix = "m", namespaceURI = "http://marklogic.com/manage") 21 | } 22 | ) 23 | package com.marklogic.mgmt.api.security; 24 | 25 | import javax.xml.bind.annotation.XmlNs; 26 | import javax.xml.bind.annotation.XmlNsForm; 27 | import javax.xml.bind.annotation.XmlSchema; 28 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/api/security/protectedpath/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @XmlSchema( 17 | namespace = "http://marklogic.com/manage/protected-path/properties", 18 | elementFormDefault = XmlNsForm.QUALIFIED, 19 | xmlns = { 20 | @XmlNs(prefix = "mpp", namespaceURI = "http://marklogic.com/manage/protected-path/properties") 21 | } 22 | ) 23 | package com.marklogic.mgmt.api.security.protectedpath; 24 | 25 | import javax.xml.bind.annotation.XmlNs; 26 | import javax.xml.bind.annotation.XmlNsForm; 27 | import javax.xml.bind.annotation.XmlSchema; 28 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/api/security/queryroleset/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @XmlSchema( 17 | namespace = "http://marklogic.com/manage/query-roleset/properties", 18 | elementFormDefault = XmlNsForm.QUALIFIED, 19 | xmlns = { 20 | @XmlNs(prefix = "qr", namespaceURI = "http://marklogic.com/manage/query-roleset/properties") 21 | } 22 | ) 23 | package com.marklogic.mgmt.api.security.queryroleset; 24 | 25 | import javax.xml.bind.annotation.XmlNs; 26 | import javax.xml.bind.annotation.XmlNsForm; 27 | import javax.xml.bind.annotation.XmlSchema; 28 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/api/server/AppServicesServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.api.server; 17 | 18 | public class AppServicesServer extends Server { 19 | public static final String APP_SERVICES_SERVER_NAME = "App-Services"; 20 | 21 | public AppServicesServer() { 22 | setServerName(APP_SERVICES_SERVER_NAME); 23 | setServerType("http"); 24 | setRoot("/"); 25 | setPort(8000); 26 | setModulesDatabase("Modules"); 27 | setContentDatabase("Documents"); 28 | setErrorHandler("/MarkLogic/rest-api/8000-error-handler.xqy"); 29 | setUrlRewriter("/MarkLogic/rest-api/8000-rewriter.xml"); 30 | setRewriteResolvesGlobally(true); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/api/server/HttpServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.api.server; 17 | 18 | import com.marklogic.mgmt.api.API; 19 | 20 | import javax.xml.bind.annotation.XmlRootElement; 21 | 22 | @XmlRootElement(name = "http-server-properties") 23 | public class HttpServer extends Server { 24 | 25 | public HttpServer() { 26 | } 27 | 28 | public HttpServer(API api, String serverName) { 29 | super(api, serverName); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/api/server/ManageServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.api.server; 17 | 18 | public class ManageServer extends Server { 19 | public static final String MANAGE_SERVER_NAME = "Manage"; 20 | 21 | public ManageServer() { 22 | setServerName(MANAGE_SERVER_NAME); 23 | setServerType("http"); 24 | setRoot("Apps/"); 25 | setPort(8002); 26 | setContentDatabase("App-Services"); 27 | setErrorHandler("manage/error-handler.xqy"); 28 | setUrlRewriter("manage/rewriter.xqy"); 29 | setPrivilege("http://marklogic.com/xdmp/privileges/manage"); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/api/server/OdbcServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.api.server; 17 | 18 | import com.marklogic.mgmt.api.API; 19 | 20 | import javax.xml.bind.annotation.XmlRootElement; 21 | 22 | @XmlRootElement(name = "odbc-server-properties") 23 | public class OdbcServer extends Server { 24 | 25 | public OdbcServer() { 26 | } 27 | 28 | public OdbcServer(API api, String serverName) { 29 | super(api, serverName); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/api/server/UsingNamespace.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.api.server; 17 | 18 | import javax.xml.bind.annotation.XmlAccessType; 19 | import javax.xml.bind.annotation.XmlAccessorType; 20 | import javax.xml.bind.annotation.XmlElement; 21 | 22 | @XmlAccessorType(XmlAccessType.FIELD) 23 | public class UsingNamespace { 24 | 25 | @XmlElement(name = "namespace-uri") 26 | private String namespaceUri; 27 | 28 | public String getNamespaceUri() { 29 | return namespaceUri; 30 | } 31 | 32 | public void setNamespaceUri(String namespaceUri) { 33 | this.namespaceUri = namespaceUri; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/api/server/XdbcServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.api.server; 17 | 18 | import com.marklogic.mgmt.api.API; 19 | 20 | import javax.xml.bind.annotation.XmlRootElement; 21 | 22 | @XmlRootElement(name = "xdbc-server-properties") 23 | public class XdbcServer extends Server { 24 | 25 | public XdbcServer() { 26 | } 27 | 28 | public XdbcServer(API api, String serverName) { 29 | super(api, serverName); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/api/server/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @XmlSchema( 17 | namespace = "http://marklogic.com/manage", 18 | elementFormDefault = XmlNsForm.QUALIFIED, 19 | xmlns = { 20 | @XmlNs(prefix = "m", namespaceURI = "http://marklogic.com/manage") 21 | } 22 | ) 23 | package com.marklogic.mgmt.api.server; 24 | 25 | import javax.xml.bind.annotation.XmlNs; 26 | import javax.xml.bind.annotation.XmlNsForm; 27 | import javax.xml.bind.annotation.XmlSchema; 28 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/api/trigger/CollectionScope.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.api.trigger; 17 | 18 | import javax.xml.bind.annotation.XmlAccessType; 19 | import javax.xml.bind.annotation.XmlAccessorType; 20 | 21 | @XmlAccessorType(XmlAccessType.FIELD) 22 | public class CollectionScope { 23 | 24 | private String uri; 25 | 26 | public CollectionScope() { 27 | } 28 | 29 | public CollectionScope(String uri) { 30 | this.uri = uri; 31 | } 32 | 33 | public String getUri() { 34 | return uri; 35 | } 36 | 37 | public void setUri(String uri) { 38 | this.uri = uri; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/api/trigger/DirectoryScope.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.api.trigger; 17 | 18 | import javax.xml.bind.annotation.XmlAccessType; 19 | import javax.xml.bind.annotation.XmlAccessorType; 20 | 21 | @XmlAccessorType(XmlAccessType.FIELD) 22 | public class DirectoryScope { 23 | 24 | private String uri; 25 | private String depth; 26 | 27 | public String getUri() { 28 | return uri; 29 | } 30 | 31 | public void setUri(String uri) { 32 | this.uri = uri; 33 | } 34 | 35 | public String getDepth() { 36 | return depth; 37 | } 38 | 39 | public void setDepth(String depth) { 40 | this.depth = depth; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/api/trigger/DocumentScope.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.api.trigger; 17 | 18 | import javax.xml.bind.annotation.XmlAccessType; 19 | import javax.xml.bind.annotation.XmlAccessorType; 20 | 21 | @XmlAccessorType(XmlAccessType.FIELD) 22 | public class DocumentScope { 23 | 24 | private String uri; 25 | 26 | public String getUri() { 27 | return uri; 28 | } 29 | 30 | public void setUri(String uri) { 31 | this.uri = uri; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/api/trigger/PropertyContent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.api.trigger; 17 | 18 | import javax.xml.bind.annotation.XmlAccessType; 19 | import javax.xml.bind.annotation.XmlAccessorType; 20 | import javax.xml.bind.annotation.XmlElement; 21 | 22 | @XmlAccessorType(XmlAccessType.FIELD) 23 | public class PropertyContent { 24 | 25 | @XmlElement(name = "property-name") 26 | private PropertyName propertyName; 27 | 28 | public PropertyName getPropertyName() { 29 | return propertyName; 30 | } 31 | 32 | public void setPropertyName(PropertyName propertyName) { 33 | this.propertyName = propertyName; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/api/trigger/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @XmlSchema( 17 | namespace = "http://marklogic.com/manage/trigger/properties", 18 | elementFormDefault = XmlNsForm.QUALIFIED, 19 | xmlns = { 20 | @XmlNs(prefix = "m", namespaceURI = "http://marklogic.com/manage/trigger/properties") 21 | } 22 | ) 23 | package com.marklogic.mgmt.api.trigger; 24 | 25 | import javax.xml.bind.annotation.XmlNs; 26 | import javax.xml.bind.annotation.XmlNsForm; 27 | import javax.xml.bind.annotation.XmlSchema; 28 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/mapper/ResourceMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.mapper; 17 | 18 | import com.marklogic.mgmt.api.Resource; 19 | 20 | /** 21 | * The eventual plan is for this to have both read and write methods. Immediate need is only for a read method. 22 | */ 23 | public interface ResourceMapper { 24 | 25 | /** 26 | * The payload is defined as a string so that the implementation can easily determine whether the payload is 27 | * JSON or XML. 28 | * 29 | * @param payload 30 | * @param type 31 | * @param 32 | * @return 33 | */ 34 | T readResource(String payload, Class type); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/resource/cpf/CpfConfigManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.resource.cpf; 17 | 18 | import com.marklogic.mgmt.ManageClient; 19 | 20 | public class CpfConfigManager extends AbstractCpfResourceManager { 21 | 22 | public CpfConfigManager(ManageClient client, String databaseIdOrName) { 23 | super(client, databaseIdOrName); 24 | } 25 | 26 | @Override 27 | protected String getIdFieldName() { 28 | return "domain-name"; 29 | } 30 | 31 | @Override 32 | protected String getResourceName() { 33 | return "cpf-config"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/resource/cpf/DomainManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.resource.cpf; 17 | 18 | import com.marklogic.mgmt.ManageClient; 19 | 20 | public class DomainManager extends AbstractCpfResourceManager { 21 | 22 | public DomainManager(ManageClient client, String databaseIdOrName) { 23 | super(client, databaseIdOrName); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/resource/hosts/HostNameProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.resource.hosts; 17 | 18 | import java.util.List; 19 | 20 | /** 21 | * This interface exists primarily to facilitate unit testing of classes that determine what hosts forests should be 22 | * assigned to without having to connect to a real MarkLogic instance. 23 | */ 24 | public interface HostNameProvider { 25 | 26 | List getHostNames(); 27 | 28 | List getGroupHostNames(String groupName); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/resource/security/PrivilegeManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.resource.security; 17 | 18 | import com.marklogic.mgmt.resource.AbstractResourceManager; 19 | import com.marklogic.mgmt.ManageClient; 20 | 21 | public class PrivilegeManager extends AbstractResourceManager { 22 | 23 | public PrivilegeManager(ManageClient client) { 24 | super(client); 25 | } 26 | 27 | @Override 28 | protected boolean useSecurityUser() { 29 | return true; 30 | } 31 | 32 | @Override 33 | protected String[] getUpdateResourceParams(String payload) { 34 | return new String[] { "kind", payloadParser.getPayloadFieldValue(payload, "kind") }; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/resource/security/SecureCredentialsManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.resource.security; 17 | 18 | import com.marklogic.mgmt.ManageClient; 19 | import com.marklogic.mgmt.resource.AbstractResourceManager; 20 | 21 | public class SecureCredentialsManager extends AbstractResourceManager { 22 | public SecureCredentialsManager(ManageClient client) { 23 | super(client); 24 | } 25 | 26 | @Override 27 | public String getResourcesPath() { 28 | return "/manage/v2/credentials/secure"; 29 | } 30 | 31 | @Override 32 | protected String getIdFieldName() { 33 | return "name"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/resource/security/UserManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.resource.security; 17 | 18 | import com.marklogic.mgmt.ManageClient; 19 | import com.marklogic.mgmt.resource.AbstractResourceManager; 20 | 21 | public class UserManager extends AbstractResourceManager { 22 | 23 | public UserManager(ManageClient client) { 24 | super(client); 25 | } 26 | 27 | @Override 28 | protected boolean useSecurityUser() { 29 | return true; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/selector/PrefixResourceSelector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.selector; 17 | 18 | public class PrefixResourceSelector extends AbstractNameMatchingResourceSelector { 19 | 20 | private String prefix; 21 | 22 | public PrefixResourceSelector(String prefix) { 23 | this.prefix = prefix; 24 | } 25 | 26 | @Override 27 | protected boolean nameMatches(String resourceName) { 28 | return resourceName.startsWith(prefix); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/selector/RegexResourceSelector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.selector; 17 | 18 | import java.util.regex.Pattern; 19 | 20 | public class RegexResourceSelector extends AbstractNameMatchingResourceSelector { 21 | 22 | private Pattern pattern; 23 | 24 | public RegexResourceSelector(String regex) { 25 | this.pattern = Pattern.compile(regex); 26 | } 27 | 28 | @Override 29 | protected boolean nameMatches(String resourceName) { 30 | return pattern.matcher(resourceName).matches(); 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/selector/ResourceSelector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.selector; 17 | 18 | import com.marklogic.mgmt.ManageClient; 19 | 20 | public interface ResourceSelector { 21 | 22 | ResourceSelection selectResources(ManageClient manageClient); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/template/TemplateBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.template; 17 | 18 | import com.marklogic.mgmt.api.Resource; 19 | 20 | import java.util.Map; 21 | 22 | public interface TemplateBuilder { 23 | 24 | Resource buildTemplate(Map propertyMap); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/template/group/GroupTemplateBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.template.group; 17 | 18 | import com.marklogic.mgmt.api.group.Group; 19 | import com.marklogic.mgmt.template.GenericTemplateBuilder; 20 | 21 | public class GroupTemplateBuilder extends GenericTemplateBuilder { 22 | 23 | public GroupTemplateBuilder() { 24 | super(Group.class); 25 | addDefaultPropertyValue("group-name", "CHANGEME-name-of-group"); 26 | addDefaultPropertyValue("metering-enabled", "true"); 27 | addDefaultPropertyValue("meters-database", "Meters"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/template/security/RoleTemplateBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.template.security; 17 | 18 | import com.marklogic.mgmt.api.security.Role; 19 | import com.marklogic.mgmt.template.GenericTemplateBuilder; 20 | 21 | public class RoleTemplateBuilder extends GenericTemplateBuilder { 22 | 23 | public RoleTemplateBuilder() { 24 | super(Role.class); 25 | addDefaultPropertyValue("role-name", "CHANGEME-name-of-role"); 26 | addDefaultPropertyValue("description", "CHANGEME description of role"); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/util/ObjectNodesSorter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.util; 17 | 18 | import com.fasterxml.jackson.databind.node.ObjectNode; 19 | 20 | import java.util.List; 21 | 22 | /** 23 | * Strategy interface for sorting a list of ObjectNode objects. Initially created to hide how Role objects must be 24 | * sorted. 25 | */ 26 | public interface ObjectNodesSorter { 27 | 28 | List sortObjectNodes(List objectNodes); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/util/PropertySource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.util; 17 | 18 | public interface PropertySource { 19 | 20 | String getProperty(String name); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/mgmt/util/SystemPropertySource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.util; 17 | 18 | public class SystemPropertySource implements PropertySource { 19 | 20 | @Override 21 | public String getProperty(String name) { 22 | return System.getProperty(name); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/rest/util/HttpClientBuilderConfigurer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.rest.util; 17 | 18 | import org.apache.http.impl.client.HttpClientBuilder; 19 | 20 | /** 21 | * @deprecated since 4.5.0; OkHttp is now the preferred client 22 | */ 23 | @Deprecated 24 | public interface HttpClientBuilderConfigurer { 25 | 26 | HttpClientBuilder configureHttpClientBuilder(RestConfig restConfig, HttpClientBuilder httpClientBuilder); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/marklogic/rest/util/configurer/UseSystemPropertiesConfigurer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.rest.util.configurer; 17 | 18 | import com.marklogic.rest.util.HttpClientBuilderConfigurer; 19 | import com.marklogic.rest.util.RestConfig; 20 | import org.apache.http.impl.client.HttpClientBuilder; 21 | 22 | /** 23 | * @deprecated since 4.5.0; OkHttp is now the preferred client 24 | */ 25 | @Deprecated 26 | public class UseSystemPropertiesConfigurer implements HttpClientBuilderConfigurer { 27 | 28 | @Override 29 | public HttpClientBuilder configureHttpClientBuilder(RestConfig restConfig, HttpClientBuilder httpClientBuilder) { 30 | return httpClientBuilder.useSystemProperties(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/test/java/com/marklogic/appdeployer/cli/DeployerDebug.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.appdeployer.cli; 17 | 18 | public class DeployerDebug { 19 | 20 | public static void main(String[] args) throws Exception { 21 | args = new String[]{ 22 | "-l", "info", 23 | "-PmlAppName=cli", 24 | "-PmlContentForestsPerHost=1", 25 | "-PmlConfigPath=src/test/resources/sample-app/db-only-config", 26 | "mlDeployContentDatabases" 27 | }; 28 | 29 | // args = new String[]{ 30 | // "-f", "build/deployer.properties", 31 | // "-u", 32 | // "-l", "INFO", 33 | // "mlDeployContentDatabases" 34 | // }; 35 | //args = new String[]{}; 36 | Main.main(args); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/test/java/com/marklogic/appdeployer/command/SortOrderConstantsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.appdeployer.command; 17 | 18 | import static org.junit.jupiter.api.Assertions.*; 19 | import org.junit.jupiter.api.Test; 20 | 21 | public class SortOrderConstantsTest { 22 | 23 | @Test 24 | public void undeployMimetypesBeforeUsers() { 25 | assertTrue(SortOrderConstants.DELETE_MIMETYPES < SortOrderConstants.DELETE_USERS, 26 | "Mimetypes need to be undeployed before users since the user doing the deleting may be deleted when users are undeployed"); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/test/java/com/marklogic/appdeployer/command/admin/RequireAtLeastMl8Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.appdeployer.command.admin; 17 | 18 | import org.junit.jupiter.api.Test; 19 | import org.junit.jupiter.api.AfterEach; 20 | 21 | import com.marklogic.appdeployer.AbstractAppDeployerTest; 22 | 23 | public class RequireAtLeastMl8Test extends AbstractAppDeployerTest { 24 | 25 | @Test 26 | public void testThatNoExceptionIsThrown() { 27 | initializeAppDeployer(new RequireAtLeastMl8Command()); 28 | appDeployer.deploy(appConfig); 29 | } 30 | 31 | @AfterEach 32 | public void teardown() { 33 | undeploySampleApp(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/com/marklogic/appdeployer/command/security/DeployRolesWithDependenciesViaCmaTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.appdeployer.command.security; 17 | 18 | import org.junit.jupiter.api.BeforeEach; 19 | 20 | public class DeployRolesWithDependenciesViaCmaTest extends DeployRolesWithDependenciesTest { 21 | 22 | @BeforeEach 23 | public void setup() { 24 | appConfig.getCmaConfig().setDeployRoles(true); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/test/java/com/marklogic/junit/NamespaceProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.junit; 17 | 18 | import org.jdom2.Namespace; 19 | 20 | /** 21 | * Provides an array of Namespace objects that can be registered with JDOM for use in XPath expressions. 22 | */ 23 | public interface NamespaceProvider { 24 | 25 | Namespace[] getNamespaces(); 26 | } 27 | -------------------------------------------------------------------------------- /src/test/java/com/marklogic/junit/README.md: -------------------------------------------------------------------------------- 1 | The classes in this package were copied from the rjrudin/ml-junit repository so that this project no longer 2 | needs to depend on the deprecated com.marklogic:ml-junit library which will not be published to Maven Central. 3 | -------------------------------------------------------------------------------- /src/test/java/com/marklogic/mgmt/admin/AdminManagerTest.java: -------------------------------------------------------------------------------- 1 | package com.marklogic.mgmt.admin; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import static org.junit.jupiter.api.Assertions.assertThrows; 6 | import static org.junit.jupiter.api.Assertions.assertTrue; 7 | 8 | public class AdminManagerTest { 9 | 10 | @Test 11 | void invalidConfig() { 12 | // As of 4.5.1, this should no longer throw an error as the connection to MarkLogic should 13 | // be lazily constructed. 14 | AdminManager mgr = new AdminManager(new AdminConfig("localhost", 8001, null, null)); 15 | 16 | RuntimeException ex = assertThrows(RuntimeException.class, () -> mgr.getRestTemplate()); 17 | assertTrue(ex.getMessage().contains("username must be of type String"), 18 | "The call to get a RestTemplate is expected to fail because no username/password has been " + 19 | "provided, and digest auth is used by default. Prior to 4.5.1, this failed when the AdminManager " + 20 | "was instantiated, which proved problematic in 4.5.0 when the user tried to run an ml-gradle task " + 21 | "without providing any credentials."); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/test/java/com/marklogic/mgmt/api/AbstractApiTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.api; 17 | 18 | import org.junit.jupiter.api.BeforeEach; 19 | 20 | import com.marklogic.mgmt.AbstractMgmtTest; 21 | 22 | public abstract class AbstractApiTest extends AbstractMgmtTest { 23 | 24 | protected API api; 25 | 26 | @BeforeEach 27 | public void setup() { 28 | api = new API(manageClient); 29 | } 30 | 31 | protected void deleteIfExists(Resource... resources) { 32 | for (Resource r : resources) { 33 | if (r != null && r.exists()) { 34 | r.delete(); 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/test/java/com/marklogic/mgmt/api/ConnectTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.api; 17 | 18 | import org.junit.jupiter.api.Test; 19 | 20 | public class ConnectTest extends AbstractApiTest { 21 | 22 | /** 23 | * Just smoke testing that we can use the connect method to connect to the same host as before. 24 | */ 25 | @Test 26 | public void test() { 27 | api.connect(manageConfig.getHost(), manageConfig); 28 | api.getDb().list(); 29 | 30 | api.connect(manageConfig.getHost()); 31 | api.getDb().list(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/test/java/com/marklogic/mgmt/resource/forests/GetMapOfPrimaryForestsTest.java: -------------------------------------------------------------------------------- 1 | package com.marklogic.mgmt.resource.forests; 2 | 3 | import com.marklogic.mgmt.AbstractMgmtTest; 4 | import com.marklogic.mgmt.api.forest.Forest; 5 | import org.junit.jupiter.api.Test; 6 | 7 | import java.util.List; 8 | import java.util.Map; 9 | import java.util.Set; 10 | 11 | import static org.junit.jupiter.api.Assertions.assertTrue; 12 | 13 | public class GetMapOfPrimaryForestsTest extends AbstractMgmtTest { 14 | 15 | /** 16 | * Simple test for verifying this method works for a couple OOTB databases. It is expected that the app-deployer 17 | * tests will stress this method given that CMA is used by a default, and thus this method will be used anytime 18 | * a database is being deployed. 19 | */ 20 | @Test 21 | void test() { 22 | Map> mapOfPrimaryForests = new ForestManager(manageClient).getMapOfPrimaryForests(); 23 | 24 | Set dbNames = mapOfPrimaryForests.keySet(); 25 | assertTrue(dbNames.contains("App-Services")); 26 | assertTrue(dbNames.contains("Documents")); 27 | assertTrue(mapOfPrimaryForests.get("App-Services").size() > 0); 28 | assertTrue(mapOfPrimaryForests.get("Documents").size() > 0); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/test/java/com/marklogic/mgmt/resource/security/TestManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 MarkLogic Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.marklogic.mgmt.resource.security; 17 | 18 | import com.marklogic.mgmt.AbstractManager; 19 | 20 | public class TestManager extends AbstractManager { 21 | 22 | @Override 23 | protected boolean useSecurityUser() { 24 | return super.useSecurityUser(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/test/resources/cma-project/databases/content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%DATABASE%%", 3 | "schema-database": "%%SCHEMAS_DATABASE%%", 4 | "triggers-database": "%%TRIGGERS_DATABASE%%" 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/cma-project/databases/modules-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%MODULES_DATABASE%%" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/cma-project/databases/schema-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%SCHEMAS_DATABASE%%" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/cma-project/databases/triggers-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%TRIGGERS_DATABASE%%" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/cma-project/security/amps/amp-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "namespace": "org:example", 3 | "local-name": "function1", 4 | "document-uri": "/module/path/name1", 5 | "modules-database": "%%MODULES_DATABASE%%", 6 | "role": [ 7 | "rest-reader" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/cma-project/security/amps/amp-2.xml: -------------------------------------------------------------------------------- 1 | 2 | function2 3 | /module/path/name2 4 | org:example 5 | %%MODULES_DATABASE%% 6 | 7 | rest-writer 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/cma-project/security/privileges/privilege1.json: -------------------------------------------------------------------------------- 1 | { 2 | "privilege-name":"sample-app-execute-1", 3 | "action": "sample-app-execute-1", 4 | "kind":"execute", 5 | "role": [ 6 | "rest-reader" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/cma-project/security/privileges/privilege2.json: -------------------------------------------------------------------------------- 1 | { 2 | "privilege-name":"sample-app-execute-2", 3 | "action": "sample-app-execute-2", 4 | "kind":"execute", 5 | "role": [ 6 | "rest-reader" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/cma-project/security/protected-paths/path-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "path-expression": "/test:element", 3 | "path-namespace": [ 4 | { 5 | "prefix": "test", 6 | "namespace-uri": "http://marklogic.com" 7 | } 8 | ], 9 | "permission": [ 10 | { 11 | "role-name": "view-admin", 12 | "capability": "read" 13 | } 14 | ], 15 | "path-set": "the path set" 16 | } 17 | -------------------------------------------------------------------------------- /src/test/resources/cma-project/security/query-rolesets/roleset1.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name": [ 3 | "view-admin", 4 | "flexrep-user" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /src/test/resources/cma-project/security/roles/role1.xml: -------------------------------------------------------------------------------- 1 | 2 | sample-app-role1 3 | 4 | manage-user 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/test/resources/cma-project/security/roles/role2.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name": "sample-app-role2", 3 | "role": [ 4 | "sample-app-role1" 5 | ], 6 | "privilege": [ 7 | { 8 | "privilege-name": "sample-app-execute-1", 9 | "action": "sample-app-execute-1", 10 | "kind": "execute" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/cma-project/security/roles/role3.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name": "sample-app-role3", 3 | "permission": [ 4 | { 5 | "role-name": "sample-app-role3", 6 | "capability": "read" 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/cma-project/security/users/jane.json: -------------------------------------------------------------------------------- 1 | { 2 | "user-name":"sample-app-jane", 3 | "password": "password", 4 | "role": [ 5 | "manage-user", "sample-app-role2" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/cma-project/security/users/john.xml: -------------------------------------------------------------------------------- 1 | 2 | sample-app-john 3 | password 4 | 5 | rest-reader 6 | sample-app-role1 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/test/resources/cma-project/servers/http1.json: -------------------------------------------------------------------------------- 1 | { 2 | "server-name": "sample-app-server1", 3 | "server-type": "http", 4 | "root": "/", 5 | "group-name": "Default", 6 | "port": 8041, 7 | "modules-database": "%%MODULES_DATABASE%%", 8 | "content-database": "%%DATABASE%%" 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/cma-project/servers/http2.json: -------------------------------------------------------------------------------- 1 | { 2 | "server-name": "sample-app-server2", 3 | "server-type": "http", 4 | "root": "/", 5 | "group-name": "Default", 6 | "port": 8042, 7 | "modules-database": "%%MODULES_DATABASE%%", 8 | "content-database": "%%DATABASE%%" 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/cma-project/servers/http3.json: -------------------------------------------------------------------------------- 1 | { 2 | "server-name": "sample-app-server3", 3 | "server-type": "http", 4 | "root": "/", 5 | "group-name": "Default", 6 | "port": 8043, 7 | "modules-database": "%%MODULES_DATABASE%%", 8 | "content-database": "%%DATABASE%%" 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/test/resources/non-admin-test/ml-config/security/roles/sample-app-role.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name" : "sample-app-role", 3 | "role" : [ "rest-admin", "rest-writer", "rest-reader" ], 4 | "privilege": [ 5 | { 6 | "privilege-name": "xdmp:eval-in", 7 | "action": "http://marklogic.com/xdmp/privileges/xdmp-eval-in", 8 | "kind": "execute" 9 | }, 10 | { 11 | "privilege-name": "any-uri", 12 | "action": "http://marklogic.com/xdmp/privileges/any-uri", 13 | "kind": "execute" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /src/test/resources/non-admin-test/ml-config/security/users/sample-app-manage-admin.json: -------------------------------------------------------------------------------- 1 | { 2 | "user-name" : "sample-app-manage-admin", 3 | "password" : "sample-app-manage-admin", 4 | "role" : [ "manage-admin", "rest-admin"] 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/non-admin-test/ml-config/security/users/sample-app-rest-admin.json: -------------------------------------------------------------------------------- 1 | { 2 | "user-name" : "sample-app-rest-admin", 3 | "password" : "sample-app-rest-admin", 4 | "role" : [ "sample-app-role" ] 5 | } -------------------------------------------------------------------------------- /src/test/resources/non-admin-test/ml-modules/ext/hello-lib.xqy: -------------------------------------------------------------------------------- 1 | world 2 | -------------------------------------------------------------------------------- /src/test/resources/payload-properties-test/json/ml-config/databases/content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%DATABASE%%", 3 | "triggers-database": "Triggers", 4 | "triple-index" : "false" 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/payload-properties-test/xml/content-database.xml: -------------------------------------------------------------------------------- 1 | 2 | %%DATABASE%% 3 | %%TRIGGERS_DATABASE%% 4 | 5 | -------------------------------------------------------------------------------- /src/test/resources/plugin-project/src/main/ml-config/databases/content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%DATABASE%%", 3 | "range-element-index": [ 4 | { 5 | "collation": "", 6 | "invalid-values": "reject", 7 | "localname": "amount", 8 | "namespace-uri": "", 9 | "range-value-positions": false, 10 | "scalar-type": "double" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/plugin-project/src/main/ml-plugins/variance/.gitignore: -------------------------------------------------------------------------------- 1 | *.dylib 2 | *.o 3 | *.zip 4 | manifest.xml 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/alert-config/alert/configs/my-alert-config-actions/my-alert-action.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "xdmp:log2", 3 | "description": "log to ErrorLog.txt1", 4 | "module": "/alert-action.xqy", 5 | "module-db": "Modules", 6 | "module-root": "/", 7 | "option": [] 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/alert-config/alert/configs/my-alert-config-rules/my-rule.xml: -------------------------------------------------------------------------------- 1 | 2 | my-rule 3 | log to ErrorLog.txt 4 | admin 5 | 6 | 7 | Yorick 8 | 9 | 10 | xdmp:log2 11 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/alert-config/alert/configs/my-alert-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "my-alert-config", 3 | "name": "My Alerting App", 4 | "description": "Alerting config for my app", 5 | "trigger": [], 6 | "domain": [], 7 | "action": [], 8 | "option": [] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/alert-config/databases/content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%DATABASE%%" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/alert-config/databases/other-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "other-%%DATABASE%%" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/alert-config/databases/other-sample-app-content/alert/configs/other-alert-config-actions/other-alert-action.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "xdmp:log3", 3 | "description": "log to ErrorLog.txt1", 4 | "module": "/alert-action.xqy", 5 | "module-db": "Modules", 6 | "module-root": "/", 7 | "option": [] 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/alert-config/databases/other-sample-app-content/alert/configs/other-alert-config-rules/other-rule.xml: -------------------------------------------------------------------------------- 1 | 2 | other-rule 3 | other log to ErrorLog.txt 4 | admin 5 | 6 | 7 | Yorick 8 | 9 | 10 | xdmp:log3 11 | 12 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/alert-config/databases/other-sample-app-content/alert/configs/other-alert-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "other-alert-config", 3 | "name": "Other Alerting App", 4 | "description": "Alerting config for other app", 5 | "trigger": [], 6 | "domain": [], 7 | "action": [], 8 | "option": [] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/alert-config/databases/unknown-database/alert/configs/should-be-ignored-alert-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "should-be-ignored-alert-config", 3 | "name": "Should Be Ignored Alerting App", 4 | "description": "This should be ignored since the parent directory of 'unknown-database' doesn't match an existing ML database", 5 | "trigger": [], 6 | "domain": [], 7 | "action": [], 8 | "option": [] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/bad-modules/options/invalid-options.xml: -------------------------------------------------------------------------------- 1 | 2 | invalid 3 | 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/cluster-test/clusters/local-cluster.json: -------------------------------------------------------------------------------- 1 | {"ssl-fips-enabled":false} -------------------------------------------------------------------------------- /src/test/resources/sample-app/cma/configurations/config1.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ml-app-deployer-test-config", 3 | "config": [ 4 | { 5 | "forest": [ 6 | { 7 | "forest-name": "cma-test-f1" 8 | }, 9 | { 10 | "forest-name": "cma-test-f2" 11 | }, 12 | { 13 | "forest-name": "cma-test-f3" 14 | } 15 | ] 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/cma/configurations/config1.xml: -------------------------------------------------------------------------------- 1 | 2 | ml-app-deployer-test-config 3 | 4 | 5 | 6 | 7 | cma-test-f1 8 | 9 | 10 | cma-test-f2 11 | 12 | 13 | cma-test-f3 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/custom-forests/databases/content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%DATABASE%%" 3 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/custom-forests/forests/sample-app-content/custom-forests.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "forest-name": "sample-app-content-custom-1", 4 | "enabled": true, 5 | "database": "%%DATABASE%%" 6 | }, 7 | { 8 | "forest-name": "sample-app-content-custom-2", 9 | "enabled": true, 10 | "database": "%%DATABASE%%" 11 | } 12 | ] 13 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/custom-forests/forests/sample-app-content/single-custom-forest.json: -------------------------------------------------------------------------------- 1 | { 2 | "forest-name": "sample-app-content-custom-3", 3 | "enabled": true, 4 | "database": "%%DATABASE%%" 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/databases-in-order-xml/databases/database-A.xml: -------------------------------------------------------------------------------- 1 | 2 | %%NAME%%-A 3 | %%NAME%%-B 4 | %%NAME%%-C 5 | 6 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/databases-in-order-xml/databases/database-B.xml: -------------------------------------------------------------------------------- 1 | 2 | %%NAME%%-B 3 | Triggers 4 | %%NAME%%-C 5 | 6 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/databases-in-order-xml/databases/database-C.xml: -------------------------------------------------------------------------------- 1 | 2 | %%NAME%%-C 3 | Triggers 4 | Schemas 5 | 6 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/databases-in-order/databases/database-A.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%NAME%%-A", 3 | "schema-database": "%%NAME%%-C", 4 | "triggers-database": "%%NAME%%-B" 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/databases-in-order/databases/database-B.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%NAME%%-B", 3 | "schema-database": "%%NAME%%-C", 4 | "triggers-database": "Triggers" 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/databases-in-order/databases/database-C.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%NAME%%-C", 3 | "schema-database": "Schemas", 4 | "triggers-database": "Triggers" 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/db-only-config/databases/content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%DATABASE%%", 3 | "range-element-index": [ 4 | { 5 | "collation": "http://marklogic.com/collation/", 6 | "invalid-values": "reject", 7 | "localname": "ÉÉÉ", 8 | "namespace-uri": "", 9 | "range-value-positions": false, 10 | "scalar-type": "string" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/default-databases/databases/content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%DATABASE%%" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/default-databases/databases/fab-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "Fab" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/default-modules-database-config/databases/content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%DATABASE%%" 3 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/default-modules-database-config/rest-api.json: -------------------------------------------------------------------------------- 1 | { 2 | "rest-api": { 3 | "name": "%%NAME%%", 4 | "group": "%%GROUP%%", 5 | "database": "%%DATABASE%%", 6 | "modules-database": "%%MODULES_DATABASE%%", 7 | "port": "%%PORT%%", 8 | "xdbc-enabled": true, 9 | "error-format": "json" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/default-servers/servers/manage-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "server-name": "Manage", 3 | "server-type": "http" 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/default-servers/servers/xdbc-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "server-name": "%%NAME%%-xdbc", 3 | "server-type": "xdbc", 4 | "root": "/", 5 | "group-name": "%%GROUP%%", 6 | "port": 8049, 7 | "modules-database": "Modules", 8 | "content-database": "Documents" 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/dhf-db-ordering/databases/final-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%mlFinalDbName%%", 3 | "range-element-index": [], 4 | "schema-database": "%%mlFinalSchemasDbName%%", 5 | "triggers-database": "%%mlFinalTriggersDbName%%", 6 | "triple-index": true, 7 | "collection-lexicon": true, 8 | "uri-lexicon": true 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/dhf-db-ordering/databases/final-schemas-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%mlFinalSchemasDbName%%" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/dhf-db-ordering/databases/final-triggers-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%mlFinalTriggersDbName%%" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/dhf-db-ordering/databases/modules-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%mlModulesDbName%%", 3 | "collection-lexicon": true, 4 | "uri-lexicon": true 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/even-more-roles-with-dependencies/security/roles/abc-login-role.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name" : "abc-login-role" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/even-more-roles-with-dependencies/security/roles/abc-sss-ui-role.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name" : "abc-sss-ui-role", 3 | "role" : [ "xyz-reader", "xyz-writer" ], 4 | "permission": [ 5 | { 6 | "role-name": "abc-sss-ui-role", 7 | "capability": "read" 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/even-more-roles-with-dependencies/security/roles/abc-ui-admin.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name" : "abc-ui-admin", 3 | "role" : [ "abc-ui-offline-admin", "flexrep-admin" ] 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/even-more-roles-with-dependencies/security/roles/abc-ui-developer.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name" : "abc-ui-developer" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/even-more-roles-with-dependencies/security/roles/abc-ui-offline-admin.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name" : "abc-ui-offline-admin", 3 | "role" : [ "abc-ui-offline-user" ] 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/even-more-roles-with-dependencies/security/roles/abc-ui-offline-user.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name" : "abc-ui-offline-user", 3 | "role" : [ "abc-sss-ui-role" ] 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/even-more-roles-with-dependencies/security/roles/xyz-admin.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name" : "xyz-admin", 3 | "role" : [ "xyz-reader", "xyz-writer", "qconsole-user" ] 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/even-more-roles-with-dependencies/security/roles/xyz-reader.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name" : "xyz-reader" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/even-more-roles-with-dependencies/security/roles/xyz-writer.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name" : "xyz-writer", 3 | "role" : [ "xyz-reader", "app-user" ] 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/flexrep-combined/databases/content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%DATABASE%%", 3 | "triggers-database": "%%TRIGGERS_DATABASE%%" 4 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/flexrep-combined/databases/triggers-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%TRIGGERS_DATABASE%%" 3 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/flexrep-combined/flexrep/master/cpf/cpf-configs/master-cpf-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "domain-name": "master-domain", 3 | "restart-user-name": "admin", 4 | "eval-module": "Modules", 5 | "eval-root": "/", 6 | "conversion-enabled": false, 7 | "permission": [{ 8 | "role-name": "app-user", 9 | "capability": "read" 10 | }] 11 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/flexrep-combined/flexrep/master/cpf/domains/master-domain.json: -------------------------------------------------------------------------------- 1 | { 2 | "domain-name": "master-domain", 3 | "description": "Test domain for sample app", 4 | "scope": "directory", 5 | "uri": "/master/", 6 | "depth": "infinity", 7 | "eval-module": "Modules", 8 | "eval-root": "/", 9 | "pipeline": ["Status Change Handling", "Flexible Replication"] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/flexrep-combined/flexrep/master/flexrep/configs/master-config.xml: -------------------------------------------------------------------------------- 1 | 3 | master-domain 4 | 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/flexrep-combined/flexrep/master/flexrep/configs/master-domain-targets/master-target.xml: -------------------------------------------------------------------------------- 1 | 4 | master-domain-target 5 | 60 6 | 300 7 | true 8 | 1 9 | false 10 | true 11 | 12 | 13 | http://localhost:8076/ 14 | 15 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/flexrep-combined/flexrep/master/servers/master-flexrep-server.xml: -------------------------------------------------------------------------------- 1 | 2 | master-flexrep-server 3 | Default 4 | http 5 | FlexRep 6 | 8121 7 | /error-handler.xqy 8 | /rewriter.xml 9 | Documents 10 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/flexrep-combined/flexrep/replica/cpf/cpf-configs/replica-cpf-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "domain-name": "replica-domain", 3 | "restart-user-name": "admin", 4 | "eval-module": "Modules", 5 | "eval-root": "/", 6 | "conversion-enabled": false, 7 | "permission": [{ 8 | "role-name": "app-user", 9 | "capability": "read" 10 | }] 11 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/flexrep-combined/flexrep/replica/cpf/domains/replica-domain.json: -------------------------------------------------------------------------------- 1 | { 2 | "domain-name": "replica-domain", 3 | "description": "Test domain for sample app", 4 | "scope": "directory", 5 | "uri": "/replica/", 6 | "depth": "infinity", 7 | "eval-module": "Modules", 8 | "eval-root": "/", 9 | "pipeline": ["Status Change Handling", "Flexible Replication"] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/flexrep-combined/flexrep/replica/flexrep/configs/replica-config.xml: -------------------------------------------------------------------------------- 1 | 3 | replica-domain 4 | 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/flexrep-combined/flexrep/replica/flexrep/configs/replica-domain-targets/replica-target.xml: -------------------------------------------------------------------------------- 1 | 4 | replica-domain-target 5 | 60 6 | 300 7 | true 8 | 1 9 | false 10 | true 11 | 12 | 13 | http://localhost:8076/ 14 | 15 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/flexrep-combined/flexrep/replica/servers/replica-flexrep-server.xml: -------------------------------------------------------------------------------- 1 | 2 | replica-flexrep-server 3 | Default 4 | http 5 | FlexRep 6 | 8122 7 | /error-handler.xqy 8 | /rewriter.xml 9 | Documents 10 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/flexrep-config/cpf/cpf-configs/sample-app-cpf-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "domain-name": "sample-app-domain-1", 3 | "restart-user-name": "admin", 4 | "eval-module": "Modules", 5 | "eval-root": "/", 6 | "conversion-enabled": false, 7 | "permission": [{ 8 | "role-name": "app-user", 9 | "capability": "read" 10 | }] 11 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/flexrep-config/cpf/domains/domain-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "domain-name": "sample-app-domain-1", 3 | "description": "Test domain for sample app", 4 | "scope": "directory", 5 | "uri": "/sample-app-1/", 6 | "depth": "infinity", 7 | "eval-module": "Modules", 8 | "eval-root": "/", 9 | "pipeline": ["Status Change Handling", "Flexible Replication"] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/flexrep-config/databases/content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%DATABASE%%", 3 | "triggers-database": "%%TRIGGERS_DATABASE%%" 4 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/flexrep-config/databases/other-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "other-%%DATABASE%%", 3 | "triggers-database": "%%TRIGGERS_DATABASE%%" 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/flexrep-config/databases/other-sample-app-content/flexrep/configs/flexrep-config-1.xml: -------------------------------------------------------------------------------- 1 | 3 | sample-app-domain-1 4 | 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/flexrep-config/databases/other-sample-app-content/flexrep/configs/sample-app-domain-1-targets/target-1.xml: -------------------------------------------------------------------------------- 1 | 4 | sample-app-domain-1-target 5 | 60 6 | 300 7 | true 8 | 1 9 | false 10 | true 11 | 12 | 13 | http://localhost:8076/ 14 | 15 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/flexrep-config/databases/other-sample-app-content/flexrep/pulls/test-pull.json: -------------------------------------------------------------------------------- 1 | { 2 | "pull-name": "docs2go", 3 | "domain-id": "%%flexrep-domains-id-sample-app-domain-1%%", 4 | "target-id": "%%flexrep-targets-id-sample-app-domain-1-target%%", 5 | "enabled": true, 6 | "url": [ 7 | "http://localhost:8076" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/flexrep-config/databases/triggers-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%TRIGGERS_DATABASE%%" 3 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/flexrep-config/flexrep/configs/flexrep-config-1.xml: -------------------------------------------------------------------------------- 1 | 3 | sample-app-domain-1 4 | 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/flexrep-config/flexrep/configs/sample-app-domain-1-targets/target-1.xml: -------------------------------------------------------------------------------- 1 | 4 | sample-app-domain-1-target 5 | 60 6 | 300 7 | true 8 | 1 9 | false 10 | true 11 | 12 | 13 | http://localhost:8076/ 14 | 15 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/host-certificates/security/certificate-templates/host-certificates/sample-app-certificate-template/README.md: -------------------------------------------------------------------------------- 1 | The host2.marklogic.com.crt file exists to verify that no error occurs when a corresponding 2 | key file cannot be found. 3 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/host-certificates/security/certificate-templates/template-1.xml: -------------------------------------------------------------------------------- 1 | 2 | sample-app-certificate-template 3 | Sample description 4 | rsa 5 | 6 | 7 | 0 8 | 9 | US 10 | VA 11 | McLean 12 | MarkLogic 13 | Consulting 14 | nobody@marklogic.com 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/lots-of-databases/databases/content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%DATABASE%%", 3 | "triggers-database": "%%TRIGGERS_DATABASE%%", 4 | "schema-database": "%%SCHEMAS_DATABASE%%" 5 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/lots-of-databases/databases/ignored-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "ignored-content", 3 | "triggers-database": "other-sample-app-triggers", 4 | "schema-database": "other-sample-app-schemas" 5 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/lots-of-databases/databases/more-content-db-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "maintain-last-modified": true, 3 | "range-element-index": [ 4 | { 5 | "collation": "http://marklogic.com/collation/", 6 | "invalid-values": "reject", 7 | "localname": "anotherElement", 8 | "namespace-uri": "urn:sampleapp", 9 | "range-value-positions": false, 10 | "scalar-type": "string" 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/lots-of-databases/databases/other-content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "other-sample-app-content", 3 | "triggers-database": "other-sample-app-triggers", 4 | "schema-database": "other-sample-app-schemas" 5 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/lots-of-databases/databases/other-schemas-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "other-sample-app-schemas" 3 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/lots-of-databases/databases/other-triggers-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "other-sample-app-triggers" 3 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/lots-of-databases/databases/schemas-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%SCHEMAS_DATABASE%%" 3 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/lots-of-databases/databases/triggers-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%TRIGGERS_DATABASE%%" 3 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/lots-of-databases/rest-api.json: -------------------------------------------------------------------------------- 1 | { 2 | "rest-api": { 3 | "name": "%%NAME%%", 4 | "group": "%%GROUP%%", 5 | "database": "%%DATABASE%%", 6 | "modules-database": "%%MODULES_DATABASE%%", 7 | "port": "%%PORT%%", 8 | "xdbc-enabled": true, 9 | "error-format": "json" 10 | } 11 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/more-roles-with-dependencies/security/roles/role0.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name" : "more-roles-role0", 3 | "role" : [ "app-user" ] 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/more-roles-with-dependencies/security/roles/role1.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name" : "more-roles-role1", 3 | "role" : [ "more-roles-role3" ] 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/more-roles-with-dependencies/security/roles/role2.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name" : "more-roles-role2", 3 | "role" : [ "more-roles-role0"] 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/more-roles-with-dependencies/security/roles/role3.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name" : "more-roles-role3", 3 | "role" : [ "more-roles-role0" ] 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-config-paths/path1/databases/one-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "sample-app-one-database", 3 | "triple-index": false, 4 | "schema-database": "sample-app-schema-database", 5 | "range-element-index": [ 6 | { 7 | "collation": "http://marklogic.com/collation/", 8 | "invalid-values": "reject", 9 | "localname": "id", 10 | "namespace-uri": "", 11 | "range-value-positions": false, 12 | "scalar-type": "string" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-config-paths/path1/databases/other-content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%DATABASE%%", 3 | "range-element-index": [ 4 | { 5 | "collation": "http://marklogic.com/collation/", 6 | "invalid-values": "reject", 7 | "localname": "id", 8 | "namespace-uri": "", 9 | "range-value-positions": false, 10 | "scalar-type": "string" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-config-paths/path1/databases/z-schemas-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "sample-app-schema-database" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-config-paths/path1/security/privileges/privilege1.json: -------------------------------------------------------------------------------- 1 | { 2 | "privilege-name":"sample-app-execute-1", 3 | "action": "urn:sample-app:privilege:1", 4 | "kind":"execute", 5 | "role": [ 6 | "rest-reader" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-config-paths/path1/security/roles/role1.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name": "sample-app-role1", 3 | "role": [ 4 | "rest-reader" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-config-paths/path1/security/roles/role2.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name": "sample-app-role2", 3 | "role": [ 4 | "rest-writer" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-config-paths/path1/security/users/xml-jane.xml: -------------------------------------------------------------------------------- 1 | 2 | sample-app-jane 3 | password 4 | 5 | rest-reader 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-config-paths/path1/servers/server.json: -------------------------------------------------------------------------------- 1 | { 2 | "server-name": "sample-app-server", 3 | "server-type": "http", 4 | "root": "/", 5 | "group-name": "Default", 6 | "port": 8048, 7 | "modules-database": "Modules", 8 | "content-database": "Modules", 9 | "namespace": [ 10 | { 11 | "prefix": "test1", 12 | "namespace-uri": "test1" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-config-paths/path2/databases/another-one-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "sample-app-one-database", 3 | "triple-index": true, 4 | "triggers-database": "sample-app-triggers-database", 5 | "range-element-index": [ 6 | { 7 | "collation": "http://marklogic.com/collation/", 8 | "invalid-values": "reject", 9 | "localname": "otherId", 10 | "namespace-uri": "", 11 | "range-value-positions": false, 12 | "scalar-type": "string" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-config-paths/path2/databases/content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%DATABASE%%", 3 | "range-element-index": [ 4 | { 5 | "collation": "http://marklogic.com/collation/", 6 | "invalid-values": "reject", 7 | "localname": "otherId", 8 | "namespace-uri": "", 9 | "range-value-positions": false, 10 | "scalar-type": "string" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-config-paths/path2/databases/subdatabases/sample-app-one-database/subdb01.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "sample-app-one-database-subdb01" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-config-paths/path2/databases/subdatabases/sample-app-one-database/subdb02.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "sample-app-one-database-subdb02" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-config-paths/path2/databases/two-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "sample-app-two-database" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-config-paths/path2/databases/z-triggers-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "sample-app-triggers-database" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-config-paths/path2/security/privileges/other-privilege1.json: -------------------------------------------------------------------------------- 1 | { 2 | "privilege-name":"sample-app-execute-1", 3 | "action": "urn:sample-app:privilege:1", 4 | "kind":"execute", 5 | "role": [ 6 | "manage-user" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-config-paths/path2/security/roles/other-role1.xml: -------------------------------------------------------------------------------- 1 | 2 | sample-app-role1 3 | 4 | manage-user 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-config-paths/path2/security/roles/other-role2.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name": "sample-app-role2", 3 | "role": [ 4 | "sample-app-role1" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-config-paths/path2/security/users/jane.json: -------------------------------------------------------------------------------- 1 | { 2 | "user-name":"sample-app-jane", 3 | "password": "password", 4 | "role": [ 5 | "manage-user" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-config-paths/path2/servers/same-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "server-name": "sample-app-server", 3 | "server-type": "http", 4 | "root": "/", 5 | "group-name": "Default", 6 | "port": 8048, 7 | "modules-database": "Documents", 8 | "content-database": "Documents", 9 | "namespace": [ 10 | { 11 | "prefix": "test2", 12 | "namespace-uri": "test2" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-schema-databases/ml-config/databases/sample-app-schemas1.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "sample-app-schemas1" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-schema-databases/ml-config/databases/sample-app-schemas1/schemas/schema1.xsd: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-schema-databases/ml-config/databases/sample-app-schemas2.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "sample-app-schemas2" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-schema-databases/ml-config/databases/sample-app-schemas2/schemas/schema2.xsd: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-schema-databases/ml-schemas/default-schema.xsd: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-triggers-databases/databases/content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%DATABASE%%", 3 | "triggers-database": "%%TRIGGERS_DATABASE%%" 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-triggers-databases/databases/other-content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "other-%%DATABASE%%", 3 | "triggers-database": "other-%%TRIGGERS_DATABASE%%" 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-triggers-databases/databases/other-sample-app-triggers/triggers/other-trigger.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "other-trigger", 3 | "description": "other trigger", 4 | "event": { 5 | "data-event": { 6 | "directory-scope": { 7 | "uri": "/otherDir/", 8 | "depth": "1" 9 | }, 10 | "document-content": { 11 | "update-kind": "create" 12 | }, 13 | "when": "post-commit" 14 | } 15 | }, 16 | "module": "/test.xqy", 17 | "module-db": "Modules", 18 | "module-root": "/modules/", 19 | "enabled": true, 20 | "recursive": true, 21 | "task-priority": "normal" 22 | } 23 | 24 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-triggers-databases/databases/other-triggers-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "other-%%TRIGGERS_DATABASE%%" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-triggers-databases/databases/third-triggers-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "third-%%TRIGGERS_DATABASE%%" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-triggers-databases/databases/third-triggers-database/triggers/third-trigger.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "third-trigger", 3 | "description": "third trigger", 4 | "event": { 5 | "data-event": { 6 | "directory-scope": { 7 | "uri": "/thirdDir/", 8 | "depth": "1" 9 | }, 10 | "document-content": { 11 | "update-kind": "create" 12 | }, 13 | "when": "post-commit" 14 | } 15 | }, 16 | "module": "/test.xqy", 17 | "module-db": "Modules", 18 | "module-root": "/modules/", 19 | "enabled": true, 20 | "recursive": true, 21 | "task-priority": "normal" 22 | } 23 | 24 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-triggers-databases/databases/triggers-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%TRIGGERS_DATABASE%%" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/multiple-triggers-databases/triggers/my-trigger.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "my-trigger", 3 | "description": "my trigger", 4 | "event": { 5 | "data-event": { 6 | "directory-scope": { 7 | "uri": "/myDir/", 8 | "depth": "1" 9 | }, 10 | "document-content": { 11 | "update-kind": "create" 12 | }, 13 | "when": "post-commit" 14 | } 15 | }, 16 | "module": "/test.xqy", 17 | "module-db": "Modules", 18 | "module-root": "/modules/", 19 | "enabled": true, 20 | "recursive": true, 21 | "task-priority": "normal" 22 | } 23 | 24 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/other-group/groups/sample-app-other-group.json: -------------------------------------------------------------------------------- 1 | { 2 | "group-name": "sample-app-other-group" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/other-group/servers/http-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "server-name": "sample-app-other-server", 3 | "server-type": "http", 4 | "root": "/", 5 | "group-name": "Default", 6 | "port": 8048, 7 | "modules-database": "Modules", 8 | "content-database": "Documents" 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/other-group/servers/other-http-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "server-name": "sample-app-other-server", 3 | "server-type": "http", 4 | "root": "/", 5 | "group-name": "sample-app-other-group", 6 | "port": 8049, 7 | "modules-database": "Modules", 8 | "content-database": "Documents" 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/other-modules/root/other-lib.xqy: -------------------------------------------------------------------------------- 1 | xquery version "1.0-ml"; 2 | 3 | module namespace other = "urn:sampleapp:other"; 4 | 5 | declare function hello($str as xs:string?) as xs:string 6 | { 7 | "Hello: " || $str 8 | }; 9 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/other-servers/servers/odbc-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "server-name": "%%NAME%%-odbc", 3 | "server-type": "odbc", 4 | "root": "/", 5 | "group-name": "%%GROUP%%", 6 | "port": 8048, 7 | "modules-database": "Modules", 8 | "content-database": "Documents" 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/other-servers/servers/rest-api-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "server-name": "%%NAME%%", 3 | "authentication": "basic" 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/other-servers/servers/xdbc-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "server-name": "%%NAME%%-xdbc", 3 | "server-type": "xdbc", 4 | "root": "/", 5 | "group-name": "%%GROUP%%", 6 | "port": 8049, 7 | "modules-database": "Modules", 8 | "content-database": "Documents" 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/partition-queries/databases/content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%DATABASE%%", 3 | "schema-database": "%%SCHEMAS_DATABASE%%", 4 | "locking": "strict", 5 | "range-element-index": [ 6 | { 7 | "scalar-type": "date", 8 | "namespace-uri": "", 9 | "localname": "myDate", 10 | "collation": "", 11 | "range-value-positions": false, 12 | "invalid-values": "reject" 13 | } 14 | ], 15 | "assignment-policy": { 16 | "assignment-policy-name": "query", 17 | "default-partition": 2 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/partition-queries/databases/sample-app-content/partition-queries/partition-query1.xml: -------------------------------------------------------------------------------- 1 | 2 | 1 3 | 4 | 5 | 6 | Manager 7 | 8 | 9 | Engineer 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/partition-queries/databases/sample-app-content/partition-queries/partition-query2.xml: -------------------------------------------------------------------------------- 1 | 2 | 2 3 | 4 | 5 | Hello World 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/partition-queries/databases/sample-app-content/partitions/partition1.json: -------------------------------------------------------------------------------- 1 | { 2 | "partition-name": "tier1", 3 | "partition-number": "1", 4 | "forests-per-host": 1, 5 | "host": [ 6 | "mlHostName1" 7 | ], 8 | "option": [ 9 | "failover=none" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/partition-queries/databases/sample-app-content/partitions/partition2.json: -------------------------------------------------------------------------------- 1 | { 2 | "partition-name": "tier2", 3 | "partition-number": "2", 4 | "forests-per-host": 1, 5 | "host": [ 6 | "mlHostName1" 7 | ], 8 | "option": [ 9 | "failover=none" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/partition-queries/databases/schemas-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%SCHEMAS_DATABASE%%" 3 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/partitions/databases/content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%DATABASE%%", 3 | "schema-database": "%%SCHEMAS_DATABASE%%", 4 | "locking": "strict", 5 | "range-element-index": [ 6 | { 7 | "scalar-type": "date", 8 | "namespace-uri": "", 9 | "localname": "myDate", 10 | "collation": "", 11 | "range-value-positions": false, 12 | "invalid-values": "reject" 13 | } 14 | ], 15 | "assignment-policy": { 16 | "assignment-policy-name": "range", 17 | "partition-key": { 18 | "element-reference": { 19 | "namespace-uri": "", 20 | "localname": "myDate", 21 | "scalar-type": "date" 22 | } 23 | }, 24 | "lower-bound-included": true 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/partitions/databases/sample-app-content/partitions/partition1.xml: -------------------------------------------------------------------------------- 1 | 2 | myDate-2011 3 | 2011-01-01 4 | 2011-12-31 5 | 1 6 | 7 | mlHostName1 8 | 9 | 17 | 18 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/partitions/databases/sample-app-content/partitions/partition2.xml: -------------------------------------------------------------------------------- 1 | 2 | myDate-2012 3 | 2012-01-01 4 | 2012-12-31 5 | 1 6 | 7 | mlHostName1 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/partitions/databases/schemas-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%SCHEMAS_DATABASE%%" 3 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/privileges-with-roles/security/privileges/privilege-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "privilege-name": "sample-app-execute-1", 3 | "action": "urn:sample-app:privilege:1", 4 | "kind": "execute", 5 | "role": [ 6 | "sample-app-role1", 7 | "manage-user" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/privileges-with-roles/security/privileges/privilege-2.xml: -------------------------------------------------------------------------------- 1 | 2 | sample-app-xml-privilege 3 | urn:sample-app:privilege:xml 4 | execute 5 | 6 | sample-app-role1 7 | rest-admin 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/privileges-with-roles/security/privileges/privilege-3.json: -------------------------------------------------------------------------------- 1 | { 2 | "privilege-name": "sample-app-execute-3", 3 | "action": "urn:sample-app:privilege:3", 4 | "kind": "execute" 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/privileges-with-roles/security/roles/sample-app-role1.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name": "sample-app-role1", 3 | "privilege": [ 4 | { 5 | "privilege-name": "sample-app-execute-1", 6 | "action": "urn:sample-app:privilege:1", 7 | "kind": "execute" 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/qbac-json-role/security/roles/a-qbac-role.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name": "a-qbac-role", 3 | "description": "testing", 4 | "capability-query": [ 5 | { 6 | "capability": "read", 7 | "query": { 8 | "word-query": { 9 | "text": { 10 | "lang": "en", 11 | "_value": "hello" 12 | } 13 | } 14 | } 15 | }, 16 | { 17 | "capability": "update", 18 | "query": { 19 | "word-query": { 20 | "text": { 21 | "lang": "en", 22 | "_value": "world" 23 | } 24 | } 25 | } 26 | } 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/qbac-xml-role/security/roles/a-qbac-xml-role.xml: -------------------------------------------------------------------------------- 1 | 2 | a-qbac-xml-role 3 | 4 | 5 | read 6 | 7 | 8 | hello 9 | 10 | 11 | 12 | 13 | update 14 | 15 | 16 | world 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/real-amp/security/amps/get-host-status.json: -------------------------------------------------------------------------------- 1 | { 2 | "namespace": "urn:sampleapp", 3 | "local-name": "get-host-status", 4 | "document-uri": "/ext/sample-lib.xqy", 5 | "modules-database": "%%MODULES_DATABASE%%", 6 | "role": ["admin"] 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/real-amp/security/users/jane.xml: -------------------------------------------------------------------------------- 1 | 2 | sample-app-jane 3 | password 4 | 5 | rest-admin 6 | 7 | temporal-admin 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/rest-api-custom-filename/my-custom-rest-api-update.json: -------------------------------------------------------------------------------- 1 | { 2 | "server-name": "my-custom-rest-api", 3 | "default-error-format": "json" 4 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/rest-api-custom-filename/my-custom-rest-api.json: -------------------------------------------------------------------------------- 1 | { 2 | "rest-api": { 3 | "name": "my-custom-rest-api", 4 | "group": "%%GROUP%%", 5 | "database": "my-custom-content", 6 | "modules-database": "my-custom-modules", 7 | "port": "%%PORT%%", 8 | "xdbc-enabled": true, 9 | "forests-per-host": 1, 10 | "error-format": "xml" 11 | } 12 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/rest-api-different-rewriter/rest-api.json: -------------------------------------------------------------------------------- 1 | { 2 | "rest-api": { 3 | "name": "%%NAME%%", 4 | "group": "%%GROUP%%", 5 | "database": "%%DATABASE%%", 6 | "modules-database": "%%MODULES_DATABASE%%", 7 | "port": "%%PORT%%", 8 | "xdbc-enabled": true, 9 | "forests-per-host": 1, 10 | "error-format": "json" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/rest-api-different-rewriter/servers/rest-api-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "server-name": "%%NAME%%", 3 | "url-rewriter": "/my/custom/rewriter.xml" 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/rest-api-other-group/groups/group.json: -------------------------------------------------------------------------------- 1 | { 2 | "group-name": "ml-app-deployer-other-group" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/rest-api-other-group/rest-api.json: -------------------------------------------------------------------------------- 1 | { 2 | "rest-api": { 3 | "name": "%%NAME%%", 4 | "group": "ml-app-deployer-other-group", 5 | "database": "%%DATABASE%%", 6 | "modules-database": "%%MODULES_DATABASE%%", 7 | "port": "%%PORT%%", 8 | "xdbc-enabled": true, 9 | "forests-per-host": 1, 10 | "error-format": "json" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/role-refers-to-itself/security/roles/sample-json-role.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name": "sample-app-json-role", 3 | "permission": [ 4 | { 5 | "role-name": "sample-app-json-role", 6 | "capability": "read" 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/role-refers-to-itself/security/roles/sample-xml-role.xml: -------------------------------------------------------------------------------- 1 | 2 | sample-app-xml-role 3 | 4 | 5 | sample-app-xml-role 6 | read 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/role-with-privilege-config/security/privileges/privilege-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "privilege-name":"sample-app-execute-1", 3 | "action": "urn:sample-app:privilege:1", 4 | "kind":"execute" 5 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/role-with-privilege-config/security/roles/sample-app-role1.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name": "sample-app-role1", 3 | "privilege": [ 4 | { 5 | "privilege-name": "sample-app-execute-1", 6 | "action": "urn:sample-app:privilege:1", 7 | "kind":"execute" 8 | } 9 | ] 10 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/roles-with-circular-dependencies/security/roles/role0.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name": "sample-app-role0", 3 | "role": [ 4 | "sample-app-role1" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/roles-with-circular-dependencies/security/roles/role1.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name": "sample-app-role1", 3 | "role": [ 4 | "sample-app-role0" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/roles-with-dependencies/security/roles/role0.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name": "sample-app-role0", 3 | "role": [ 4 | "sample-app-role1", 5 | "sample-app-role2", 6 | "sample-app-role3", 7 | "sample-app-role4", 8 | "sample-app-role5" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/roles-with-dependencies/security/roles/role1.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name": "sample-app-role1", 3 | "role": [ 4 | "sample-app-role2", 5 | "sample-app-role3" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/roles-with-dependencies/security/roles/role2.xml: -------------------------------------------------------------------------------- 1 | 2 | sample-app-role2 3 | 4 | sample-app-role3 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/roles-with-dependencies/security/roles/role3.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name": "sample-app-role3" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/roles-with-dependencies/security/roles/role4.xml: -------------------------------------------------------------------------------- 1 | 2 | sample-app-role4 3 | 4 | sample-app-role1 5 | sample-app-role2 6 | sample-app-role3 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/roles-with-dependencies/security/roles/role5.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name": "sample-app-role5", 3 | "role": [ 4 | "sample-app-role1", 5 | "sample-app-role2", 6 | "sample-app-role3", 7 | "sample-app-role4" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/roles-with-permissions/security/roles/sampleapp-install.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name" : "sampleapp-install", 3 | "permission" : [ { 4 | "role-name" : "sampleapp-modules", 5 | "capability" : "execute" 6 | }, { 7 | "role-name" : "sampleapp-install", 8 | "capability" : "update" 9 | }, { 10 | "role-name" : "sampleapp-install", 11 | "capability" : "insert" 12 | }, { 13 | "role-name" : "sampleapp-modules", 14 | "capability" : "read" 15 | } ] 16 | } 17 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/roles-with-permissions/security/roles/sampleapp-modules.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name" : "sampleapp-modules" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/single-server/servers/http-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "server-name": "%%NAME%%-http", 3 | "server-type": "http", 4 | "root": "/", 5 | "group-name": "%%GROUP%%", 6 | "port": %%HTTP_PORT%%, 7 | "modules-database": "Modules", 8 | "content-database": "Documents" 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/cpf/cpf-configs/sample-app-cpf-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "domain-name": "sample-app-domain-1", 3 | "restart-user-name": "admin", 4 | "eval-module": "%%MODULES_DATABASE%%", 5 | "eval-root": "/", 6 | "conversion-enabled": false, 7 | "permission": [{ 8 | "role-name": "app-user", 9 | "capability": "read" 10 | }] 11 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/cpf/domains/domain-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "domain-name": "sample-app-domain-1", 3 | "description": "Test domain for sample app", 4 | "scope": "directory", 5 | "uri": "/sample-app-1/", 6 | "depth": "infinity", 7 | "eval-module": "%%MODULES_DATABASE%%", 8 | "eval-root": "/", 9 | "pipeline":["sample-app-pipeline-1"] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/cpf/domains/domain-2.xml: -------------------------------------------------------------------------------- 1 | 2 | sample-app-domain-2 3 | Test domain for sample app 4 | directory 5 | /sample-app-2/ 6 | infinity 7 | %%MODULES_DATABASE%% 8 | / 9 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/cpf/pipelines/pipeline-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "pipeline-name": "sample-app-pipeline-1", 3 | "pipeline-description": "Sample app pipeline", 4 | "success-action": { 5 | "module": "/MarkLogic/cpf/actions/success-action.xqy" 6 | }, 7 | "failure-action": { 8 | "module": "/marklogic/cpf/actions/failure-action.xqy" 9 | }, 10 | "status-transition": [ 11 | { 12 | "annotation": "Currently just a copy of the first transition in Status Change Handling", 13 | "status": "created", 14 | "on-success": "http://marklogic.com/states/initial", 15 | "priority": 500, 16 | "default-action": { 17 | "module": "/marklogic/cpf/actions/set-updated-action.xqy" 18 | }, 19 | "execute": [ 20 | { 21 | "condition": { 22 | "module": "/marklogic/cpf/actions/changed-type-condition.xqy" 23 | }, 24 | "action": { 25 | "module": "/marklogic/cpf/actions/success-action.xqy" 26 | } 27 | } 28 | ] 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/databases/content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%DATABASE%%", 3 | "range-element-index": [ 4 | { 5 | "collation": "http://marklogic.com/collation/", 6 | "invalid-values": "reject", 7 | "localname": "id", 8 | "namespace-uri": "urn:sampleapp", 9 | "range-value-positions": false, 10 | "scalar-type": "string" 11 | }, 12 | { 13 | "collation": "", 14 | "invalid-values": "reject", 15 | "localname": "amount", 16 | "namespace-uri": "", 17 | "range-value-positions": false, 18 | "scalar-type": "int" 19 | } 20 | ], 21 | "triple-index":true, 22 | "collection-lexicon":true, 23 | "triggers-database": "%%TRIGGERS_DATABASE%%", 24 | "schema-database": "%%SCHEMAS_DATABASE%%" 25 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/databases/schemas-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%SCHEMAS_DATABASE%%" 3 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/databases/triggers-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%TRIGGERS_DATABASE%%" 3 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/forests/content-forest.json: -------------------------------------------------------------------------------- 1 | { 2 | "forest-name": "%%FOREST_NAME%%", 3 | "host": "%%FOREST_HOST%%", 4 | "database": "%%DATABASE%%" 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/groups/sample-app-group.json: -------------------------------------------------------------------------------- 1 | { 2 | "group-name": "sample-app-group", 3 | "metering-enabled": false 4 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/mimetypes/ditamap.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"application/ditamap+xml", 3 | "extension":["ditamap"], 4 | "format":"xml" 5 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/rest-api.json: -------------------------------------------------------------------------------- 1 | { 2 | "rest-api": { 3 | "name": "%%NAME%%", 4 | "group": "%%GROUP%%", 5 | "database": "%%DATABASE%%", 6 | "modules-database": "%%MODULES_DATABASE%%", 7 | "port": "%%PORT%%", 8 | "xdbc-enabled": true, 9 | "forests-per-host": 3, 10 | "error-format": "json" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/security/amps/amp-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "namespace": "http://example.com/uri", 3 | "local-name": "ml-app-deployer-test-1", 4 | "document-uri": "/module/path/name", 5 | "modules-database": "Modules", 6 | "role": ["app-user"] 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/security/amps/amp-2.xml: -------------------------------------------------------------------------------- 1 | 2 | ml-app-deployer-test-2 3 | /module/path/name2 4 | http://example.com/uri 5 | 6 | app-user 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/security/certificate-authorities/server.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIC3TCCAkYCCQCJtpKDQbobyTANBgkqhkiG9w0BAQsFADCBsjELMAkGA1UEBhMC 3 | VVMxCzAJBgNVBAgMAlRYMQ8wDQYDVQQHDAZBdXN0aW4xHjAcBgNVBAoMFU1hcmtM 4 | b2dpYyBDb3Jwb3JhdGlvbjEXMBUGA1UECwwOVFggRW5naW5lZXJpbmcxITAfBgNV 5 | BAMMGE1hcmtMb2dpYyBUWCBFbmdpbmVlcmluZzEpMCcGCSqGSIb3DQEJARYabm9y 6 | bWFuLndhbHNoQG1hcmtsb2dpYy5jb20wHhcNMTQwODI3MTkyMzQyWhcNMTUwODI3 7 | MTkyMzQyWjCBsjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAlRYMQ8wDQYDVQQHDAZB 8 | dXN0aW4xHjAcBgNVBAoMFU1hcmtMb2dpYyBDb3Jwb3JhdGlvbjEXMBUGA1UECwwO 9 | VFggRW5naW5lZXJpbmcxITAfBgNVBAMMGE1hcmtMb2dpYyBUWCBFbmdpbmVlcmlu 10 | ZzEpMCcGCSqGSIb3DQEJARYabm9ybWFuLndhbHNoQG1hcmtsb2dpYy5jb20wgZ8w 11 | DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAJSo3wFMDvTV7Q+4NDDMu9aJZ6uK4l8b 12 | ACIk5/Ug+MoST+CuIfeBlb2Y6dxNCwkADwVPpykslDcHYFygxFIcnHHVhgqZ0xzu 13 | LPXBagXmHyj+mb6im1tkbqAxQ7gj/SDeCnQYRIwNRlGgWZJFViaYJH3CC8G/f16F 14 | IhDyQS3h28W3AgMBAAEwDQYJKoZIhvcNAQELBQADgYEAWbidV4huPlf8Ac0c3Cbs 15 | Nx2xogODSjNPKqwug0Y3jKx33uxeY7i9oParWSnVFkG0JYUZEfrO5fmtS6JSA1Lk 16 | e3BioC9xgclEYFiDoZSARasL8hdNvu7v+EYZEnS43rR4M7CQiq/Tf50o4VjiVM9S 17 | I0Bo+VZSaShQKipBEHS8sP8= 18 | -----END CERTIFICATE----- -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/security/certificate-templates/template-1.xml: -------------------------------------------------------------------------------- 1 | 2 | sample-app-template 3 | Sample description 4 | rsa 5 | 6 | 7 | 0 8 | 9 | US 10 | VA 11 | McLean 12 | MarkLogic 13 | Consulting 14 | nobody@marklogic.com 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/security/credentials/credentials-aws.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "aws", 3 | "access-key": "AWS-ACCESS-KEY", 4 | "secret-key": "SECRET-KEY" 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/security/credentials/credentials-azure.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | AZURE-STORAGE-ACCOUNT 4 | STORAGE-KEY 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/security/external-security/external-security-1.xml: -------------------------------------------------------------------------------- 1 | 2 | sample-app-external-security 3 | 4 | ldap 5 | 300 6 | internal 7 | ldap://localhost:389 8 | base 9 | ou 10 | guest 11 | password 12 | MD5 13 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/security/privileges/privilege-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "privilege-name":"sample-app-execute-1", 3 | "action": "urn:sample-app:privilege:1", 4 | "kind":"execute" 5 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/security/privileges/privilege-2.json: -------------------------------------------------------------------------------- 1 | { 2 | "privilege-name":"sample-app-execute-2", 3 | "action": "urn:sample-app:privilege:2", 4 | "kind":"execute" 5 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/security/protected-collections/collection-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "collection": "sample-app-collection#stuff", 3 | "permission": [ 4 | { 5 | "role-name": "view-admin", 6 | "capability": "read" 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/security/protected-collections/collection-2.xml: -------------------------------------------------------------------------------- 1 | 2 | http://example.org 3 | 4 | 5 | domain-management 6 | update 7 | 8 | 9 | domain-management 10 | read 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/security/protected-paths/path-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "path-expression": "/test:element", 3 | "path-namespace": [ 4 | { 5 | "prefix": "test", 6 | "namespace-uri": "http://marklogic.com" 7 | } 8 | ], 9 | "permission": [ 10 | { 11 | "role-name": "view-admin", 12 | "capability": "read" 13 | } 14 | ], 15 | "path-set": "the path set" 16 | } 17 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/security/query-rolesets/queryset-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name": [ 3 | "view-admin", 4 | "flexrep-user" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/security/roles/sample-app-role1.json: -------------------------------------------------------------------------------- 1 | { 2 | /* Test */ 3 | "role-name": "sample-app-role1" 4 | // Another test 5 | 6 | /* Even more 7 | 8 | 9 | testing */ 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/security/roles/sample-app-role2.xml: -------------------------------------------------------------------------------- 1 | 2 | sample-app-role2 3 | 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/security/secure-credentials/secure-credentials-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sec-creds1", 3 | "description": "Secure Credentials", 4 | "username": "sample-app-jane", 5 | "password": "password", 6 | "signing": false, 7 | "target": [ 8 | { 9 | "uri-pattern": "http://.*:8080/test/", 10 | "authentication": "basic" 11 | }, 12 | { 13 | "uri-pattern": "https://.*:443/test/", 14 | "authentication": "basic" 15 | } 16 | ], 17 | "permission": [ 18 | { 19 | "role-name": "rest-reader", 20 | "capability": "read" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/security/users/jane.json: -------------------------------------------------------------------------------- 1 | { 2 | "user-name":"sample-app-jane", 3 | "password": "password", 4 | "description": "temporal-admin is granted so the user can hit /v1/eval, as that grants the xdbc-eval privilege", 5 | "role": ["rest-reader", "rest-extension-user", "temporal-admin"] 6 | } 7 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/security/users/john.json: -------------------------------------------------------------------------------- 1 | { 2 | "user-name":"sample-app-john", 3 | "password": "password", 4 | "description": "CUSTOM_TOKEN_FOR_JOHN_DESCRIPTION" 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/servers/odbc-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "server-name": "%%NAME%%-odbc", 3 | "server-type": "odbc", 4 | "root": "/", 5 | "group-name": "%%GROUP%%", 6 | "port": 8048, 7 | "modules-database": "Modules", 8 | "content-database": "%%DATABASE%%" 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/servers/rest-api-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "server-name": "%%NAME%%", 3 | "authentication": "basic" 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/task-servers/task-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "threads": 32, 3 | "log-errors": false, 4 | "debug-allow": false, 5 | "profile-allow": false 6 | } 7 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/tasks/task-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "task-enabled":true, 3 | "task-path":"/path/to/query.xqy", 4 | "task-root":"/", 5 | "task-type":"weekly", 6 | "task-period":2, 7 | "task-day":["tuesday"], 8 | "task-start-time":"12:00:00", 9 | "task-database":"Documents", 10 | "task-modules":"", 11 | "task-user":"nobody" 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/temporal/axis/temporal-system-axis.json: -------------------------------------------------------------------------------- 1 | { 2 | "axis-name": "system", 3 | "axis-start": { 4 | "element-reference": { 5 | "namespace-uri": "", 6 | "localname": "systemStart" 7 | } 8 | }, 9 | "axis-end": { 10 | "element-reference": { 11 | "namespace-uri": "", 12 | "localname": "systemEnd" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/temporal/axis/temporal-valid-axis.json: -------------------------------------------------------------------------------- 1 | { 2 | "axis-name": "valid", 3 | "axis-start": { 4 | "element-reference": { 5 | "namespace-uri": "", 6 | "localname": "validStart" 7 | } 8 | }, 9 | "axis-end": { 10 | "element-reference": { 11 | "namespace-uri": "", 12 | "localname": "validEnd" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/temporal/collections/lsqt/temporal-collection-lsqt.json: -------------------------------------------------------------------------------- 1 | { 2 | "lsqt-enabled": true, 3 | "automation": { 4 | "enabled": true, 5 | "period": 5000 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/temporal/collections/temporal-collection.json: -------------------------------------------------------------------------------- 1 | { 2 | "collection-name": "temporal-collection", 3 | "system-axis": "system", 4 | "valid-axis": "valid" 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-config/triggers/my-trigger.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "my-trigger", 3 | "description": "my trigger", 4 | "event": { 5 | "data-event": { 6 | "directory-scope": { 7 | "uri": "/myDir/", 8 | "depth": "1" 9 | }, 10 | "document-content": { 11 | "update-kind": "create" 12 | }, 13 | "when": "post-commit" 14 | } 15 | }, 16 | "module": "/test.xqy", 17 | "module-db": "Modules", 18 | "module-root": "/modules/", 19 | "enabled": true, 20 | "recursive": true, 21 | "task-priority": "normal" 22 | } 23 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-data/child/collections.properties: -------------------------------------------------------------------------------- 1 | test2.xml=xml-data 2 | test3.txt=text-data 3 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-data/child/permissions.properties: -------------------------------------------------------------------------------- 1 | test3.txt=%%roleName%%,read,%%roleName%%,update 2 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-data/child/test2.xml: -------------------------------------------------------------------------------- 1 | world 2 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-data/child/test3.txt: -------------------------------------------------------------------------------- 1 | Hello world. 2 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-data/test1.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello": "%%TOKEN_TEST%%" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-modules/ext/lib/test.xqy: -------------------------------------------------------------------------------- 1 | 2 | @ml.COLOR 3 | @ml.DESCRIPTION 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-modules/ext/lib/test2.xqy: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-modules/ext/sample-lib.xqy: -------------------------------------------------------------------------------- 1 | xquery version "1.0-ml"; 2 | 3 | module namespace sample = "urn:sampleapp"; 4 | 5 | declare function echo($str as xs:string?) as xs:string 6 | { 7 | "You said: " || $str 8 | }; 9 | 10 | declare function get-host-status() 11 | { 12 | xdmp:host-status(xdmp:host()) 13 | }; 14 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-modules/options/sample-app-options.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | sample-app-docs 5 | 6 | 7 | unfiltered 8 | 0 9 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-modules/services/sql.xqy: -------------------------------------------------------------------------------- 1 | xquery version "1.0-ml"; 2 | 3 | module namespace service = "http://marklogic.com/rest-api/resource/sql"; 4 | 5 | declare function get( 6 | $context as map:map, 7 | $params as map:map 8 | ) as document-node()* 9 | { 10 | document { 11 | xdmp:sql( 12 | map:get($params, "query"), 13 | "array" 14 | ) 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-schemas/.do-not-load: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marklogic/ml-app-deployer/416e792f144e4bcf3ec0f307892e74fe4e069de6/src/test/resources/sample-app/src/main/ml-schemas/.do-not-load -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-schemas/my.rules: -------------------------------------------------------------------------------- 1 | # Copyright 2014-2016 MarkLogic Corporation. All Rights Reserved. 2 | 3 | prefix rdf: 4 | prefix rdfs: 5 | 6 | tbox { 7 | ?p rdfs:domain ?c . 8 | } 9 | 10 | rule "domain axioms" construct { 11 | rdfs:domain rdfs:domain rdf:Property . 12 | rdfs:domain rdfs:range rdfs:Class . 13 | } {} 14 | 15 | rule "domain rdfs2" construct { 16 | ?x a ?c 17 | } { 18 | ?x ?p ?y . 19 | ?p rdfs:domain ?c 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/ml-schemas/x.xsd: -------------------------------------------------------------------------------- 1 | 2 | %%replaceMe%% 3 | 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/src/main/more-data/test4.json: -------------------------------------------------------------------------------- 1 | { 2 | "more": "data" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/static-check-modules/ext/bad.xqy: -------------------------------------------------------------------------------- 1 | let $x := 2 | return () 3 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/subdatabases/databases/content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%DATABASE%%", 3 | "triggers-database": "%%TRIGGERS_DATABASE%%", 4 | "schema-database": "%%SCHEMAS_DATABASE%%", 5 | "range-element-index" : [ 6 | { 7 | "invalid-values" : "reject", 8 | "collation" : "http://marklogic.com/collation/", 9 | "localname" : "FirstName", 10 | "namespace-uri" : "http://person", 11 | "range-value-positions" : false, 12 | "scalar-type" : "string" 13 | }, 14 | { 15 | "invalid-values" : "reject", 16 | "collation" : "", 17 | "localname" : "BirthDate", 18 | "namespace-uri" : "http://person", 19 | "range-value-positions" : false, 20 | "scalar-type" : "dateTime" 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/subdatabases/databases/my-super-db.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "mysuperdb", 3 | "triggers-database": "%%TRIGGERS_DATABASE%%", 4 | "schema-database": "%%SCHEMAS_DATABASE%%", 5 | "range-element-index" : [ 6 | { 7 | "invalid-values" : "reject", 8 | "collation" : "http://marklogic.com/collation/", 9 | "localname" : "FirstName", 10 | "namespace-uri" : "http://person", 11 | "range-value-positions" : false, 12 | "scalar-type" : "string" 13 | }, 14 | { 15 | "invalid-values" : "reject", 16 | "collation" : "", 17 | "localname" : "BirthDate", 18 | "namespace-uri" : "http://person", 19 | "range-value-positions" : false, 20 | "scalar-type" : "dateTime" 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/subdatabases/databases/schemas-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%SCHEMAS_DATABASE%%" 3 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/subdatabases/databases/subdatabases/mysuperdb/mysuperdb-subdb01.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "mysuperdb-subdb01", 3 | "range-element-index" : [ 4 | { 5 | "invalid-values" : "reject", 6 | "collation" : "http://marklogic.com/collation/", 7 | "localname" : "FirstName", 8 | "namespace-uri" : "http://person", 9 | "range-value-positions" : false, 10 | "scalar-type" : "string" 11 | }, 12 | { 13 | "invalid-values" : "reject", 14 | "collation" : "", 15 | "localname" : "BirthDate", 16 | "namespace-uri" : "http://person", 17 | "range-value-positions" : false, 18 | "scalar-type" : "dateTime" 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/subdatabases/databases/subdatabases/mysuperdb/mysuperdb-subdb02.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "mysuperdb-subdb02", 3 | "range-element-index" : [ 4 | { 5 | "invalid-values" : "reject", 6 | "collation" : "http://marklogic.com/collation/", 7 | "localname" : "FirstName", 8 | "namespace-uri" : "http://person", 9 | "range-value-positions" : false, 10 | "scalar-type" : "string" 11 | }, 12 | { 13 | "invalid-values" : "reject", 14 | "collation" : "", 15 | "localname" : "BirthDate", 16 | "namespace-uri" : "http://person", 17 | "range-value-positions" : false, 18 | "scalar-type" : "dateTime" 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/subdatabases/databases/subdatabases/sample-app-content/sample-app-content-subdb01.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "sample-app-content-subdb01", 3 | "range-element-index" : [ 4 | { 5 | "invalid-values" : "reject", 6 | "collation" : "http://marklogic.com/collation/", 7 | "localname" : "FirstName", 8 | "namespace-uri" : "http://person", 9 | "range-value-positions" : false, 10 | "scalar-type" : "string" 11 | }, 12 | { 13 | "invalid-values" : "reject", 14 | "collation" : "", 15 | "localname" : "BirthDate", 16 | "namespace-uri" : "http://person", 17 | "range-value-positions" : false, 18 | "scalar-type" : "dateTime" 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/subdatabases/databases/subdatabases/sample-app-content/sample-app-content-subdb02.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "sample-app-content-subdb02", 3 | "range-element-index" : [ 4 | { 5 | "invalid-values" : "reject", 6 | "collation" : "http://marklogic.com/collation/", 7 | "localname" : "FirstName", 8 | "namespace-uri" : "http://person", 9 | "range-value-positions" : false, 10 | "scalar-type" : "string" 11 | }, 12 | { 13 | "invalid-values" : "reject", 14 | "collation" : "", 15 | "localname" : "BirthDate", 16 | "namespace-uri" : "http://person", 17 | "range-value-positions" : false, 18 | "scalar-type" : "dateTime" 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/subdatabases/databases/triggers-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%TRIGGERS_DATABASE%%" 3 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/tasks-disabled/tasks/disabled-task.json: -------------------------------------------------------------------------------- 1 | { 2 | "task-enabled": false, 3 | "task-path": "/this/should/be/disabled.xqy", 4 | "task-root": "/", 5 | "task-type": "weekly", 6 | "task-period": 2, 7 | "task-day": [ 8 | "tuesday" 9 | ], 10 | "task-start-time": "12:00:00", 11 | "task-database": "Documents", 12 | "task-modules": "", 13 | "task-user": "nobody" 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/tasks-in-child-dir/groups/group1-task.json: -------------------------------------------------------------------------------- 1 | { 2 | "group-name": "sampleAppGroup1", 3 | "metering-enabled": false 4 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/tasks-in-child-dir/tasks/default-group-task.json: -------------------------------------------------------------------------------- 1 | { 2 | "task-enabled":true, 3 | "task-path":"/path/to/query.xqy", 4 | "task-root":"/", 5 | "task-type":"weekly", 6 | "task-period":2, 7 | "task-day":["tuesday"], 8 | "task-start-time":"12:00:00", 9 | "task-database":"Documents", 10 | "task-modules":"", 11 | "task-user":"nobody" 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/tasks-in-child-dir/tasks/sampleAppGroup1/group1-task.json: -------------------------------------------------------------------------------- 1 | { 2 | "task-enabled":true, 3 | "task-path":"/path/to/other-query.xqy", 4 | "task-root":"/", 5 | "task-type":"weekly", 6 | "task-period":2, 7 | "task-day":["tuesday"], 8 | "task-start-time":"12:00:00", 9 | "task-database":"Documents", 10 | "task-modules":"", 11 | "task-user":"nobody" 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/tasks-with-same-path/tasks/task-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "task-enabled":true, 3 | "task-path":"/path/to/query.xqy", 4 | "task-root":"/", 5 | "task-type":"weekly", 6 | "task-period":2, 7 | "task-day":["tuesday"], 8 | "task-start-time":"12:00:00", 9 | "task-database":"Documents", 10 | "task-modules":"", 11 | "task-user":"nobody" 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/tasks-with-same-path/tasks/task-2.json: -------------------------------------------------------------------------------- 1 | { 2 | "task-enabled":true, 3 | "task-path":"/path/to/query.xqy", 4 | "task-root":"/", 5 | "task-type":"weekly", 6 | "task-period":2, 7 | "task-day":["tuesday"], 8 | "task-start-time":"12:00:00", 9 | "task-database":"Modules", 10 | "task-modules":"", 11 | "task-user":"nobody" 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/tasks-with-same-path/tasks/task-3.json: -------------------------------------------------------------------------------- 1 | { 2 | "task-enabled":true, 3 | "task-path":"/path/to/query.xqy", 4 | "task-root":"/differentPath", 5 | "task-type":"weekly", 6 | "task-period":2, 7 | "task-day":["tuesday"], 8 | "task-start-time":"12:00:00", 9 | "task-database":"Modules", 10 | "task-modules":"", 11 | "task-user":"nobody" 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/tasks-with-same-path/tasks/task-4.json: -------------------------------------------------------------------------------- 1 | { 2 | "task-enabled":true, 3 | "task-path":"/path/to/query.xqy", 4 | "task-root":"/differentPath", 5 | "task-type":"weekly", 6 | "task-period":3, 7 | "task-day":["tuesday"], 8 | "task-start-time":"12:00:00", 9 | "task-database":"Modules", 10 | "task-modules":"", 11 | "task-user":"nobody" 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/tde-validation/databases/content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name" : "%%DATABASE%%", 3 | "schema-database": "%%SCHEMAS_DATABASE%%" 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/tde-validation/databases/sample-app-schemas/schemas/tde/bad-template.json: -------------------------------------------------------------------------------- 1 | { 2 | "template": { 3 | "context": "/example", 4 | "description": "This is a description with quotes in it '\"", 5 | "collections": [ 6 | "example" 7 | ], 8 | "rows": [ 9 | { 10 | "schemaName": "Example", 11 | "viewName": "default", 12 | "columns": [ 13 | { 14 | "name": "Id", 15 | "scalarType": "string", 16 | "val": "Id" 17 | }, 18 | { 19 | "name": "DuplicateColumn", 20 | "scalarType": "string", 21 | "val": "DuplicateColumn" 22 | }, 23 | { 24 | "name": "DuplicateColumn", 25 | "scalarType": "string", 26 | "val": "DuplicateColumn" 27 | } 28 | ] 29 | } 30 | ] 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/tde-validation/databases/schemas-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%SCHEMAS_DATABASE%%" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/temporal-config-with-lsqt/databases/content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%DATABASE%%", 3 | "schema-database": "%%SCHEMAS_DATABASE%%", 4 | "range-element-index": [ 5 | { 6 | "collation": "", 7 | "invalid-values": "reject", 8 | "localname": "validStart", 9 | "namespace-uri": "", 10 | "range-value-positions": false, 11 | "scalar-type": "dateTime" 12 | } 13 | , 14 | { 15 | "collation": "", 16 | "invalid-values": "reject", 17 | "localname": "validEnd", 18 | "namespace-uri": "", 19 | "range-value-positions": false, 20 | "scalar-type": "dateTime" 21 | } 22 | , 23 | { 24 | "collation": "", 25 | "invalid-values": "reject", 26 | "localname": "systemStart", 27 | "namespace-uri": "", 28 | "range-value-positions": false, 29 | "scalar-type": "dateTime" 30 | } 31 | , 32 | { 33 | "collation": "", 34 | "invalid-values": "reject", 35 | "localname": "systemEnd", 36 | "namespace-uri": "", 37 | "range-value-positions": false, 38 | "scalar-type": "dateTime" 39 | } 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/temporal-config-with-lsqt/databases/other-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "other-%%DATABASE%%", 3 | "schema-database": "other-%%SCHEMAS_DATABASE%%", 4 | "range-element-index": [ 5 | { 6 | "collation": "", 7 | "invalid-values": "reject", 8 | "localname": "validStart", 9 | "namespace-uri": "", 10 | "range-value-positions": false, 11 | "scalar-type": "dateTime" 12 | } 13 | , 14 | { 15 | "collation": "", 16 | "invalid-values": "reject", 17 | "localname": "validEnd", 18 | "namespace-uri": "", 19 | "range-value-positions": false, 20 | "scalar-type": "dateTime" 21 | } 22 | , 23 | { 24 | "collation": "", 25 | "invalid-values": "reject", 26 | "localname": "systemStart", 27 | "namespace-uri": "", 28 | "range-value-positions": false, 29 | "scalar-type": "dateTime" 30 | } 31 | , 32 | { 33 | "collation": "", 34 | "invalid-values": "reject", 35 | "localname": "systemEnd", 36 | "namespace-uri": "", 37 | "range-value-positions": false, 38 | "scalar-type": "dateTime" 39 | } 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/temporal-config-with-lsqt/databases/other-sample-app-content/temporal/axes/temporal-system-axis.json: -------------------------------------------------------------------------------- 1 | { 2 | "axis-name": "system", 3 | "axis-start": { 4 | "element-reference": { 5 | "namespace-uri": "", 6 | "localname": "systemStart" 7 | } 8 | }, 9 | "axis-end": { 10 | "element-reference": { 11 | "namespace-uri": "", 12 | "localname": "systemEnd" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/temporal-config-with-lsqt/databases/other-sample-app-content/temporal/axes/temporal-valid-axis.json: -------------------------------------------------------------------------------- 1 | { 2 | "axis-name": "valid", 3 | "axis-start": { 4 | "element-reference": { 5 | "namespace-uri": "", 6 | "localname": "validStart" 7 | } 8 | }, 9 | "axis-end": { 10 | "element-reference": { 11 | "namespace-uri": "", 12 | "localname": "validEnd" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/temporal-config-with-lsqt/databases/other-sample-app-content/temporal/collections/lsqt/temporal-collection.json: -------------------------------------------------------------------------------- 1 | { 2 | "lsqt-enabled": true, 3 | "automation": { 4 | "enabled": true, 5 | "period": 5000 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/temporal-config-with-lsqt/databases/other-sample-app-content/temporal/collections/temporal-collection.json: -------------------------------------------------------------------------------- 1 | { 2 | "collection-name": "temporal-collection", 3 | "system-axis": "system", 4 | "valid-axis": "valid" 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/temporal-config-with-lsqt/databases/other-schemas-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "other-%%SCHEMAS_DATABASE%%" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/temporal-config-with-lsqt/databases/schemas-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%SCHEMAS_DATABASE%%" 3 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/temporal-config-with-lsqt/temporal/axes/temporal-system-axis.json: -------------------------------------------------------------------------------- 1 | { 2 | "axis-name": "system", 3 | "axis-start": { 4 | "element-reference": { 5 | "namespace-uri": "", 6 | "localname": "systemStart" 7 | } 8 | }, 9 | "axis-end": { 10 | "element-reference": { 11 | "namespace-uri": "", 12 | "localname": "systemEnd" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/temporal-config-with-lsqt/temporal/axes/temporal-valid-axis.json: -------------------------------------------------------------------------------- 1 | { 2 | "axis-name": "valid", 3 | "axis-start": { 4 | "element-reference": { 5 | "namespace-uri": "", 6 | "localname": "validStart" 7 | } 8 | }, 9 | "axis-end": { 10 | "element-reference": { 11 | "namespace-uri": "", 12 | "localname": "validEnd" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/temporal-config-with-lsqt/temporal/collections/lsqt/temporal-collection.json: -------------------------------------------------------------------------------- 1 | { 2 | "lsqt-enabled": true, 3 | "automation": { 4 | "enabled": true, 5 | "period": 5000 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/temporal-config-with-lsqt/temporal/collections/temporal-collection.json: -------------------------------------------------------------------------------- 1 | { 2 | "collection-name": "temporal-collection", 3 | "system-axis": "system", 4 | "valid-axis": "valid" 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/temporal-config/databases/content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%DATABASE%%", 3 | "schema-database": "%%SCHEMAS_DATABASE%%", 4 | "range-element-index": [ 5 | { 6 | "collation": "", 7 | "invalid-values": "reject", 8 | "localname": "validStart", 9 | "namespace-uri": "", 10 | "range-value-positions": false, 11 | "scalar-type": "dateTime" 12 | } 13 | , 14 | { 15 | "collation": "", 16 | "invalid-values": "reject", 17 | "localname": "validEnd", 18 | "namespace-uri": "", 19 | "range-value-positions": false, 20 | "scalar-type": "dateTime" 21 | } 22 | , 23 | { 24 | "collation": "", 25 | "invalid-values": "reject", 26 | "localname": "systemStart", 27 | "namespace-uri": "", 28 | "range-value-positions": false, 29 | "scalar-type": "dateTime" 30 | } 31 | , 32 | { 33 | "collation": "", 34 | "invalid-values": "reject", 35 | "localname": "systemEnd", 36 | "namespace-uri": "", 37 | "range-value-positions": false, 38 | "scalar-type": "dateTime" 39 | } 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/temporal-config/databases/schemas-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%SCHEMAS_DATABASE%%" 3 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/temporal-config/temporal/axes/temporal-system-axis.json: -------------------------------------------------------------------------------- 1 | { 2 | "axis-name": "system", 3 | "axis-start": { 4 | "element-reference": { 5 | "namespace-uri": "", 6 | "localname": "systemStart" 7 | } 8 | }, 9 | "axis-end": { 10 | "element-reference": { 11 | "namespace-uri": "", 12 | "localname": "systemEnd" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/temporal-config/temporal/axes/temporal-valid-axis.json: -------------------------------------------------------------------------------- 1 | { 2 | "axis-name": "valid", 3 | "axis-start": { 4 | "element-reference": { 5 | "namespace-uri": "", 6 | "localname": "validStart" 7 | } 8 | }, 9 | "axis-end": { 10 | "element-reference": { 11 | "namespace-uri": "", 12 | "localname": "validEnd" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/temporal-config/temporal/collections/temporal-collection.json: -------------------------------------------------------------------------------- 1 | { 2 | "collection-name": "temporal-collection", 3 | "system-axis": "system", 4 | "valid-axis": "valid" 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/uni-temporal-config/databases/content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%DATABASE%%", 3 | "schema-database": "%%SCHEMAS_DATABASE%%", 4 | "range-element-index": [ 5 | { 6 | "collation": "", 7 | "invalid-values": "reject", 8 | "localname": "systemStart", 9 | "namespace-uri": "", 10 | "range-value-positions": false, 11 | "scalar-type": "dateTime" 12 | } 13 | , 14 | { 15 | "collation": "", 16 | "invalid-values": "reject", 17 | "localname": "systemEnd", 18 | "namespace-uri": "", 19 | "range-value-positions": false, 20 | "scalar-type": "dateTime" 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/uni-temporal-config/databases/schemas-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%SCHEMAS_DATABASE%%" 3 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/uni-temporal-config/temporal/axes/temporal-system-axis.json: -------------------------------------------------------------------------------- 1 | { 2 | "axis-name": "system", 3 | "axis-start": { 4 | "element-reference": { 5 | "namespace-uri": "", 6 | "localname": "systemStart" 7 | } 8 | }, 9 | "axis-end": { 10 | "element-reference": { 11 | "namespace-uri": "", 12 | "localname": "systemEnd" 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/uni-temporal-config/temporal/collections/uni-temporal-collection.json: -------------------------------------------------------------------------------- 1 | { 2 | "collection-name": "uni-temporal-collection", 3 | "system-axis": "system", 4 | "option": ["updates-safe"] 5 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/users-to-not-undeploy/security/roles/admin.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name": "admin", 3 | "description": "Not clear why someone would try to modify this role, but just in case, we don't want to delete it on undeploy" 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/users-to-not-undeploy/security/roles/testRole.json: -------------------------------------------------------------------------------- 1 | { 2 | "role-name": "ml-app-deployer-test-role", 3 | "description": "This is here to make sure we can delete it" 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/users-to-not-undeploy/security/users/custom-user.json: -------------------------------------------------------------------------------- 1 | { 2 | "user-name": "ml-app-deployer-test-user", 3 | "password": "changeme" 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/users-to-not-undeploy/security/users/nobody-user.json: -------------------------------------------------------------------------------- 1 | { 2 | "user-name": "nobody" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/view-schemas/databases/content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%DATABASE%%", 3 | "range-element-index": [ 4 | { 5 | "collation": "http://marklogic.com/collation/", 6 | "invalid-values": "reject", 7 | "localname": "id", 8 | "namespace-uri": "urn:sampleapp", 9 | "range-value-positions": false, 10 | "scalar-type": "string" 11 | }, 12 | { 13 | "collation": "", 14 | "invalid-values": "reject", 15 | "localname": "amount", 16 | "namespace-uri": "", 17 | "range-value-positions": false, 18 | "scalar-type": "int" 19 | } 20 | ], 21 | "triple-index":true, 22 | "collection-lexicon":true, 23 | "schema-database": "%%SCHEMAS_DATABASE%%" 24 | } 25 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/view-schemas/databases/other-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "other-%%DATABASE%%", 3 | "schema-database": "%%SCHEMAS_DATABASE%%" 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/view-schemas/databases/other-sample-app-content/view-schemas/main-views/view-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "view-name": "ordertable", 3 | "schema-name": "main", 4 | "element-scope": {"namespace-uri":"", "localname":"order"}, 5 | "column": [ 6 | { 7 | "column-name": "amount", 8 | "element-reference": { 9 | "namespace-uri": "", 10 | "localname": "amount", 11 | "scalar-type": "int" 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/view-schemas/databases/other-sample-app-content/view-schemas/view-schema-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "view-schema-name": "main", 3 | "permission": [ 4 | { 5 | "role-name": "rest-reader", 6 | "capability": "read" 7 | }, 8 | { 9 | "role-name": "rest-writer", 10 | "capability": "update" 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/view-schemas/databases/schemas-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%SCHEMAS_DATABASE%%" 3 | } -------------------------------------------------------------------------------- /src/test/resources/sample-app/view-schemas/view-schemas/main-views/view-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "view-name": "ordertable", 3 | "schema-name": "main", 4 | "element-scope": {"namespace-uri":"", "localname":"order"}, 5 | "column": [ 6 | { 7 | "column-name": "amount", 8 | "element-reference": { 9 | "namespace-uri": "", 10 | "localname": "amount", 11 | "scalar-type": "int" 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/sample-app/view-schemas/view-schemas/view-schema-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "view-schema-name": "main", 3 | "permission": [ 4 | { 5 | "role-name": "rest-reader", 6 | "capability": "read" 7 | }, 8 | { 9 | "role-name": "rest-writer", 10 | "capability": "update" 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /src/test/resources/schemas-marklogic9/to-be-ignored/test.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/test/resources/schemas-marklogic9/x.tdej: -------------------------------------------------------------------------------- 1 | { "template": {} } -------------------------------------------------------------------------------- /src/test/resources/schemas-marklogic9/x.tdex: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/resources/schemas-project/src/main/ml-config/databases/content-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%DATABASE%%", 3 | "schema-database": "%%SCHEMAS_DATABASE%%" 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/schemas-project/src/main/ml-config/databases/schemas-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "database-name": "%%SCHEMAS_DATABASE%%" 3 | } -------------------------------------------------------------------------------- /src/test/resources/schemas-project/src/main/ml-schemas/tde/template1.json: -------------------------------------------------------------------------------- 1 | { 2 | "template": { 3 | "context": "/example", 4 | "collections": [ 5 | "example" 6 | ], 7 | "rows": [ 8 | { 9 | "schemaName": "Example", 10 | "viewName": "default", 11 | "columns": [ 12 | { 13 | "name": "Id", 14 | "scalarType": "string", 15 | "val": "Id" 16 | } 17 | ] 18 | } 19 | ] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/resources/schemas-project/src/main/more-schemas/qbv/example.sjs: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const op = require('/MarkLogic/optic'); 3 | op.fromView('Example2', 'default').generateView('qbv', 'example') 4 | -------------------------------------------------------------------------------- /src/test/resources/schemas-project/src/main/more-schemas/tde/template2.json: -------------------------------------------------------------------------------- 1 | { 2 | "template": { 3 | "context": "/example2", 4 | "collections": [ 5 | "example2" 6 | ], 7 | "rows": [ 8 | { 9 | "schemaName": "Example2", 10 | "viewName": "default", 11 | "columns": [ 12 | { 13 | "name": "Id", 14 | "scalarType": "string", 15 | "val": "Id" 16 | } 17 | ] 18 | } 19 | ] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/resources/test.properties: -------------------------------------------------------------------------------- 1 | # Properties for connecting to the Mgmt API; port 8002 is assumed 2 | # Can override these files via a gitignored "user.properties" file in this same directory 3 | mlHost=localhost 4 | 5 | # When testing MarkLogic Cloud manually, comment these out for a more realistic test (it's fine to leave them 6 | # uncommented, as they'll be ignored, it's just more realistic to comment them out). 7 | mlUsername=admin 8 | mlPassword=admin 9 | mlManagePort=8002 10 | mlAdminPort=8001 11 | 12 | # When testing MarkLogic Cloud manually, you'll need to set these in user.properties: 13 | # mlHost=the name of the host 14 | # mlCloudApiKey=the key value 15 | # mlBasePath=the base path for the Manage app server 16 | -------------------------------------------------------------------------------- /src/test/resources/token-test/ml-config/rest-api.json: -------------------------------------------------------------------------------- 1 | { 2 | "rest-api": { 3 | "name": "%%NAME%%", 4 | "group": "%%GROUP%%", 5 | "database": "%%DATABASE%%", 6 | "modules-database": "%%MODULES_DATABASE%%", 7 | "port": "%%PORT%%", 8 | "xdbc-enabled": %%xdbcEnabled%%, 9 | "error-format": "json" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/token-test/ml-modules/root/hello.xqy: -------------------------------------------------------------------------------- 1 | 2 | %%sample-token%% 3 | 4 | --------------------------------------------------------------------------------