Skip to content

Commit 9b87fc5

Browse files
committed
Merge branch 'feature/IncomingRelationshipAttribute' into develop
Offers support for adding an `IncomingRelationshipAttribute` content type and corresponding attribute view component to the OnTopic Editor. This commit does not provide that implementation, it simply permits the editor to offer that implementation without needing to extend the `DefaultTopicLookupService`.
2 parents f32054e + 8c5a0c6 commit 9b87fc5

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

OnTopic/DefaultTopicLookupService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public DefaultTopicLookupService(IEnumerable<Type>? types = null, Type? defaultT
4545
TryAdd(typeof(FileListAttribute));
4646
TryAdd(typeof(FilePathAttribute));
4747
TryAdd(typeof(HtmlAttribute));
48+
TryAdd(typeof(IncomingRelationshipAttribute));
4849
TryAdd(typeof(InstructionAttribute));
4950
TryAdd(typeof(LastModifiedAttribute));
5051
TryAdd(typeof(LastModifiedByAttribute));

OnTopic/Metadata/AttributeDescriptor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ public abstract class AttributeDescriptor : Topic {
5656
/// </remarks>
5757
/// <param name="key">A string representing the key for the new topic instance.</param>
5858
/// <param name="contentType">A string representing the key of the target content type.</param>
59-
/// <param name="id">The unique identifier assigned by the data store for an existing topic.</param>
6059
/// <param name="parent">Optional topic to set as the new topic's parent.</param>
60+
/// <param name="id">The unique identifier assigned by the data store for an existing topic.</param>
6161
/// <exception cref="ArgumentException">
6262
/// Thrown when the class representing the content type is found, but doesn't derive from <see cref="Topic"/>.
6363
/// </exception>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*==============================================================================================================================
2+
| Author Ignia, LLC
3+
| Client Ignia, LLC
4+
| Project Topics Library
5+
\=============================================================================================================================*/
6+
7+
namespace OnTopic.Metadata.AttributeTypes {
8+
9+
/*============================================================================================================================
10+
| CLASS: INCOMING RELATIONSHIP ATTRIBUTE (DESCRIPTOR)
11+
\---------------------------------------------------------------------------------------------------------------------------*/
12+
/// <summary>
13+
/// Represents metadata for describing an incoming relationship attribute type, including information on how it will be
14+
/// presented and validated in the editor.
15+
/// </summary>
16+
/// <remarks>
17+
/// This class is primarily used by the Topic Editor interface to determine how attributes are displayed as part of the
18+
/// CMS; except in very specific scenarios, it is not typically used elsewhere in the Topic Library itself.
19+
/// </remarks>
20+
public class IncomingRelationshipAttribute : AttributeTypeDescriptor {
21+
22+
/*==========================================================================================================================
23+
| CONSTRUCTOR
24+
\-------------------------------------------------------------------------------------------------------------------------*/
25+
/// <inheritdoc />
26+
public IncomingRelationshipAttribute(
27+
string key,
28+
string contentType,
29+
Topic parent,
30+
int id = -1
31+
) : base(
32+
key,
33+
contentType,
34+
parent,
35+
id
36+
) {
37+
}
38+
39+
} //Class
40+
} //Namespace

0 commit comments

Comments
 (0)