Service - Comment

From Izara Wiki
Jump to navigation Jump to search

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-conversations/izara-conversations-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,
	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"
		}
    ]
}

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: "many",
					handler: true					
				},
				to: {
					objType: {
						// every objType
					},				
					linkType: "many"
				}
			}
		]
	}
}
  • 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.

hasReference

{
	"hasReference": {
		fieldNames: {
		},
		storageResources: {
			myGraph: {
				storageType: "graph",
				graphServerTag: "GraphHandler"			
			}
		},
		links: [
			{
				storageResourceTags: ["myGraph"],
				from: {
					objType: {
						serviceTag: "comment",					
						objectType: "comment"
					},
					linkType: "many",
					handler: true					
				},
				to: {
					objType: {
						// every objType
					},				
					linkType: "many"
				}
			}
		]
	}
}
  • Cannect to any other object, is a soft refence link.

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 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.

Working documents

Comment