├── .eslintrc.json ├── .gitignore ├── .gitlab-ci.yml ├── COPYRIGHT.txt ├── LICENSE.txt ├── README.md ├── VERSIONS.md ├── babel.config.json ├── conf ├── config.properties └── logging.properties ├── dmx-linux.sh ├── dmx-mac.command ├── dmx-windows.bat ├── modules-external └── about-this-directory.txt ├── modules ├── dmx-accesscontrol │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── systems │ │ │ └── dmx │ │ │ └── accesscontrol │ │ │ ├── AccessControlPlugin.java │ │ │ ├── AccessControlService.java │ │ │ ├── AnonymousAccessFilter.java │ │ │ ├── AuthorizationMethod.java │ │ │ ├── Constants.java │ │ │ ├── DeprecatedUserAccountMethods.java │ │ │ ├── event │ │ │ ├── PostLoginUser.java │ │ │ └── PostLogoutUser.java │ │ │ └── migrations │ │ │ ├── Migration2.java │ │ │ └── Migration3.java │ │ ├── js │ │ ├── accesscontrol.js │ │ ├── components │ │ │ ├── dmx-login-state.vue │ │ │ └── dmx-user-account-options.vue │ │ └── plugin.js │ │ └── resources │ │ ├── migrations │ │ └── migration1.json │ │ └── plugin.properties ├── dmx-account-management │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── systems │ │ │ │ └── dmx │ │ │ │ └── accountmanagement │ │ │ │ ├── AccountManagementPlugin.java │ │ │ │ ├── AccountManagementService.java │ │ │ │ ├── AccountManager.java │ │ │ │ ├── CheckCredentialsResult.java │ │ │ │ ├── Constants.java │ │ │ │ ├── DmxAccountManager.java │ │ │ │ └── migrations │ │ │ │ └── Migration1.java │ │ └── resources │ │ │ └── plugin.properties │ │ └── test │ │ └── java │ │ └── systems │ │ └── dmx │ │ └── accountmanagement │ │ ├── AccountManagementPluginTest.java │ │ └── CheckCredentialsResultTest.java ├── dmx-base │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── systems │ │ │ └── dmx │ │ │ └── base │ │ │ ├── Constants.java │ │ │ └── migrations │ │ │ └── Migration2.java │ │ ├── js │ │ ├── components │ │ │ ├── dmx-url-renderer.vue │ │ │ └── mixins │ │ │ │ ├── info-mode.js │ │ │ │ ├── mode.js │ │ │ │ └── object.js │ │ └── plugin.js │ │ └── resources │ │ ├── migrations │ │ ├── migration1.json │ │ └── migration2.properties │ │ └── plugin.properties ├── dmx-bookmarks │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── systems │ │ │ └── dmx │ │ │ └── bookmarks │ │ │ └── Constants.java │ │ └── resources │ │ ├── migrations │ │ └── migration1.json │ │ └── plugin.properties ├── dmx-caching │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── systems │ │ │ └── dmx │ │ │ └── caching │ │ │ └── CachingPlugin.java │ │ └── test │ │ └── java │ │ └── systems │ │ └── dmx │ │ └── caching │ │ └── CachingTest.java ├── dmx-config │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── systems │ │ │ └── dmx │ │ │ └── config │ │ │ ├── ConfigCustomizer.java │ │ │ ├── ConfigDef.java │ │ │ ├── ConfigDefs.java │ │ │ ├── ConfigModRole.java │ │ │ ├── ConfigPlugin.java │ │ │ ├── ConfigService.java │ │ │ ├── ConfigTarget.java │ │ │ ├── Constants.java │ │ │ └── migrations │ │ │ └── Migration2.java │ │ └── resources │ │ ├── migrations │ │ ├── migration1.json │ │ └── migration2.properties │ │ └── plugin.properties ├── dmx-contacts │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── systems │ │ │ └── dmx │ │ │ └── contacts │ │ │ ├── Constants.java │ │ │ ├── ContactsPlugin.java │ │ │ └── ContactsService.java │ │ ├── js │ │ ├── components │ │ │ ├── dmx-email-address-renderer.vue │ │ │ └── mixins │ │ │ │ ├── info-mode.js │ │ │ │ ├── mode.js │ │ │ │ └── object.js │ │ └── plugin.js │ │ └── resources │ │ ├── migrations │ │ ├── migration1.json │ │ └── migration2.json │ │ └── plugin.properties ├── dmx-core │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── systems │ │ │ └── dmx │ │ │ └── core │ │ │ ├── Assoc.java │ │ │ ├── AssocPlayer.java │ │ │ ├── AssocType.java │ │ │ ├── ChildTopics.java │ │ │ ├── CompDef.java │ │ │ ├── Constants.java │ │ │ ├── DMXObject.java │ │ │ ├── DMXType.java │ │ │ ├── Identifiable.java │ │ │ ├── JSONEnabled.java │ │ │ ├── Player.java │ │ │ ├── RelatedAssoc.java │ │ │ ├── RelatedObject.java │ │ │ ├── RelatedTopic.java │ │ │ ├── RoleType.java │ │ │ ├── Topic.java │ │ │ ├── TopicPlayer.java │ │ │ ├── TopicType.java │ │ │ ├── ViewConfig.java │ │ │ ├── impl │ │ │ ├── AccessLayer.java │ │ │ ├── AssocImpl.java │ │ │ ├── AssocModelImpl.java │ │ │ ├── AssocPlayerImpl.java │ │ │ ├── AssocPlayerModelImpl.java │ │ │ ├── AssocTypeImpl.java │ │ │ ├── AssocTypeModelImpl.java │ │ │ ├── ChangeReportImpl.java │ │ │ ├── ChildTopicsFetcher.java │ │ │ ├── ChildTopicsImpl.java │ │ │ ├── ChildTopicsModelImpl.java │ │ │ ├── ChildTopicsSequence.java │ │ │ ├── CompDefImpl.java │ │ │ ├── CompDefModelImpl.java │ │ │ ├── CoreEvent.java │ │ │ ├── CoreServiceImpl.java │ │ │ ├── DMXObjectImpl.java │ │ │ ├── DMXObjectModelImpl.java │ │ │ ├── DMXTypeImpl.java │ │ │ ├── EventManager.java │ │ │ ├── FacetValueModelImpl.java │ │ │ ├── InjectableService.java │ │ │ ├── InstantiationIterable.java │ │ │ ├── JerseyRequestFilter.java │ │ │ ├── JerseyResponseFilter.java │ │ │ ├── LabelCalculation.java │ │ │ ├── Messages.java │ │ │ ├── MigrationManager.java │ │ │ ├── ModelFactoryImpl.java │ │ │ ├── PlayerImpl.java │ │ │ ├── PlayerModelImpl.java │ │ │ ├── PluginImpl.java │ │ │ ├── PluginInfoImpl.java │ │ │ ├── PluginManager.java │ │ │ ├── PrivilegedAccessImpl.java │ │ │ ├── ReadableIterable.java │ │ │ ├── RelatedAssocImpl.java │ │ │ ├── RelatedAssocModelImpl.java │ │ │ ├── RelatedTopicImpl.java │ │ │ ├── RelatedTopicModelImpl.java │ │ │ ├── RestResourcesPublication.java │ │ │ ├── RoleTypeImpl.java │ │ │ ├── RoleTypeModelImpl.java │ │ │ ├── StaticResourcesPublication.java │ │ │ ├── StorageDecorator.java │ │ │ ├── TopicDeletionModelImpl.java │ │ │ ├── TopicImpl.java │ │ │ ├── TopicModelImpl.java │ │ │ ├── TopicPlayerImpl.java │ │ │ ├── TopicPlayerModelImpl.java │ │ │ ├── TopicReferenceModelImpl.java │ │ │ ├── TopicTypeImpl.java │ │ │ ├── TopicTypeModelImpl.java │ │ │ ├── TransactionFactory.java │ │ │ ├── TypeModelImpl.java │ │ │ ├── TypeStorage.java │ │ │ ├── ValueIntegrator.java │ │ │ ├── ViewAssocImpl.java │ │ │ ├── ViewConfigImpl.java │ │ │ ├── ViewConfigModelImpl.java │ │ │ ├── ViewPropsImpl.java │ │ │ ├── ViewTopicImpl.java │ │ │ ├── WebPublishingService.java │ │ │ ├── WebSocketConnectionImpl.java │ │ │ ├── WebSocketConnectionPool.java │ │ │ ├── WebSocketServiceImpl.java │ │ │ └── WebSocketServlet.java │ │ │ ├── migrations │ │ │ └── Migration4.java │ │ │ ├── model │ │ │ ├── AssocModel.java │ │ │ ├── AssocPlayerModel.java │ │ │ ├── AssocTypeModel.java │ │ │ ├── ChildTopicsModel.java │ │ │ ├── CompDefModel.java │ │ │ ├── DMXObjectModel.java │ │ │ ├── PlayerModel.java │ │ │ ├── RelatedAssocModel.java │ │ │ ├── RelatedObjectModel.java │ │ │ ├── RelatedTopicModel.java │ │ │ ├── RoleTypeModel.java │ │ │ ├── SimpleValue.java │ │ │ ├── TopicDeletionModel.java │ │ │ ├── TopicModel.java │ │ │ ├── TopicPlayerModel.java │ │ │ ├── TopicReferenceModel.java │ │ │ ├── TopicTypeModel.java │ │ │ ├── TypeModel.java │ │ │ ├── ViewConfigModel.java │ │ │ ├── facets │ │ │ │ └── FacetValueModel.java │ │ │ └── topicmaps │ │ │ │ ├── ViewAssoc.java │ │ │ │ ├── ViewProps.java │ │ │ │ └── ViewTopic.java │ │ │ ├── osgi │ │ │ ├── CoreActivator.java │ │ │ ├── PluginActivator.java │ │ │ └── PluginContext.java │ │ │ ├── service │ │ │ ├── ChangeReport.java │ │ │ ├── Cookies.java │ │ │ ├── CoreService.java │ │ │ ├── CriticalityLevel.java │ │ │ ├── DMXEvent.java │ │ │ ├── DMXException.java │ │ │ ├── Directive.java │ │ │ ├── Directives.java │ │ │ ├── DirectivesResponse.java │ │ │ ├── EventListener.java │ │ │ ├── Inject.java │ │ │ ├── Migration.java │ │ │ ├── ModelFactory.java │ │ │ ├── Plugin.java │ │ │ ├── PluginInfo.java │ │ │ ├── QueryResult.java │ │ │ ├── TopicResult.java │ │ │ ├── Transactional.java │ │ │ ├── accesscontrol │ │ │ │ ├── AccessControlException.java │ │ │ │ ├── Credentials.java │ │ │ │ ├── Operation.java │ │ │ │ ├── Permissions.java │ │ │ │ ├── PrivilegedAccess.java │ │ │ │ └── SharingMode.java │ │ │ ├── event │ │ │ │ ├── AllPluginsActive.java │ │ │ │ ├── CheckAssocReadAccess.java │ │ │ │ ├── CheckAssocWriteAccess.java │ │ │ │ ├── CheckTopicReadAccess.java │ │ │ │ ├── CheckTopicWriteAccess.java │ │ │ │ ├── IntroduceAssocType.java │ │ │ │ ├── IntroduceRoleType.java │ │ │ │ ├── IntroduceTopicType.java │ │ │ │ ├── PostCreateAssoc.java │ │ │ │ ├── PostCreateTopic.java │ │ │ │ ├── PostDeleteAssoc.java │ │ │ │ ├── PostDeleteTopic.java │ │ │ │ ├── PostUpdateAssoc.java │ │ │ │ ├── PostUpdateTopic.java │ │ │ │ ├── PreCreateAssoc.java │ │ │ │ ├── PreCreateAssocType.java │ │ │ │ ├── PreCreateRoleType.java │ │ │ │ ├── PreCreateTopic.java │ │ │ │ ├── PreCreateTopicType.java │ │ │ │ ├── PreDeleteAssoc.java │ │ │ │ ├── PreDeleteTopic.java │ │ │ │ ├── PreSendAssoc.java │ │ │ │ ├── PreSendAssocType.java │ │ │ │ ├── PreSendTopic.java │ │ │ │ ├── PreSendTopicType.java │ │ │ │ ├── PreUpdateAssoc.java │ │ │ │ ├── PreUpdateTopic.java │ │ │ │ ├── ServiceRequestFilter.java │ │ │ │ ├── ServiceResponseFilter.java │ │ │ │ ├── StaticResourceFilter.java │ │ │ │ └── WebsocketTextMessage.java │ │ │ └── websocket │ │ │ │ ├── WebSocketConnection.java │ │ │ │ └── WebSocketService.java │ │ │ ├── storage │ │ │ └── spi │ │ │ │ ├── DMXStorage.java │ │ │ │ ├── DMXStorageFactory.java │ │ │ │ └── DMXTransaction.java │ │ │ └── util │ │ │ ├── ContextTracker.java │ │ │ ├── DMXUtils.java │ │ │ ├── IdList.java │ │ │ ├── JavaUtils.java │ │ │ ├── SequencedHashMap.java │ │ │ └── UniversalExceptionMapper.java │ │ └── resources │ │ └── migrations │ │ ├── migration1.json │ │ ├── migration2.json │ │ ├── migration3.json │ │ └── migration4.properties ├── dmx-datetime │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── systems │ │ │ └── dmx │ │ │ └── datetime │ │ │ └── Constants.java │ │ ├── js │ │ ├── components │ │ │ ├── dmx-date-picker.vue │ │ │ ├── dmx-time-picker.vue │ │ │ └── mixins │ │ │ │ ├── comp-def.js │ │ │ │ ├── context.js │ │ │ │ ├── info-mode.js │ │ │ │ ├── object.js │ │ │ │ └── path.js │ │ └── plugin.js │ │ └── resources │ │ ├── migrations │ │ └── migration1.json │ │ └── plugin.properties ├── dmx-details │ └── src │ │ └── main │ │ └── js │ │ ├── details.js │ │ └── plugin.js ├── dmx-distribution │ ├── assembly.xml │ ├── bundle-deploy │ │ └── about-this-directory.txt │ ├── bundle-dev │ │ └── about-this-directory.txt │ └── pom.xml ├── dmx-events │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── systems │ │ │ └── dmx │ │ │ └── events │ │ │ ├── Constants.java │ │ │ ├── EventsPlugin.java │ │ │ └── EventsService.java │ │ └── resources │ │ ├── migrations │ │ └── migration1.json │ │ └── plugin.properties ├── dmx-facets │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── systems │ │ │ └── dmx │ │ │ └── facets │ │ │ ├── Constants.java │ │ │ ├── FacetsPlugin.java │ │ │ └── FacetsService.java │ │ └── resources │ │ ├── migrations │ │ └── migration1.json │ │ └── plugin.properties ├── dmx-features │ ├── pom.xml │ └── src │ │ └── main │ │ └── resources │ │ └── features.xml ├── dmx-files │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── systems │ │ │ │ └── dmx │ │ │ │ └── files │ │ │ │ ├── Constants.java │ │ │ │ ├── DirectoryListing.java │ │ │ │ ├── DiskQuotaCheck.java │ │ │ │ ├── FileRepositoryException.java │ │ │ │ ├── FilesPlugin.java │ │ │ │ ├── FilesService.java │ │ │ │ ├── ItemKind.java │ │ │ │ ├── PathMapper.java │ │ │ │ ├── ResourceInfo.java │ │ │ │ ├── StoredFile.java │ │ │ │ ├── UploadedFile.java │ │ │ │ ├── event │ │ │ │ └── CheckDiskQuota.java │ │ │ │ └── migrations │ │ │ │ ├── Migration3.java │ │ │ │ ├── Migration4.java │ │ │ │ ├── Migration5.java │ │ │ │ └── Migration6.java │ │ ├── js │ │ │ ├── components │ │ │ │ ├── dmx-download-iframe.vue │ │ │ │ ├── dmx-file-renderer.vue │ │ │ │ ├── dmx-file-size.vue │ │ │ │ ├── dmx-filebrowser-reveal.vue │ │ │ │ ├── dmx-folder-renderer.vue │ │ │ │ └── mixins │ │ │ │ │ ├── context.js │ │ │ │ │ └── object.js │ │ │ ├── files-rpc.js │ │ │ ├── files.js │ │ │ └── plugin.js │ │ └── resources │ │ │ ├── migrations │ │ │ ├── migration1.json │ │ │ ├── migration2.json │ │ │ ├── migration3.properties │ │ │ ├── migration4.properties │ │ │ ├── migration5.properties │ │ │ └── migration6.properties │ │ │ └── plugin.properties │ │ └── test │ │ └── java │ │ └── systems │ │ └── dmx │ │ └── files │ │ └── test │ │ └── FilesTest.java ├── dmx-help-menu │ └── src │ │ └── main │ │ └── js │ │ ├── components │ │ ├── dmx-about-box.vue │ │ └── dmx-help-menu.vue │ │ ├── dmx-logo.svg │ │ ├── help-menu.js │ │ └── plugin.js ├── dmx-hot-deploy │ └── pom.xml ├── dmx-notes │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── systems │ │ │ └── dmx │ │ │ └── notes │ │ │ └── Constants.java │ │ └── resources │ │ ├── migrations │ │ └── migration1.json │ │ └── plugin.properties ├── dmx-plugin │ └── pom.xml ├── dmx-provision │ ├── 3rd-party-bundles │ │ └── pom.xml │ ├── dmx-bundles │ │ └── pom.xml │ ├── felix-bundles │ │ └── pom.xml │ └── pom.xml ├── dmx-search │ └── src │ │ └── main │ │ ├── js │ │ ├── plugin.js │ │ └── search.js │ │ └── style │ │ └── style.css ├── dmx-storage-neo4j │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── systems │ │ │ └── dmx │ │ │ └── storage │ │ │ └── neo4j │ │ │ ├── ModelIterator.java │ │ │ ├── Neo4jStorage.java │ │ │ ├── Neo4jStorageFactory.java │ │ │ ├── Neo4jTransactionAdapter.java │ │ │ ├── NodeType.java │ │ │ └── RelationtypeCache.java │ │ └── test │ │ └── java │ │ └── systems │ │ └── dmx │ │ └── storage │ │ └── neo4j │ │ └── Neo4jStorageTest.java ├── dmx-tags │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── systems │ │ │ └── dmx │ │ │ └── tags │ │ │ └── Constants.java │ │ └── resources │ │ ├── migrations │ │ └── migration1.json │ │ └── plugin.properties ├── dmx-test │ ├── pom.xml │ └── src │ │ └── test │ │ └── java │ │ └── systems │ │ └── dmx │ │ ├── core │ │ └── impl │ │ │ ├── CoreServiceTest.java │ │ │ ├── CoreServiceTestEnvironment.java │ │ │ ├── DM5CoreServiceTest.java │ │ │ ├── EventTest.java │ │ │ ├── JavaUtilsTest.java │ │ │ └── PersonTest.java │ │ └── test │ │ ├── JSONTest.java │ │ └── JavaAPITest.java ├── dmx-timestamps │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── systems │ │ │ └── dmx │ │ │ └── timestamps │ │ │ ├── Constants.java │ │ │ ├── TimestampsPlugin.java │ │ │ └── TimestampsService.java │ │ └── test │ │ └── java │ │ └── systems │ │ └── dmx │ │ └── timestamps │ │ └── TimestampsTest.java ├── dmx-topicmaps │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── systems │ │ │ └── dmx │ │ │ └── topicmaps │ │ │ ├── Constants.java │ │ │ ├── DefaultTopicmapType.java │ │ │ ├── Messenger.java │ │ │ ├── TopicCoords.java │ │ │ ├── Topicmap.java │ │ │ ├── TopicmapCustomizer.java │ │ │ ├── TopicmapType.java │ │ │ ├── TopicmapsPlugin.java │ │ │ ├── TopicmapsService.java │ │ │ └── migrations │ │ │ └── Migration2.java │ │ ├── js │ │ ├── components │ │ │ ├── dmx-topicmap-commands.vue │ │ │ ├── dmx-topicmap-fit.vue │ │ │ ├── dmx-topicmap-info.vue │ │ │ └── dmx-topicmap-reset.vue │ │ ├── plugin.js │ │ ├── selection.js │ │ └── topicmaps.js │ │ └── resources │ │ ├── migrations │ │ ├── migration1.json │ │ └── migration2.properties │ │ └── plugin.properties ├── dmx-typeeditor │ └── src │ │ └── main │ │ └── js │ │ ├── components │ │ ├── dmx-comp-def-list.vue │ │ ├── dmx-comp-def.vue │ │ ├── dmx-data-type-select.vue │ │ ├── dmx-type-renderer.vue │ │ └── mixins │ │ │ ├── context.js │ │ │ ├── info-mode.js │ │ │ └── mode.js │ │ ├── plugin.js │ │ └── typeeditor.js ├── dmx-webclient │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── systems │ │ │ └── dmx │ │ │ └── webclient │ │ │ ├── Constants.java │ │ │ ├── WebclientPlugin.java │ │ │ └── migrations │ │ │ ├── Migration2.java │ │ │ ├── Migration3.java │ │ │ ├── Migration4.java │ │ │ ├── Migration5.java │ │ │ ├── Migration6.java │ │ │ └── Migration7.java │ │ ├── js │ │ ├── app.js │ │ ├── components │ │ │ ├── App.vue │ │ │ ├── dmx-arrow-select.vue │ │ │ ├── dmx-color-picker.vue │ │ │ ├── dmx-icon-picker.vue │ │ │ ├── dmx-resizer.vue │ │ │ ├── dmx-spinner.vue │ │ │ ├── dmx-webclient.vue │ │ │ └── mixins │ │ │ │ ├── info-mode.js │ │ │ │ ├── mode.js │ │ │ │ └── object.js │ │ ├── country-flag-polyfill.js │ │ ├── element-plus-ext.js │ │ ├── element-plus.js │ │ ├── error-handler.js │ │ ├── main.js │ │ ├── plugin-manager.js │ │ ├── quill-extensions │ │ │ ├── topic-link.js │ │ │ └── video.js │ │ ├── router.js │ │ └── store │ │ │ └── webclient.js │ │ ├── resources-build │ │ ├── dots.png │ │ ├── favicon.png │ │ ├── index.html │ │ └── ubuntu-font │ │ │ ├── 4iCp6KVjbNBYlgoKejYHtFyBN4FNgYUJ31U.woff2 │ │ │ ├── 4iCp6KVjbNBYlgoKejYHtFyCN4FNgYUJ31U.woff2 │ │ │ ├── 4iCp6KVjbNBYlgoKejYHtFyDN4FNgYUJ31U.woff2 │ │ │ ├── 4iCp6KVjbNBYlgoKejYHtFyLN4FNgYUJ31U.woff2 │ │ │ ├── 4iCp6KVjbNBYlgoKejYHtFyMN4FNgYUJ31U.woff2 │ │ │ ├── 4iCp6KVjbNBYlgoKejYHtFyPN4FNgYUJ.woff2 │ │ │ ├── 4iCs6KVjbNBYlgoKcQ72nU6AF7xm.woff2 │ │ │ ├── 4iCs6KVjbNBYlgoKcg72nU6AF7xm.woff2 │ │ │ ├── 4iCs6KVjbNBYlgoKcw72nU6AF7xm.woff2 │ │ │ ├── 4iCs6KVjbNBYlgoKew72nU6AF7xm.woff2 │ │ │ ├── 4iCs6KVjbNBYlgoKfA72nU6AF7xm.woff2 │ │ │ ├── 4iCs6KVjbNBYlgoKfw72nU6AFw.woff2 │ │ │ ├── 4iCu6KVjbNBYlgoKej70l0miFYxn.woff2 │ │ │ ├── 4iCu6KVjbNBYlgoKej73l0miFYxnu4w.woff2 │ │ │ ├── 4iCu6KVjbNBYlgoKej74l0miFYxnu4w.woff2 │ │ │ ├── 4iCu6KVjbNBYlgoKej75l0miFYxnu4w.woff2 │ │ │ ├── 4iCu6KVjbNBYlgoKej76l0miFYxnu4w.woff2 │ │ │ ├── 4iCu6KVjbNBYlgoKej7wl0miFYxnu4w.woff2 │ │ │ ├── 4iCv6KVjbNBYlgoCjC3js2yNPYZvg7UI.woff2 │ │ │ ├── 4iCv6KVjbNBYlgoCjC3jsGyNPYZvgw.woff2 │ │ │ ├── 4iCv6KVjbNBYlgoCjC3jtGyNPYZvg7UI.woff2 │ │ │ ├── 4iCv6KVjbNBYlgoCjC3jvGyNPYZvg7UI.woff2 │ │ │ ├── 4iCv6KVjbNBYlgoCjC3jvWyNPYZvg7UI.woff2 │ │ │ ├── 4iCv6KVjbNBYlgoCjC3jvmyNPYZvg7UI.woff2 │ │ │ └── fonts.css │ │ └── resources │ │ ├── migrations │ │ ├── migration1.json │ │ ├── migration4.properties │ │ └── migration5.properties │ │ └── plugin.properties ├── dmx-webservice │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── systems │ │ └── dmx │ │ └── webservice │ │ ├── WebservicePlugin.java │ │ └── provider │ │ ├── BooleanProvider.java │ │ ├── CatchAllExceptionMapper.java │ │ ├── JSONEnabledCollectionProvider.java │ │ ├── JSONEnabledProvider.java │ │ ├── NumberProvider.java │ │ ├── ObjectProvider.java │ │ └── StringCollectionProvider.java └── dmx-workspaces │ ├── pom.xml │ └── src │ └── main │ ├── java │ └── systems │ │ └── dmx │ │ └── workspaces │ │ ├── Constants.java │ │ ├── WorkspacesPlugin.java │ │ ├── WorkspacesService.java │ │ └── migrations │ │ ├── Migration3.java │ │ ├── Migration4.java │ │ └── Migration5.java │ ├── js │ ├── components │ │ ├── dmx-workspace-commands.vue │ │ ├── dmx-workspace-info.vue │ │ └── dmx-workspace-options.vue │ ├── plugin.js │ └── workspaces.js │ └── resources │ ├── migrations │ ├── migration1.json │ ├── migration2.json │ └── migration4.properties │ └── plugin.properties ├── package.json ├── pom.xml └── webpack.config.js /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es2021": true 5 | }, 6 | "globals": { 7 | "DEV": "readonly" 8 | }, 9 | "extends": [ 10 | "standard", 11 | "plugin:vue/essential" 12 | ], 13 | "parserOptions": { 14 | "ecmaVersion": 12, 15 | "sourceType": "module" 16 | }, 17 | "ignorePatterns": [ 18 | "**/src/main/resources/web", 19 | "**/target", 20 | "**/dist" 21 | ], 22 | "plugins": [ 23 | "vue" 24 | ], 25 | "rules": { 26 | "indent": ["error", 2, { 27 | "ignoreComments": true 28 | }], 29 | "key-spacing": ["error", {"mode": "minimum"}], 30 | "max-len": ["error", 120], 31 | "multiline-ternary": "off", 32 | "no-multi-spaces": "off", 33 | "object-curly-spacing": ["error", "never"], 34 | "operator-linebreak": ["error", "after", {"overrides": {"?": "before", "|>": "before"}}], 35 | "padded-blocks": "off", 36 | "vue/return-in-computed-property": "off" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | /bundle/ 3 | /bundle-cache/ 4 | /bundle-deploy/ 5 | /bundle-disabled/ 6 | /dmx-db/ 7 | /dmx-*-db/ 8 | /dmx-files/ 9 | /modules-external/ 10 | /modules-nodejs/ 11 | 12 | target/ 13 | node_modules/ 14 | 15 | *~ 16 | .idea 17 | .project 18 | .classpath 19 | .settings 20 | .shell_history 21 | .DS_Store 22 | 23 | npm-debug.log 24 | npm-debug.log.* 25 | stats*.json 26 | 27 | commit-message.txt 28 | 29 | *.tmproj 30 | *.sublime-project 31 | *.sublime-workspace 32 | 33 | *.bak 34 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | include: 2 | - project: 'devops/ci-templates' 3 | ref: node20 4 | file: 5 | - '/.platform-templates.yml' 6 | -------------------------------------------------------------------------------- /COPYRIGHT.txt: -------------------------------------------------------------------------------- 1 | DMX is a knowledge building platform. 2 | 3 | Copyright (C) 2000-2018 Jörg Richter et al. 4 | Copyright (C) 2019-2025 DMX Systems 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as 8 | published by the Free Software Foundation, either version 3 of the 9 | License, or (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | -------------------------------------------------------------------------------- /babel.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@babel/preset-env" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /conf/logging.properties: -------------------------------------------------------------------------------- 1 | # CONSOLE LOGGING 2 | handlers=java.util.logging.ConsoleHandler 3 | java.util.logging.ConsoleHandler.level=ALL 4 | 5 | # FILE LOGGING 6 | # Uncomment the following "handlers" line and comment the "handlers" line above. 7 | # handlers=java.util.logging.FileHandler 8 | java.util.logging.FileHandler.level=ALL 9 | java.util.logging.FileHandler.pattern=dmx.log 10 | java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter 11 | java.util.logging.FileHandler.append=true 12 | 13 | # You can also log to console and file at the same time. 14 | # Just define both handlers in one "handlers" line, separated by whitespace or comma. 15 | 16 | 17 | # GLOBAL LOG LEVEL 18 | # Use of one of these values: 19 | # WARNING - high level, sparse logging 20 | # INFO - mid level, the default 21 | # FINE - lower level, verbose logging 22 | # Enabling logging at a given level also enables logging at all higher levels. 23 | # Their are two additional levels: 24 | # ALL - logging all messages 25 | # OFF - turn off logging 26 | .level=INFO 27 | 28 | # PER-CLASS LOG LEVELS 29 | # State the fully qualified class name and add ".level", e.g.: 30 | # systems.dmx.core.impl.CoreServiceImpl.level=WARNING 31 | # systems.dmx.core.impl.TransactionFactory.level=FINE 32 | # systems.dmx.core.impl.ValueIntegrator.level=FINE 33 | # systems.dmx.core.impl.WebPublishingService.level=FINE 34 | # systems.dmx.core.impl.WebSocketConnectionImpl.level=FINE 35 | # systems.dmx.accesscontrol.AccessControlPlugin.level=FINE 36 | # systems.dmx.workspaces.WorkspacesPlugin.level=OFF 37 | # systems.dmx.files.FilesPlugin.level=FINE 38 | -------------------------------------------------------------------------------- /dmx-linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "$(dirname "$0")" 3 | exec java -Dfile.encoding=UTF-8 -Dfelix.system.properties=file:conf/config.properties --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.security=ALL-UNNAMED -jar bin/felix.jar 4 | -------------------------------------------------------------------------------- /dmx-mac.command: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "$(dirname "$0")" 3 | java -Dfile.encoding=UTF-8 -Dfelix.system.properties=file:conf/config.properties --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.security=ALL-UNNAMED -jar bin/felix.jar 4 | -------------------------------------------------------------------------------- /dmx-windows.bat: -------------------------------------------------------------------------------- 1 | cd %~dp0 2 | java -Dfile.encoding=UTF-8 -Dfelix.system.properties=file:conf/config.properties --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.security=ALL-UNNAMED -jar bin\felix.jar 3 | -------------------------------------------------------------------------------- /modules-external/about-this-directory.txt: -------------------------------------------------------------------------------- 1 | 2 | About the modules-external directory 3 | ------------------------------------ 4 | 5 | This is where you develop your own DMX plugins. 6 | 7 | Create a new directory here for each plugin. 8 | Every time you build your plugin it gets automatically (re)deployed. 9 | 10 | Use the modules-external directory when you've build DMX from source 11 | and want develop 3rd-party plugins and DMX standard plugins in parallel. 12 | 13 | -------------------------------------------------------------------------------- /modules/dmx-accesscontrol/src/main/java/systems/dmx/accesscontrol/AuthorizationMethod.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.accesscontrol; 2 | 3 | import systems.dmx.core.Topic; 4 | import systems.dmx.core.service.accesscontrol.Credentials; 5 | 6 | 7 | 8 | public interface AuthorizationMethod { 9 | 10 | /** 11 | * Checks if the given credentials are valid. 12 | * 13 | * @return the corresponding Username topic if the credentials are valid, or null otherwise. 14 | */ 15 | Topic checkCredentials(Credentials cred); 16 | } 17 | -------------------------------------------------------------------------------- /modules/dmx-accesscontrol/src/main/java/systems/dmx/accesscontrol/Constants.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.accesscontrol; 2 | 3 | 4 | 5 | public class Constants { 6 | 7 | // Topic Types 8 | public static final String USER_ACCOUNT = "dmx.accesscontrol.user_account"; 9 | public static final String USERNAME = "dmx.accesscontrol.username"; 10 | public static final String PASSWORD = "dmx.accesscontrol.password"; 11 | public static final String LOGIN_ENABLED = "dmx.accesscontrol.login_enabled"; // config type 12 | 13 | // Assoc Types 14 | public static final String MEMBERSHIP = "dmx.accesscontrol.membership"; 15 | 16 | // Props (topic/assoc) 17 | public static final String SALT = "dmx.accesscontrol.salt"; // for Password topics 18 | public static final String OWNER = "dmx.accesscontrol.owner"; // for Workspace topics 19 | public static final String CREATOR = "dmx.accesscontrol.creator"; 20 | public static final String MODIFIER = "dmx.accesscontrol.modifier"; 21 | 22 | // Misc 23 | public static final String ADMIN_USERNAME = "admin"; 24 | } 25 | -------------------------------------------------------------------------------- /modules/dmx-accesscontrol/src/main/java/systems/dmx/accesscontrol/DeprecatedUserAccountMethods.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.accesscontrol; 2 | 3 | import org.osgi.framework.BundleContext; 4 | import org.osgi.framework.ServiceReference; 5 | import systems.dmx.core.Topic; 6 | import systems.dmx.core.service.accesscontrol.Credentials; 7 | 8 | 9 | 10 | @Deprecated 11 | public interface DeprecatedUserAccountMethods { 12 | 13 | Topic createUserAccount(Credentials cred); 14 | 15 | Topic _createUserAccount(Credentials cred) throws Exception; 16 | 17 | Topic createUsername(String userName); 18 | 19 | interface DeprecatedAccountManagementServiceCallable { 20 | T call(DeprecatedUserAccountMethods deprecatedAccountManagementService) throws Exception; 21 | } 22 | 23 | static V call(BundleContext bundleContext, DeprecatedAccountManagementServiceCallable callable) { 24 | ServiceReference sr = bundleContext.getServiceReference( 25 | "systems.dmx.accountmanagement.AccountManagementService"); 26 | try { 27 | DeprecatedUserAccountMethods service = (DeprecatedUserAccountMethods) bundleContext.getService(sr); 28 | return service != null ? callable.call(service) : null; 29 | } catch (Exception e) { 30 | throw new RuntimeException(e); 31 | } finally { 32 | bundleContext.ungetService(sr); 33 | } 34 | } 35 | 36 | class CallableException extends RuntimeException { 37 | final Exception causeFromCallable; 38 | CallableException(Exception cause) { 39 | super(cause); 40 | causeFromCallable = cause; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /modules/dmx-accesscontrol/src/main/java/systems/dmx/accesscontrol/event/PostLoginUser.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.accesscontrol.event; 2 | 3 | import systems.dmx.core.service.EventListener; 4 | 5 | 6 | 7 | public interface PostLoginUser extends EventListener { 8 | 9 | void postLoginUser(String username); 10 | } 11 | -------------------------------------------------------------------------------- /modules/dmx-accesscontrol/src/main/java/systems/dmx/accesscontrol/event/PostLogoutUser.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.accesscontrol.event; 2 | 3 | import systems.dmx.core.service.EventListener; 4 | 5 | 6 | 7 | public interface PostLogoutUser extends EventListener { 8 | 9 | void postLogoutUser(String username); 10 | } 11 | -------------------------------------------------------------------------------- /modules/dmx-accesscontrol/src/main/java/systems/dmx/accesscontrol/migrations/Migration3.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.accesscontrol.migrations; 2 | 3 | import systems.dmx.core.service.Migration; 4 | 5 | 6 | 7 | public class Migration3 extends Migration { 8 | 9 | // -------------------------------------------------------------------------------------------------- Public Methods 10 | 11 | @Override 12 | public void run() { 13 | // Functionality taken over by dmx-account-management's Migration1 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /modules/dmx-accesscontrol/src/main/js/accesscontrol.js: -------------------------------------------------------------------------------- 1 | import dmx from 'dmx-api' 2 | 3 | export default { 4 | 5 | state: { 6 | 7 | username: undefined, // the logged in user (String); falsish if no user is logged in 8 | 9 | // Login dialog 10 | visible: false, // Login dialog visibility 11 | extensions: [] // extra Vue components for the Login dialog 12 | }, 13 | 14 | actions: { 15 | 16 | loggedIn ({state}, username) { 17 | DEV && console.log('Login', username) 18 | state.username = username 19 | }, 20 | 21 | logout ({state, dispatch}) { 22 | DEV && console.log('Logout', state.username) 23 | // Note: once logout request is sent we must succeed synchronously. Plugins may perform further 24 | // requests in their "loggedOut" handler which may rely on up-to-date login/logout state. 25 | dmx.rpc.logout().then(() => { 26 | state.username = undefined 27 | dispatch('loggedOut') 28 | }) 29 | }, 30 | 31 | openLoginDialog ({state}) { 32 | state.visible = true 33 | }, 34 | 35 | closeLoginDialog ({state}) { 36 | state.visible = false 37 | }, 38 | 39 | revealUsername ({state, dispatch}) { 40 | dmx.rpc.getTopicByValue('dmx.accesscontrol.username', state.username).then(topic => { 41 | dispatch('revealTopic', {topic}) 42 | }) 43 | }, 44 | 45 | registerLoginExtension ({state}, ext) { 46 | state.extensions.push(ext) 47 | }, 48 | 49 | createUserAccount (_, {username, password}) { 50 | return dmx.rpc.createUserAccount(username, password) 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /modules/dmx-accesscontrol/src/main/js/components/dmx-login-state.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 43 | 44 | 56 | -------------------------------------------------------------------------------- /modules/dmx-accesscontrol/src/main/js/components/dmx-user-account-options.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 17 | -------------------------------------------------------------------------------- /modules/dmx-accesscontrol/src/main/js/plugin.js: -------------------------------------------------------------------------------- 1 | export default ({store, dmx}) => ({ 2 | 3 | init () { 4 | dmx.rpc.getUsername().then(username => { 5 | store.state.accesscontrol.username = username 6 | }) 7 | }, 8 | 9 | storeModule: { 10 | name: 'accesscontrol', 11 | module: require('./accesscontrol').default 12 | }, 13 | 14 | components: [ 15 | { 16 | comp: require('dmx-login-dialog').default, 17 | mount: 'webclient', 18 | props: () => ({ 19 | visible: store.state.accesscontrol.visible, 20 | extensions: store.state.accesscontrol.extensions 21 | }), 22 | listeners: { 23 | 'logged-in': username => store.dispatch('initTypeCache').then(() => { 24 | store.dispatch('loggedIn', username) 25 | }), 26 | close: _ => store.dispatch('closeLoginDialog') 27 | } 28 | }, 29 | { 30 | comp: require('./components/dmx-login-state').default, 31 | mount: 'toolbar-right' 32 | } 33 | ], 34 | 35 | extraMenuItems: [{ 36 | uri: 'dmx.accesscontrol.user_account', 37 | optionsComp: require('./components/dmx-user-account-options').default, 38 | create: (username, options, pos) => { 39 | store.dispatch('createUserAccount', { 40 | username, 41 | password: options.password 42 | }).then(topic => 43 | store.dispatch('revealTopic', {topic, pos}) 44 | ) 45 | } 46 | }] 47 | }) 48 | -------------------------------------------------------------------------------- /modules/dmx-accesscontrol/src/main/resources/plugin.properties: -------------------------------------------------------------------------------- 1 | dmx.plugin.model_version = 3 2 | dmx.plugin.dependencies = systems.dmx.webclient 3 | -------------------------------------------------------------------------------- /modules/dmx-account-management/README.md: -------------------------------------------------------------------------------- 1 | 2 | # DMX Account-Management 3 | 4 | This plugin deals with user account-related tasks like creating users or changing passwords. 5 | 6 | ## Plugin Configuration 7 | 8 | The following options must be configured via dmx-platform's `config.properties`: 9 | 10 | ``` 11 | dmx.accountmanagement.manager = DMX 12 | ``` 13 | 14 | ### Configure account manager 15 | An account manager is an extension to the account management DMX plugin which usually adds support for storing and 16 | checking user credentials in some 3rd party system (eg. a dedicated database). Each account manager has an identifying 17 | name attached. This name can be used in the property `dmx.accountmanagement.manager` to select an account manager which 18 | is responsible for creating new user by default. 19 | 20 | This is only necessary when there is more than one account manager present. If no external account managers have been 21 | provided there is always an account manager with the name "DMX". This is also the default value for this property. 22 | 23 | Keep in mind that another mechanism in the account creation process optionally allows the developer to select an 24 | account manager beforehand. If that mechanism is used, the configured account manager has no effect. In other word, 25 | the configured account manager is only used when during the account creation, no account manager was selected 26 | explicitly. 27 | 28 | Copyright (c) 2024-2025 DMX Systems 29 | -------------------------------------------------------------------------------- /modules/dmx-account-management/src/main/java/systems/dmx/accountmanagement/AccountManager.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.accountmanagement; 2 | 3 | import systems.dmx.core.service.accesscontrol.Credentials; 4 | 5 | 6 | 7 | public interface AccountManager { 8 | 9 | String name(); 10 | 11 | /** 12 | * Unconditionally creates an account. 13 | */ 14 | void createAccount(Credentials cred); 15 | 16 | /** 17 | * Unconditionally changes an account's password 18 | */ 19 | void changePassword(Credentials currentCred, Credentials newCred); 20 | 21 | /** 22 | * Called by the DMX platform when a username topic has been deleted. This indicates 23 | * the no more logins will happen with that username. 24 | * 25 | * The implementation may choose to remove what is has stored about that 26 | * user, too. 27 | * 28 | * @param username 29 | */ 30 | void onUsernameDeleted(String username); 31 | 32 | /** 33 | * Check whether the given credentials are valid in the underlying system. 34 | *

