A typical codegpt project consists of these files
The project file is a xml file in the namespace
https://metafactory.io/xsd/v1/project
An example of a typical codegpt.xml project file:
<?xml version="1.0" encoding="UTF-8"?>
<codecomposer_project xmlns="https://metafactory.io/xsd/v1/project" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://metafactory.io/xsd/v1/project https://metafactory.io/xsd/v1/project.xsd">
<model>model.xml</model>
<codeinstruction>codeinstruction.xml</codeinstruction>
<snippets_folder>snippet</snippets_folder>
<!--
The output we create is written in the parent folder. In the codeinstructions are
(sub) paths specified, but they all start in the folder specified by the output_folder
element
-->
<output_folder>..</output_folder>
<buildsets>
<!--
...
Create your buildsets here
...
-->
<maps>
<map name="javaTypes">
<entry key="DateTime" value="java.time.LocalDateTime"></entry>
<!-- override the mapping for Date with java.time.LocalDate instead of java.util.Date -->
<entry key="Date" value="java.time.LocalDate"></entry>
<entry key="blob" value="byte[]"></entry>
<entry key="clob" value="com.fasterxml.jackson.databind.JsonNode"></entry>
</map>
</maps>
<property_files>
<property_file filepath="template.properties" ></property_file>
<property_file filepath="local.properties" ignoreMissing="true"></property_file>
</property_files>
<configuration>
<!-- Instruct CodeGPT formatting is handled by builtin Google Java Formatter -->
<java_formatter>google_java_format</java_formatter>
<auto_update_namespace>false</auto_update_namespace>
<use_optionals_in_api>false</use_optionals_in_api>
<use_fluent_setters_in_api>false</use_fluent_setters_in_api>
</configuration>
<business_style>
<author></author>
<javadoc_for_interface>Created by CodeGPT.</javadoc_for_interface>
<javadoc_for_class>Created by CodeGPT.</javadoc_for_class>
<header></header>
<footer></footer>
<create_default_java_doc_for_interface>false</create_default_java_doc_for_interface>
<add_author_to_default_java_doc_for_interface>false</add_author_to_default_java_doc_for_interface>
<create_default_java_doc_for_class>false</create_default_java_doc_for_class>
<add_author_to_default_java_doc_for_class>false</add_author_to_default_java_doc_for_class>
<create_default_java_doc_for_getters_setters>false</create_default_java_doc_for_getters_setters>
</business_style>
</codecomposer_project>
The model file is specified in the project file with the <model> element (line 4). A model file is a xml file in the namespace
https://metafactory.io/xsd/v1/model
The root element is model and it has zero or more package children.
An example of a model.xml file is:
<?xml version="1.0" encoding="UTF-8"?>
<model xmlns="https://metafactory.io/xsd/v1/model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://metafactory.io/xsd/v1/model https://metafactory.io/xsd/v1/model.xsd">
<package name="domain_model">
<object name="Relation">
<metadata>
<enum>false</enum>
<name.plural>Relations</name.plural>
</metadata>
<reference name="type" type="RelationType" multiplicity="1..1" notnull="true"></reference>
<reference name="person" type="Person" multiplicity="0..1" notnull="false"></reference>
<reference name="company" type="Company" multiplicity="0..1" notnull="false"></reference>
</object>
<object name="RelationType">
<metadata>
<enum>true</enum>
<enum.constants>Private,Business</enum.constants>
<name.plural>RelationTypes</name.plural>
</metadata>
</object>
<object name="Person">
<metadata>
<enum>false</enum>
<name.plural>Persons</name.plural>
</metadata>
<attribute name="firstName" type="String" length="40" notnull="true"></attribute>
<attribute name="middleName" type="String" length="10" notnull="false"></attribute>
<attribute name="lastName" type="String" length="60" notnull="true"></attribute>
<attribute name="birthDate" type="Date"></attribute>
<reference name="address" type="Address" multiplicity="0..n" notnull="false"></reference>
<reference name="phone" type="Phone" multiplicity="0..n" notnull="false"></reference>
<reference name="email" type="Email" multiplicity="0..n" notnull="false"></reference>
</object>
<object name="Company">
<metadata>
<enum>false</enum>
<name.plural>Companies</name.plural>
</metadata>
<attribute name="name" type="String" length="120" notnull="true">
<metadata>
<businesskey>1</businesskey>
</metadata>
</attribute>
<attribute name="description" type="text"></attribute>
<reference name="address" type="Address" multiplicity="0..n" notnull="false"></reference>
<reference name="phone" type="Phone" multiplicity="0..1" notnull="false"></reference>
<reference name="email" type="Email" multiplicity="0..1" notnull="false"></reference>
</object>
<object name="Address">
<metadata>
<enum>false</enum>
<name.plural>Addresss</name.plural>
</metadata>
<attribute name="streetName" type="String" notnull="true">
<metadata>
<businesskey>2</businesskey>
</metadata>
</attribute>
<attribute name="zipCode" type="String">
<metadata>
<businesskey>3</businesskey>
</metadata>
</attribute>
<attribute name="city" type="String" notnull="true">
<metadata>
<businesskey>1</businesskey>
</metadata>
</attribute>
<attribute name="country" type="String"></attribute>
<attribute name="description" type="text"></attribute>
<reference name="type" type="AddressType" multiplicity="1..1" notnull="true"></reference>
<reference name="person" type="Person" multiplicity="0..1" notnull="false"></reference>
<reference name="company" type="Company" multiplicity="0..1" notnull="false"></reference>
</object>
<object name="Phone">
<metadata>
<enum>false</enum>
<name.plural>Phones</name.plural>
</metadata>
<attribute name="number" type="String" length="20" notnull="true">
<metadata>
<businesskey>1</businesskey>
</metadata>
</attribute>
<attribute name="description" type="text" length="250" notnull="false"></attribute>
<reference name="person" type="Person" multiplicity="0..1" notnull="false"></reference>
<reference name="company" type="Company" multiplicity="0..1" notnull="false"></reference>
</object>
<object name="Email">
<metadata>
<enum>false</enum>
<name.plural>Emails</name.plural>
</metadata>
<attribute name="emailAddress" type="String" length="80" notnull="true">
<metadata>
<businesskey>1</businesskey>
</metadata>
</attribute>
<attribute name="description" type="text" length="250" notnull="false"></attribute>
<reference name="person" type="Person" multiplicity="0..1" notnull="false"></reference>
<reference name="company" type="Company" multiplicity="0..1" notnull="false"></reference>
</object>
<object name="AddressType">
<metadata>
<enum>false</enum>
<enum_use>true</enum_use>
<name.plural>AddressTypes</name.plural>
</metadata>
<attribute name="key" type="String" notnull="true">
<metadata>
<businesskey>1</businesskey>
<model.apicomment>Unique key</model.apicomment>
</metadata>
</attribute>
<attribute name="qualifier" type="Integer" notnull="false">
<metadata>
<model.apicomment>Numeric value used for sorting</model.apicomment>
</metadata>
</attribute>
</object>
</package>
</model>
A package contains objects. An object has attribute and reference children. An attribute has a name and a type, a reference has a name, a type (another object) and a multiplicity (to indicate 1 or n relation).