Collections in workspaces configuration and applications
[ Feature description ]
- The workspace configuration describes the collection this workspace uses, and the kind of documents it contains.
- The workspace configuration describes also for each application it uses the collections this application has access to, and the role of the collection for this application.
- When the application is initialized, the collections are automatically loaded, using the storage engine class defined in the general configuration.
[ Core libraries changes - Applications ]
- New method Controller::initialize(), called by Controller::run() after the context has been passed to the Controller class, and before to call Controller::handleRequest().
- ApplicationConfiguration class has a new property $useCollections, an array to list the collections to use and their role
- Application class has a new property $collections, an array to the collections themselves, filled by the new initialize() method.
- Controller and Application classes are now abstract.
[ Core libraries changes - Workspaces ]
- WorkspaceConfiguration class has a new property $collections, the keys being the collection names, the values the collections document types to use. It's use by Application::initialize (cf. supra) to load the collections, and is also intended in the future to allow to browse collections from a workspace in a workspace settings web page or to print the collections not used by any specific application.
- WorkspaceConfiguration::getCollectionNameWithPrefix($workspace, $name) returns the full name of a collection, with the workspace prefix.
[ Core libraries changes - Collections ]
- New factory static method: Collection::load($id, $documentType) to get a collection of the type specified in the configuration. For example if $Config['DocumentStorage']['Type'] is 'MongoDB', it returns an instance of MongoDBCollection.
[ Minor changes ]
- Improved code documentation for Application class.