Service - Comment: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 5: Line 5:
= Repository =
= Repository =


https://bitbucket.org/izara-conversations/izara-conversations-comment
https://bitbucket.org/izara-core-shared/izara-core-shared-comment


= Use cases =
= Use cases =
Line 32: Line 32:
objectType: "comment",
objectType: "comment",
canDelete: false,
canDelete: false,
belongTo: {
serviceTag: "user",
objectType: "user"
}
storageResources: {
storageResources: {
myGraph: {
myGraph: {
Line 55: Line 59:
type: "identifier",
type: "identifier",
fieldName: "commentId"
fieldName: "commentId"
}
    ]
}
</syntaxhighlight>
=== commentReferenceLink ===
<syntaxhighlight lang="JavaScript">
{
objectType: "commentReferenceLink",
canDelete: false,
belongTo: {
serviceTag: "user",
objectType: "user"
}
storageResources: {
myGraph: {
storageType: "graph",
graphServerTag: "GraphHandler"
}
    },
    fieldNames: {
commentReferenceLinkId: {
type: "string",
randomOnCreate: true,
canUpdate: false,
storageResourceTags: ['myGraph']
}
    },
    identifiers: [
{
type: "identifier",
fieldName: "commentReferenceLinkId"
}
    ]
}
</syntaxhighlight>
=== commentPrimarySubjectLink ===
<syntaxhighlight lang="JavaScript">
{
objectType: "commentPrimarySubjectLink",
canDelete: false,
belongTo: {
serviceTag: "user",
objectType: "user"
}
storageResources: {
myGraph: {
storageType: "graph",
graphServerTag: "GraphHandler"
}
    },
    fieldNames: {
commentPrimarySubjectLinkId: {
type: "string",
randomOnCreate: true,
canUpdate: false,
storageResourceTags: ['myGraph']
}
    },
    identifiers: [
{
type: "identifier",
fieldName: "commentPrimarySubjectLinkId"
}
}
     ]
     ]
Line 172: Line 242:
objectType: "comment"
objectType: "comment"
},
},
linkType: "many",
linkType: "one",
handler: true
handler: true
},
},
to: {
to: {
objType: {
objType: {
// every objType
serviceTag: "comment",
},
objectType: "commentReferenceLink"
linkType: "many"
},
linkType: "many",
handler: true
}
}
}
}
Line 187: Line 259:
</syntaxhighlight>
</syntaxhighlight>


* Cannect to any other object, is a strong link that identifies the primary topic of the comment. For comments that have no inReplyTo relationship this forms the initial connection with an object, such as user messaging or topic in community forum.
* Connect to commentPrimarySubjectLink which then links to any other object, is a strong link that identifies the primary topic of the comment. For comments that have no inReplyTo relationship this forms the initial connection with an object, such as user messaging or topic in community forum.