35 | * Non-DMX implementations are supposed to tell the platform via the return value, that a username topic 36 | * lookup is necessary. See {@link CheckCredentialsResult} for details on how to do that. 37 | * 38 | * @param credentials 39 | * @return 40 | */ 41 | CheckCredentialsResult checkCredentials(Credentials credentials); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /modules/dmx-account-management/src/main/java/systems/dmx/accountmanagement/CheckCredentialsResult.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.accountmanagement; 2 | 3 | import systems.dmx.core.Topic; 4 | 5 | public final class CheckCredentialsResult { 6 | private CheckCredentialsResult(boolean success, Topic usernameTopic) { 7 | this.success = success; 8 | this.usernameTopic = usernameTopic; 9 | } 10 | 11 | public final boolean success; 12 | 13 | public final Topic usernameTopic; 14 | 15 | /** 16 | * Creates an instance which tells the platform that the credentials are correct and which username topic 17 | * to user in order to proceed. 18 | * 19 | * @param usernameTopic 20 | * @return 21 | */ 22 | static CheckCredentialsResult success(Topic usernameTopic) { 23 | if (usernameTopic == null) { 24 | throw new IllegalArgumentException("usernameTopic must not be null"); 25 | } 26 | return new CheckCredentialsResult(true, usernameTopic); 27 | } 28 | 29 | /** 30 | * Creates an instance which tells the platform that the credentials are correct and that a username topic 31 | * has to be done which could also lead to the creation of such. All of which the platform takes care of. 32 | * 33 | * @return 34 | */ 35 | public static CheckCredentialsResult lookupOrCreationRequired() { 36 | return new CheckCredentialsResult(true, null); 37 | } 38 | 39 | /** 40 | * Creates an instance which tells the platform that the credentials are incorrect and login shall not proceed. 41 | * 42 | * @return 43 | */ 44 | public static CheckCredentialsResult failed() { 45 | return new CheckCredentialsResult(false, null); 46 | } 47 | } -------------------------------------------------------------------------------- /modules/dmx-account-management/src/main/java/systems/dmx/accountmanagement/Constants.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.accountmanagement; 2 | 3 | 4 | 5 | public final class Constants { 6 | 7 | private Constants() {} 8 | 9 | // Topic Types 10 | public static final String USER_ACCOUNT = "dmx.accesscontrol.user_account"; 11 | public static final String USERNAME = "dmx.accesscontrol.username"; 12 | public static final String PASSWORD = "dmx.accesscontrol.password"; 13 | 14 | // Props (topic/assoc) 15 | public static final String SALT = "dmx.accesscontrol.salt"; // for Password topics 16 | 17 | static final String ACCOUNT_MANAGER_NAME = "dmx.accountmanager.name"; 18 | } 19 | -------------------------------------------------------------------------------- /modules/dmx-account-management/src/main/resources/plugin.properties: -------------------------------------------------------------------------------- 1 | dmx.plugin.model_version = 1 2 | dmx.plugin.dependencies = systems.dmx.accesscontrol, systems.dmx.workspaces 3 | -------------------------------------------------------------------------------- /modules/dmx-base/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 4.0.0 6 | 7 | DMX Base 8 | systems.dmx 9 | dmx-base 10 | 5.4-SNAPSHOT 11 | bundle 12 | 13 | 14 | systems.dmx 15 | dmx-plugin 16 | 5.4-SNAPSHOT 17 | ../dmx-plugin/pom.xml 18 | 19 | 20 | -------------------------------------------------------------------------------- /modules/dmx-base/src/main/java/systems/dmx/base/Constants.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.base; 2 | 3 | 4 | 5 | public class Constants { 6 | 7 | // Topic Types 8 | public static final String URL = "dmx.base.url"; 9 | 10 | // Assoc Types 11 | public static final String USER_MAILBOX = "dmx.base.user_mailbox"; 12 | } 13 | -------------------------------------------------------------------------------- /modules/dmx-base/src/main/java/systems/dmx/base/migrations/Migration2.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.base.migrations; 2 | 3 | import systems.dmx.core.service.Migration; 4 | 5 | 6 | 7 | /** 8 | * Adds assoc type "User Mailbox". 9 | * 10 | * Part of DMX 5.2 11 | * Runs only in UPDATE mode. 12 | */ 13 | public class Migration2 extends Migration { 14 | 15 | @Override 16 | public void run() { 17 | dmx.createAssocType(mf.newAssocTypeModel("dmx.base.user_mailbox", "User Mailbox", "dmx.core.text")); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /modules/dmx-base/src/main/js/components/dmx-url-renderer.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 17 | -------------------------------------------------------------------------------- /modules/dmx-base/src/main/js/components/mixins/info-mode.js: -------------------------------------------------------------------------------- 1 | export default { 2 | computed: { 3 | infoMode () { 4 | return this.mode === 'info' 5 | }, 6 | formMode () { 7 | return this.mode === 'form' 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /modules/dmx-base/src/main/js/components/mixins/mode.js: -------------------------------------------------------------------------------- 1 | export default { 2 | props: { 3 | mode: { 4 | type: String, 5 | required: true, 6 | validator: mode => ['info', 'form'].includes(mode) 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /modules/dmx-base/src/main/js/components/mixins/object.js: -------------------------------------------------------------------------------- 1 | import dmx from 'dmx-api' 2 | 3 | export default { 4 | props: { 5 | object: { 6 | type: dmx.DMXObject, 7 | required: true 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /modules/dmx-base/src/main/js/plugin.js: -------------------------------------------------------------------------------- 1 | export default { 2 | valueRenderers: { 3 | 'dmx.base.url': require('./components/dmx-url-renderer').default 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /modules/dmx-base/src/main/resources/migrations/migration1.json: -------------------------------------------------------------------------------- 1 | { 2 | "topic_types": [ 3 | { 4 | "value": "URL", 5 | "uri": "dmx.base.url", 6 | "dataTypeUri": "dmx.core.text" 7 | } 8 | ], 9 | "assoc_types": [ 10 | { 11 | "value": "User Mailbox", 12 | "uri": "dmx.base.user_mailbox", 13 | "dataTypeUri": "dmx.core.text" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /modules/dmx-base/src/main/resources/migrations/migration2.properties: -------------------------------------------------------------------------------- 1 | migrationRunMode = UPDATE 2 | -------------------------------------------------------------------------------- /modules/dmx-base/src/main/resources/plugin.properties: -------------------------------------------------------------------------------- 1 | dmx.plugin.model_version = 2 2 | dmx.plugin.main_package = systems.dmx.base 3 | -------------------------------------------------------------------------------- /modules/dmx-bookmarks/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 4.0.0 6 | 7 | DMX Bookmarks 8 | systems.dmx 9 | dmx-bookmarks 10 | 5.4-SNAPSHOT 11 | bundle 12 | 13 | 14 | systems.dmx 15 | dmx-plugin 16 | 5.4-SNAPSHOT 17 | ../dmx-plugin/pom.xml 18 | 19 | 20 | -------------------------------------------------------------------------------- /modules/dmx-bookmarks/src/main/java/systems/dmx/bookmarks/Constants.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.bookmarks; 2 | 3 | 4 | 5 | public class Constants { 6 | 7 | // Topic Types 8 | public static final String BOOKMARK = "dmx.bookmarks.bookmark"; 9 | public static final String BOOKMARK_DESCRIPTION = "dmx.bookmarks.description"; 10 | } 11 | -------------------------------------------------------------------------------- /modules/dmx-bookmarks/src/main/resources/migrations/migration1.json: -------------------------------------------------------------------------------- 1 | // Part of DMX 5.0-beta-4 2 | // Runs ALWAYS 3 | 4 | { 5 | "topic_types": [ 6 | { 7 | "value": "Bookmark Description", 8 | "uri": "dmx.bookmarks.description", 9 | "dataTypeUri": "dmx.core.html" 10 | }, 11 | { 12 | "value": "Bookmark", 13 | "uri": "dmx.bookmarks.bookmark", 14 | "dataTypeUri": "dmx.core.entity", 15 | "compDefs": [ 16 | { 17 | "childTypeUri": "dmx.base.url", 18 | "childCardinalityUri": "dmx.core.one", 19 | "isIdentityAttr": true 20 | }, 21 | { 22 | "childTypeUri": "dmx.bookmarks.description", 23 | "childCardinalityUri": "dmx.core.one" 24 | } 25 | ], 26 | "viewConfigTopics": [ 27 | { 28 | "typeUri": "dmx.webclient.view_config", 29 | "children": { 30 | "dmx.webclient.icon": "\uf08e", 31 | "dmx.webclient.add_to_create_menu": true 32 | } 33 | } 34 | ] 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /modules/dmx-bookmarks/src/main/resources/plugin.properties: -------------------------------------------------------------------------------- 1 | dmx.plugin.model_version = 1 2 | dmx.plugin.dependencies = systems.dmx.base, systems.dmx.webclient 3 | -------------------------------------------------------------------------------- /modules/dmx-caching/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 4.0.0 6 | 7 | DMX Caching 8 | systems.dmx 9 | dmx-caching 10 | 5.4-SNAPSHOT 11 | bundle 12 | 13 | 14 | systems.dmx 15 | dmx-plugin 16 | 5.4-SNAPSHOT 17 | ../dmx-plugin/pom.xml 18 | 19 | 20 | 21 | 22 | systems.dmx 23 | dmx-timestamps 24 | 5.4-SNAPSHOT 25 | 26 | 27 | 28 | 29 | 30 | 31 | org.apache.felix 32 | maven-bundle-plugin 33 | 34 | 35 | systems.dmx.caching.CachingPlugin 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /modules/dmx-caching/src/test/java/systems/dmx/caching/CachingTest.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.caching; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.assertEquals; 6 | import static org.junit.Assert.assertFalse; 7 | import static org.junit.Assert.assertNull; 8 | import static org.junit.Assert.assertSame; 9 | import static org.junit.Assert.assertTrue; 10 | 11 | import java.io.File; 12 | import java.util.Date; 13 | import java.util.logging.Logger; 14 | 15 | 16 | 17 | public class CachingTest { 18 | 19 | private Logger logger = Logger.getLogger(getClass().getName()); 20 | 21 | @Test 22 | public void regex() { 23 | String CACHABLE_PATH = "core/(topic|association)/(\\d+)"; 24 | assertTrue("core/topic/2695".matches(CACHABLE_PATH)); 25 | assertFalse("/core/topic/2695".matches(CACHABLE_PATH)); 26 | assertFalse("base/core/topic/2695".matches(CACHABLE_PATH)); 27 | assertFalse("core/topic/2695?".matches(CACHABLE_PATH)); 28 | assertFalse("core/topic/2695?children=true".matches(CACHABLE_PATH)); 29 | } 30 | 31 | @Test 32 | public void date() { 33 | logger.info("### Date(0)=" + new Date(0) + "\n " + 34 | "Date(-1)=" + new Date(-1)); 35 | } 36 | 37 | @Test 38 | public void parent() { 39 | File f = new File("/home/terry"); 40 | String s = File.separator; 41 | assertEquals(s + "home" + s + "terry", f.getPath()); 42 | f = f.getParentFile(); 43 | assertEquals(s + "home", f.getPath()); 44 | f = f.getParentFile(); 45 | assertEquals(s, f.getPath()); 46 | f = f.getParentFile(); 47 | assertNull(f); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /modules/dmx-config/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 4.0.0 6 | 7 | DMX Config 8 | systems.dmx 9 | dmx-config 10 | 5.4-SNAPSHOT 11 | bundle 12 | 13 | 14 | systems.dmx 15 | dmx-plugin 16 | 5.4-SNAPSHOT 17 | ../dmx-plugin/pom.xml 18 | 19 | 20 | 21 | 22 | 23 | org.apache.felix 24 | maven-bundle-plugin 25 | 26 | 27 | systems.dmx.config.ConfigPlugin 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /modules/dmx-config/src/main/java/systems/dmx/config/ConfigCustomizer.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.config; 2 | 3 | import systems.dmx.core.Topic; 4 | import systems.dmx.core.model.TopicModel; 5 | 6 | 7 | 8 | public interface ConfigCustomizer { 9 | 10 | TopicModel getConfigValue(Topic topic); 11 | } 12 | -------------------------------------------------------------------------------- /modules/dmx-config/src/main/java/systems/dmx/config/ConfigDefs.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.config; 2 | 3 | import systems.dmx.core.JSONEnabled; 4 | 5 | import org.codehaus.jettison.json.JSONObject; 6 | 7 | 8 | 9 | class ConfigDefs implements JSONEnabled { 10 | 11 | // ---------------------------------------------------------------------------------------------- Instance Variables 12 | 13 | private JSONObject json; 14 | 15 | // ---------------------------------------------------------------------------------------------------- Constructors 16 | 17 | ConfigDefs(JSONObject json) { 18 | this.json = json; 19 | } 20 | 21 | // -------------------------------------------------------------------------------------------------- Public Methods 22 | 23 | @Override 24 | public JSONObject toJSON() { 25 | return json; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /modules/dmx-config/src/main/java/systems/dmx/config/ConfigModRole.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.config; 2 | 3 | 4 | 5 | public enum ConfigModRole { 6 | ADMIN, 7 | SYSTEM, 8 | CREATOR, 9 | OWNER, 10 | MEMBER 11 | } 12 | -------------------------------------------------------------------------------- /modules/dmx-config/src/main/java/systems/dmx/config/ConfigService.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.config; 2 | 3 | import systems.dmx.core.RelatedTopic; 4 | import systems.dmx.core.Topic; 5 | import systems.dmx.core.model.TopicModel; 6 | import systems.dmx.core.service.DirectivesResponse; 7 | 8 | 9 | 10 | public interface ConfigService { 11 | 12 | ConfigDefs getConfigDefs(); 13 | 14 | RelatedTopic getConfigTopic(String configTypeUri, long topicId); 15 | 16 | DirectivesResponse updateConfigTopic(long topicId, TopicModel updateModel); 17 | 18 | void createConfigTopic(String configTypeUri, Topic topic); 19 | 20 | // --- 21 | 22 | void registerConfigDef(ConfigDef configDef); 23 | 24 | void unregisterConfigDef(String configTypeUri); 25 | } 26 | -------------------------------------------------------------------------------- /modules/dmx-config/src/main/java/systems/dmx/config/ConfigTarget.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.config; 2 | 3 | import systems.dmx.core.Topic; 4 | 5 | 6 | 7 | public enum ConfigTarget { 8 | 9 | SINGLETON("topicUri") { 10 | @Override 11 | String hashKey(Topic topic) { 12 | return hashKey(topic.getUri()); 13 | } 14 | }, 15 | 16 | TYPE_INSTANCES("typeUri") { 17 | @Override 18 | String hashKey(Topic topic) { 19 | return hashKey(topic.getTypeUri()); 20 | } 21 | }; 22 | 23 | // ---------------------------------------------------------------------------------------------- Instance Variables 24 | 25 | private String prefix; 26 | 27 | // ---------------------------------------------------------------------------------------------------- Constructors 28 | 29 | private ConfigTarget(String prefix) { 30 | this.prefix = prefix; 31 | } 32 | 33 | // ----------------------------------------------------------------------------------------- Package Private Methods 34 | 35 | String hashKey(String configurableUri) { 36 | return prefix + ":" + configurableUri; 37 | } 38 | 39 | abstract String hashKey(Topic topic); 40 | } 41 | -------------------------------------------------------------------------------- /modules/dmx-config/src/main/java/systems/dmx/config/Constants.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.config; 2 | 3 | 4 | 5 | public class Constants { 6 | 7 | // Topic Types 8 | public static final String CONFIGURATION = "dmx.config.configuration"; 9 | 10 | // Role Types 11 | public static final String CONFIGURABLE = "dmx.config.configurable"; 12 | } 13 | -------------------------------------------------------------------------------- /modules/dmx-config/src/main/java/systems/dmx/config/migrations/Migration2.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.config.migrations; 2 | 3 | import static systems.dmx.config.Constants.*; 4 | import systems.dmx.core.Assoc; 5 | import systems.dmx.core.service.Migration; 6 | import systems.dmx.core.service.accesscontrol.PrivilegedAccess; 7 | 8 | 9 | 10 | /** 11 | * Creates missing workspace assignments for existing "Configuration" assocs. 12 | *

13 | * Part of DMX 5.2 14 | * Runs only in UPDATE mode. 15 | */ 16 | public class Migration2 extends Migration { 17 | 18 | // -------------------------------------------------------------------------------------------------- Public Methods 19 | 20 | @Override 21 | public void run() { 22 | PrivilegedAccess pa = dmx.getPrivilegedAccess(); 23 | long workspaceId = pa.getAdminWorkspaceId(); 24 | for (Assoc assoc : dmx.getAssocsByType(CONFIGURATION)) { 25 | pa.assignToWorkspace(assoc, workspaceId); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /modules/dmx-config/src/main/resources/migrations/migration1.json: -------------------------------------------------------------------------------- 1 | // Part of DMX 5.0-beta-4 2 | // Runs ALWAYS 3 | 4 | { 5 | "assoc_types": [ 6 | { 7 | "value": "Configuration", 8 | "uri": "dmx.config.configuration", 9 | "dataTypeUri": "dmx.core.text", 10 | "viewConfigTopics": [ 11 | { 12 | "typeUri": "dmx.webclient.view_config", 13 | "children": { 14 | "dmx.webclient.color": "hsl(255, 40%, 53%)", 15 | "dmx.webclient.color#dmx.webclient.background_color": "hsl(255, 80%, 96%)" 16 | } 17 | } 18 | ] 19 | } 20 | ], 21 | "role_types": [ 22 | { 23 | "value": "Configurable", 24 | "uri": "dmx.config.configurable" 25 | } 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /modules/dmx-config/src/main/resources/migrations/migration2.properties: -------------------------------------------------------------------------------- 1 | migrationRunMode = UPDATE 2 | -------------------------------------------------------------------------------- /modules/dmx-config/src/main/resources/plugin.properties: -------------------------------------------------------------------------------- 1 | dmx.plugin.model_version = 2 2 | dmx.plugin.dependencies = systems.dmx.webclient 3 | -------------------------------------------------------------------------------- /modules/dmx-contacts/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 4.0.0 6 | 7 | DMX Contacts 8 | systems.dmx 9 | dmx-contacts 10 | 5.4-SNAPSHOT 11 | bundle 12 | 13 | 14 | systems.dmx 15 | dmx-plugin 16 | 5.4-SNAPSHOT 17 | ../dmx-plugin/pom.xml 18 | 19 | 20 | 21 | 22 | 23 | org.apache.felix 24 | maven-bundle-plugin 25 | 26 | 27 | systems.dmx.contacts.ContactsPlugin 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /modules/dmx-contacts/src/main/java/systems/dmx/contacts/ContactsService.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.contacts; 2 | 3 | import systems.dmx.core.RelatedTopic; 4 | 5 | import java.util.List; 6 | 7 | 8 | 9 | public interface ContactsService { 10 | 11 | List getOrganizations(long personId); 12 | 13 | List getPersons(long organizationId); 14 | } 15 | -------------------------------------------------------------------------------- /modules/dmx-contacts/src/main/js/components/dmx-email-address-renderer.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 24 | -------------------------------------------------------------------------------- /modules/dmx-contacts/src/main/js/components/mixins/info-mode.js: -------------------------------------------------------------------------------- 1 | export default { 2 | computed: { 3 | infoMode () { 4 | return this.mode === 'info' 5 | }, 6 | formMode () { 7 | return this.mode === 'form' 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /modules/dmx-contacts/src/main/js/components/mixins/mode.js: -------------------------------------------------------------------------------- 1 | export default { 2 | props: { 3 | mode: { 4 | type: String, 5 | required: true, 6 | validator: mode => ['info', 'form'].includes(mode) 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /modules/dmx-contacts/src/main/js/components/mixins/object.js: -------------------------------------------------------------------------------- 1 | import dmx from 'dmx-api' 2 | 3 | export default { 4 | props: { 5 | object: { 6 | type: dmx.DMXObject, 7 | required: true 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /modules/dmx-contacts/src/main/js/plugin.js: -------------------------------------------------------------------------------- 1 | export default { 2 | valueRenderers: { 3 | 'dmx.contacts.email_address': require('./components/dmx-email-address-renderer').default 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /modules/dmx-contacts/src/main/resources/plugin.properties: -------------------------------------------------------------------------------- 1 | dmx.plugin.model_version = 2 2 | dmx.plugin.dependencies = systems.dmx.base, systems.dmx.datetime, systems.dmx.webclient 3 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/AssocPlayer.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core; 2 | 3 | 4 | 5 | /** 6 | * An association at the end of an {@link Assoc}. 7 | *

8 | * An AssocPlayer has an {@link Assoc} and a role type. The role type expresses the role the Assoc 9 | * plays in the association. 10 | *

11 | * The assoc (player) is referred to by ID. The role type is referred to by URI. 12 | */ 13 | public interface AssocPlayer extends Player { 14 | 15 | Assoc getAssoc(); 16 | } 17 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/AssocType.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core; 2 | 3 | import systems.dmx.core.model.AssocTypeModel; 4 | 5 | 6 | 7 | /** 8 | * Part of DMX's type system, like a class whose instances are {@link Assoc}s. 9 | */ 10 | public interface AssocType extends DMXType { 11 | 12 | // === Updating === 13 | 14 | void update(AssocTypeModel model); 15 | } 16 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/CompDef.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core; 2 | 3 | import systems.dmx.core.model.CompDefModel; 4 | 5 | 6 | 7 | /** 8 | * A composition definition of a parent type and a child type -- part of DMX's type system. 9 | *

10 | * The parent type is either a {@link TopicType} or an {@link AssocType}. The child type is always a {@link TopicType}. 11 | * 12 | * @author Jörg Richter 13 | */ 14 | public interface CompDef extends Assoc { 15 | 16 | String getCompDefUri(); 17 | 18 | // --- 19 | 20 | String getParentTypeUri(); 21 | 22 | String getChildTypeUri(); 23 | 24 | // --- 25 | 26 | /** 27 | * @return The custom association type, or null if not set. 28 | */ 29 | String getCustomAssocTypeUri(); 30 | 31 | /** 32 | * @return The type to be used to create an association instance based on this comp def. 33 | * That is the custom association type if set, otherwise dmx.core.composition. 34 | * Is never null. 35 | */ 36 | String getInstanceLevelAssocTypeUri(); 37 | 38 | // --- Child Cardinality --- 39 | 40 | String getChildCardinalityUri(); 41 | 42 | // TODO: currently not supported 43 | void setChildCardinalityUri(String childCardinalityUri); 44 | 45 | // --- 46 | 47 | ViewConfig getViewConfig(); 48 | 49 | // --- 50 | 51 | void update(CompDefModel model); 52 | 53 | // --- 54 | 55 | CompDefModel getModel(); 56 | } 57 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/Identifiable.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core; 2 | 3 | 4 | 5 | /** 6 | * A common interface for all entities that provide an ID. 7 | */ 8 | public interface Identifiable { 9 | 10 | long getId(); 11 | } 12 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/JSONEnabled.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core; 2 | 3 | import org.codehaus.jettison.json.JSONObject; 4 | 5 | 6 | 7 | /** 8 | * A common interface for all entities that provide a JSON representation. 9 | */ 10 | public interface JSONEnabled { 11 | 12 | JSONObject toJSON(); 13 | 14 | default public String dump() { 15 | try { 16 | return getClass().getSimpleName() + " " + toJSON().toString(4); 17 | } catch (Exception e) { 18 | throw new RuntimeException("Prettyprinting failed", e); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/Player.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core; 2 | 3 | import systems.dmx.core.model.PlayerModel; 4 | 5 | 6 | 7 | /** 8 | * A Player represents one of the 2 {@link Assoc} ends. 9 | *

10 | * A Player has a {@link DMXObject} and a role type. The role type expresses the role the DMXObject 11 | * plays in the association. 12 | */ 13 | public interface Player extends JSONEnabled { 14 | 15 | long getId(); 16 | 17 | String getRoleTypeUri(); 18 | 19 | O getDMXObject(); 20 | 21 | // --- 22 | 23 | void setRoleTypeUri(String roleTypeUri); 24 | 25 | // --- 26 | 27 | // TODO: use generics 28 | PlayerModel getModel(); 29 | } 30 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/RelatedAssoc.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core; 2 | 3 | import systems.dmx.core.model.RelatedAssocModel; 4 | 5 | 6 | 7 | /** 8 | * An Assoc-Assoc pair. 9 | */ 10 | public interface RelatedAssoc extends RelatedObject, Assoc { 11 | 12 | RelatedAssocModel getModel(); 13 | } 14 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/RelatedObject.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core; 2 | 3 | 4 | 5 | public interface RelatedObject extends DMXObject { 6 | 7 | Assoc getRelatingAssoc(); 8 | } 9 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/RelatedTopic.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core; 2 | 3 | import systems.dmx.core.model.RelatedTopicModel; 4 | 5 | 6 | 7 | /** 8 | * A Topic-Assoc pair. 9 | */ 10 | public interface RelatedTopic extends RelatedObject, Topic { 11 | 12 | RelatedTopicModel getModel(); 13 | } 14 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/RoleType.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core; 2 | 3 | import systems.dmx.core.model.RoleTypeModel; 4 | 5 | 6 | 7 | /** 8 | * A role type is basically a topic plus a view config. 9 | */ 10 | public interface RoleType extends Topic { 11 | 12 | // View Config 13 | 14 | ViewConfig getViewConfig(); 15 | 16 | Object getViewConfigValue(String configTypeUri, String childTypeUri); 17 | 18 | // 19 | 20 | RoleTypeModel getModel(); 21 | } 22 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/Topic.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core; 2 | 3 | import systems.dmx.core.model.TopicModel; 4 | 5 | 6 | 7 | /** 8 | * A topic -- DMX's central data object. 9 | * 10 | * @author Jörg Richter 11 | */ 12 | public interface Topic extends DMXObject { 13 | 14 | /** 15 | * Searches this topic's child topics for a topic of the given type. 16 | * Only the child topics which are already loaded into memory are searched; the DB is not accessed. 17 | *

18 | * The first topic found is returned, according to a depth-first search. 19 | * For multiple-value children the first topic is returned. 20 | * If the given type matches this topic directly it is returned immediately. 21 | *

22 | * The search is driven by this topic's type definition. That is child topics which do not adhere 23 | * to the type definition are not found. 24 | *

25 | * TODO: make this generic by moving to DMXObject interface? 26 | * 27 | * @return the found topic, or null. 28 | */ 29 | Topic findChildTopic(String topicTypeUri); 30 | 31 | // --- 32 | 33 | @Override 34 | TopicModel getModel(); 35 | } 36 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/TopicPlayer.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core; 2 | 3 | 4 | 5 | /** 6 | * A topic at the end of an {@link Assoc}. 7 | *

8 | * A TopicPlayer has a {@link Topic} and a role type. The role type expresses the role the Topic 9 | * plays in the association. 10 | *

11 | * The topic (player) is referred to either by ID or URI. The role type is referred to by URI. 12 | */ 13 | public interface TopicPlayer extends Player { 14 | 15 | Topic getTopic(); 16 | 17 | String getTopicUri(); 18 | } 19 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/TopicType.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core; 2 | 3 | import systems.dmx.core.model.TopicTypeModel; 4 | 5 | 6 | 7 | /** 8 | * Part of DMX's type system, like a class whose instances are {@link Topic}s. 9 | */ 10 | public interface TopicType extends DMXType { 11 | 12 | // === Updating === 13 | 14 | void update(TopicTypeModel model); 15 | } 16 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/ViewConfig.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core; 2 | 3 | import systems.dmx.core.model.TopicModel; 4 | import systems.dmx.core.model.ViewConfigModel; 5 | 6 | 7 | 8 | /** 9 | * A container for config topics. 10 | *

11 | * Config topics can be accessed by their type URI. 12 | * A view config can contain only one config topic with a certain type URI. 13 | */ 14 | public interface ViewConfig { 15 | 16 | Iterable getConfigTopics(); 17 | 18 | /** 19 | * @return the config topic for the given type URI, or null if there is none. 20 | */ 21 | Topic getConfigTopic(String configTypeUri); 22 | 23 | /** 24 | * Adds a config topic to this view config. 25 | * 26 | * @return the (instantiated) config topic. 27 | * 28 | * @throws RuntimeException if this view config already contains a config topic with the same type URI. 29 | */ 30 | Topic addConfigTopic(TopicModel configTopic); 31 | 32 | /** 33 | * Sets a single value of a certain config topic. 34 | * If no such config topic exists in this view config it is created. 35 | * 36 | * @param configTypeUri The type URI of the config topic, e.g. "dmx.webclient.view_config" 37 | * @param childTypeUri The child type URI of the config value to set, e.g. "dmx.webclient.icon" 38 | * @param value The config value (String, Integer, Long, Double, or Boolean) 39 | */ 40 | ViewConfig setConfigValue(String configTypeUri, String childTypeUri, Object value); 41 | 42 | ViewConfig setConfigValueRef(String configTypeUri, String childTypeUri, Object topicIdOrUri); 43 | 44 | // --- 45 | 46 | ViewConfigModel getModel(); 47 | } 48 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/impl/AssocPlayerImpl.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.impl; 2 | 3 | import systems.dmx.core.Assoc; 4 | import systems.dmx.core.AssocPlayer; 5 | 6 | 7 | 8 | /** 9 | * An association player that is attached to the {@link AccessLayer}. 10 | */ 11 | class AssocPlayerImpl extends PlayerImpl implements AssocPlayer { 12 | 13 | // ---------------------------------------------------------------------------------------------------- Constructors 14 | 15 | AssocPlayerImpl(AssocPlayerModelImpl model, AssocModelImpl assoc) { 16 | super(model, assoc); 17 | } 18 | 19 | // -------------------------------------------------------------------------------------------------- Public Methods 20 | 21 | 22 | 23 | // === AssocPlayer Implementation === 24 | 25 | @Override 26 | public Assoc getAssoc() { 27 | return (Assoc) getDMXObject(); 28 | } 29 | 30 | 31 | 32 | // === PlayerImpl Overrides === 33 | 34 | @Override 35 | public AssocPlayerModelImpl getModel() { 36 | return (AssocPlayerModelImpl) model; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/impl/AssocTypeImpl.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.impl; 2 | 3 | import systems.dmx.core.AssocType; 4 | import systems.dmx.core.model.AssocTypeModel; 5 | 6 | /** 7 | * An association type that is attached to the {@link CoreService}. 8 | */ 9 | class AssocTypeImpl extends DMXTypeImpl implements AssocType { 10 | 11 | // ---------------------------------------------------------------------------------------------------- Constructors 12 | 13 | AssocTypeImpl(AssocTypeModelImpl model, AccessLayer al) { 14 | super(model, al); 15 | } 16 | 17 | // -------------------------------------------------------------------------------------------------- Public Methods 18 | 19 | // AssocType Implementation 20 | 21 | @Override 22 | public AssocTypeModelImpl getModel() { 23 | return (AssocTypeModelImpl) model; 24 | } 25 | 26 | @Override 27 | public void update(AssocTypeModel updateModel) { 28 | model.update((AssocTypeModelImpl) updateModel); // ### FIXME: call through al for access control 29 | } 30 | 31 | // ----------------------------------------------------------------------------------------- Package Private Methods 32 | 33 | @Override 34 | AssocTypeModelImpl _getModel() { 35 | return al._getAssocType(getUri()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/impl/InstantiationIterable.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.impl; 2 | 3 | import java.util.Iterator; 4 | 5 | 6 | 7 | /** 8 | * A wrapper iterable that instantiates models from an underlying DMXObjectModel iterable. 9 | */ 10 | class InstantiationIterable implements Iterable { 11 | 12 | private Iterable models; // underlying iterable 13 | 14 | InstantiationIterable(Iterable models) { 15 | this.models = models; 16 | } 17 | 18 | @Override 19 | public Iterator iterator() { 20 | Iterator i = models.iterator(); 21 | return new Iterator() { 22 | 23 | @Override 24 | public boolean hasNext() { 25 | return i.hasNext(); 26 | } 27 | 28 | @Override 29 | public O next() { 30 | return i.next().instantiate(); 31 | } 32 | 33 | @Override 34 | public void remove() { 35 | throw new UnsupportedOperationException(); 36 | } 37 | }; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/impl/JerseyRequestFilter.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.impl; 2 | 3 | import systems.dmx.core.service.Cookies; 4 | 5 | import com.sun.jersey.spi.container.ContainerRequest; 6 | import com.sun.jersey.spi.container.ContainerRequestFilter; 7 | 8 | 9 | 10 | class JerseyRequestFilter implements ContainerRequestFilter { 11 | 12 | // ---------------------------------------------------------------------------------------------- Instance Variables 13 | 14 | private EventManager em; 15 | 16 | // ---------------------------------------------------------------------------------------------------- Constructors 17 | 18 | JerseyRequestFilter(EventManager em) { 19 | this.em = em; 20 | } 21 | 22 | // -------------------------------------------------------------------------------------------------- Public Methods 23 | 24 | @Override 25 | public ContainerRequest filter(ContainerRequest request) { 26 | Cookies.set(request); 27 | em.fireEvent(CoreEvent.SERVICE_REQUEST_FILTER, request); 28 | return request; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/impl/PluginInfoImpl.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.impl; 2 | 3 | import systems.dmx.core.service.PluginInfo; 4 | import org.codehaus.jettison.json.JSONObject; 5 | 6 | 7 | 8 | class PluginInfoImpl implements PluginInfo { 9 | 10 | // ---------------------------------------------------------------------------------------------- Instance Variables 11 | 12 | private JSONObject pluginInfo = new JSONObject(); 13 | 14 | // ---------------------------------------------------------------------------------------------------- Constructors 15 | 16 | /** 17 | * @param pluginFile file name or empty 18 | * @param styleFile file name or empty 19 | */ 20 | PluginInfoImpl(String pluginUri, String pluginFile, String styleFile) { 21 | try { 22 | pluginInfo.put("pluginUri", pluginUri); 23 | pluginInfo.put("pluginFile", pluginFile); 24 | pluginInfo.put("styleFile", styleFile); 25 | } catch (Exception e) { 26 | throw new RuntimeException("Serialization failed", e); 27 | } 28 | } 29 | 30 | // -------------------------------------------------------------------------------------------------- Public Methods 31 | 32 | @Override 33 | public JSONObject toJSON() { 34 | return pluginInfo; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/impl/ReadableIterable.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.impl; 2 | 3 | import java.util.Iterator; 4 | 5 | 6 | 7 | /** 8 | * A wrapper iterable that skips unreadables from an underlying DMXObjectModel iterable. 9 | */ 10 | class ReadableIterable implements Iterable { 11 | 12 | private Iterable models; // underlying iterable 13 | 14 | ReadableIterable(Iterable models) { 15 | this.models = models; 16 | } 17 | 18 | @Override 19 | public Iterator iterator() { 20 | return new ReadableIterator(); 21 | } 22 | 23 | // ---------------------------------------------------------------------------------------------------- Nested Class 24 | 25 | private class ReadableIterator implements Iterator { 26 | 27 | private Iterator i = models.iterator(); 28 | private M next; // next readable object; updated by findNext() 29 | 30 | @Override 31 | public boolean hasNext() { 32 | findNext(); 33 | return next != null; 34 | } 35 | 36 | @Override 37 | public M next() { 38 | return next; 39 | } 40 | 41 | @Override 42 | public void remove() { 43 | throw new UnsupportedOperationException(); 44 | } 45 | 46 | private void findNext() { 47 | next = null; 48 | while (i.hasNext() && next == null) { 49 | M model = i.next(); 50 | if (model.isReadable()) { 51 | next = model; 52 | } 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/impl/RelatedAssocImpl.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.impl; 2 | 3 | import systems.dmx.core.Assoc; 4 | import systems.dmx.core.RelatedAssoc; 5 | 6 | 7 | 8 | /** 9 | * An Assoc-Assoc pair that is attached to the {@link AccessLayer}. 10 | */ 11 | class RelatedAssocImpl extends AssocImpl implements RelatedAssoc { 12 | 13 | // ---------------------------------------------------------------------------------------------------- Constructors 14 | 15 | RelatedAssocImpl(RelatedAssocModelImpl model, AccessLayer al) { 16 | super(model, al); 17 | } 18 | 19 | // -------------------------------------------------------------------------------------------------- Public Methods 20 | 21 | @Override 22 | public Assoc getRelatingAssoc() { 23 | return getModel().getRelatingAssoc().instantiate(); 24 | } 25 | 26 | @Override 27 | public RelatedAssocModelImpl getModel() { 28 | return (RelatedAssocModelImpl) model; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/impl/RelatedTopicImpl.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.impl; 2 | 3 | import systems.dmx.core.Assoc; 4 | import systems.dmx.core.RelatedTopic; 5 | 6 | 7 | 8 | /** 9 | * A Topic-Assoc pair that is attached to the {@link AccessLayer}. 10 | */ 11 | class RelatedTopicImpl extends TopicImpl implements RelatedTopic { 12 | 13 | // ---------------------------------------------------------------------------------------------------- Constructors 14 | 15 | RelatedTopicImpl(RelatedTopicModelImpl model, AccessLayer al) { 16 | super(model, al); 17 | } 18 | 19 | // -------------------------------------------------------------------------------------------------- Public Methods 20 | 21 | @Override 22 | public Assoc getRelatingAssoc() { 23 | return getModel().getRelatingAssoc().instantiate(); 24 | } 25 | 26 | @Override 27 | public RelatedTopicModelImpl getModel() { 28 | return (RelatedTopicModelImpl) model; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/impl/RestResourcesPublication.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.impl; 2 | 3 | import java.util.List; 4 | 5 | 6 | 7 | class RestResourcesPublication { 8 | 9 | // ---------------------------------------------------------------------------------------------- Instance Variables 10 | 11 | private List singletons; 12 | private List> classes; 13 | 14 | private WebPublishingService wpService; 15 | 16 | // ---------------------------------------------------------------------------------------------------- Constructors 17 | 18 | RestResourcesPublication(List singletons, List> classes, WebPublishingService wpService) { 19 | this.singletons = singletons; 20 | this.classes = classes; 21 | this.wpService = wpService; 22 | } 23 | 24 | // -------------------------------------------------------------------------------------------------- Public Methods 25 | 26 | void unpublish() { 27 | wpService.unpublishRestResources(singletons, classes); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/impl/RoleTypeImpl.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.impl; 2 | 3 | import systems.dmx.core.RoleType; 4 | import systems.dmx.core.ViewConfig; 5 | import systems.dmx.core.model.PlayerModel; 6 | 7 | 8 | 9 | class RoleTypeImpl extends TopicImpl implements RoleType { 10 | 11 | // ---------------------------------------------------------------------------------------------------- Constructors 12 | 13 | RoleTypeImpl(TopicModelImpl model, AccessLayer al) { 14 | super(model, al); 15 | } 16 | 17 | // -------------------------------------------------------------------------------------------------- Public Methods 18 | 19 | // View Config 20 | 21 | @Override 22 | public final ViewConfig getViewConfig() { 23 | PlayerModel configurable = al.typeStorage.newTypePlayer(getId()); 24 | return new ViewConfigImpl(configurable, getModel().getViewConfig(), al); 25 | } 26 | 27 | @Override 28 | public final Object getViewConfigValue(String configTypeUri, String childTypeUri) { 29 | return getModel().getViewConfigValue(configTypeUri, childTypeUri); 30 | } 31 | 32 | // 33 | 34 | @Override 35 | public RoleTypeModelImpl getModel() { 36 | return (RoleTypeModelImpl) model; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/impl/StaticResourcesPublication.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.impl; 2 | 3 | 4 | 5 | class StaticResourcesPublication { 6 | 7 | // ---------------------------------------------------------------------------------------------- Instance Variables 8 | 9 | private String uriNamespace; 10 | 11 | private WebPublishingService wpService; 12 | 13 | // ---------------------------------------------------------------------------------------------------- Constructors 14 | 15 | StaticResourcesPublication(String uriNamespace, WebPublishingService wpService) { 16 | this.uriNamespace = uriNamespace; 17 | this.wpService = wpService; 18 | } 19 | 20 | // -------------------------------------------------------------------------------------------------- Public Methods 21 | 22 | void unpublish() { 23 | wpService.unpublishStaticResources(uriNamespace); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/impl/TopicDeletionModelImpl.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.impl; 2 | 3 | import systems.dmx.core.model.RelatedTopicModel; 4 | import systems.dmx.core.model.TopicDeletionModel; 5 | 6 | 7 | 8 | class TopicDeletionModelImpl extends RelatedTopicModelImpl implements TopicDeletionModel { 9 | 10 | // ---------------------------------------------------------------------------------------------------- Constructors 11 | 12 | TopicDeletionModelImpl(RelatedTopicModelImpl relatedTopic) { 13 | super(relatedTopic); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/impl/TopicPlayerImpl.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.impl; 2 | 3 | import systems.dmx.core.Topic; 4 | import systems.dmx.core.TopicPlayer; 5 | 6 | 7 | 8 | /** 9 | * A topic player that is attached to the {@link AccessLayer}. 10 | */ 11 | class TopicPlayerImpl extends PlayerImpl implements TopicPlayer { 12 | 13 | // ---------------------------------------------------------------------------------------------------- Constructors 14 | 15 | TopicPlayerImpl(TopicPlayerModelImpl model, AssocModelImpl assoc) { 16 | super(model, assoc); 17 | } 18 | 19 | // -------------------------------------------------------------------------------------------------- Public Methods 20 | 21 | 22 | 23 | // === TopicPlayer Implementation === 24 | 25 | @Override 26 | public Topic getTopic() { 27 | return (Topic) getDMXObject(); 28 | } 29 | 30 | @Override 31 | public String getTopicUri() { 32 | return getModel().getTopicUri(); 33 | } 34 | 35 | 36 | 37 | // === PlayerImpl Overrides === 38 | 39 | @Override 40 | public TopicPlayerModelImpl getModel() { 41 | return (TopicPlayerModelImpl) model; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/impl/TopicTypeImpl.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.impl; 2 | 3 | import systems.dmx.core.TopicType; 4 | import systems.dmx.core.model.TopicTypeModel; 5 | 6 | 7 | 8 | /** 9 | * A topic type that is attached to the {@link CoreService}. 10 | */ 11 | class TopicTypeImpl extends DMXTypeImpl implements TopicType { 12 | 13 | // ---------------------------------------------------------------------------------------------------- Constructors 14 | 15 | TopicTypeImpl(TopicTypeModelImpl model, AccessLayer al) { 16 | super(model, al); 17 | } 18 | 19 | // -------------------------------------------------------------------------------------------------- Public Methods 20 | 21 | 22 | 23 | // ***************** 24 | // *** TopicType *** 25 | // ***************** 26 | 27 | 28 | 29 | @Override 30 | public TopicTypeModelImpl getModel() { 31 | return (TopicTypeModelImpl) model; 32 | } 33 | 34 | @Override 35 | public void update(TopicTypeModel updateModel) { 36 | model.update((TopicTypeModelImpl) updateModel); // ### FIXME: call through al for access control 37 | } 38 | 39 | 40 | 41 | // ----------------------------------------------------------------------------------------- Package Private Methods 42 | 43 | @Override 44 | TopicTypeModelImpl _getModel() { 45 | return al._getTopicType(getUri()); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/impl/ViewAssocImpl.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.impl; 2 | 3 | import systems.dmx.core.model.topicmaps.ViewAssoc; 4 | import systems.dmx.core.model.topicmaps.ViewProps; 5 | 6 | import org.codehaus.jettison.json.JSONObject; 7 | 8 | 9 | 10 | // TODO: rethink inheritance. Can we have a common "ObjectViewModel" for both, topics and assocs? 11 | // Is this a case for Java 8 interfaces, which can have a default implementation? 12 | class ViewAssocImpl extends AssocModelImpl implements ViewAssoc { 13 | 14 | // --- Instance Variables --- 15 | 16 | private ViewProps viewProps; 17 | 18 | // --- Constructors --- 19 | 20 | ViewAssocImpl(AssocModelImpl assoc, ViewProps viewProps) { 21 | super(assoc); 22 | this.viewProps = viewProps; 23 | } 24 | 25 | // --- Public Methods --- 26 | 27 | @Override 28 | public JSONObject toJSON() { 29 | try { 30 | return super.toJSON().put("viewProps", viewProps.toJSON()); 31 | } catch (Exception e) { 32 | throw new RuntimeException("Serialization failed", e); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/impl/ViewTopicImpl.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.impl; 2 | 3 | import systems.dmx.core.model.TopicModel; 4 | import systems.dmx.core.model.topicmaps.ViewTopic; 5 | import systems.dmx.core.model.topicmaps.ViewProps; 6 | 7 | import org.codehaus.jettison.json.JSONObject; 8 | 9 | 10 | 11 | // TODO: rethink inheritance. Can we have a common "ObjectViewModel" for both, topics and assocs? 12 | // Is this a case for Java 8 interfaces, which can have a default implementation? 13 | class ViewTopicImpl extends TopicModelImpl implements ViewTopic { 14 | 15 | // --- Instance Variables --- 16 | 17 | private ViewProps viewProps; 18 | 19 | // --- Constructors --- 20 | 21 | ViewTopicImpl(TopicModelImpl topic, ViewProps viewProps) { 22 | super(topic); 23 | this.viewProps = viewProps; 24 | } 25 | 26 | // --- Public Methods --- 27 | 28 | public ViewProps getViewProps() { 29 | return viewProps; 30 | } 31 | 32 | // --- 33 | 34 | public int getX() { 35 | return viewProps.getInt("dmx.topicmaps.x"); 36 | } 37 | 38 | public int getY() { 39 | return viewProps.getInt("dmx.topicmaps.y"); 40 | } 41 | 42 | public boolean getVisibility() { 43 | return viewProps.getBoolean("dmx.topicmaps.visibility"); 44 | } 45 | 46 | // --- 47 | 48 | @Override 49 | public JSONObject toJSON() { 50 | try { 51 | return super.toJSON().put("viewProps", viewProps.toJSON()); 52 | } catch (Exception e) { 53 | throw new RuntimeException("Serialization failed", e); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/migrations/Migration4.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.migrations; 2 | 3 | import systems.dmx.core.Topic; 4 | import systems.dmx.core.model.SimpleValue; 5 | import systems.dmx.core.service.Migration; 6 | 7 | 8 | 9 | /** 10 | * Renames data type "Identity" -> "Entity". 11 | * 12 | * Part of DMX 5.0 13 | * Runs only in UPDATE mode. 14 | */ 15 | public class Migration4 extends Migration { 16 | 17 | @Override 18 | public void run() { 19 | Topic identity = dmx.getTopicByUri("dmx.core.identity"); 20 | identity.setUri("dmx.core.entity"); 21 | identity.setSimpleValue(new SimpleValue("Entity")); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/model/AssocPlayerModel.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.model; 2 | 3 | 4 | 5 | /** 6 | * The data that underly an {@link AssocPlayer}. 7 | */ 8 | public interface AssocPlayerModel extends PlayerModel { 9 | } 10 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/model/AssocTypeModel.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.model; 2 | 3 | 4 | 5 | /** 6 | * The data that underly an {@link AssocType}. 7 | *

8 | * A AssocTypeModel can also be used to provide the data for an association type create or 9 | * update operation. To instantiate an AssocTypeModel use the {@link ModelFactory}. 10 | * 11 | * @author Jörg Richter 12 | */ 13 | public interface AssocTypeModel extends TypeModel { 14 | 15 | @Override 16 | AssocTypeModel addCompDef(CompDefModel compDef); 17 | } 18 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/model/CompDefModel.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.model; 2 | 3 | 4 | 5 | /** 6 | * The data that underly a {@link CompDef}. 7 | * 8 | * @author Jörg Richter 9 | */ 10 | public interface CompDefModel extends AssocModel { 11 | 12 | String getCompDefUri(); 13 | 14 | /** 15 | * @return the URI of the Custom Assoc Type set for this comp def, or null if no 16 | * Custom Assoc Type is set. 17 | */ 18 | String getCustomAssocTypeUri(); 19 | 20 | /** 21 | * @return the type to be used to create an association instance based on this comp def. 22 | */ 23 | String getInstanceLevelAssocTypeUri(); 24 | 25 | String getParentTypeUri(); 26 | 27 | String getChildTypeUri(); 28 | 29 | String getChildCardinalityUri(); 30 | 31 | ViewConfigModel getViewConfig(); 32 | 33 | // --- 34 | 35 | // TODO: currently not supported. Drop from public API? 36 | void setChildCardinalityUri(String childCardinalityUri); 37 | 38 | void setViewConfig(ViewConfigModel viewConfig); 39 | } 40 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/model/DMXObjectModel.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.model; 2 | 3 | import systems.dmx.core.Identifiable; 4 | import systems.dmx.core.JSONEnabled; 5 | 6 | 7 | 8 | /** 9 | * The data that underly a {@link DMXObject}. 10 | */ 11 | public interface DMXObjectModel extends Identifiable, JSONEnabled, Cloneable { 12 | 13 | // --- ID --- 14 | 15 | long getId(); 16 | 17 | void setId(long id); 18 | 19 | // --- URI --- 20 | 21 | String getUri(); 22 | 23 | void setUri(String uri); 24 | 25 | // --- Type URI --- 26 | 27 | String getTypeUri(); 28 | 29 | void setTypeUri(String typeUri); 30 | 31 | // --- Simple Value --- 32 | 33 | SimpleValue getSimpleValue(); 34 | 35 | // --- 36 | 37 | void setSimpleValue(String value); 38 | 39 | void setSimpleValue(int value); 40 | 41 | void setSimpleValue(long value); 42 | 43 | void setSimpleValue(boolean value); 44 | 45 | void setSimpleValue(SimpleValue value); 46 | 47 | // --- Child Topics --- 48 | 49 | ChildTopicsModel getChildTopics(); 50 | 51 | void setChildTopics(ChildTopicsModel childTopics); 52 | 53 | // --- misc --- 54 | 55 | // ### TODO: drop it? 56 | void set(DMXObjectModel object); 57 | 58 | // --- 59 | 60 | PlayerModel createPlayerModel(String roleTypeUri); 61 | 62 | 63 | 64 | // === Java API === 65 | 66 | DMXObjectModel clone(); // TODO: make generic 67 | } 68 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/model/PlayerModel.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.model; 2 | 3 | import systems.dmx.core.JSONEnabled; 4 | 5 | 6 | 7 | /** 8 | * The data that underly a {@link Player}. 9 | */ 10 | public interface PlayerModel extends JSONEnabled, Cloneable { 11 | 12 | long getId(); 13 | 14 | String getRoleTypeUri(); 15 | 16 | String getTypeUri(); 17 | 18 | // --- 19 | 20 | void setId(long id); 21 | 22 | void setRoleTypeUri(String roleTypeUri); 23 | 24 | // --- 25 | 26 | PlayerModel clone(); 27 | } 28 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/model/RelatedAssocModel.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.model; 2 | 3 | 4 | 5 | public interface RelatedAssocModel extends AssocModel, RelatedObjectModel { 6 | } 7 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/model/RelatedObjectModel.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.model; 2 | 3 | 4 | 5 | public interface RelatedObjectModel extends DMXObjectModel { 6 | 7 | AssocModel getRelatingAssoc(); 8 | } 9 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/model/RelatedTopicModel.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.model; 2 | 3 | 4 | 5 | public interface RelatedTopicModel extends TopicModel, RelatedObjectModel { 6 | 7 | RelatedTopicModel clone(); 8 | } 9 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/model/RoleTypeModel.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.model; 2 | 3 | 4 | 5 | /** 6 | * Data that underlies a {@link RoleType}. 7 | * 8 | * @author Jörg Richter 9 | */ 10 | public interface RoleTypeModel extends TopicModel { 11 | 12 | // View Config 13 | 14 | ViewConfigModel getViewConfig(); 15 | 16 | Object getViewConfigValue(String configTypeUri, String childTypeUri); 17 | 18 | // needed? 19 | void setViewConfig(ViewConfigModel viewConfig); 20 | } 21 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/model/TopicDeletionModel.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.model; 2 | 3 | 4 | 5 | public interface TopicDeletionModel extends RelatedTopicModel { 6 | } 7 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/model/TopicModel.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.model; 2 | 3 | 4 | 5 | /** 6 | * The data that underly a {@link Topic}. 7 | *

8 | * A TopicModel can also be used to provide the data for a topic create or update 9 | * operation. To instantiate a TopicModel use the {@link ModelFactory}. 10 | * 11 | * @author Jörg Richter 12 | */ 13 | public interface TopicModel extends DMXObjectModel { 14 | 15 | TopicModel clone(); 16 | } 17 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/model/TopicPlayerModel.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.model; 2 | 3 | 4 | 5 | /** 6 | * The data that underly a {@link TopicPlayer}. 7 | */ 8 | public interface TopicPlayerModel extends PlayerModel { 9 | 10 | String getTopicUri(); 11 | 12 | boolean topicIdentifiedByUri(); 13 | } 14 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/model/TopicReferenceModel.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.model; 2 | 3 | import java.util.List; 4 | 5 | 6 | 7 | public interface TopicReferenceModel extends RelatedTopicModel { 8 | 9 | boolean isReferenceById(); 10 | 11 | boolean isReferenceByUri(); 12 | 13 | /** 14 | * Returns true if this reference refers to nothing. 15 | */ 16 | boolean isEmptyRef(); 17 | 18 | // --- 19 | 20 | /** 21 | * Checks whether this reference refers to the given topic. 22 | */ 23 | boolean isReferingTo(TopicModel topic); 24 | 25 | /** 26 | * From the given topics finds the one this reference refers to. 27 | */ 28 | RelatedTopicModel findReferencedTopic(List topics); 29 | } 30 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/model/TopicTypeModel.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.model; 2 | 3 | 4 | 5 | /** 6 | * The data that underly a {@link TopicType}. 7 | *

8 | * A TopicTypeModel can also be used to provide the data for a topic type create or update 9 | * operation. To instantiate a TopicTypeModel use the {@link ModelFactory}. 10 | * 11 | * @author Jörg Richter 12 | */ 13 | public interface TopicTypeModel extends TypeModel { 14 | 15 | @Override 16 | TopicTypeModel addCompDef(CompDefModel compDef); 17 | } 18 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/model/topicmaps/ViewAssoc.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.model.topicmaps; 2 | 3 | import systems.dmx.core.model.AssocModel; 4 | 5 | 6 | 7 | /** 8 | * An association viewmodel as contained in a topicmap viewmodel. 9 | */ 10 | public interface ViewAssoc extends AssocModel { 11 | 12 | // ViewProps getViewProps(); // TODO: needed? 13 | } 14 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/model/topicmaps/ViewProps.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.model.topicmaps; 2 | 3 | import systems.dmx.core.DMXObject; 4 | import systems.dmx.core.JSONEnabled; 5 | 6 | 7 | 8 | /** 9 | * A mapping of prop URIs (strings) to prop values (objects). Used to hold and transport view properties. 10 | * There are (de)serialzation and store-to-DB facilities. 11 | *

12 | * Note: ViewTopic/ViewAssoc extends a core model class. Core model classes can only be instantiated through the model 13 | * factory. The newViewTopic/Assoc calls expect a ViewProps object. That's why ViewProps is specified in the Core as 14 | * well despite ViewProps does not extend a core model class. 15 | */ 16 | public interface ViewProps extends Iterable, JSONEnabled { 17 | 18 | /** 19 | * Returns the prop value mapped to the given prop URI, or null if no value is mapped. 20 | */ 21 | Object get(String propUri); 22 | 23 | /** 24 | * Convenience getter. 25 | */ 26 | String getString(String propUri); 27 | 28 | /** 29 | * Convenience getter. 30 | */ 31 | int getInt(String propUri); 32 | 33 | /** 34 | * Convenience getter. 35 | */ 36 | boolean getBoolean(String propUri); 37 | 38 | ViewProps set(String propUri, Object value); 39 | 40 | void store(DMXObject object); 41 | } 42 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/model/topicmaps/ViewTopic.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.model.topicmaps; 2 | 3 | import systems.dmx.core.model.TopicModel; 4 | 5 | 6 | 7 | /** 8 | * A topic viewmodel as contained in a topicmap viewmodel. 9 | *

10 | * That is a generic topic model enriched by view properties. Standard view properties are "dmx.topicmaps.x", 11 | * "dmx.topicmaps.y", and "dmx.topicmaps.visibility". Additional view properties can be added by plugins (by 12 | * implementing a Viewmodel Customizer). 13 | */ 14 | public interface ViewTopic extends TopicModel { 15 | 16 | ViewProps getViewProps(); 17 | 18 | // --- 19 | 20 | /** 21 | * Convencience method to access the "dmx.topicmaps.x" standard view property. 22 | */ 23 | int getX(); 24 | 25 | /** 26 | * Convencience method to access the "dmx.topicmaps.y" standard view property. 27 | */ 28 | int getY(); 29 | 30 | /** 31 | * Convencience method to access the "dmx.topicmaps.visibility" standard view property. 32 | */ 33 | boolean getVisibility(); 34 | } 35 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/osgi/PluginContext.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.osgi; 2 | 3 | import systems.dmx.core.service.CoreService; 4 | 5 | import org.osgi.framework.BundleContext; 6 | 7 | 8 | 9 | public interface PluginContext { 10 | 11 | // --- Hooks to be overridden by the plugin developer --- 12 | 13 | void preInstall(); 14 | 15 | void init(); 16 | 17 | void shutdown(); 18 | 19 | void serviceArrived(Object service); 20 | 21 | void serviceGone(Object service); 22 | 23 | // --- Internal --- 24 | 25 | String getPluginName(); 26 | 27 | BundleContext getBundleContext(); 28 | 29 | void setCoreService(CoreService dmx); 30 | } 31 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/ChangeReport.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service; 2 | 3 | import systems.dmx.core.JSONEnabled; 4 | import systems.dmx.core.Topic; 5 | import systems.dmx.core.RelatedTopic; 6 | 7 | import java.util.List; 8 | 9 | import org.codehaus.jettison.json.JSONObject; 10 | 11 | 12 | 13 | public interface ChangeReport extends JSONEnabled { 14 | 15 | boolean hasChanges(); 16 | 17 | List getChanges(String compDefUri); 18 | 19 | class Change implements JSONEnabled { 20 | 21 | // TODO: type newValue RelatedTopic. 22 | // At the moment in case of a facet update we have just a Topic though. 23 | public Topic newValue; 24 | public RelatedTopic oldValue; 25 | 26 | public Change(Topic newValue, RelatedTopic oldValue) { 27 | this.newValue = newValue; 28 | this.oldValue = oldValue; 29 | } 30 | 31 | @Override 32 | public JSONObject toJSON() { 33 | try { 34 | return new JSONObject() 35 | .put("newValue", newValue != null ? newValue.toJSON() : JSONObject.NULL) 36 | .put("oldValue", oldValue != null ? oldValue.toJSON() : JSONObject.NULL); 37 | } catch (Exception e) { 38 | throw new RuntimeException("Serialization failed", e); 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/CriticalityLevel.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service; 2 | 3 | 4 | 5 | public enum CriticalityLevel { 6 | WARNING, ERROR 7 | } 8 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/DMXException.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service; 2 | 3 | 4 | 5 | public class DMXException extends RuntimeException { 6 | 7 | private CriticalityLevel level; 8 | 9 | public DMXException(String message, CriticalityLevel level) { 10 | super(message); 11 | this.level = level; 12 | } 13 | 14 | public CriticalityLevel getLevel() { 15 | return level; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/Directive.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service; 2 | 3 | public enum Directive { 4 | 5 | UPDATE_TOPIC, 6 | DELETE_TOPIC, 7 | 8 | UPDATE_ASSOC, 9 | DELETE_ASSOC, 10 | 11 | UPDATE_TOPIC_TYPE, 12 | DELETE_TOPIC_TYPE, 13 | 14 | UPDATE_ASSOC_TYPE, 15 | DELETE_ASSOC_TYPE, 16 | 17 | UPDATE_ROLE_TYPE, 18 | DELETE_ROLE_TYPE 19 | } 20 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/EventListener.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service; 2 | 3 | 4 | 5 | /** 6 | * Marker interface for all event listener interfaces. 7 | * ### TODO: rename to DMXEventListener? 8 | */ 9 | public interface EventListener { 10 | } 11 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/Inject.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | 9 | 10 | @Target(ElementType.FIELD) 11 | @Retention(RetentionPolicy.RUNTIME) 12 | public @interface Inject { 13 | } 14 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/Plugin.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service; 2 | 3 | import java.io.InputStream; 4 | 5 | 6 | 7 | public interface Plugin { 8 | 9 | /** 10 | * Accesses a static resource of the plugin. A static resource is some data (images, audio, text, etc) that is 11 | * contained in the plugin bundle (that is the jar file). 12 | * 13 | * @param name The resource name: a "/"-separated path name, relative to the plugin bundle's root directory. 14 | * It may or may not begin with "/" (it makes no difference). 15 | * 16 | * @return An InputStream to read the static resource content. 17 | * 18 | * @throws RuntimeException If no such static resource is contained in the plugin bundle. 19 | */ 20 | InputStream getStaticResource(String name); 21 | 22 | /** 23 | * Checks if this plugin bundle contains a static resource with the given name. 24 | * 25 | * @param name The resource name: a "/"-separated path name, relative to the plugin bundle's root directory. 26 | * It may or may not begin with "/" (it makes no difference). 27 | */ 28 | boolean hasStaticResource(String name); 29 | } 30 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/PluginInfo.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service; 2 | 3 | import systems.dmx.core.JSONEnabled; 4 | 5 | 6 | 7 | public interface PluginInfo extends JSONEnabled { 8 | } 9 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/TopicResult.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service; 2 | 3 | import systems.dmx.core.JSONEnabled; 4 | import systems.dmx.core.Topic; 5 | import systems.dmx.core.util.DMXUtils; 6 | import org.codehaus.jettison.json.JSONObject; 7 | import java.util.List; 8 | 9 | 10 | 11 | public class TopicResult implements JSONEnabled { 12 | 13 | // ---------------------------------------------------------------------------------------------- Instance Variables 14 | 15 | public String query; 16 | public String topicTypeUri; 17 | public boolean searchChildTopics; 18 | public List topics; 19 | 20 | // ---------------------------------------------------------------------------------------------------- Constructors 21 | 22 | public TopicResult(String query, String topicTypeUri, boolean searchChildTopics, List topics) { 23 | this.query = query; 24 | this.topicTypeUri = topicTypeUri; 25 | this.searchChildTopics = searchChildTopics; 26 | this.topics = topics; 27 | } 28 | 29 | // -------------------------------------------------------------------------------------------------- Public Methods 30 | 31 | @Override 32 | public JSONObject toJSON() { 33 | try { 34 | return new JSONObject() 35 | .put("query", query) 36 | .put("topicTypeUri", topicTypeUri) 37 | .put("searchChildTopics", searchChildTopics) 38 | .put("topics", DMXUtils.toJSONArray(topics)); 39 | } catch (Exception e) { 40 | throw new RuntimeException("Serialization failed", e); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/Transactional.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | 9 | 10 | @Target(ElementType.METHOD) 11 | @Retention(RetentionPolicy.RUNTIME) 12 | public @interface Transactional { 13 | } 14 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/accesscontrol/AccessControlException.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.accesscontrol; 2 | 3 | 4 | 5 | public class AccessControlException extends RuntimeException { 6 | 7 | public AccessControlException(String message) { 8 | super(message); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/accesscontrol/Operation.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.accesscontrol; 2 | 3 | 4 | 5 | public enum Operation { 6 | 7 | READ("dmx.accesscontrol.operation.read"), 8 | WRITE("dmx.accesscontrol.operation.write"); 9 | 10 | public final String uri; 11 | 12 | private Operation(String uri) { 13 | this.uri = uri; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/accesscontrol/Permissions.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.accesscontrol; 2 | 3 | import systems.dmx.core.JSONEnabled; 4 | 5 | import org.codehaus.jettison.json.JSONObject; 6 | 7 | import java.util.HashMap; 8 | 9 | 10 | 11 | /** 12 | * Calculated permissions for the current user. 13 | *

14 | * A mapping from operations to booleans. 15 | */ 16 | public class Permissions extends HashMap implements JSONEnabled { 17 | 18 | // -------------------------------------------------------------------------------------------------- Public Methods 19 | 20 | public Permissions add(Operation operation, boolean allowed) { 21 | put(operation.uri, allowed); 22 | return this; 23 | } 24 | 25 | @Override 26 | public JSONObject toJSON() { 27 | return new JSONObject(this); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/AllPluginsActive.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.service.EventListener; 4 | 5 | 6 | 7 | public interface AllPluginsActive extends EventListener { 8 | 9 | void allPluginsActive(); 10 | } 11 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/CheckAssocReadAccess.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.service.EventListener; 4 | 5 | 6 | 7 | public interface CheckAssocReadAccess extends EventListener { 8 | 9 | void checkAssocReadAccess(long assocId); 10 | } 11 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/CheckAssocWriteAccess.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.service.EventListener; 4 | 5 | 6 | 7 | public interface CheckAssocWriteAccess extends EventListener { 8 | 9 | void checkAssocWriteAccess(long assocId); 10 | } 11 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/CheckTopicReadAccess.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.service.EventListener; 4 | 5 | 6 | 7 | public interface CheckTopicReadAccess extends EventListener { 8 | 9 | void checkTopicReadAccess(long topicId); 10 | } 11 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/CheckTopicWriteAccess.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.service.EventListener; 4 | 5 | 6 | 7 | public interface CheckTopicWriteAccess extends EventListener { 8 | 9 | void checkTopicWriteAccess(long topicId); 10 | } 11 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/IntroduceRoleType.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.RoleType; 4 | import systems.dmx.core.service.EventListener; 5 | 6 | 7 | 8 | public interface IntroduceRoleType extends EventListener { 9 | 10 | void introduceRoleType(RoleType roleType); 11 | } 12 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/PostCreateAssoc.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.Assoc; 4 | import systems.dmx.core.service.EventListener; 5 | 6 | 7 | 8 | public interface PostCreateAssoc extends EventListener { 9 | 10 | void postCreateAssoc(Assoc assoc); 11 | } 12 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/PostCreateTopic.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.Topic; 4 | import systems.dmx.core.service.EventListener; 5 | 6 | 7 | 8 | public interface PostCreateTopic extends EventListener { 9 | 10 | void postCreateTopic(Topic topic); 11 | } 12 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/PostDeleteAssoc.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.model.AssocModel; 4 | import systems.dmx.core.service.EventListener; 5 | 6 | 7 | 8 | public interface PostDeleteAssoc extends EventListener { 9 | 10 | void postDeleteAssoc(AssocModel assoc); 11 | } 12 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/PostDeleteTopic.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.model.TopicModel; 4 | import systems.dmx.core.service.EventListener; 5 | 6 | 7 | 8 | public interface PostDeleteTopic extends EventListener { 9 | 10 | void postDeleteTopic(TopicModel topic); 11 | } 12 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/PostUpdateAssoc.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.Assoc; 4 | import systems.dmx.core.model.AssocModel; 5 | import systems.dmx.core.service.ChangeReport; 6 | import systems.dmx.core.service.EventListener; 7 | 8 | 9 | 10 | public interface PostUpdateAssoc extends EventListener { 11 | 12 | void postUpdateAssoc(Assoc assoc, ChangeReport report, AssocModel updateModel); 13 | } 14 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/PostUpdateTopic.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.Topic; 4 | import systems.dmx.core.model.TopicModel; 5 | import systems.dmx.core.service.ChangeReport; 6 | import systems.dmx.core.service.EventListener; 7 | 8 | 9 | 10 | public interface PostUpdateTopic extends EventListener { 11 | 12 | void postUpdateTopic(Topic topic, ChangeReport report, TopicModel updateModel); 13 | } 14 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/PreCreateAssoc.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.model.AssocModel; 4 | import systems.dmx.core.service.EventListener; 5 | 6 | 7 | 8 | public interface PreCreateAssoc extends EventListener { 9 | 10 | void preCreateAssoc(AssocModel model); 11 | } 12 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/PreCreateAssocType.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.model.AssocTypeModel; 4 | import systems.dmx.core.service.EventListener; 5 | 6 | 7 | 8 | public interface PreCreateAssocType extends EventListener { 9 | 10 | void preCreateAssocType(AssocTypeModel model); 11 | } 12 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/PreCreateRoleType.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.model.RoleTypeModel; 4 | import systems.dmx.core.service.EventListener; 5 | 6 | 7 | 8 | public interface PreCreateRoleType extends EventListener { 9 | 10 | void preCreateRoleType(RoleTypeModel model); 11 | } 12 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/PreCreateTopic.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.model.TopicModel; 4 | import systems.dmx.core.service.EventListener; 5 | 6 | 7 | 8 | public interface PreCreateTopic extends EventListener { 9 | 10 | void preCreateTopic(TopicModel model); 11 | } 12 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/PreCreateTopicType.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.model.TopicTypeModel; 4 | import systems.dmx.core.service.EventListener; 5 | 6 | 7 | 8 | public interface PreCreateTopicType extends EventListener { 9 | 10 | void preCreateTopicType(TopicTypeModel model); 11 | } 12 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/PreDeleteAssoc.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.Assoc; 4 | import systems.dmx.core.service.EventListener; 5 | 6 | 7 | 8 | public interface PreDeleteAssoc extends EventListener { 9 | 10 | void preDeleteAssoc(Assoc assoc); 11 | } 12 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/PreDeleteTopic.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.Topic; 4 | import systems.dmx.core.service.EventListener; 5 | 6 | 7 | 8 | public interface PreDeleteTopic extends EventListener { 9 | 10 | void preDeleteTopic(Topic topic); 11 | } 12 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/PreSendAssoc.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.Assoc; 4 | import systems.dmx.core.service.EventListener; 5 | 6 | 7 | 8 | public interface PreSendAssoc extends EventListener { 9 | 10 | void preSendAssoc(Assoc assoc); 11 | } 12 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/PreSendAssocType.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.AssocType; 4 | import systems.dmx.core.service.EventListener; 5 | 6 | 7 | 8 | public interface PreSendAssocType extends EventListener { 9 | 10 | void preSendAssocType(AssocType assocType); 11 | } 12 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/PreSendTopic.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.Topic; 4 | import systems.dmx.core.service.EventListener; 5 | 6 | 7 | 8 | public interface PreSendTopic extends EventListener { 9 | 10 | void preSendTopic(Topic topic); 11 | } 12 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/PreSendTopicType.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.TopicType; 4 | import systems.dmx.core.service.EventListener; 5 | 6 | 7 | 8 | public interface PreSendTopicType extends EventListener { 9 | 10 | void preSendTopicType(TopicType topicType); 11 | } 12 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/PreUpdateAssoc.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.Assoc; 4 | import systems.dmx.core.model.AssocModel; 5 | import systems.dmx.core.service.EventListener; 6 | 7 | 8 | 9 | public interface PreUpdateAssoc extends EventListener { 10 | 11 | void preUpdateAssoc(Assoc assoc, AssocModel updateModel); 12 | } 13 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/PreUpdateTopic.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.Topic; 4 | import systems.dmx.core.model.TopicModel; 5 | import systems.dmx.core.service.EventListener; 6 | 7 | 8 | 9 | public interface PreUpdateTopic extends EventListener { 10 | 11 | void preUpdateTopic(Topic topic, TopicModel updateModel); 12 | } 13 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/ServiceRequestFilter.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.service.EventListener; 4 | 5 | // ### TODO: hide Jersey internals. Upgrade to JAX-RS 2.0. 6 | import com.sun.jersey.spi.container.ContainerRequest; 7 | 8 | 9 | 10 | public interface ServiceRequestFilter extends EventListener { 11 | 12 | void serviceRequestFilter(ContainerRequest containerRequest); 13 | } 14 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/ServiceResponseFilter.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.service.EventListener; 4 | 5 | // ### TODO: hide Jersey internals. Upgrade to JAX-RS 2.0. 6 | import com.sun.jersey.spi.container.ContainerResponse; 7 | 8 | 9 | 10 | public interface ServiceResponseFilter extends EventListener { 11 | 12 | void serviceResponseFilter(ContainerResponse response); 13 | } 14 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/StaticResourceFilter.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.service.EventListener; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | import javax.servlet.http.HttpServletResponse; 7 | 8 | 9 | 10 | public interface StaticResourceFilter extends EventListener { 11 | 12 | void staticResourceFilter(HttpServletRequest request, HttpServletResponse response); 13 | } 14 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/event/WebsocketTextMessage.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.event; 2 | 3 | import systems.dmx.core.service.EventListener; 4 | 5 | 6 | 7 | public interface WebsocketTextMessage extends EventListener { 8 | 9 | void websocketTextMessage(String message); 10 | } 11 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/websocket/WebSocketConnection.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.websocket; 2 | 3 | 4 | 5 | public interface WebSocketConnection { 6 | 7 | String getClientId(); 8 | 9 | /** 10 | * @return the username associated with this WebSocket connection, or null if no one is associated (= not logged in). 11 | */ 12 | String getUsername(); 13 | } 14 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/service/websocket/WebSocketService.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.service.websocket; 2 | 3 | import java.util.function.Predicate; 4 | 5 | 6 | 7 | public interface WebSocketService { 8 | 9 | void sendToOrigin(String message); 10 | 11 | void sendToAll(String message); 12 | 13 | void sendToAllButOrigin(String message); 14 | 15 | void sendToReadAllowed(String message, long objectId); 16 | 17 | void sendToSome(String message, Predicate connectionFilter); 18 | 19 | // --- 20 | 21 | String getWebSocketURL(); 22 | } 23 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/storage/spi/DMXStorageFactory.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.storage.spi; 2 | 3 | import systems.dmx.core.impl.ModelFactoryImpl; 4 | 5 | 6 | 7 | /** 8 | * A factory for obtaining a DMX storage. 9 | */ 10 | public interface DMXStorageFactory { 11 | 12 | DMXStorage newDMXStorage(String databasePath, ModelFactoryImpl mf); 13 | } 14 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/storage/spi/DMXTransaction.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.storage.spi; 2 | 3 | 4 | 5 | public interface DMXTransaction { 6 | 7 | void success(); 8 | 9 | void failure(); 10 | 11 | void finish(); 12 | } 13 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/util/ContextTracker.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.util; 2 | 3 | import java.util.concurrent.Callable; 4 | 5 | 6 | 7 | public class ContextTracker { 8 | 9 | // ---------------------------------------------------------------------------------------------- Instance Variables 10 | 11 | private ThreadLocal tl = new ThreadLocal(); 12 | 13 | // -------------------------------------------------------------------------------------------------- Public Methods 14 | 15 | public V run(long value, Callable callable) throws Exception { 16 | Long _value = null; 17 | try { 18 | _value = tl.get(); 19 | tl.set(value); 20 | return callable.call(); // throws exception 21 | } finally { 22 | tl.set(_value); 23 | } 24 | } 25 | 26 | public Long getValue() { 27 | return tl.get(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/util/IdList.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.util; 2 | 3 | import systems.dmx.core.Identifiable; 4 | import java.util.ArrayList; 5 | 6 | 7 | 8 | public class IdList extends ArrayList { 9 | 10 | public IdList() { 11 | } 12 | 13 | public IdList(String ids) { 14 | for (String id : ids.split(",")) { 15 | add(Long.parseLong(id)); 16 | } 17 | } 18 | 19 | public IdList(Iterable items) { 20 | items.forEach(item -> add(item.getId())); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/java/systems/dmx/core/util/SequencedHashMap.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.core.util; 2 | 3 | import java.util.ArrayList; 4 | import java.util.LinkedHashMap; 5 | import java.util.List; 6 | 7 | 8 | 9 | public class SequencedHashMap extends LinkedHashMap { 10 | 11 | /** 12 | * @param beforeKey the key before the key-value entry is put. 13 | * If null the entry is put at the end. 14 | * If non-null but not contained in the map an exception is thrown. 15 | */ 16 | public void putBefore(K key, V value, K beforeKey) { 17 | // collect keys of entries to shift 18 | List shiftKeys = new ArrayList(); 19 | if (beforeKey != null) { 20 | boolean shift = false; 21 | for (K k : keySet()) { 22 | if (!shift && k.equals(beforeKey)) { 23 | shift = true; 24 | } 25 | if (shift) { 26 | shiftKeys.add(k); 27 | } 28 | } 29 | // 30 | if (shiftKeys.isEmpty()) { 31 | throw new RuntimeException("Key \"" + beforeKey + "\" not found in " + keySet()); 32 | } 33 | } 34 | // 35 | put(key, value); 36 | // 37 | // shift entries 38 | for (K k : shiftKeys) { 39 | put(k, remove(k)); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/resources/migrations/migration2.json: -------------------------------------------------------------------------------- 1 | { 2 | "topic_types": [ 3 | { 4 | "value": "Identity Attribute", 5 | "uri": "dmx.core.identity_attr", 6 | "dataTypeUri": "dmx.core.boolean" 7 | }, 8 | { 9 | "value": "Include in Label", 10 | "uri": "dmx.core.include_in_label", 11 | "dataTypeUri": "dmx.core.boolean" 12 | } 13 | ], 14 | "assoc_types": [ 15 | { 16 | "value": "Custom Association Type", 17 | "uri": "dmx.core.custom_assoc_type", 18 | "dataTypeUri": "dmx.core.text" 19 | }, 20 | { 21 | "value": "Composition Definition", 22 | "uri": "dmx.core.composition_def", 23 | "dataTypeUri": "dmx.core.composite", 24 | "compDefs": [ 25 | { 26 | "childTypeUri": "dmx.core.cardinality", 27 | "childCardinalityUri": "dmx.core.one", 28 | "includeInLabel": true 29 | }, 30 | { 31 | "childTypeUri": "dmx.core.assoc_type", 32 | "childCardinalityUri": "dmx.core.one", 33 | "customAssocTypeUri": "dmx.core.custom_assoc_type", 34 | "includeInLabel": true 35 | }, 36 | { 37 | "childTypeUri": "dmx.core.identity_attr", 38 | "childCardinalityUri": "dmx.core.one" 39 | }, 40 | { 41 | "childTypeUri": "dmx.core.include_in_label", 42 | "childCardinalityUri": "dmx.core.one" 43 | } 44 | ] 45 | } 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/resources/migrations/migration3.json: -------------------------------------------------------------------------------- 1 | { 2 | "topic_types": [ 3 | { 4 | "value": "Plugin Name", 5 | "uri": "dmx.core.plugin_name", 6 | "dataTypeUri": "dmx.core.text" 7 | }, 8 | { 9 | "value": "Symbolic Name", 10 | "uri": "dmx.core.plugin_symbolic_name", 11 | "dataTypeUri": "dmx.core.text" 12 | }, 13 | { 14 | "value": "Migration Nr.", 15 | "uri": "dmx.core.plugin_migration_nr", 16 | "dataTypeUri": "dmx.core.number" 17 | }, 18 | { 19 | "value": "Plugin", 20 | "uri": "dmx.core.plugin", 21 | "dataTypeUri": "dmx.core.entity", 22 | "compDefs": [ 23 | { 24 | "childTypeUri": "dmx.core.plugin_name", 25 | "childCardinalityUri": "dmx.core.one" 26 | }, 27 | { 28 | "childTypeUri": "dmx.core.plugin_symbolic_name", 29 | "childCardinalityUri": "dmx.core.one" 30 | }, 31 | { 32 | "childTypeUri": "dmx.core.plugin_migration_nr", 33 | "childCardinalityUri": "dmx.core.one" 34 | } 35 | ] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /modules/dmx-core/src/main/resources/migrations/migration4.properties: -------------------------------------------------------------------------------- 1 | migrationRunMode = UPDATE 2 | -------------------------------------------------------------------------------- /modules/dmx-datetime/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 4.0.0 6 | 7 | DMX Date/Time 8 | systems.dmx 9 | dmx-datetime 10 | 5.4-SNAPSHOT 11 | bundle 12 | 13 | 14 | systems.dmx 15 | dmx-plugin 16 | 5.4-SNAPSHOT 17 | ../dmx-plugin/pom.xml 18 | 19 | 20 | -------------------------------------------------------------------------------- /modules/dmx-datetime/src/main/java/systems/dmx/datetime/Constants.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.datetime; 2 | 3 | 4 | 5 | public class Constants { 6 | 7 | // Topic Types 8 | public static final String DATETIME = "dmx.datetime"; 9 | public static final String DATE = "dmx.datetime.date"; 10 | public static final String TIME = "dmx.datetime.time"; 11 | public static final String MONTH = "dmx.datetime.month"; 12 | public static final String DAY = "dmx.datetime.day"; 13 | public static final String YEAR = "dmx.datetime.year"; 14 | public static final String HOUR = "dmx.datetime.hour"; 15 | public static final String MINUTE = "dmx.datetime.minute"; 16 | 17 | // Assoc Types 18 | public static final String FROM = "dmx.datetime.from"; 19 | public static final String TO = "dmx.datetime.to"; 20 | } 21 | -------------------------------------------------------------------------------- /modules/dmx-datetime/src/main/js/components/mixins/comp-def.js: -------------------------------------------------------------------------------- 1 | import dmx from 'dmx-api' 2 | 3 | export default { 4 | props: { 5 | compDef: { 6 | type: dmx.CompDef, 7 | required: true 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /modules/dmx-datetime/src/main/js/components/mixins/context.js: -------------------------------------------------------------------------------- 1 | export default { 2 | props: { 3 | context: { 4 | type: Object, 5 | required: true 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /modules/dmx-datetime/src/main/js/components/mixins/info-mode.js: -------------------------------------------------------------------------------- 1 | export default { 2 | computed: { 3 | infoMode () { 4 | return this.mode === 'info' 5 | }, 6 | formMode () { 7 | return this.mode === 'form' 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /modules/dmx-datetime/src/main/js/components/mixins/object.js: -------------------------------------------------------------------------------- 1 | import dmx from 'dmx-api' 2 | 3 | export default { 4 | props: { 5 | // the Topic/Assoc to render; is never undefined; 6 | // may be an "empty" topic/assoc, without ID, with just type set 7 | object: { 8 | type: dmx.DMXObject, 9 | required: true 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /modules/dmx-datetime/src/main/js/components/mixins/path.js: -------------------------------------------------------------------------------- 1 | export default { 2 | props: { 3 | path: { 4 | type: Array, 5 | required: true 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /modules/dmx-datetime/src/main/js/plugin.js: -------------------------------------------------------------------------------- 1 | export default { 2 | valueRenderers: { 3 | 'dmx.datetime.date': require('./components/dmx-date-picker').default, 4 | 'dmx.datetime.time': require('./components/dmx-time-picker').default 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /modules/dmx-datetime/src/main/resources/plugin.properties: -------------------------------------------------------------------------------- 1 | dmx.plugin.model_version = 1 2 | -------------------------------------------------------------------------------- /modules/dmx-distribution/bundle-deploy/about-this-directory.txt: -------------------------------------------------------------------------------- 1 | 2 | About the bundle-deploy directory 3 | --------------------------------- 4 | 5 | This is the hot deploy directory. 6 | 7 | Drop bundles here to deploy them. 8 | Remove to undeploy. 9 | 10 | So, to install e.g. a DeepaMehta plugin (.jar file) just drop it here. 11 | Restarting DeepaMehta is not required. 12 | 13 | -------------------------------------------------------------------------------- /modules/dmx-distribution/bundle-dev/about-this-directory.txt: -------------------------------------------------------------------------------- 1 | 2 | About the bundle-dev directory 3 | ------------------------------ 4 | 5 | This is where you develop your own DMX plugins. 6 | 7 | Create a new directory here for each plugin. 8 | Every time you build your plugin it gets automatically (re)deployed. 9 | 10 | -------------------------------------------------------------------------------- /modules/dmx-events/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 4.0.0 6 | 7 | DMX Events 8 | systems.dmx 9 | dmx-events 10 | 5.4-SNAPSHOT 11 | bundle 12 | 13 | 14 | systems.dmx 15 | dmx-plugin 16 | 5.4-SNAPSHOT 17 | ../dmx-plugin/pom.xml 18 | 19 | 20 | 21 | 22 | systems.dmx 23 | dmx-contacts 24 | 5.4-SNAPSHOT 25 | 26 | 27 | systems.dmx 28 | dmx-timestamps 29 | 5.4-SNAPSHOT 30 | 31 | 32 | 33 | 34 | 35 | 36 | org.apache.felix 37 | maven-bundle-plugin 38 | 39 | 40 | systems.dmx.events.EventsPlugin 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /modules/dmx-events/src/main/java/systems/dmx/events/Constants.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.events; 2 | 3 | 4 | 5 | public class Constants { 6 | 7 | // Topic Types 8 | public static final String EVENT = "dmx.events.event"; 9 | public static final String EVENT_NAME = "dmx.events.event_name"; 10 | public static final String EVENT_DESCRIPTION = "dmx.events.event_description"; 11 | public static final String EVENT_INVOLVEMENT_ROLE = "dmx.events.role"; 12 | 13 | // Assoc Types 14 | public static final String EVENT_INVOLVEMENT = "dmx.events.event_involvement"; 15 | } 16 | -------------------------------------------------------------------------------- /modules/dmx-events/src/main/java/systems/dmx/events/EventsService.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.events; 2 | 3 | import systems.dmx.core.RelatedTopic; 4 | 5 | import java.util.List; 6 | 7 | 8 | 9 | public interface EventsService { 10 | 11 | List getEvents(long personId); 12 | 13 | List getPersons(long eventId); 14 | } 15 | -------------------------------------------------------------------------------- /modules/dmx-events/src/main/resources/plugin.properties: -------------------------------------------------------------------------------- 1 | dmx.plugin.model_version = 1 2 | dmx.plugin.dependencies = systems.dmx.contacts 3 | -------------------------------------------------------------------------------- /modules/dmx-facets/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 4.0.0 6 | 7 | DMX Facets 8 | systems.dmx 9 | dmx-facets 10 | 5.4-SNAPSHOT 11 | bundle 12 | 13 | 14 | systems.dmx 15 | dmx-plugin 16 | 5.4-SNAPSHOT 17 | ../dmx-plugin/pom.xml 18 | 19 | 20 | 21 | 22 | 23 | org.apache.felix 24 | maven-bundle-plugin 25 | 26 | 27 | systems.dmx.facets.FacetsPlugin 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /modules/dmx-facets/src/main/java/systems/dmx/facets/Constants.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.facets; 2 | 3 | 4 | 5 | public class Constants { 6 | 7 | // Role Types 8 | public static final String FACET = "dmx.facets.facet"; 9 | } 10 | -------------------------------------------------------------------------------- /modules/dmx-facets/src/main/resources/migrations/migration1.json: -------------------------------------------------------------------------------- 1 | { 2 | "role_types": [ 3 | { 4 | "value": "Facet", 5 | "uri": "dmx.facets.facet" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /modules/dmx-facets/src/main/resources/plugin.properties: -------------------------------------------------------------------------------- 1 | dmx.plugin.model_version = 1 2 | -------------------------------------------------------------------------------- /modules/dmx-files/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 4.0.0 6 | 7 | DMX Files 8 | systems.dmx 9 | dmx-files 10 | 5.4-SNAPSHOT 11 | bundle 12 | 13 | 14 | systems.dmx 15 | dmx-plugin 16 | 5.4-SNAPSHOT 17 | ../dmx-plugin/pom.xml 18 | 19 | 20 | 21 | 22 | systems.dmx 23 | dmx-config 24 | 5.4-SNAPSHOT 25 | 26 | 27 | commons-io 28 | commons-io 29 | 30 | 31 | 32 | 33 | 34 | 35 | org.apache.felix 36 | maven-bundle-plugin 37 | 38 | 39 | systems.dmx.files.FilesPlugin 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /modules/dmx-files/src/main/java/systems/dmx/files/Constants.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.files; 2 | 3 | 4 | 5 | public class Constants { 6 | 7 | // Topic Types 8 | public static final String FILE = "dmx.files.file"; 9 | public static final String FILE_NAME = "dmx.files.file_name"; 10 | public static final String FOLDER = "dmx.files.folder"; 11 | public static final String FOLDER_NAME = "dmx.files.folder_name"; 12 | public static final String PATH = "dmx.files.path"; 13 | public static final String MEDIA_TYPE = "dmx.files.media_type"; 14 | public static final String SIZE = "dmx.files.size"; 15 | public static final String DISK_QUOTA = "dmx.files.disk_quota"; 16 | } 17 | -------------------------------------------------------------------------------- /modules/dmx-files/src/main/java/systems/dmx/files/FileRepositoryException.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.files; 2 | 3 | import javax.ws.rs.core.Response.Status; 4 | 5 | 6 | 7 | public class FileRepositoryException extends Exception { 8 | 9 | // ---------------------------------------------------------------------------------------------- Instance Variables 10 | 11 | private Status status; 12 | 13 | // ---------------------------------------------------------------------------------------------------- Constructors 14 | 15 | FileRepositoryException(String message, Status status) { 16 | super(message); 17 | this.status = status; 18 | } 19 | 20 | // -------------------------------------------------------------------------------------------------- Public Methods 21 | 22 | public Status getStatus() { 23 | return status; 24 | } 25 | 26 | public int getStatusCode() { 27 | return status.getStatusCode(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /modules/dmx-files/src/main/java/systems/dmx/files/ItemKind.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.files; 2 | 3 | 4 | 5 | public enum ItemKind { 6 | 7 | FILE, DIRECTORY; 8 | 9 | public String stringify() { 10 | return name().toLowerCase(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /modules/dmx-files/src/main/java/systems/dmx/files/PathMapper.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.files; 2 | 3 | import java.io.File; 4 | 5 | 6 | 7 | interface PathMapper { 8 | 9 | /** 10 | * Maps an absolute path to a repository path. 11 | * 12 | * @param path A canonic absolute path. 13 | * 14 | * @return A repository path. Relative to the repository base path. 15 | * Begins with slash, no slash at the end. 16 | */ 17 | String repoPath(File path); 18 | } 19 | -------------------------------------------------------------------------------- /modules/dmx-files/src/main/java/systems/dmx/files/ResourceInfo.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.files; 2 | 3 | import systems.dmx.core.JSONEnabled; 4 | 5 | import org.codehaus.jettison.json.JSONObject; 6 | 7 | import java.io.File; 8 | 9 | 10 | 11 | public class ResourceInfo implements JSONEnabled { 12 | 13 | // ---------------------------------------------------------------------------------------------- Instance Variables 14 | 15 | private ItemKind kind; // FILE or DIRECTORY 16 | 17 | // ---------------------------------------------------------------------------------------------------- Constructors 18 | 19 | /** 20 | * Precondition: the file exists. 21 | */ 22 | public ResourceInfo(File file) { 23 | kind = file.isDirectory() ? ItemKind.DIRECTORY : ItemKind.FILE; 24 | } 25 | 26 | // -------------------------------------------------------------------------------------------------- Public Methods 27 | 28 | public ItemKind getItemKind() { 29 | return kind; 30 | } 31 | 32 | @Override 33 | public JSONObject toJSON() { 34 | try { 35 | return new JSONObject() 36 | .put("kind", kind.stringify()); 37 | } catch (Exception e) { 38 | throw new RuntimeException("Serialization failed", e); 39 | } 40 | } 41 | 42 | @Override 43 | public String toString() { 44 | return "resource info (kind=\"" + kind + "\")"; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /modules/dmx-files/src/main/java/systems/dmx/files/event/CheckDiskQuota.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.files.event; 2 | 3 | import systems.dmx.core.service.EventListener; 4 | 5 | 6 | 7 | public interface CheckDiskQuota extends EventListener { 8 | 9 | void checkDiskQuota(String username, long fileSize, long diskQuota); 10 | } 11 | -------------------------------------------------------------------------------- /modules/dmx-files/src/main/java/systems/dmx/files/migrations/Migration3.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.files.migrations; 2 | 3 | import systems.dmx.core.Topic; 4 | import systems.dmx.core.service.Migration; 5 | 6 | 7 | 8 | /** 9 | * Deletes topic types "File Content" and "Foler Content". 10 | *

11 | * Part of DMX 5.2 12 | * Runs only in UPDATE mode. 13 | */ 14 | public class Migration3 extends Migration { 15 | 16 | // -------------------------------------------------------------------------------------------------- Public Methods 17 | 18 | @Override 19 | public void run() { 20 | for (Topic topic : dmx.getTopicsByType("dmx.files.file_content")) { 21 | topic.delete(); 22 | } 23 | for (Topic topic : dmx.getTopicsByType("dmx.files.folder_content")) { 24 | topic.delete(); 25 | } 26 | dmx.deleteTopicType("dmx.files.file_content"); 27 | dmx.deleteTopicType("dmx.files.folder_content"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /modules/dmx-files/src/main/java/systems/dmx/files/migrations/Migration4.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.files.migrations; 2 | 3 | import systems.dmx.core.service.Migration; 4 | import static systems.dmx.files.Constants.*; 5 | 6 | 7 | 8 | /** 9 | * Sets "Noneditable" view config for "File" and "Folder" types. 10 | *

11 | * Part of DMX 5.2 12 | * Runs only in UPDATE mode. 13 | */ 14 | public class Migration4 extends Migration { 15 | 16 | // -------------------------------------------------------------------------------------------------- Public Methods 17 | 18 | @Override 19 | public void run() { 20 | dmx.getTopicType(FILE).getViewConfig().setConfigValue( 21 | "dmx.webclient.view_config", "dmx.webclient.noneditable", true 22 | ); 23 | dmx.getTopicType(FOLDER).getViewConfig().setConfigValue( 24 | "dmx.webclient.view_config", "dmx.webclient.noneditable", true 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /modules/dmx-files/src/main/java/systems/dmx/files/migrations/Migration5.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.files.migrations; 2 | 3 | import static systems.dmx.core.Constants.*; 4 | import static systems.dmx.files.Constants.*; 5 | import systems.dmx.core.CompDef; 6 | import systems.dmx.core.service.Migration; 7 | 8 | 9 | 10 | /** 11 | * Set "Path" as the identity attribute for both, "File" and "Folder". 12 | *

13 | * Part of DMX 5.3 14 | * Runs only in UPDATE mode. 15 | */ 16 | public class Migration5 extends Migration { 17 | 18 | // -------------------------------------------------------------------------------------------------- Public Methods 19 | 20 | @Override 21 | public void run() { 22 | setIdentityAttr(dmx.getTopicType(FILE).getCompDef(PATH)); 23 | setIdentityAttr(dmx.getTopicType(FOLDER).getCompDef(PATH)); 24 | } 25 | 26 | // ------------------------------------------------------------------------------------------------- Private Methods 27 | 28 | private void setIdentityAttr(CompDef compDef) { 29 | compDef.update(mf.newCompDefModel(mf.newAssocModel(mf.newChildTopicsModel().set(IDENTITY_ATTR, true)), null)); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /modules/dmx-files/src/main/js/components/dmx-download-iframe.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 14 | 15 | 20 | -------------------------------------------------------------------------------- /modules/dmx-files/src/main/js/components/dmx-file-size.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 26 | -------------------------------------------------------------------------------- /modules/dmx-files/src/main/js/components/dmx-filebrowser-reveal.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 16 | 17 | 24 | -------------------------------------------------------------------------------- /modules/dmx-files/src/main/js/components/mixins/context.js: -------------------------------------------------------------------------------- 1 | export default { 2 | props: { 3 | context: { 4 | type: Object, 5 | required: true 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /modules/dmx-files/src/main/js/components/mixins/object.js: -------------------------------------------------------------------------------- 1 | import dmx from 'dmx-api' 2 | 3 | export default { 4 | props: { 5 | object: { 6 | type: dmx.DMXObject, 7 | required: true 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /modules/dmx-files/src/main/js/files-rpc.js: -------------------------------------------------------------------------------- 1 | export default class FilesRPC { 2 | 3 | constructor (dmx, http) { 4 | this.dmx = dmx 5 | this.http = http 6 | } 7 | 8 | // File System Representation 9 | 10 | getFolderTopic (repoPath) { 11 | return this.http.get(`/files/folder/${encodeURIComponent(repoPath)}`) 12 | .then(response => new this.dmx.Topic(response.data)) 13 | } 14 | 15 | getChildFileTopic (folderId, repoPath) { 16 | return this.http.get(`/files/parent/${folderId}/file/${encodeURIComponent(repoPath)}`) 17 | .then(response => new this.dmx.RelatedTopic(response.data)) 18 | } 19 | 20 | getChildFolderTopic (folderId, repoPath) { 21 | return this.http.get(`/files/parent/${folderId}/folder/${encodeURIComponent(repoPath)}`) 22 | .then(response => new this.dmx.RelatedTopic(response.data)) 23 | } 24 | 25 | // File Repository 26 | 27 | getDirectoryListing (repoPath) { 28 | return this.http.get(`/files/${encodeURIComponent(repoPath)}`) 29 | .then(response => response.data) 30 | } 31 | 32 | openFile(fileTopicId) { 33 | this.http.get(`/files/open/${fileTopicId}`) 34 | } 35 | 36 | // File Content 37 | 38 | getFileContent (repoPath) { 39 | return this.http.get(this.filerepoURL(repoPath)) 40 | .then(response => response.data) 41 | } 42 | 43 | filerepoURL (repoPath) { 44 | return '/filerepo/' + encodeURIComponent(repoPath) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /modules/dmx-files/src/main/js/files.js: -------------------------------------------------------------------------------- 1 | import FilesRPC from './files-rpc' 2 | 3 | export default ({dmx, axios: http}) => { 4 | 5 | const filesRPC = new FilesRPC(dmx, http) 6 | 7 | return { 8 | 9 | state: { 10 | url: undefined // URL of file to download 11 | }, 12 | 13 | actions: { 14 | 15 | revealFileBrowser ({dispatch}) { 16 | filesRPC.getFolderTopic('/').then(folder => { 17 | dispatch('revealTopic', {topic: folder}) 18 | }) 19 | }, 20 | 21 | downloadFile ({state, rootState}) { 22 | const repoPath = rootState.object.children['dmx.files.path'].value 23 | state.url = filesRPC.filerepoURL(repoPath) + '?download' 24 | }, 25 | 26 | // RPC delegates 27 | 28 | getChildFileTopic (_, {folderId, repoPath}) { 29 | return filesRPC.getChildFileTopic(folderId, repoPath) 30 | }, 31 | 32 | getChildFolderTopic (_, {folderId, repoPath}) { 33 | return filesRPC.getChildFolderTopic(folderId, repoPath) 34 | }, 35 | 36 | getDirectoryListing (_, repoPath) { 37 | return filesRPC.getDirectoryListing(repoPath) 38 | }, 39 | 40 | getFileContent (_, repoPath) { 41 | return filesRPC.getFileContent(repoPath) 42 | }, 43 | 44 | openFile (_, fileTopicId) { 45 | filesRPC.openFile(fileTopicId) 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /modules/dmx-files/src/main/js/plugin.js: -------------------------------------------------------------------------------- 1 | export default ({store}) => ({ 2 | 3 | storeModule: { 4 | name: 'files', 5 | module: require('./files').default 6 | }, 7 | 8 | components: [ 9 | { 10 | comp: require('./components/dmx-filebrowser-reveal').default, 11 | mount: 'toolbar-left' 12 | }, 13 | { 14 | comp: require('./components/dmx-download-iframe').default, 15 | mount: 'webclient' 16 | } 17 | ], 18 | 19 | objectRenderers: { 20 | 'dmx.files.file': require('./components/dmx-file-renderer').default, 21 | 'dmx.files.folder': require('./components/dmx-folder-renderer').default 22 | }, 23 | 24 | valueRenderers: { 25 | 'dmx.files.size': require('./components/dmx-file-size').default, 26 | }, 27 | 28 | doubleClickHandlers: { 29 | 'dmx.files.file': topic => store.dispatch('openFile', topic.id), 30 | 'dmx.files.folder': topic => store.dispatch('openFile', topic.id) 31 | }, 32 | 33 | detailPanelButtons: { 34 | 'dmx.files.file': [ 35 | { 36 | label: 'Download File', 37 | handler: _ => store.dispatch('downloadFile') 38 | } 39 | ] 40 | } 41 | }) 42 | -------------------------------------------------------------------------------- /modules/dmx-files/src/main/resources/migrations/migration2.json: -------------------------------------------------------------------------------- 1 | // Part of DMX 5.0-beta-4 2 | // Runs ALWAYS 3 | 4 | { 5 | "topic_types": [ 6 | { 7 | "value": "Disk Quota (MB)", 8 | "uri": "dmx.files.disk_quota", 9 | "dataTypeUri": "dmx.core.number" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /modules/dmx-files/src/main/resources/migrations/migration3.properties: -------------------------------------------------------------------------------- 1 | migrationRunMode = UPDATE 2 | -------------------------------------------------------------------------------- /modules/dmx-files/src/main/resources/migrations/migration4.properties: -------------------------------------------------------------------------------- 1 | migrationRunMode = UPDATE 2 | -------------------------------------------------------------------------------- /modules/dmx-files/src/main/resources/migrations/migration5.properties: -------------------------------------------------------------------------------- 1 | migrationRunMode = UPDATE 2 | -------------------------------------------------------------------------------- /modules/dmx-files/src/main/resources/migrations/migration6.properties: -------------------------------------------------------------------------------- 1 | migrationRunMode = UPDATE 2 | -------------------------------------------------------------------------------- /modules/dmx-files/src/main/resources/plugin.properties: -------------------------------------------------------------------------------- 1 | dmx.plugin.model_version = 6 2 | dmx.plugin.dependencies = systems.dmx.webclient 3 | -------------------------------------------------------------------------------- /modules/dmx-files/src/test/java/systems/dmx/files/test/FilesTest.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.files.test; 2 | 3 | import systems.dmx.files.DirectoryListing; 4 | import systems.dmx.files.DirectoryListing.FileItem; 5 | import systems.dmx.files.ItemKind; 6 | 7 | import static org.junit.Assert.assertTrue; 8 | import static org.junit.Assert.fail; 9 | 10 | import org.junit.Ignore; 11 | import org.junit.Test; 12 | 13 | import org.codehaus.jettison.json.JSONException; 14 | 15 | import java.io.File; 16 | import java.util.List; 17 | 18 | 19 | 20 | public class FilesTest { 21 | 22 | // ### FIXME: enable the tests 23 | // ### They rely on the dmx.filerepo.path system property as defined in project POM 24 | 25 | @Ignore @Test 26 | public void directoryListing() { 27 | DirectoryListing dir = new DirectoryListing(new File("/"), null); // pathMapper=null 28 | List items = dir.getFileItems(); 29 | FileItem item = items.get(0); 30 | ItemKind kind = item.getItemKind(); 31 | assertTrue(kind == ItemKind.FILE || kind == ItemKind.DIRECTORY); 32 | } 33 | 34 | @Ignore @Test 35 | public void directoryListingJSON() { 36 | try { 37 | DirectoryListing dir = new DirectoryListing(new File("/"), null); // pathMapper=null 38 | List items = dir.getFileItems(); 39 | FileItem item = items.get(0); 40 | String kind = item.toJSON().getString("kind"); 41 | assertTrue(kind.equals("file") || kind.equals("directory")); 42 | } catch (JSONException e) { 43 | fail(); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /modules/dmx-help-menu/src/main/js/components/dmx-about-box.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 45 | 46 | 64 | -------------------------------------------------------------------------------- /modules/dmx-help-menu/src/main/js/components/dmx-help-menu.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 33 | -------------------------------------------------------------------------------- /modules/dmx-help-menu/src/main/js/help-menu.js: -------------------------------------------------------------------------------- 1 | export default { 2 | 3 | state: { 4 | items: [], 5 | aboutBoxVisibility: false 6 | }, 7 | 8 | actions: { 9 | 10 | registerHelpMenuItem ({state}, item) { 11 | state.items.push(item) 12 | }, 13 | 14 | openAboutBox ({state}) { 15 | state.aboutBoxVisibility = true 16 | }, 17 | 18 | closeAboutBox ({state}) { 19 | state.aboutBoxVisibility = false 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /modules/dmx-help-menu/src/main/js/plugin.js: -------------------------------------------------------------------------------- 1 | export default { 2 | 3 | storeModule: { 4 | name: 'helpmenu', 5 | module: require('./help-menu').default 6 | }, 7 | 8 | components: [ 9 | { 10 | comp: require('./components/dmx-help-menu').default, 11 | mount: 'toolbar-right' 12 | }, 13 | { 14 | comp: require('./components/dmx-about-box').default, 15 | mount: 'webclient' 16 | } 17 | ], 18 | 19 | helpMenuItems: [ 20 | { 21 | label: 'Documentation', 22 | href: 'https://docs.dmx.systems' 23 | }, 24 | { 25 | label: 'Forum', 26 | href: 'https://forum.dmx.systems' 27 | }, 28 | { 29 | label: 'About DMX', 30 | action: 'openAboutBox', 31 | divided: true 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /modules/dmx-notes/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 4.0.0 6 | 7 | DMX Notes 8 | systems.dmx 9 | dmx-notes 10 | 5.4-SNAPSHOT 11 | bundle 12 | 13 | 14 | systems.dmx 15 | dmx-plugin 16 | 5.4-SNAPSHOT 17 | ../dmx-plugin/pom.xml 18 | 19 | 20 | -------------------------------------------------------------------------------- /modules/dmx-notes/src/main/java/systems/dmx/notes/Constants.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.notes; 2 | 3 | 4 | 5 | public class Constants { 6 | 7 | // Topic Types 8 | public static final String NOTE = "dmx.notes.note"; 9 | public static final String NOTE_TITLE = "dmx.notes.title"; 10 | public static final String NOTE_TEXT = "dmx.notes.text"; 11 | } 12 | -------------------------------------------------------------------------------- /modules/dmx-notes/src/main/resources/migrations/migration1.json: -------------------------------------------------------------------------------- 1 | { 2 | "topic_types": [ 3 | { 4 | "value": "Title", 5 | "uri": "dmx.notes.title", 6 | "dataTypeUri": "dmx.core.text" 7 | }, 8 | { 9 | "value": "Text", 10 | "uri": "dmx.notes.text", 11 | "dataTypeUri": "dmx.core.html" 12 | }, 13 | { 14 | "value": "Note", 15 | "uri": "dmx.notes.note", 16 | "dataTypeUri": "dmx.core.entity", 17 | "compDefs": [ 18 | { 19 | "childTypeUri": "dmx.notes.title", 20 | "childCardinalityUri": "dmx.core.one" 21 | }, 22 | { 23 | "childTypeUri": "dmx.notes.text", 24 | "childCardinalityUri": "dmx.core.one" 25 | } 26 | ], 27 | "viewConfigTopics": [ 28 | { 29 | "typeUri": "dmx.webclient.view_config", 30 | "children": { 31 | "dmx.webclient.icon": "\uf24a", 32 | "dmx.webclient.add_to_create_menu": true 33 | } 34 | } 35 | ] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /modules/dmx-notes/src/main/resources/plugin.properties: -------------------------------------------------------------------------------- 1 | dmx.plugin.model_version = 1 2 | dmx.plugin.dependencies = systems.dmx.webclient 3 | -------------------------------------------------------------------------------- /modules/dmx-provision/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 4.0.0 6 | 7 | DMX Provision 8 | systems.dmx 9 | dmx-provision 10 | 5.4-SNAPSHOT 11 | pom 12 | 13 | 14 | systems.dmx 15 | dmx 16 | 5.4-SNAPSHOT 17 | ../../pom.xml 18 | 19 | 30 | 31 | 3rd-party-bundles 32 | felix-bundles 33 | dmx-bundles 34 | 35 | 36 | -------------------------------------------------------------------------------- /modules/dmx-search/src/main/js/search.js: -------------------------------------------------------------------------------- 1 | export default { 2 | 3 | state: { 4 | 5 | visible: false, // search widget visibility 6 | 7 | pos: undefined, // search widget position in `model` and `render` coordinates 8 | // (objects with 'x' and 'y' properties) 9 | options: { 10 | noSelect: false, // Optional: if trueish the revealed topic will not be selected. Otherwise it will. 11 | topicHandler: undefined // Optional: a handler that is invoked subsequently to "revealTopic". 12 | // The revealed topic is passed. 13 | }, 14 | 15 | extraMenuItems: [] // Extra type menu items which require special create logic. 16 | }, 17 | 18 | actions: { 19 | 20 | /** 21 | * @param pos `model` and `render` coordinates 22 | */ 23 | openSearchWidget ({state}, {pos, options}) { 24 | // console.log('openSearchWidget', pos, options) 25 | state.visible = true 26 | state.pos = pos 27 | state.options = options || {} 28 | }, 29 | 30 | closeSearchWidget ({state}) { 31 | state.visible = false 32 | }, 33 | 34 | registerExtraMenuItems ({state}, items) { 35 | state.extraMenuItems = [...state.extraMenuItems, ...items] 36 | } 37 | }, 38 | 39 | getters: { 40 | createTopicTypes: (state, getters, rootState) => { 41 | const topicTypes = rootState.typeCache.topicTypes // undefined while webclient launch 42 | return topicTypes && Object.values(topicTypes) 43 | .filter(topicType => topicType.getViewConfig('dmx.webclient.add_to_create_menu')) 44 | .sort((tt1, tt2) => tt1.value.localeCompare(tt2.value)) 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /modules/dmx-search/src/main/style/style.css: -------------------------------------------------------------------------------- 1 | .dmx-search-widget video.ql-video { 2 | max-width: 300px; 3 | } 4 | -------------------------------------------------------------------------------- /modules/dmx-storage-neo4j/src/main/java/systems/dmx/storage/neo4j/Neo4jStorageFactory.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.storage.neo4j; 2 | 3 | import systems.dmx.core.impl.ModelFactoryImpl; 4 | import systems.dmx.core.storage.spi.DMXStorage; 5 | import systems.dmx.core.storage.spi.DMXStorageFactory; 6 | 7 | 8 | 9 | /** 10 | * A factory for obtaining a DMX storage based on Neo4j/Lucene. 11 | */ 12 | public class Neo4jStorageFactory implements DMXStorageFactory { 13 | 14 | // -------------------------------------------------------------------------------------------------- Public Methods 15 | 16 | @Override 17 | public DMXStorage newDMXStorage(String databasePath, ModelFactoryImpl mf) { 18 | return new Neo4jStorage(databasePath, mf); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /modules/dmx-storage-neo4j/src/main/java/systems/dmx/storage/neo4j/Neo4jTransactionAdapter.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.storage.neo4j; 2 | 3 | import systems.dmx.core.storage.spi.DMXTransaction; 4 | 5 | import org.neo4j.graphdb.GraphDatabaseService; 6 | import org.neo4j.graphdb.Transaction; 7 | 8 | 9 | 10 | /** 11 | * Adapts a Neo4j transaction to a DMX transaction. 12 | */ 13 | class Neo4jTransactionAdapter implements DMXTransaction { 14 | 15 | // ---------------------------------------------------------------------------------------------- Instance Variables 16 | 17 | private Transaction tx; 18 | 19 | // ---------------------------------------------------------------------------------------------------- Constructors 20 | 21 | Neo4jTransactionAdapter(GraphDatabaseService neo4j) { 22 | tx = neo4j.beginTx(); 23 | } 24 | 25 | // -------------------------------------------------------------------------------------------------- Public Methods 26 | 27 | @Override 28 | public void success() { 29 | tx.success(); 30 | } 31 | 32 | @Override 33 | public void failure() { 34 | tx.failure(); 35 | } 36 | 37 | @Override 38 | public void finish() { 39 | tx.finish(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /modules/dmx-tags/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 4.0.0 6 | 7 | DMX Tags 8 | systems.dmx 9 | dmx-tags 10 | 5.4-SNAPSHOT 11 | bundle 12 | 13 | 14 | systems.dmx 15 | dmx-plugin 16 | 5.4-SNAPSHOT 17 | ../dmx-plugin/pom.xml 18 | 19 | 20 | -------------------------------------------------------------------------------- /modules/dmx-tags/src/main/java/systems/dmx/tags/Constants.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.tags; 2 | 3 | 4 | 5 | public class Constants { 6 | 7 | // Topic Types 8 | public static final String TAG = "dmx.tags.tag"; 9 | public static final String TAG_NAME = "dmx.tags.tag_name"; 10 | } 11 | -------------------------------------------------------------------------------- /modules/dmx-tags/src/main/resources/migrations/migration1.json: -------------------------------------------------------------------------------- 1 | { 2 | "topic_types": [ 3 | { 4 | "value": "Tag Name", 5 | "uri": "dmx.tags.tag_name", 6 | "dataTypeUri": "dmx.core.text" 7 | }, 8 | { 9 | "value": "Tag", 10 | "uri": "dmx.tags.tag", 11 | "dataTypeUri": "dmx.core.entity", 12 | "compDefs": [ 13 | { 14 | "childTypeUri": "dmx.tags.tag_name", 15 | "childCardinalityUri": "dmx.core.one", 16 | "isIdentityAttr": true 17 | } 18 | ], 19 | "viewConfigTopics": [ 20 | { 21 | "typeUri": "dmx.webclient.view_config", 22 | "children": { 23 | "dmx.webclient.icon": "\uf02b" 24 | } 25 | } 26 | ] 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /modules/dmx-tags/src/main/resources/plugin.properties: -------------------------------------------------------------------------------- 1 | dmx.plugin.model_version = 1 2 | dmx.plugin.dependencies = systems.dmx.webclient 3 | -------------------------------------------------------------------------------- /modules/dmx-timestamps/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 4.0.0 6 | 7 | DMX Timestamps 8 | systems.dmx 9 | dmx-timestamps 10 | 5.4-SNAPSHOT 11 | bundle 12 | 13 | 14 | systems.dmx 15 | dmx-plugin 16 | 5.4-SNAPSHOT 17 | ../dmx-plugin/pom.xml 18 | 19 | 20 | 21 | 22 | 23 | org.apache.felix 24 | maven-bundle-plugin 25 | 26 | 27 | systems.dmx.timestamps.TimestampsPlugin 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /modules/dmx-timestamps/src/main/java/systems/dmx/timestamps/Constants.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.timestamps; 2 | 3 | 4 | 5 | public class Constants { 6 | 7 | // Props (topic/assoc) 8 | public static final String CREATED = "dmx.timestamps.created"; 9 | public static final String MODIFIED = "dmx.timestamps.modified"; 10 | } 11 | -------------------------------------------------------------------------------- /modules/dmx-timestamps/src/main/java/systems/dmx/timestamps/TimestampsService.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.timestamps; 2 | 3 | import systems.dmx.core.Assoc; 4 | import systems.dmx.core.DMXObject; 5 | import systems.dmx.core.Topic; 6 | 7 | import java.util.Collection; 8 | 9 | 10 | 11 | public interface TimestampsService { 12 | 13 | // === Timestamps === 14 | 15 | long getCreationTime(long objectId); 16 | 17 | long getModificationTime(long objectId); 18 | 19 | // --- 20 | 21 | void setModified(DMXObject object); 22 | 23 | /** 24 | * Retrieves the CREATED/MODIFIED timestamps and stores them in the given object's model (under synthetic child type 25 | * URIs dmx.timestamps.created and dmx.timestamps.modified). 26 | */ 27 | void enrichWithTimestamps(DMXObject object); 28 | 29 | // === Retrieval === 30 | 31 | Collection getTopicsByCreationTime(long from, long to); 32 | 33 | Collection getTopicsByModificationTime(long from, long to); 34 | 35 | Collection getAssocsByCreationTime(long from, long to); 36 | 37 | Collection getAssocsByModificationTime(long from, long to); 38 | } 39 | -------------------------------------------------------------------------------- /modules/dmx-topicmaps/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 4.0.0 6 | 7 | DMX Topicmaps 8 | systems.dmx 9 | dmx-topicmaps 10 | 5.4-SNAPSHOT 11 | bundle 12 | 13 | 14 | systems.dmx 15 | dmx-plugin 16 | 5.4-SNAPSHOT 17 | ../dmx-plugin/pom.xml 18 | 19 | 20 | 21 | 22 | systems.dmx 23 | dmx-webclient 24 | 5.4-SNAPSHOT 25 | 26 | 27 | systems.dmx 28 | dmx-base 29 | 5.4-SNAPSHOT 30 | 31 | 32 | 33 | 34 | 35 | 36 | org.apache.felix 37 | maven-bundle-plugin 38 | 39 | 40 | systems.dmx.topicmaps.TopicmapsPlugin 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /modules/dmx-topicmaps/src/main/java/systems/dmx/topicmaps/Constants.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.topicmaps; 2 | 3 | 4 | 5 | public class Constants { 6 | 7 | // Topic Types 8 | public static final String TOPICMAP = "dmx.topicmaps.topicmap"; 9 | public static final String TOPICMAP_NAME = "dmx.topicmaps.topicmap_name"; 10 | public static final String TOPICMAP_DESCRIPTION = "dmx.topicmaps.topicmap_description"; 11 | public static final String TOPICMAP_TYPE_URI = "dmx.topicmaps.topicmap_type_uri"; 12 | 13 | // Assoc Types 14 | public static final String TOPICMAP_CONTEXT = "dmx.topicmaps.topicmap_context"; 15 | public static final String BACKGROUND_IMAGE = "dmx.topicmaps.background_image"; 16 | 17 | // Role Types 18 | public static final String TOPICMAP_CONTENT = "dmx.topicmaps.topicmap_content"; 19 | 20 | // Props (topicmap) 21 | public static final String PAN_X = "dmx.topicmaps.pan_x"; 22 | public static final String PAN_Y = "dmx.topicmaps.pan_y"; 23 | public static final String ZOOM = "dmx.topicmaps.zoom"; 24 | 25 | // Props (topic/assoc) 26 | public static final String X = "dmx.topicmaps.x"; // topic only 27 | public static final String Y = "dmx.topicmaps.y"; // topic only 28 | public static final String VISIBILITY = "dmx.topicmaps.visibility"; 29 | public static final String PINNED = "dmx.topicmaps.pinned"; 30 | public static final String WIDTH = "dmx.topicmaps.width"; 31 | public static final String HEIGHT = "dmx.topicmaps.height"; 32 | } 33 | -------------------------------------------------------------------------------- /modules/dmx-topicmaps/src/main/java/systems/dmx/topicmaps/DefaultTopicmapType.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.topicmaps; 2 | 3 | import static systems.dmx.topicmaps.Constants.*; 4 | import systems.dmx.core.Topic; 5 | import systems.dmx.core.model.topicmaps.ViewProps; 6 | import systems.dmx.core.service.CoreService; 7 | 8 | 9 | 10 | class DefaultTopicmapType implements TopicmapType { 11 | 12 | @Override 13 | public String getUri() { 14 | return TOPICMAP; 15 | } 16 | 17 | @Override 18 | public void initTopicmapState(Topic topicmapTopic, ViewProps viewProps, CoreService dmx) { 19 | dmx.getModelFactory().newViewProps() 20 | .set(PAN_X, 0) 21 | .set(PAN_Y, 0) 22 | .set(ZOOM, 1.0) 23 | .store(topicmapTopic); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /modules/dmx-topicmaps/src/main/java/systems/dmx/topicmaps/TopicmapCustomizer.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.topicmaps; 2 | 3 | import systems.dmx.core.RelatedTopic; 4 | import systems.dmx.core.model.topicmaps.ViewProps; 5 | 6 | 7 | 8 | public interface TopicmapCustomizer { 9 | 10 | void customizeTopic(RelatedTopic topic, ViewProps viewProps); 11 | } 12 | -------------------------------------------------------------------------------- /modules/dmx-topicmaps/src/main/java/systems/dmx/topicmaps/TopicmapType.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.topicmaps; 2 | 3 | import systems.dmx.core.Topic; 4 | import systems.dmx.core.model.topicmaps.ViewProps; 5 | import systems.dmx.core.service.CoreService; 6 | 7 | 8 | 9 | public interface TopicmapType { 10 | 11 | String getUri(); 12 | 13 | void initTopicmapState(Topic topicmapTopic, ViewProps viewProps, CoreService dmx); 14 | } 15 | -------------------------------------------------------------------------------- /modules/dmx-topicmaps/src/main/java/systems/dmx/topicmaps/migrations/Migration2.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.topicmaps.migrations; 2 | 3 | import static systems.dmx.base.Constants.*; 4 | import static systems.dmx.core.Constants.*; 5 | import static systems.dmx.topicmaps.Constants.*; 6 | import static systems.dmx.webclient.Constants.*; 7 | import systems.dmx.core.service.Migration; 8 | 9 | 10 | 11 | /** 12 | * Adds "Background Image" to "Topicmap". 13 | * 14 | * Part of DMX 5.3 15 | * Runs only in UPDATE mode. 16 | */ 17 | public class Migration2 extends Migration { 18 | 19 | @Override 20 | public void run() { 21 | dmx.createAssocType(mf.newAssocTypeModel(BACKGROUND_IMAGE, "Background Image", TEXT)); 22 | dmx.getTopicType(TOPICMAP).addCompDef(mf.newCompDefModel( 23 | BACKGROUND_IMAGE, false, false, 24 | TOPICMAP, URL, ONE 25 | )).getViewConfig() 26 | .setConfigValue(VIEW_CONFIG, COLOR, "hsl(5, 50%, 53%)") 27 | .setConfigValue(VIEW_CONFIG, COLOR + "#" + BACKGROUND_COLOR, "hsl(5, 80%, 96%)"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /modules/dmx-topicmaps/src/main/js/components/dmx-topicmap-fit.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 14 | -------------------------------------------------------------------------------- /modules/dmx-topicmaps/src/main/js/components/dmx-topicmap-info.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 22 | -------------------------------------------------------------------------------- /modules/dmx-topicmaps/src/main/js/components/dmx-topicmap-reset.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 15 | -------------------------------------------------------------------------------- /modules/dmx-topicmaps/src/main/resources/migrations/migration2.properties: -------------------------------------------------------------------------------- 1 | migrationRunMode = UPDATE 2 | -------------------------------------------------------------------------------- /modules/dmx-topicmaps/src/main/resources/plugin.properties: -------------------------------------------------------------------------------- 1 | dmx.plugin.model_version = 2 2 | dmx.plugin.dependencies = systems.dmx.webclient, systems.dmx.base 3 | -------------------------------------------------------------------------------- /modules/dmx-typeeditor/src/main/js/components/dmx-comp-def.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 34 | 35 | 54 | -------------------------------------------------------------------------------- /modules/dmx-typeeditor/src/main/js/components/mixins/context.js: -------------------------------------------------------------------------------- 1 | export default { 2 | props: { 3 | context: { 4 | type: Object, 5 | required: true 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /modules/dmx-typeeditor/src/main/js/components/mixins/info-mode.js: -------------------------------------------------------------------------------- 1 | export default { 2 | computed: { 3 | infoMode () { 4 | return this.mode === 'info' 5 | }, 6 | formMode () { 7 | return this.mode === 'form' 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /modules/dmx-typeeditor/src/main/js/components/mixins/mode.js: -------------------------------------------------------------------------------- 1 | export default { 2 | props: { 3 | mode: { 4 | type: String, 5 | required: true, 6 | validator: mode => ['info', 'form'].includes(mode) 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /modules/dmx-typeeditor/src/main/js/plugin.js: -------------------------------------------------------------------------------- 1 | export default ({store}) => ({ 2 | 3 | storeModule: { 4 | name: 'typeeditor', 5 | module: require('./typeeditor').default 6 | }, 7 | 8 | objectRenderers: { 9 | 'dmx.core.topic_type': require('./components/dmx-type-renderer').default, 10 | 'dmx.core.assoc_type': require('./components/dmx-type-renderer').default 11 | }, 12 | 13 | extraMenuItems: [ 14 | { 15 | uri: 'dmx.core.topic_type', 16 | create: (name, _, pos) => { 17 | store.dispatch('createTopicType', {name, pos}) 18 | } 19 | }, 20 | { 21 | uri: 'dmx.core.assoc_type', 22 | create: (name, _, pos) => { 23 | store.dispatch('createAssocType', {name, pos}) 24 | } 25 | }, 26 | { 27 | uri: 'dmx.core.role_type', 28 | create: (name, _, pos) => { 29 | store.dispatch('createRoleType', {name, pos}) 30 | } 31 | } 32 | ] 33 | }) 34 | -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/java/systems/dmx/webclient/Constants.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.webclient; 2 | 3 | 4 | 5 | public class Constants { 6 | 7 | // Topic Types 8 | public static final String VIEW_CONFIG = "dmx.webclient.view_config"; 9 | public static final String ICON = "dmx.webclient.icon"; 10 | public static final String COLOR = "dmx.webclient.color"; 11 | public static final String ADD_TO_CREATE_MENU = "dmx.webclient.add_to_create_menu"; 12 | public static final String WIDGET = "dmx.webclient.widget"; 13 | public static final String CLEARABLE = "dmx.webclient.clearable"; 14 | public static final String CUSTOMIZABLE = "dmx.webclient.customizable"; 15 | 16 | // Assoc Types 17 | public static final String BACKGROUND_COLOR = "dmx.webclient.background_color"; 18 | 19 | // Widgets 20 | public static final String SELECT = "dmx.webclient.select"; 21 | } 22 | -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/java/systems/dmx/webclient/migrations/Migration4.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.webclient.migrations; 2 | 3 | import systems.dmx.core.service.Migration; 4 | 5 | 6 | 7 | /** 8 | * Adds "Noneditable" to "View Configuration". 9 | *

10 | * Part of DMX 5.2 11 | * Runs only in UPDATE mode. 12 | */ 13 | public class Migration4 extends Migration { 14 | 15 | @Override 16 | public void run() { 17 | dmx.createTopicType(mf.newTopicTypeModel("dmx.webclient.noneditable", "Noneditable", "dmx.core.boolean")); 18 | dmx.getTopicType("dmx.webclient.view_config").addCompDefBefore(mf.newCompDefModel( 19 | "dmx.webclient.view_config", "dmx.webclient.noneditable", "dmx.core.one" 20 | ), "dmx.webclient.widget"); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/java/systems/dmx/webclient/migrations/Migration5.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.webclient.migrations; 2 | 3 | import static systems.dmx.webclient.Constants.*; 4 | import static systems.dmx.core.Constants.*; 5 | import systems.dmx.core.TopicType; 6 | import systems.dmx.core.service.Migration; 7 | 8 | 9 | 10 | /** 11 | * Adds "Arrow Shape" and "Hollow" props to "View Configuration". 12 | *

13 | * Part of DMX 5.2 14 | * Runs only in UPDATE mode. 15 | */ 16 | public class Migration5 extends Migration { 17 | 18 | @Override 19 | public void run() { 20 | dmx.createTopicType(mf.newTopicTypeModel("dmx.webclient.arrow_shape", "Arrow Shape", TEXT)); 21 | dmx.createTopicType(mf.newTopicTypeModel("dmx.webclient.hollow", "Hollow", BOOLEAN)); 22 | TopicType viewConfig = dmx.getTopicType(VIEW_CONFIG); 23 | viewConfig.addCompDef(mf.newCompDefModel(VIEW_CONFIG, "dmx.webclient.arrow_shape", ONE)); 24 | viewConfig.addCompDef(mf.newCompDefModel(VIEW_CONFIG, "dmx.webclient.hollow", ONE)); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/java/systems/dmx/webclient/migrations/Migration7.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.webclient.migrations; 2 | 3 | import static systems.dmx.webclient.Constants.*; 4 | import static systems.dmx.core.Constants.*; 5 | import systems.dmx.core.service.Migration; 6 | 7 | 8 | 9 | /** 10 | * Adds arrow heads to 2 more role types. 11 | *

12 | * Part of DMX 5.3 13 | * Runs ALWAYS 14 | */ 15 | public class Migration7 extends Migration { 16 | 17 | @Override 18 | public void run() { 19 | dmx.getRoleType(SEQUENCE_START).getViewConfig().setConfigValue( 20 | VIEW_CONFIG, "dmx.webclient.arrow_shape", "triangle" 21 | ); 22 | dmx.getRoleType(SUCCESSOR).getViewConfig().setConfigValue( 23 | VIEW_CONFIG, "dmx.webclient.arrow_shape", "triangle" 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/js/app.js: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import App from './components/App' 3 | 4 | export default createApp(App) 5 | -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/js/components/dmx-arrow-select.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 38 | 39 | 44 | -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/js/components/dmx-icon-picker.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 55 | 56 | 62 | -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/js/components/dmx-spinner.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 10 | -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/js/components/mixins/info-mode.js: -------------------------------------------------------------------------------- 1 | export default { 2 | computed: { 3 | infoMode () { 4 | return this.mode === 'info' 5 | }, 6 | formMode () { 7 | return this.mode === 'form' 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/js/components/mixins/mode.js: -------------------------------------------------------------------------------- 1 | export default { 2 | props: { 3 | mode: { 4 | type: String, 5 | required: true, 6 | validator: mode => ['info', 'form'].includes(mode) 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/js/components/mixins/object.js: -------------------------------------------------------------------------------- 1 | import dmx from 'dmx-api' 2 | 3 | export default { 4 | props: { 5 | // the Topic/Assoc to render; is never undefined; 6 | // may be an "empty" topic/assoc, without ID, with just type set 7 | object: { 8 | type: dmx.DMXObject, 9 | required: true 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/js/country-flag-polyfill.js: -------------------------------------------------------------------------------- 1 | import {polyfillCountryFlagEmojis} from "country-flag-emoji-polyfill" 2 | const isNeeded = polyfillCountryFlagEmojis() 3 | console.log('[DMX] country-flag-emoji-polyfill:', isNeeded) 4 | -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/js/element-plus-ext.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { 3 | Table, TableColumn, Header, Container, Main, Upload, Drawer, Timeline, TimelineItem, Badge, ButtonGroup 4 | } from 'element-ui' 5 | 6 | // register components 7 | Vue.use(Table) 8 | Vue.use(TableColumn) 9 | Vue.use(Header) 10 | Vue.use(Container) 11 | Vue.use(Main) 12 | Vue.use(Upload) 13 | Vue.use(Drawer) 14 | Vue.use(Timeline) 15 | Vue.use(TimelineItem) 16 | Vue.use(Badge) 17 | Vue.use(ButtonGroup) 18 | -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/js/element-plus.js: -------------------------------------------------------------------------------- 1 | import { ElMessageBox, ElNotification } from 'element-plus' 2 | import { ArrowDown } from '@element-plus/icons-vue' 3 | import 'element-plus/theme-chalk/el-message-box.css' 4 | import 'element-plus/theme-chalk/el-notification.css' 5 | import app from './app' 6 | // import DialogDraggable from 'vue-element-dialog-draggable' // TODO? 7 | 8 | export default () => undefined // import('./element-plus-ext') // TODO 9 | 10 | // set locale // TODO? 11 | // import locale from 'element-plus/lib/locale' 12 | // locale.use(require('element-plus/lib/locale/lang/en').default) 13 | 14 | // global config // TODO? 15 | // Vue.prototype.$ELEMENT = { 16 | // size: 'mini' 17 | // } 18 | 19 | // register app assets 20 | app.use(ElMessageBox) 21 | app.use(ElNotification) 22 | 23 | app.component('ArrowDown', ArrowDown) 24 | 25 | // Vue.use(Loading.directive) // TODO? 26 | // Vue.use(DialogDraggable) // TODO? 27 | -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/js/error-handler.js: -------------------------------------------------------------------------------- 1 | import app from './app' 2 | 3 | Error.prototype.toString = function () { 4 | return `${this.message}${this.cause ? `, Caused by ${this.cause}` : ''}` 5 | } 6 | 7 | export default function onHttpError (error) { 8 | // enhancement 9 | error.message = error.response.data.error || error.message 10 | error.cause = error.response.data.cause 11 | // alert box 12 | const level = error.response.data.level || 'ERROR' 13 | app.config.globalProperties.$notify({ 14 | title: level, 15 | type: level.toLowerCase(), 16 | message: `

${error.message}

${error.cause ? `

Cause: ${error.cause}

` : ''}`, 17 | dangerouslyUseHTMLString: true, 18 | duration: 0 19 | }) 20 | } 21 | -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/dots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/dots.png -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/favicon.png -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | DMX 5.4-SNAPSHOT 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCp6KVjbNBYlgoKejYHtFyBN4FNgYUJ31U.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCp6KVjbNBYlgoKejYHtFyBN4FNgYUJ31U.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCp6KVjbNBYlgoKejYHtFyCN4FNgYUJ31U.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCp6KVjbNBYlgoKejYHtFyCN4FNgYUJ31U.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCp6KVjbNBYlgoKejYHtFyDN4FNgYUJ31U.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCp6KVjbNBYlgoKejYHtFyDN4FNgYUJ31U.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCp6KVjbNBYlgoKejYHtFyLN4FNgYUJ31U.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCp6KVjbNBYlgoKejYHtFyLN4FNgYUJ31U.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCp6KVjbNBYlgoKejYHtFyMN4FNgYUJ31U.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCp6KVjbNBYlgoKejYHtFyMN4FNgYUJ31U.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCp6KVjbNBYlgoKejYHtFyPN4FNgYUJ.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCp6KVjbNBYlgoKejYHtFyPN4FNgYUJ.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCs6KVjbNBYlgoKcQ72nU6AF7xm.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCs6KVjbNBYlgoKcQ72nU6AF7xm.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCs6KVjbNBYlgoKcg72nU6AF7xm.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCs6KVjbNBYlgoKcg72nU6AF7xm.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCs6KVjbNBYlgoKcw72nU6AF7xm.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCs6KVjbNBYlgoKcw72nU6AF7xm.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCs6KVjbNBYlgoKew72nU6AF7xm.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCs6KVjbNBYlgoKew72nU6AF7xm.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCs6KVjbNBYlgoKfA72nU6AF7xm.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCs6KVjbNBYlgoKfA72nU6AF7xm.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCs6KVjbNBYlgoKfw72nU6AFw.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCs6KVjbNBYlgoKfw72nU6AFw.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCu6KVjbNBYlgoKej70l0miFYxn.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCu6KVjbNBYlgoKej70l0miFYxn.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCu6KVjbNBYlgoKej73l0miFYxnu4w.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCu6KVjbNBYlgoKej73l0miFYxnu4w.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCu6KVjbNBYlgoKej74l0miFYxnu4w.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCu6KVjbNBYlgoKej74l0miFYxnu4w.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCu6KVjbNBYlgoKej75l0miFYxnu4w.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCu6KVjbNBYlgoKej75l0miFYxnu4w.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCu6KVjbNBYlgoKej76l0miFYxnu4w.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCu6KVjbNBYlgoKej76l0miFYxnu4w.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCu6KVjbNBYlgoKej7wl0miFYxnu4w.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCu6KVjbNBYlgoKej7wl0miFYxnu4w.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCv6KVjbNBYlgoCjC3js2yNPYZvg7UI.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCv6KVjbNBYlgoCjC3js2yNPYZvg7UI.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCv6KVjbNBYlgoCjC3jsGyNPYZvgw.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCv6KVjbNBYlgoCjC3jsGyNPYZvgw.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCv6KVjbNBYlgoCjC3jtGyNPYZvg7UI.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCv6KVjbNBYlgoCjC3jtGyNPYZvg7UI.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCv6KVjbNBYlgoCjC3jvGyNPYZvg7UI.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCv6KVjbNBYlgoCjC3jvGyNPYZvg7UI.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCv6KVjbNBYlgoCjC3jvWyNPYZvg7UI.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCv6KVjbNBYlgoCjC3jvWyNPYZvg7UI.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCv6KVjbNBYlgoCjC3jvmyNPYZvg7UI.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmx-systems/dmx-platform/c79a7ef0863602ba9c4fe17c45f1e0def7f6e00d/modules/dmx-webclient/src/main/resources-build/ubuntu-font/4iCv6KVjbNBYlgoCjC3jvmyNPYZvg7UI.woff2 -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources/migrations/migration4.properties: -------------------------------------------------------------------------------- 1 | migrationRunMode = UPDATE 2 | -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources/migrations/migration5.properties: -------------------------------------------------------------------------------- 1 | migrationRunMode = UPDATE 2 | -------------------------------------------------------------------------------- /modules/dmx-webclient/src/main/resources/plugin.properties: -------------------------------------------------------------------------------- 1 | dmx.plugin.model_version = 7 2 | -------------------------------------------------------------------------------- /modules/dmx-webservice/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 4.0.0 6 | 7 | DMX Webservice 8 | systems.dmx 9 | dmx-webservice 10 | 5.4-SNAPSHOT 11 | bundle 12 | 13 | 14 | systems.dmx 15 | dmx-plugin 16 | 5.4-SNAPSHOT 17 | ../dmx-plugin/pom.xml 18 | 19 | 20 | 21 | 22 | systems.dmx 23 | dmx-workspaces 24 | 5.4-SNAPSHOT 25 | 26 | 27 | 28 | 29 | 30 | 31 | org.apache.felix 32 | maven-bundle-plugin 33 | 34 | 35 | systems.dmx.webservice.WebservicePlugin 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /modules/dmx-webservice/src/main/java/systems/dmx/webservice/provider/CatchAllExceptionMapper.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.webservice.provider; 2 | 3 | import systems.dmx.core.util.UniversalExceptionMapper; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | 7 | import javax.ws.rs.core.Context; 8 | import javax.ws.rs.core.Response; 9 | import javax.ws.rs.ext.ExceptionMapper; 10 | import javax.ws.rs.ext.Provider; 11 | 12 | 13 | 14 | /** 15 | * This mapper maps all Throwables to a suitable response. 16 | *

17 | * We don't want Jersey to re-throw anything to the HTTP container as this would result in logging 18 | * the exception twice and possibly in interspersed illegible stack traces (see #484). 19 | *

20 | * 2 additional aspects are handled: 21 | * - Logging the exception. 22 | * - Enriching the response with an error entity. 23 | */ 24 | @Provider 25 | public class CatchAllExceptionMapper implements ExceptionMapper { 26 | 27 | // ---------------------------------------------------------------------------------------------- Instance Variables 28 | 29 | @Context 30 | HttpServletRequest request; 31 | 32 | // -------------------------------------------------------------------------------------------------- Public Methods 33 | 34 | @Override 35 | public Response toResponse(Throwable e) { 36 | return new UniversalExceptionMapper(e, request).toResponse(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /modules/dmx-workspaces/src/main/java/systems/dmx/workspaces/Constants.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.workspaces; 2 | 3 | 4 | 5 | public class Constants { 6 | 7 | public static final String ENABLED_SHARING_MODES_LABEL = "Enabled Sharing Modes"; 8 | 9 | // Topic Types 10 | public static final String WORKSPACE = "dmx.workspaces.workspace"; 11 | public static final String WORKSPACE_NAME = "dmx.workspaces.workspace_name"; 12 | public static final String WORKSPACE_DESCRIPTION = "dmx.workspaces.workspace_description"; 13 | public static final String WORKSPACE_FACET = "dmx.workspaces.workspace_facet"; 14 | public static final String SHARING_MODE = "dmx.workspaces.sharing_mode"; 15 | 16 | public static final String ENABLED_SHARING_MODES = "dmx.workspaces.enabled_sharing_modes"; 17 | public static final String PRIVATE_ENABLED = "dmx.workspaces.private.enabled"; 18 | public static final String CONFIDENTIAL_ENABLED = "dmx.workspaces.confidential.enabled"; 19 | public static final String COLLABORATIVE_ENABLED = "dmx.workspaces.collaborative.enabled"; 20 | public static final String PUBLIC_ENABLED = "dmx.workspaces.public.enabled"; 21 | public static final String COMMON_ENABLED = "dmx.workspaces.common.enabled"; 22 | 23 | // Assoc Types 24 | public static final String WORKSPACE_ASSIGNMENT = "dmx.workspaces.workspace_assignment"; 25 | } 26 | -------------------------------------------------------------------------------- /modules/dmx-workspaces/src/main/java/systems/dmx/workspaces/migrations/Migration3.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.workspaces.migrations; 2 | 3 | import systems.dmx.core.service.Inject; 4 | import systems.dmx.core.service.Migration; 5 | import systems.dmx.workspaces.WorkspacesService; 6 | 7 | 8 | 9 | /** 10 | * Create "DMX" workspace. 11 | *

12 | * Part of DMX 5.0-beta-4 13 | * Runs ALWAYS 14 | */ 15 | public class Migration3 extends Migration { 16 | 17 | // ---------------------------------------------------------------------------------------------- Instance Variables 18 | 19 | @Inject 20 | private WorkspacesService wsService; 21 | 22 | // -------------------------------------------------------------------------------------------------- Public Methods 23 | 24 | @Override 25 | public void run() { 26 | wsService.createWorkspace( 27 | WorkspacesService.DMX_WORKSPACE_NAME, 28 | WorkspacesService.DMX_WORKSPACE_URI, 29 | WorkspacesService.DMX_WORKSPACE_SHARING_MODE 30 | ); 31 | // Note 1: the workspace has no owner yet as the Access Control plugin is not yet activated (as it depends 32 | // on the Workspaces plugin). We set the owner in the Access Control migration #2. 33 | // Note 2: we can't postpone the creation of the "DMX" workspace to a Access Control migration as it 34 | // must be already available at Workspaces plugin activation time (as needed for the type introduction). 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /modules/dmx-workspaces/src/main/java/systems/dmx/workspaces/migrations/Migration4.java: -------------------------------------------------------------------------------- 1 | package systems.dmx.workspaces.migrations; 2 | 3 | import static systems.dmx.workspaces.Constants.*; 4 | import systems.dmx.core.Topic; 5 | import systems.dmx.core.service.Migration; 6 | 7 | 8 | 9 | /** 10 | * Sets labels of "Enabled Sharing Modes" topics created before DMX 5.2 11 | *

12 | * Part of DMX 5.2 13 | * Runs only in UPDATE mode. 14 | */ 15 | public class Migration4 extends Migration { 16 | 17 | // -------------------------------------------------------------------------------------------------- Public Methods 18 | 19 | @Override 20 | public void run() { 21 | for (Topic topic : dmx.getTopicsByType(ENABLED_SHARING_MODES)) { 22 | topic.setSimpleValue(ENABLED_SHARING_MODES_LABEL); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /modules/dmx-workspaces/src/main/js/components/dmx-workspace-info.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 22 | -------------------------------------------------------------------------------- /modules/dmx-workspaces/src/main/js/components/dmx-workspace-options.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 32 | 33 | 40 | -------------------------------------------------------------------------------- /modules/dmx-workspaces/src/main/js/plugin.js: -------------------------------------------------------------------------------- 1 | export default ({store}) => { 2 | return { 3 | 4 | init () { 5 | store.state.workspaces.ready = store.dispatch('fetchWorkspaceTopics') // ### FIXME: init state too late? 6 | // 7 | window.addEventListener('focus', () => { 8 | store.dispatch('updateWorkspaceCookie') 9 | }) 10 | }, 11 | 12 | storeModule: { 13 | name: 'workspaces', 14 | module: require('./workspaces').default 15 | }, 16 | 17 | storeWatcher: [ 18 | {getter: state => state.workspaces.workspaceId, callback: initWritable}, 19 | {getter: state => state.accesscontrol.username, callback: initWritable} 20 | ], 21 | 22 | components: [{ 23 | comp: require('./components/dmx-workspace-commands').default, 24 | mount: 'toolbar-left' 25 | }], 26 | 27 | workspaceCommands: { 28 | 'dmx.topicmaps.topicmap': [ 29 | require('./components/dmx-workspace-info').default 30 | ] 31 | }, 32 | 33 | extraMenuItems: [{ 34 | uri: 'dmx.workspaces.workspace', 35 | optionsComp: require('./components/dmx-workspace-options').default, 36 | create: (name, data) => { 37 | store.dispatch('createWorkspace', { 38 | name, 39 | sharingModeUri: data.sharingModeUri 40 | }) 41 | } 42 | }] 43 | } 44 | 45 | function initWritable () { 46 | store.dispatch('_initWorkspaceIsWritable') 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /modules/dmx-workspaces/src/main/resources/migrations/migration4.properties: -------------------------------------------------------------------------------- 1 | migrationRunMode = UPDATE 2 | -------------------------------------------------------------------------------- /modules/dmx-workspaces/src/main/resources/plugin.properties: -------------------------------------------------------------------------------- 1 | dmx.plugin.model_version = 5 2 | dmx.plugin.dependencies = systems.dmx.webclient 3 | --------------------------------------------------------------------------------