Skip to content

Commit

Permalink
Update TagType implementation
Browse files Browse the repository at this point in the history
1. Moved TagType from under FocusType to AssignmentHolderType.
2. Added minimalistic items and documentation.
  • Loading branch information
mederly committed Dec 19, 2022
1 parent 3655158 commit e788b07
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 21 deletions.
2 changes: 1 addition & 1 deletion config/sql/generic-old/h2-4.6-all.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ ALTER TABLE m_function_library
ALTER TABLE m_generic_object
ADD CONSTRAINT fk_generic_object FOREIGN KEY (oid) REFERENCES m_focus;
ALTER TABLE m_tag
ADD CONSTRAINT fk_tag FOREIGN KEY (oid) REFERENCES m_focus;
ADD CONSTRAINT fk_tag FOREIGN KEY (oid) REFERENCES m_object;
ALTER TABLE m_lookup_table
ADD CONSTRAINT fk_lookup_table FOREIGN KEY (oid) REFERENCES m_object;
ALTER TABLE m_lookup_table_row
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<xsd:include schemaLocation="http://midpoint.evolveum.com/xml/ns/public/common/common-gui-3" />
<xsd:include schemaLocation="http://midpoint.evolveum.com/xml/ns/public/common/common-provisioning-3" />
<xsd:include schemaLocation="http://midpoint.evolveum.com/xml/ns/public/common/common-correlation-3" />
<xsd:include schemaLocation="http://midpoint.evolveum.com/xml/ns/public/common/common-simulations-3" />

<!-- ################################## -->
<!-- ## Common Schema Layer ## -->
Expand Down Expand Up @@ -761,12 +762,52 @@
<xsd:complexType name="TagType">
<xsd:annotation>
<xsd:documentation>
TODO
A tag is a "mark" given to an object - currently a prism object, an assignment, or audited/simulation event.
Tags are used in various contexts, for example as policy situations or event tags. (More uses are expected
in the future.) This object serves as a point of definition of such tags.

Well-known archetypes: policy situation, event tag.
</xsd:documentation>
<xsd:appinfo>
<a:since>4.7</a:since>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="tns:FocusType">
<xsd:extension base="tns:AssignmentHolderType">
<xsd:sequence>
<xsd:element name="uri" type="xsd:anyURI" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Optional URI assigned to this tag. For example, policy situations had traditionally such URIs.
It should be globally unique.
</xsd:documentation>
<xsd:appinfo>
<a:displayName>TagType.uri</a:displayName>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="display" type="tns:DisplayType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Display properties of the tag. It is used to display the tag in drop-down lists, buttons, etc..
</xsd:documentation>
<xsd:appinfo>
<a:displayName>TagType.display</a:displayName>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="policyRule" type="tns:GlobalPolicyRuleType" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
Global policy rules that can yield this tag (policy situation or event tag).
By including them here they are evaluated automatically, just like if they would be included
in the system configuration. (Provided that this tag is in appropriate lifecycle state.)
</xsd:documentation>
<xsd:appinfo>
<a:displayName>TagType.uri</a:displayName>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
Expand Down Expand Up @@ -14611,7 +14652,7 @@
<xsd:annotation>
<xsd:documentation>
Tag(s) that are the result when this policy rule is triggered.
TODO
These may be implicit if the policy rule is defined as part of tag definition.
</xsd:documentation>
<xsd:appinfo>
<a:objectReferenceTargetType>c:TagType</a:objectReferenceTargetType>
Expand All @@ -14621,30 +14662,22 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="tag" type="xsd:string" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
Tag(s) that are the result when this policy rule is triggered.
TODO if this is an URI, what is the default namespace?
</xsd:documentation>
<xsd:appinfo>
<a:displayName>PolicyRuleType.tag</a:displayName>
<a:help>PolicyRuleType.tag.help</a:help>
<a:since>4.7</a:since>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="policySituation" type="xsd:anyURI" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Policy situation that is the result when this policy rule is
triggered. If the situation is not explicitly stated then
default situation will be selected instead. The situation
is determined by the constraint that triggered the rule.
DEPRECATED. Use tagRef instead.

TODO specify the time of planned removal
</xsd:documentation>
<xsd:appinfo>
<a:displayName>PolicyRuleType.policySituation</a:displayName>
<a:help>PolicyRuleType.policySituation.help</a:help>
<a:deprecated>true</a:deprecated>
<a:deprecatedSince>4.7</a:deprecatedSince>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,7 @@
<xsd:element name="record" type="tns:RecordPolicyActionType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Record action. The operation will proceed. Policy situation will be recorded for
Record action. The operation will proceed. Policy situation(s) will be recorded for
given object or assignment. It can be reported on or certified later on.
</xsd:documentation>
<xsd:appinfo>
Expand Down Expand Up @@ -2171,6 +2171,7 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<!-- TODO we may select what situation(s) we want to record. The default is all applicable ones. -->
<!--<xsd:element name="situationConstraints" type="tns:SituationConstraintsStorageStrategyType" minOccurs="0">-->
<!--<xsd:annotation>-->
<!--<xsd:documentation>-->
Expand All @@ -2179,7 +2180,6 @@
<!--</xsd:documentation>-->
<!--</xsd:annotation>-->
<!--</xsd:element>-->

</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
)
@Persister(impl = MidPointJoinedPersister.class)
@DynamicUpdate
public class RTag extends RFocus {
public class RTag extends RObject {

private RPolyString nameCopy;

Expand All @@ -54,7 +54,7 @@ public void setNameCopy(RPolyString nameCopy) {
public static void copyFromJAXB(
TagType jaxb, RTag repo, RepositoryContext repositoryContext,
IdGeneratorResult generatorResult) throws DtoTranslationException {
copyFocusInformationFromJAXB(jaxb, repo, repositoryContext, generatorResult);
copyAssignmentHolderInformationFromJAXB(jaxb, repo, repositoryContext, generatorResult);

repo.setNameCopy(RPolyString.copyFromJAXB(jaxb.getName()));
}
Expand Down

0 comments on commit e788b07

Please sign in to comment.