ClassDefinitions with XClassCreator

Description

Currently we define a Class by creating it's BaseClass in a ClassCollection and also adding it to HBM files. Furthermore, every time when getting a Field from a class you have to know it's type.

A ClassDefinition is a component designed to be a single point of definition for a class, it consists of a DocRef and ClassFields. From it, an XClass or HBM can be generated. https://synjira.atlassian.net/browse/CELDEV-263#icft=CELDEV-263

The ClassField defines type and it's properties. It is defined statically and can be used to retrieve values in the expected data type via ModelAccess.

ClassDefinitionPackage bundle ClassDefinitions together and are activatable via ConfigurationSource.

The XClassCreator loads all ClassDefinitionPackages via ComponentManager and generates XClasses out of them on their respective document.

Activity

Show:

Marc Sladek 14 July 2016 at 14:45

added mutability detection to ClassFields

Marc Sladek 12 July 2016 at 14:58

ClassFields are now immutable

Marc Sladek 20 June 2016 at 13:55

Added ClassDefinitionPackage, see description

Fabian Pichler 18 June 2016 at 14:44

Please explain how the packaging (previously called classCollections) works in the new implementation. The replaced com.celements.common.classes.IClassCollectionRole has a notion of package expressed in the getConfigName.

Sofar the XClass-collection/package contract has been:
E.g. the collection/package "blog" is defined by com.celements.blog.plugin.BlogClasses and includes the following XClasses:

  • NewsletterReceiverClass

  • BlogConfigClass

  • ArticleClass

  • ReceiverEMailClass

  • NewsletterConfigClass

  • BlogArticleSubscriptionClass

Class collections/packages can be activated in xwiki.cfg "celements.classcollections" or in the XWikiPreferences field "activated_classcollections". If the collection is activated can easily be checked calling the isActivated method on the collection object. As soon as the collection is activated for a database/wiki, all therein contained XClasses get created or updated.

To successfully replace the IClassCollectionRole we need a replacement for the collection/package activation behaviour. Please explain.

Fabian Pichler 17 June 2016 at 09:10

I suggest this is more than an "improvement". Can we upgrade to "New Feature"?

Fixed

Details

Priority

Assignee

Reporter

Components

Fix versions

Clockify

Created 16 June 2016 at 09:25
Updated 3 November 2022 at 02:34
Resolved 25 August 2016 at 16:19

Flag notifications