Skip to content

Commit

Permalink
Corrected cardinality and range of the oslc_config:acceptedBy property (
Browse files Browse the repository at this point in the history
#423)

Corrected cardinality and range of the oslc_config:acceptedBy property
  • Loading branch information
Jad-el-khoury authored Oct 30, 2023
1 parent d3673d3 commit df1813e
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

- Kotlin 1.9.0 is used; `kotlin-stdlib-jdk8` dependency was replaced with `kotlin-stdlib` due to [Kotlin updates](https://kotlinlang.org/docs/whatsnew18.html#updated-jvm-compilation-target).
- Allow application to reset the oauth token cached within the server, when it deems that it is no longer valid
- 🧨Corrected cardinality and range of the oslc_config:acceptedBy property (from String[0..1] to Resource[0..*])

### Deprecated

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@
<resourceProperties id="_pnZqcZUdEeq-KoPaR9_Cfg" name="versionId" description="A short human-readable identifier for the version of a resource. All versioned resources should have this property; where the property is present, this identifier must be unique amongst all currently existing versions of the same concept resource. The subject of this property should be the concept resource URI." valueType="String"/>
<resourceProperties id="_jaBLoBe3Ee2Qoa8h9kRCOQ" name="component" description="The component to which this version belongs. Configuration Management provider should indicate the owning component for each version resource using either this property, or using the membership relationship from the component LDPC." valueType="Resource" range="_BrY_wBe1Ee2Qoa8h9kRCOQ"/>
<resourceProperties id="_Idof4BfGEe2Qoa8h9kRCOQ" name="configurations" valueType="Resource" range="_jaDA0Re3Ee2Qoa8h9kRCOQ"/>
<resourceProperties id="_fSwgsBfKEe2Qoa8h9kRCOQ" name="acceptedBy" occurs="zeroOrOne" valueType="String" range="_poyKgJUdEeq-KoPaR9_Cfg"/>
<resourceProperties id="_fSwgsBfKEe2Qoa8h9kRCOQ" name="acceptedBy" occurs="zeroOrMany" valueType="Resource" range="_poyKgJUdEeq-KoPaR9_Cfg"/>
<resourceProperties id="_-mzV8BfLEe2Qoa8h9kRCOQ" name="baselineOfStream" valueType="Resource" range="_jaDA0Re3Ee2Qoa8h9kRCOQ"/>
<resourceProperties id="_-mzV8RfLEe2Qoa8h9kRCOQ" name="branch" valueType="Resource"/>
<resourceProperties id="_-mzV8hfLEe2Qoa8h9kRCOQ" name="previousBaseline" valueType="Resource" range="_U16uYBfKEe2Qoa8h9kRCOQ"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
import org.eclipse.lyo.oslc.domains.DctermsVocabularyConstants;
import org.eclipse.lyo.oslc.domains.OsclVocabularyConstants;
import org.eclipse.lyo.oslc.domains.Agent;
import org.eclipse.lyo.oslc.domains.RdfsClass;
import org.eclipse.lyo.oslc.domains.config.Component;
import org.eclipse.lyo.oslc.domains.config.Contribution;
import org.eclipse.lyo.oslc.domains.Person;
Expand Down Expand Up @@ -111,7 +112,7 @@ public class Configuration
private String title;
// Start of user code attributeAnnotation:acceptedBy
// End of user code
private String acceptedBy;
private Set<Link> acceptedBy = new HashSet<>();
// Start of user code attributeAnnotation:branch
// End of user code
private Link branch;
Expand Down Expand Up @@ -215,6 +216,11 @@ public void addSubject(final String subject)
this.subject.add(subject);
}

public void addAcceptedBy(final Link acceptedBy)
{
this.acceptedBy.add(acceptedBy);
}

public void addSelections(final Link selections)
{
this.selections.add(selections);
Expand Down Expand Up @@ -368,11 +374,11 @@ public String getTitle()
// End of user code
@OslcName("acceptedBy")
@OslcPropertyDefinition(Oslc_configDomainConstants.CONFIGURATION_MANAGEMENT_NAMSPACE + "acceptedBy")
@OslcOccurs(Occurs.ZeroOrOne)
@OslcValueType(ValueType.String)
@OslcOccurs(Occurs.ZeroOrMany)
@OslcValueType(ValueType.Resource)
@OslcRange({RdfsDomainConstants.CLASS_TYPE})
@OslcReadOnly(false)
public String getAcceptedBy()
public Set<Link> getAcceptedBy()
{
// Start of user code getterInit:acceptedBy
// End of user code
Expand Down Expand Up @@ -647,11 +653,15 @@ public void setTitle(final String title )

// Start of user code setterAnnotation:acceptedBy
// End of user code
public void setAcceptedBy(final String acceptedBy )
public void setAcceptedBy(final Set<Link> acceptedBy )
{
// Start of user code setterInit:acceptedBy
// End of user code
this.acceptedBy = acceptedBy;
this.acceptedBy.clear();
if (acceptedBy != null)
{
this.acceptedBy.addAll(acceptedBy);
}
// Start of user code setterFinalize:acceptedBy
// End of user code
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import org.eclipse.lyo.oslc.domains.ProvVocabularyConstants;
import org.eclipse.lyo.oslc.domains.IAgent;
import org.eclipse.lyo.oslc.domains.config.IBaseline;
import org.eclipse.lyo.oslc.domains.IRdfsClass;
import org.eclipse.lyo.oslc.domains.config.IComponent;
import org.eclipse.lyo.oslc.domains.config.IConfiguration;
import org.eclipse.lyo.oslc.domains.config.IContribution;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import org.eclipse.lyo.oslc.domains.DctermsVocabularyConstants;
import org.eclipse.lyo.oslc.domains.OsclVocabularyConstants;
import org.eclipse.lyo.oslc.domains.IAgent;
import org.eclipse.lyo.oslc.domains.IRdfsClass;
import org.eclipse.lyo.oslc.domains.config.IComponent;
import org.eclipse.lyo.oslc.domains.config.IContribution;
import org.eclipse.lyo.oslc.domains.IPerson;
Expand All @@ -77,6 +78,7 @@ public interface IConfiguration
public void addContributor(final Link contributor );
public void addCreator(final Link creator );
public void addSubject(final String subject );
public void addAcceptedBy(final Link acceptedBy );
public void addSelections(final Link selections );
public void addInstanceShape(final Link instanceShape );
public void addModifiedBy(final Link modifiedBy );
Expand Down Expand Up @@ -152,11 +154,11 @@ public interface IConfiguration

@OslcName("acceptedBy")
@OslcPropertyDefinition(Oslc_configDomainConstants.CONFIGURATION_MANAGEMENT_NAMSPACE + "acceptedBy")
@OslcOccurs(Occurs.ZeroOrOne)
@OslcValueType(ValueType.String)
@OslcOccurs(Occurs.ZeroOrMany)
@OslcValueType(ValueType.Resource)
@OslcRange({RdfsDomainConstants.CLASS_TYPE})
@OslcReadOnly(false)
public String getAcceptedBy();
public Set<Link> getAcceptedBy();

@OslcName("branch")
@OslcPropertyDefinition(Oslc_configDomainConstants.CONFIGURATION_MANAGEMENT_NAMSPACE + "branch")
Expand Down Expand Up @@ -256,7 +258,7 @@ public interface IConfiguration
public void setModified(final Date modified );
public void setSubject(final Set<String> subject );
public void setTitle(final String title );
public void setAcceptedBy(final String acceptedBy );
public void setAcceptedBy(final Set<Link> acceptedBy );
public void setBranch(final Link branch );
public void setComponent(final Link component );
public void setContribution(final Link contribution );
Expand Down

0 comments on commit df1813e

Please sign in to comment.