Create class with properties

Hello,

I have a problem with properties in new class :

When i create a class i do not know how i can add new properties in my page without use “Editing class”.
Or can i create class directly with properties like “date” or like “external Image” (Creating New XClass Property Types (XWiki.org)) ?

I would like to create a page/class in an automated way with existing properties, without going through the web interface. It’s possible ?

Indeed after I have no problem to manipulate my objects with REST requests.

Please Help :slight_smile:

Hi, you can script the creation of a class if you want, see for ex https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Scripting/APIGuide/#HCreateanXClass

Thx for your answer !

I have understood for TextArea with the addTextAreaField or the Date with addDateField, but how am I supposed to do with properties that we created like ExternalImage?

The addXXX() methods are just helper methods. You can check how they’re implemented and do the same for your custom property, using the {{groovy}} macro or by creating a custom Script Service that you’d then call from the velocity or groovy macro for example. For example: xwiki-platform/BaseClass.java at 04beb9c3fe427568085bc9082b87821f2562cafc · xwiki/xwiki-platform · GitHub