Skip to content

Commit

Permalink
Merge branch 'feature/codegen'
Browse files Browse the repository at this point in the history
  • Loading branch information
tonydamage committed Feb 28, 2022
2 parents 740aa40 + b70f627 commit 65cca2f
Show file tree
Hide file tree
Showing 30 changed files with 143 additions and 138 deletions.
1 change: 0 additions & 1 deletion gui/admin-gui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@
<groupId>com.evolveum.prism</groupId>
<artifactId>prism-impl</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.evolveum.midpoint.infra</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,15 @@ public void onClick(AjaxRequestTarget ajaxRequestTarget) {
if (getTitleModel() != null) {
box.add(new Label(ID_TITLE, getTitleModel()));
} else if (getTitlePropertyName() != null) {
box.add(new Label(ID_TITLE, createLabelModel(getTitlePropertyName(), SummaryPanelSpecificationType.F_TITLE_1)));
box.add(new Label(ID_TITLE, createLabelModel(getTitlePropertyName(), SummaryPanelSpecificationType.F_TITLE1)));
} else {
box.add(new Label(ID_TITLE, " "));
}

if (getTitle2Model() != null) {
box.add(new Label(ID_TITLE2, getTitle2Model()));
} else if (getTitle2PropertyName() != null) {
box.add(new Label(ID_TITLE, createLabelModel(getTitle2PropertyName(), SummaryPanelSpecificationType.F_TITLE_2)));
box.add(new Label(ID_TITLE, createLabelModel(getTitle2PropertyName(), SummaryPanelSpecificationType.F_TITLE2)));
} else {
Label label = new Label(ID_TITLE2, " ");
label.setVisible(false);
Expand All @@ -155,7 +155,7 @@ public void onClick(AjaxRequestTarget ajaxRequestTarget) {
if (getTitle3Model() != null) {
box.add(new Label(ID_TITLE3, getTitle3Model()));
} else if (getTitle3PropertyName() != null) {
box.add(new Label(ID_TITLE, createLabelModel(getTitle3PropertyName(), SummaryPanelSpecificationType.F_TITLE_3)));
box.add(new Label(ID_TITLE, createLabelModel(getTitle3PropertyName(), SummaryPanelSpecificationType.F_TITLE3)));
} else {
Label label = new Label(ID_TITLE3, " ");
label.setVisible(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.evolveum.midpoint.web.page.admin.resources.PageResourceWizard;
import com.evolveum.midpoint.web.util.InfoTooltipBehavior;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ProvisioningScriptHostType;
import com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ScriptCapabilityHostType;
import com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ScriptCapabilityType;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.html.WebMarkupContainer;
Expand Down Expand Up @@ -77,10 +78,10 @@ protected void onUpdate(AjaxRequestTarget target) {
}

private IModel prepareOnConnectorModel(){
CapabilityDto dto = (CapabilityDto)getModel().getObject();
CapabilityDto dto = getModel().getObject();
ScriptCapabilityType script = (ScriptCapabilityType)dto.getCapability();

for(ScriptCapabilityType.Host host: script.getHost()){
for(ScriptCapabilityHostType host: script.getHost()){
if(ProvisioningScriptHostType.CONNECTOR.equals(host.getType())){
return new PropertyModel<List<String>>(host, "language");
}
Expand All @@ -91,10 +92,10 @@ private IModel prepareOnConnectorModel(){
}

private IModel prepareOnResourceModel(){
CapabilityDto dto = (CapabilityDto)getModel().getObject();
CapabilityDto dto = getModel().getObject();
ScriptCapabilityType script = (ScriptCapabilityType)dto.getCapability();

for(ScriptCapabilityType.Host host: script.getHost()){
for(ScriptCapabilityHostType host: script.getHost()){
if(ProvisioningScriptHostType.RESOURCE.equals(host.getType())){
return new PropertyModel<List<String>>(host, "language");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ private static String prepareConfiguration(LoggingConfigurationType config, Midp
generateAuditingLogConfig(config.getAuditing(), sb);

if (null != config.getAdvanced()) {
for (Object item : config.getAdvanced().getContent()) {
for (Object item : config.getAdvanced().getAny()) {
sb.append(item.toString());
sb.append("\n");
}
Expand Down
181 changes: 94 additions & 87 deletions infra/schema/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,6 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
</dependency>
<!-- Needed only for #toStrings of prism classes. -->
<dependency>
<groupId>org.apache.cxf.xjc-utils</groupId>
<artifactId>cxf-xjc-runtime</artifactId>
<exclusions>
<exclusion>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
Expand All @@ -111,10 +100,6 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics-runtime</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand All @@ -140,19 +125,11 @@
<artifactId>jackson-databind</artifactId>
</dependency>

<!-- TODO this should go away with WSDLs -->
<dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
</dependency>

<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
</dependency>

<dependency>
<groupId>com.google.guava</groupId>
Expand Down Expand Up @@ -221,95 +198,125 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<groupId>com.evolveum.prism</groupId>
<artifactId>prism-maven-plugin</artifactId>
<version>${project.version}</version>
<configuration>
<schemaFiles>
<schemaFile>src/main/resources/xml/ns/public/common/common-3.xsd</schemaFile>
<schemaFile>src/main/resources/xml/ns/public/common/api-types-3.xsd</schemaFile>
<schemaFile>src/main/resources/xml/ns/public/connector/icf-1/resource-schema-3.xsd</schemaFile>
<schemaFile>src/main/resources/xml/ns/public/model/scripting/scripting-3.xsd</schemaFile>
</schemaFiles>
<catalogFiles>
<catalogFile>src/compile/resources/jax-ws-catalog.xml</catalogFile>
<catalogFile>src/main/resources/META-INF/schemas-in-this-module.xml</catalogFile> <!-- nextCatalog doesn't work for unknown reason -->
</catalogFiles>
<templateDir>src/main/schemadoc/templates</templateDir>
</configuration>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
<wsdlRoot>${project.directory}/src/main/resources/xml</wsdlRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>src/main/resources/xml/ns/private/webservice/modelService.wsdl</wsdl>
<catalog>${basedir}/src/compile/resources/jax-ws-catalog.xml</catalog>
<extraargs>
<extraarg>-impl</extraarg>
<extraarg>-verbose</extraarg>
<extraarg>-xjc-Xts</extraarg>
<extraarg>-xjc-XhashCode</extraarg>
<extraarg>
-xjc-XhashCode-hashCodeStrategyClass=com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy
</extraarg>
<extraarg>-xjc-Xequals</extraarg>
<extraarg>
-xjc-Xequals-equalsStrategyClass=com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy
</extraarg>
<extraarg>-nexclude</extraarg>
<extraarg>http://prism.evolveum.com/xml/ns/public/types-3</extraarg>
<extraarg>-nexclude</extraarg>
<extraarg>http://prism.evolveum.com/xml/ns/public/annotation-3</extraarg>
<extraarg>-nexclude</extraarg>
<extraarg>http://prism.evolveum.com/xml/ns/public/query-3</extraarg>
<extraarg>-xjc-Xmidpoint</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
<!--
This avoids going online for schema checking which may slow down the build sometimes extremely,
e.g. when firewall is set to drop SYN packet silently during connection.
-->
<additionalJvmArgs>-Dcom.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.noCorrectnessCheck=true</additionalJvmArgs>
</configuration>
<id>schemadoc</id>
<phase>package</phase>
<goals>
<goal>wsdl2java</goal>
<goal>schemadoc</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.cxf.xjcplugins</groupId>
<artifactId>cxf-xjc-ts</artifactId>
<version>${cxf-xjc.version}</version>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>0.10.0</version>
</dependency>
<dependency>
<groupId>com.evolveum.prism.tools</groupId>
<artifactId>xjc-plugin</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>com.evolveum.prism</groupId>
<artifactId>prism-maven-plugin</artifactId>
<artifactId>prism-codegen-maven-plugin</artifactId>
<version>${project.version}</version>
<configuration>
<schemaFiles>
<schemaFile>src/main/resources/xml/ns/public/common/common-3.xsd</schemaFile>
<schemaFile>src/main/resources/xml/ns/public/common/audit-3.xsd</schemaFile>
<schemaFile>src/main/resources/xml/ns/public/common/api-types-3.xsd</schemaFile>
<schemaFile>src/main/resources/xml/ns/public/resource/capabilities-3.xsd</schemaFile>
<schemaFile>src/main/resources/xml/ns/public/connector/icf-1/resource-schema-3.xsd</schemaFile>
<schemaFile>src/main/resources/xml/ns/public/connector/icf-1/connector-schema-3.xsd</schemaFile>
<schemaFile>src/main/resources/xml/ns/public/model/scripting/scripting-3.xsd</schemaFile>
</schemaFiles>
<wsdlFiles>
<wsdlFile>src/main/resources/xml/ns/public/common/fault-3.wsdl</wsdlFile>
<wsdlFile>src/main/resources/xml/ns/public/model/model-3.wsdl</wsdlFile>
</wsdlFiles>
<catalogFiles>
<catalogFile>src/compile/resources/jax-ws-catalog.xml</catalogFile>
<catalogFile>src/main/resources/META-INF/schemas-in-this-module.xml</catalogFile> <!-- nextCatalog doesn't work for unknown reason -->
</catalogFiles>
<templateDir>src/main/schemadoc/templates</templateDir>
<constants>
<constant>
<prefix>C</prefix>
<namespace>http://midpoint.evolveum.com/xml/ns/public/common/common-3</namespace>
<name>COMMON</name>
</constant>
<constant>
<prefix>T</prefix>
<namespace>http://prism.evolveum.com/xml/ns/public/types-3</namespace>
<name>TYPES</name>
</constant>
<constant>
<prefix>Q</prefix>
<namespace>http://prism.evolveum.com/xml/ns/public/query-3</namespace>
<name>QUERY</name>
</constant>
<constant>
<prefix>R_CAP</prefix>
<namespace>http://midpoint.evolveum.com/xml/ns/public/resource/capabilities-3</namespace>
<name>CAPABILITIES</name>
</constant>
<constant>
<prefix>A</prefix>
<namespace>http://prism.evolveum.com/xml/ns/public/annotation-3</namespace>
<name>ANNOTATION</name>
</constant>
<constant>
<prefix>S</prefix>
<namespace>http://midpoint.evolveum.com/xml/ns/public/model/situation-1.xsd</namespace>
<name>SITUATION</name>
</constant>
<constant>
<prefix>SC</prefix>
<namespace>http://midpoint.evolveum.com/xml/ns/public/model/scripting-3</namespace>
<name>SCRIPTING</name>
</constant>
<constant>
<prefix>ICF_S</prefix>
<namespace>http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3</namespace>
<name>ICF_SCHEMA</name>
</constant>
<constant>
<prefix>ICF_C</prefix>
<namespace>http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/connector-schema-3</namespace>
<name>ICF_CONFIGURATION</name>
</constant>
<constant>
<prefix>ENC</prefix>
<namespace>http://www.w3.org/2001/04/xmlenc#</namespace>
<name>XML_ENC</name>
</constant>
<constant>
<prefix>DSIG</prefix>
<namespace>http://www.w3.org/2000/09/xmldsig#</namespace>
<name>XML_DSIG</name>
</constant>
<constant>
<prefix>XSD</prefix>
<namespace>http://www.w3.org/2001/XMLSchema</namespace>
<name>XSD</name>
</constant>
</constants>
</configuration>
<executions>
<execution>
<id>schemadoc</id>
<phase>package</phase>
<id>codegen</id>
<phase>generate-sources</phase>
<goals>
<goal>schemadoc</goal>
<goal>codegen</goal>
</goals>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7720,7 +7720,7 @@
<xsd:element name="name" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Name of the expression (function). The name is used for several purposed.
Name of the expression (function). The name is used for several purposes.
If the expression is a function in a function library then this name identifies
the function (the name must be unique in the whole library).
But even if the expression is not part of the library the name may still be used
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,19 @@

<xsd:element name="testConnection" type="tns:TestConnectionCapabilityType"/>

<xsd:complexType name="ScriptCapabilityHostType">
<xsd:sequence>
<xsd:element name="type" type="c:ProvisioningScriptHostType"/>
<xsd:element name="language" type="xsd:anyURI" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
Specifies the script language(s) supported on this host.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="ScriptCapabilityType">
<xsd:annotation>
<xsd:documentation>
Expand All @@ -578,20 +591,7 @@
<xsd:complexContent>
<xsd:extension base="tns:CapabilityType">
<xsd:sequence>
<xsd:element name="host" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="type" type="c:ProvisioningScriptHostType"/>
<xsd:element name="language" type="xsd:anyURI" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
Specifies the script language(s) supported on this host.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="host" maxOccurs="unbounded" type="tns:ScriptCapabilityHostType" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private <O extends ObjectType> void serializationRoundTripPrismObject(PrismObjec

// THEN
System.out.println("\nSerialized object:");
System.out.println(serializedObject);
//System.out.println(serializedObject);
PrismObject<O> deserializedObject = SerializationUtil.fromString(serializedObject);

System.out.println("\nDeserialized object (PrismObject):");
Expand Down

0 comments on commit 65cca2f

Please sign in to comment.