Skip to content

Commit

Permalink
Update to model version 1.2 (#56)
Browse files Browse the repository at this point in the history
* Update to model version 1.2

* Fixed EMF ThingPreference

* Relative subpaths support

* Fix according to comment
  • Loading branch information
Alex Vorobiev authored Jan 28, 2021
1 parent ef9313c commit 50671fa
Show file tree
Hide file tree
Showing 424 changed files with 6,221 additions and 514 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ cdp4common/target/**
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*


**/target/**
2 changes: 1 addition & 1 deletion cdp4common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.rheagroup</groupId>
<artifactId>cdp4-sdk4j-parent</artifactId>
<version>2.0.0</version>
<version>3.0.0</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public class SentinelThingProvider {
sentinelProvider.put("IterationSetup", new IterationSetup(new UUID(0L, 0L), null, null));
sentinelProvider.put("MeasurementScale", new CyclicRatioScale(new UUID(0L, 0L), null, null));
sentinelProvider.put("MeasurementUnit", new DerivedUnit(new UUID(0L, 0L), null, null));
sentinelProvider.put("Organization", new Organization(new UUID(0L, 0L), null, null));
sentinelProvider.put("Parameter", new Parameter(new UUID(0L, 0L), null, null));
sentinelProvider.put("ParameterBase", new Parameter(new UUID(0L, 0L), null, null));
sentinelProvider.put("ParameterType", new ArrayParameterType(new UUID(0L, 0L), null, null));
Expand Down
38 changes: 21 additions & 17 deletions cdp4common/src/main/java/cdp4common/commondata/Alias.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,27 @@

package cdp4common.commondata;

import cdp4common.AggregationKind;
import cdp4common.ChangeKind;
import cdp4common.Container;
import cdp4common.UmlInformation;
import cdp4common.engineeringmodeldata.Iteration;
import cdp4common.helpers.PojoThingFactory;
import cdp4common.sitedirectorydata.DomainOfExpertise;
import cdp4common.sitedirectorydata.Person;
import cdp4common.types.CacheKey;
import java.util.*;
import java.util.stream.*;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.io.*;
import java.net.URI;
import cdp4common.*;
import cdp4common.commondata.*;
import cdp4common.diagramdata.*;
import cdp4common.engineeringmodeldata.*;
import cdp4common.exceptions.ContainmentException;
import cdp4common.extensions.*;
import cdp4common.helpers.*;
import cdp4common.reportingdata.*;
import cdp4common.sitedirectorydata.*;
import cdp4common.types.*;
import org.apache.commons.lang3.ObjectUtils;
import com.google.common.base.Strings;
import com.google.common.cache.Cache;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import com.google.common.collect.Iterables;
import lombok.*;

/**
* representation of an alternative human-readable name for a concept
Expand Down Expand Up @@ -199,6 +201,7 @@ public void resolveProperties(cdp4common.dto.Thing dtoThing) {
this.setLanguageCode(dto.getLanguageCode());
this.setModifiedOn(dto.getModifiedOn());
this.setRevisionNumber(dto.getRevisionNumber());
this.setThingPreference(dto.getThingPreference());

this.resolveExtraProperties();
}
Expand All @@ -219,6 +222,7 @@ public cdp4common.dto.Thing toDto() {
dto.setLanguageCode(this.getLanguageCode());
dto.setModifiedOn(this.getModifiedOn());
dto.setRevisionNumber(this.getRevisionNumber());
dto.setThingPreference(this.getThingPreference());

dto.setIterationContainerId(this.getCacheKey().getIteration());
dto.registerSourceThing(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@

package cdp4common.commondata;

import java.time.OffsetDateTime;
import java.util.*;
import cdp4common.sitedirectorydata.*;
import cdp4common.types.*;
import cdp4common.CDPVersion;

/**
* abstract supertype that represents information expressed in human-readable natural language
* Note: Multiple alternative annotations may be given in different natural languages.
Expand Down
3 changes: 3 additions & 0 deletions cdp4common/src/main/java/cdp4common/commondata/Citation.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import cdp4common.diagramdata.*;
import cdp4common.engineeringmodeldata.*;
import cdp4common.exceptions.ContainmentException;
import cdp4common.extensions.*;
import cdp4common.helpers.*;
import cdp4common.reportingdata.*;
import cdp4common.sitedirectorydata.*;
Expand Down Expand Up @@ -225,6 +226,7 @@ public void resolveProperties(cdp4common.dto.Thing dtoThing) {
this.setRevisionNumber(dto.getRevisionNumber());
this.setShortName(dto.getShortName());
this.setSource(ObjectUtils.firstNonNull(PojoThingFactory.get(this.getCache(), dto.getSource(), dto.getIterationContainerId(), ReferenceSource.class), SentinelThingProvider.getSentinel(ReferenceSource.class)));
this.setThingPreference(dto.getThingPreference());

this.resolveExtraProperties();
}
Expand All @@ -247,6 +249,7 @@ public cdp4common.dto.Thing toDto() {
dto.setRevisionNumber(this.getRevisionNumber());
dto.setShortName(this.getShortName());
dto.setSource(this.getSource() != null ? this.getSource().getIid() : new UUID(0L, 0L));
dto.setThingPreference(this.getThingPreference());

dto.setIterationContainerId(this.getCacheKey().getIteration());
dto.registerSourceThing(this);
Expand Down
25 changes: 25 additions & 0 deletions cdp4common/src/main/java/cdp4common/commondata/ClassKind.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ public enum ClassKind {
*/
Definition,

/**
* Assertion that the Class is an instance of DependentParameterTypeAssignment
*/
DependentParameterTypeAssignment,

/**
* Assertion that the Class is an instance of DerivedQuantityKind
*/
Expand Down Expand Up @@ -379,6 +384,11 @@ public enum ClassKind {
*/
IdCorrespondence,

/**
* Assertion that the Class is an instance of IndependentParameterTypeAssignment
*/
IndependentParameterTypeAssignment,

/**
* Assertion that the Class is an instance of IntervalScale
*/
Expand All @@ -404,6 +414,11 @@ public enum ClassKind {
*/
LogarithmicScale,

/**
* Assertion that the Class is an instance of LogEntryChangelogItem
*/
LogEntryChangelogItem,

/**
* Assertion that the Class is an instance of MappingToReferenceScale
*/
Expand Down Expand Up @@ -499,6 +514,11 @@ public enum ClassKind {
*/
Organization,

/**
* Assertion that the Class is an instance of OrganizationalParticipant
*/
OrganizationalParticipant,

/**
* Assertion that the Class is an instance of OwnedStyle
*/
Expand Down Expand Up @@ -744,6 +764,11 @@ public enum ClassKind {
*/
RuleViolation,

/**
* Assertion that the Class is an instance of SampledFunctionParameterType
*/
SampledFunctionParameterType,

/**
* Assertion that the Class is an instance of ScalarParameterType
*/
Expand Down
33 changes: 19 additions & 14 deletions cdp4common/src/main/java/cdp4common/commondata/DefinedThing.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,27 @@

package cdp4common.commondata;

import cdp4common.AggregationKind;
import cdp4common.ChangeKind;
import cdp4common.UmlInformation;
import cdp4common.engineeringmodeldata.Iteration;
import cdp4common.types.CacheKey;
import cdp4common.types.ContainerList;
import java.util.*;
import java.util.stream.*;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.io.*;
import java.net.URI;
import cdp4common.*;
import cdp4common.commondata.*;
import cdp4common.diagramdata.*;
import cdp4common.engineeringmodeldata.*;
import cdp4common.exceptions.ContainmentException;
import cdp4common.extensions.*;
import cdp4common.helpers.*;
import cdp4common.reportingdata.*;
import cdp4common.sitedirectorydata.*;
import cdp4common.types.*;
import org.apache.commons.lang3.ObjectUtils;
import com.google.common.base.Strings;
import com.google.common.cache.Cache;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.UUID;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import com.google.common.collect.Iterables;
import lombok.*;

/**
* abstract specialization of Thing for all classes that need a human readable definition, i.e. a name and a short name, and optionally explicit textual definitions, aliases and hyperlinks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import cdp4common.diagramdata.*;
import cdp4common.engineeringmodeldata.*;
import cdp4common.exceptions.ContainmentException;
import cdp4common.extensions.*;
import cdp4common.helpers.*;
import cdp4common.reportingdata.*;
import cdp4common.sitedirectorydata.*;
Expand Down Expand Up @@ -245,6 +246,7 @@ public void resolveProperties(cdp4common.dto.Thing dtoThing) {
this.setModifiedOn(dto.getModifiedOn());
PojoThingFactory.clearAndAddRange(this.getNote(), dto.getNote());
this.setRevisionNumber(dto.getRevisionNumber());
this.setThingPreference(dto.getThingPreference());

this.resolveExtraProperties();
}
Expand All @@ -267,6 +269,7 @@ public cdp4common.dto.Thing toDto() {
dto.setModifiedOn(this.getModifiedOn());
dto.getNote().addAll(this.getNote().toDtoOrderedItemList());
dto.setRevisionNumber(this.getRevisionNumber());
dto.setThingPreference(this.getThingPreference());

dto.setIterationContainerId(this.getCacheKey().getIteration());
dto.registerSourceThing(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.util.*;
import cdp4common.sitedirectorydata.*;
import cdp4common.types.*;
import cdp4common.CDPVersion;

/**
* thing that can be deprecated, meaning it is declared to be obsolescent
Expand Down
3 changes: 3 additions & 0 deletions cdp4common/src/main/java/cdp4common/commondata/HyperLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import cdp4common.diagramdata.*;
import cdp4common.engineeringmodeldata.*;
import cdp4common.exceptions.ContainmentException;
import cdp4common.extensions.*;
import cdp4common.helpers.*;
import cdp4common.reportingdata.*;
import cdp4common.sitedirectorydata.*;
Expand Down Expand Up @@ -201,6 +202,7 @@ public void resolveProperties(cdp4common.dto.Thing dtoThing) {
this.setLanguageCode(dto.getLanguageCode());
this.setModifiedOn(dto.getModifiedOn());
this.setRevisionNumber(dto.getRevisionNumber());
this.setThingPreference(dto.getThingPreference());
this.setUri(dto.getUri());

this.resolveExtraProperties();
Expand All @@ -221,6 +223,7 @@ public cdp4common.dto.Thing toDto() {
dto.setLanguageCode(this.getLanguageCode());
dto.setModifiedOn(this.getModifiedOn());
dto.setRevisionNumber(this.getRevisionNumber());
dto.setThingPreference(this.getThingPreference());
dto.setUri(this.getUri());

dto.setIterationContainerId(this.getCacheKey().getIteration());
Expand Down
25 changes: 25 additions & 0 deletions cdp4common/src/main/java/cdp4common/commondata/LogEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,20 @@
import java.util.*;
import cdp4common.sitedirectorydata.*;
import cdp4common.types.*;
import cdp4common.CDPVersion;

/**
* representation of an entry in a logbook
* Note 1: A LogEntry is a human written message that records succinctly what change was applied at what point in time to the SiteDirectory or to an EngineeringModel and optionally records information on why the change was applied.
* Note 2: A LogEntry could be categorized (see Category and CategorizableThing) e.g. to denote that a LogEntry contains a "design rationale". This would later help with reporting or retrieving useful information from the logbook.
*/
public interface LogEntry {
/**
* Gets a list of UUID.
* The list of affected Domains of Expertise that this LogEntry.
*/
ArrayList<UUID> getAffectedDomainIid();

/**
* Gets a list of UUID.
* weak reference to zero or more items that are relevant to or affected by what is described in the content of this LogEntry
Expand All @@ -58,6 +65,18 @@ public interface LogEntry {
*/
LogLevelKind getLevel();

/**
* Gets a list of contained LogEntryChangelogItem.
*/
@CDPVersion(version = "1.2.0")
ContainerList<LogEntryChangelogItem> getLogEntryChangelogItem();

/**
* Sets a list of UUID.
* The list of affected Domains of Expertise that this LogEntry.
*/
void setAffectedDomainIid(ArrayList<UUID> affectedDomainIid);

/**
* Sets a list of UUID.
* weak reference to zero or more items that are relevant to or affected by what is described in the content of this LogEntry
Expand All @@ -77,4 +96,10 @@ public interface LogEntry {
* Note: The <i>level</i> can be used to filter log entries. Also applications may provide a setting that switches on or off logging log entries of a certain level.
*/
void setLevel(LogLevelKind level);

/**
* Sets a list of contained LogEntryChangelogItem.
*/
@CDPVersion(version = "1.2.0")
void setLogEntryChangelogItem(ContainerList<LogEntryChangelogItem> logEntryChangelogItem);
}
Loading

0 comments on commit 50671fa

Please sign in to comment.