=== hasReference ===
=== hasReference ===
Line 209: Line 281:
serviceTag: "comment",
serviceTag: "comment",
objectType: "comment"
objectType: "comment"
},
linkType: "one",
handler: true
},
to: {
objType: {
serviceTag: "comment",
objectType: "commentReferenceLink"
},
linkType: "many",
handler: true
}
}
]
}
}
</syntaxhighlight>
* Connect to commentReferenceLink which then links to any other object, is a soft reference link.
=== isCommentReference ===
<syntaxhighlight lang="JavaScript">
{
"isCommentReference": {
fieldNames: {
},
storageResources: {
myGraph: {
storageType: "graph",
graphServerTag: "GraphHandler"
}
},
links: [
{
storageResourceTags: ["myGraph"],
from: {
objType: {
serviceTag: "comment",
objectType: "commentReferenceLink"
},
},
linkType: "many",
linkType: "many",
Line 225: Line 337:
</syntaxhighlight>
</syntaxhighlight>


* Cannect to any other object, is a soft refence link.
* connects commentReferenceLink to any other object in project


=== amendsComment ===
=== amendsComment ===
Line 265: Line 377:
</syntaxhighlight>
</syntaxhighlight>


* Method of editing or updating a comment, the original comment remains but amendments can be applied for the final ui presentation. Links to previous versions of a comment can remain, other comments that quote an out of date amended comment show the original comment quote.
* Method of editing or updating a comment, the original comment remains but most recent amendment is used for the final ui presentation
* Links to previous versions of a comment can remain, other comments that quote an out of date amended comment show the older non-amended comment quote (but could note the quote has been updated since quoted)
* When creating an amendment could select which relationships get copied across, eg inReplyTo etc, defaulting to all. This is a method of updating relationships without needing to remove old relationships
* A relationship to an amended comment could be ignored or hidden (might not be efficient and be better to have disabled relationships)


= Working documents =
= Working documents =

Latest revision as of 01:40, 11 August 2025

Overview

Individual comments within a conversation/forum/communication, comments interconnect together to create conversations and can connect to other project object types.

Repository

https://bitbucket.org/izara-core-shared/izara-core-shared-comment

Use cases

  • community forum
  • conversations between members
  • comments and feedback for products or orders

Conversation structure

A conversation begins when a comment is made that is not in reply to another comment.

An initial comment can be attached to another object, eg a user for user-to-user communication, to a product as a product question, to an order as a message to order participants, or to a forum topic.

Comments can then be in reply to another comment, and can only reply to a single comment.

Object Schemas

Additional Information
Per Service Schemas

objType

comment

{
	objectType: "comment",
	canDelete: false,
	belongTo: {
		serviceTag: "user",
		objectType: "user"
	}
	storageResources: {
		myGraph: {
			storageType: "graph",
			graphServerTag: "GraphHandler"
		}
    },
    fieldNames: {
		commentId: {
			type: "string",
			randomOnCreate: true,
			canUpdate: false,
			storageResourceTags: ['myGraph']
		}
		commentBody: {
			type: "string",
			canUpdate: false,
			storageResourceTags: ['myGraph']
		}
    },
    identifiers: [
		{
			type: "identifier",
			fieldName: "commentId"
		}
    ]
}

commentReferenceLink

{
	objectType: "commentReferenceLink",
	canDelete: false,
	belongTo: {
		serviceTag: "user",
		objectType: "user"
	}
	storageResources: {
		myGraph: {
			storageType: "graph",
			graphServerTag: "GraphHandler"
		}
    },
    fieldNames: {
		commentReferenceLinkId: {
			type: "string",
			randomOnCreate: true,
			canUpdate: false,
			storageResourceTags: ['myGraph']
		}
    },
    identifiers: [
		{
			type: "identifier",
			fieldName: "commentReferenceLinkId"
		}
    ]
}

commentPrimarySubjectLink

{
	objectType: "commentPrimarySubjectLink",
	canDelete: false,
	belongTo: {
		serviceTag: "user",
		objectType: "user"
	}
	storageResources: {
		myGraph: {
			storageType: "graph",
			graphServerTag: "GraphHandler"
		}
    },
    fieldNames: {
		commentPrimarySubjectLinkId: {
			type: "string",
			randomOnCreate: true,
			canUpdate: false,
			storageResourceTags: ['myGraph']
		}
    },
    identifiers: [
		{
			type: "identifier",
			fieldName: "commentPrimarySubjectLinkId"
		}
    ]
}

Object Relationships

inReplyTo

{
	"inReplyTo": {
		fieldNames: {
		},
		storageResources: {
			myGraph: {
				storageType: "graph",
				graphServerTag: "GraphHandler"			
			}
		},
		links: [
			{
				storageResourceTags: ["myGraph"],
				from: {
					objType: {
						serviceTag: "comment",					
						objectType: "comment"
					},
					linkType: "many",
					handler: true					
				},
				to: {
					objType: {
						serviceTag: "comment",				
						objectType: "comment"					
					},				
					linkType: "one"
				}
			}
		]
	}
}
  • Connects as a reply to another comment. One comment can only reply to one other comment, but one comment can have many replies.

quotesComment

{
	"quotesComment": {
		fieldNames: {
			"startChar": {
			  type: "integer",
			  requiredOnCreate: true,
			  canUpdate: false,
			},
			"endChar": {
			  type: "integer",
			  requiredOnCreate: true,
			  canUpdate: false,
			},
		},
		storageResources: {
			myGraph: {
				storageType: "graph",
				graphServerTag: "GraphHandler"			
			}
		},
		links: [
			{
				storageResourceTags: ["myGraph"],
				from: {
					objType: {
						serviceTag: "comment",					
						objectType: "comment"
					},
					linkType: "many",
					handler: true					
				},
				to: {
					objType: {
						serviceTag: "comment",				
						objectType: "comment"					
					},				
					linkType: "many"
				}
			}
		]
	}
}
  • Quotes another comment, will need a property that specifies which characters are quoted, and perhaps where in the new comment the quotes should be shown.
  • One comment can quote many other comments or quote another comment multiple times.

hasPrimarySubject

{
	"hasPrimarySubject": {
		fieldNames: {
		},
		storageResources: {
			myGraph: {
				storageType: "graph",
				graphServerTag: "GraphHandler"			
			}
		},
		links: [
			{
				storageResourceTags: ["myGraph"],
				from: {
					objType: {
						serviceTag: "comment",					
						objectType: "comment"
					},
					linkType: "one",
					handler: true					
				},
				to: {
					objType: {
						serviceTag: "comment",					
						objectType: "commentReferenceLink"
					},
					linkType: "many",
					handler: true	
				}
			}
		]
	}
}
  • Connect to commentPrimarySubjectLink which then links to any other object, is a strong link that identifies the primary topic of the comment. For comments that have no inReplyTo relationship this forms the initial connection with an object, such as user messaging or topic in community forum.

hasReference

{
	"hasReference": {
		fieldNames: {
		},
		storageResources: {
			myGraph: {
				storageType: "graph",
				graphServerTag: "GraphHandler"			
			}
		},
		links: [
			{
				storageResourceTags: ["myGraph"],
				from: {
					objType: {
						serviceTag: "comment",					
						objectType: "comment"
					},
					linkType: "one",
					handler: true					
				},
				to: {
					objType: {
						serviceTag: "comment",					
						objectType: "commentReferenceLink"
					},
					linkType: "many",
					handler: true	
				}
			}
		]
	}
}
  • Connect to commentReferenceLink which then links to any other object, is a soft reference link.

isCommentReference

{
	"isCommentReference": {
		fieldNames: {
		},
		storageResources: {
			myGraph: {
				storageType: "graph",
				graphServerTag: "GraphHandler"			
			}
		},
		links: [
			{
				storageResourceTags: ["myGraph"],
				from: {
					objType: {
						serviceTag: "comment",					
						objectType: "commentReferenceLink"
					},
					linkType: "many",
					handler: true					
				},
				to: {
					objType: {
						// every objType
					},				
					linkType: "many"
				}
			}
		]
	}
}
  • connects commentReferenceLink to any other object in project

amendsComment

{
	"amendsComment": {
		fieldNames: {
		},
		storageResources: {
			myGraph: {
				storageType: "graph",
				graphServerTag: "GraphHandler"			
			}
		},
		links: [
			{
				storageResourceTags: ["myGraph"],
				from: {
					objType: {
						serviceTag: "comment",					
						objectType: "comment"
					},
					linkType: "one",
					handler: true					
				},
				to: {
					objType: {
						serviceTag: "comment",				
						objectType: "comment"					
					},				
					linkType: "one"
				}
			}
			// not sure need to add reverse direction here?
		]
	}
}
  • Method of editing or updating a comment, the original comment remains but most recent amendment is used for the final ui presentation
  • Links to previous versions of a comment can remain, other comments that quote an out of date amended comment show the older non-amended comment quote (but could note the quote has been updated since quoted)
  • When creating an amendment could select which relationships get copied across, eg inReplyTo etc, defaulting to all. This is a method of updating relationships without needing to remove old relationships
  • A relationship to an amended comment could be ignored or hidden (might not be efficient and be better to have disabled relationships)

Working documents

Comment