Annotation 2.5 API Create Comment

Hi All,

I have been using the Content Manger API for a few releases now, recently tried using the Annotation classes, the code doesn't through any errors, and returns the expected results. But the annotations are not visible in Collective Spaces. I can find, them update them and delete them through the API. What am I missing any guidance would be great.

emoji
Parents
  • Here is the code and the properties I am setting on the comment which doesn't appear.

     string xmlMetadata = "<ishfields>" +
                    "<ishfield name='FISHANNOTATIONTYPE' level='annotation'>Editorial</ishfield>" +
                    "<ishfield name='FISHANNOTATIONTEXT' level='annotation'>Oracle 12.2 is supported and Oracle 12.1 is deprecated</ishfield>" +
                    "<ishfield name='FISHANNOTPROPOSEDCHNGTXT' level='annotation'>Replace 'Oracle 12.1' with 'Oracle 12.2'</ishfield>" +
                    "<ishfield name='FISHREVISIONID' level='annotation'>" + revisionId + "</ishfield>" +
                    "<ishfield name='FISHPUBLOGICALID' level='annotation'>" + pubGUID + "</ishfield>" +
                    "<ishfield name='FISHPUBVERSION' level='annotation'>1</ishfield>" +
                    "<ishfield name='FISHANNOTATIONSTATUS' level='annotation' ishvaluetype='element'>VANNOTATIONSTATUSUNSHARED</ishfield>" +
                    "<ishfield name='FISHANNOTATIONCATEGORY' level='annotation'>Comment</ishfield>" +
                    "<ishfield name='FISHANNOTATIONADDRESS' level='annotation' xml:space='preserve'>[{'revisionId':" + revisionId + ",'type':'TEXT_RANGE_SELECTOR','startContainerQuery':'/*[1]/node()[3]/node()[1]/node()[1]/node()[1]','startOffset':75,'endContainerQuery':'/*[1]/node()[3]/node()[1]/node()[1]/node()[1]','endOffset':80}]</ishfield>" +
                    "</ishfields>";
                    userClientAnnotation.Create(xmlMetadata);

    Here is a comment I made through the UI. Which I was able to find using the find method and request the following metadata.

    <?xml version="1.0" encoding="utf-16"?>
    <ishobjects>
    	<ishobject ishref="GUID-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" ishtype="ISHAnnotation" ishannotationref="2840765">
    		<ishfields>
    			<ishfield name="FISHANNOTATIONADDRESS" level="annotation" xml:space="preserve">[{"revisionId":"GUID-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","type":"TEXT_RANGE_SELECTOR","startContainerQuery":"/*[1]/node()[3]/node()[1]/node()[1]/node()[1]","startOffset":60,"endContainerQuery":"/*[1]/node()[3]/node()[1]/node()[1]/node()[1]","endOffset":70}]</ishfield>
    			<ishfield name="FISHANNOTATIONCREATOR" level="annotation" xml:space="preserve">ajain</ishfield>
    			<ishfield name="FISHANNOTATIONCATEGORY" level="annotation" xml:space="preserve">Comment</ishfield>
    			<ishfield name="FISHPUBLOGICALID" level="annotation" xml:space="preserve">GUID-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</ishfield>
    			<ishfield name="FISHANNOTATIONTYPE" level="annotation" xml:space="preserve">Editorial</ishfield>
    		</ishfields>
    	</ishobject>
    </ishobjects>

    I can't tell what is different, if anything. Or is there a step after creating it to make it visible?

    emoji
Reply
  • Here is the code and the properties I am setting on the comment which doesn't appear.

     string xmlMetadata = "<ishfields>" +
                    "<ishfield name='FISHANNOTATIONTYPE' level='annotation'>Editorial</ishfield>" +
                    "<ishfield name='FISHANNOTATIONTEXT' level='annotation'>Oracle 12.2 is supported and Oracle 12.1 is deprecated</ishfield>" +
                    "<ishfield name='FISHANNOTPROPOSEDCHNGTXT' level='annotation'>Replace 'Oracle 12.1' with 'Oracle 12.2'</ishfield>" +
                    "<ishfield name='FISHREVISIONID' level='annotation'>" + revisionId + "</ishfield>" +
                    "<ishfield name='FISHPUBLOGICALID' level='annotation'>" + pubGUID + "</ishfield>" +
                    "<ishfield name='FISHPUBVERSION' level='annotation'>1</ishfield>" +
                    "<ishfield name='FISHANNOTATIONSTATUS' level='annotation' ishvaluetype='element'>VANNOTATIONSTATUSUNSHARED</ishfield>" +
                    "<ishfield name='FISHANNOTATIONCATEGORY' level='annotation'>Comment</ishfield>" +
                    "<ishfield name='FISHANNOTATIONADDRESS' level='annotation' xml:space='preserve'>[{'revisionId':" + revisionId + ",'type':'TEXT_RANGE_SELECTOR','startContainerQuery':'/*[1]/node()[3]/node()[1]/node()[1]/node()[1]','startOffset':75,'endContainerQuery':'/*[1]/node()[3]/node()[1]/node()[1]/node()[1]','endOffset':80}]</ishfield>" +
                    "</ishfields>";
                    userClientAnnotation.Create(xmlMetadata);

    Here is a comment I made through the UI. Which I was able to find using the find method and request the following metadata.

    <?xml version="1.0" encoding="utf-16"?>
    <ishobjects>
    	<ishobject ishref="GUID-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" ishtype="ISHAnnotation" ishannotationref="2840765">
    		<ishfields>
    			<ishfield name="FISHANNOTATIONADDRESS" level="annotation" xml:space="preserve">[{"revisionId":"GUID-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","type":"TEXT_RANGE_SELECTOR","startContainerQuery":"/*[1]/node()[3]/node()[1]/node()[1]/node()[1]","startOffset":60,"endContainerQuery":"/*[1]/node()[3]/node()[1]/node()[1]/node()[1]","endOffset":70}]</ishfield>
    			<ishfield name="FISHANNOTATIONCREATOR" level="annotation" xml:space="preserve">ajain</ishfield>
    			<ishfield name="FISHANNOTATIONCATEGORY" level="annotation" xml:space="preserve">Comment</ishfield>
    			<ishfield name="FISHPUBLOGICALID" level="annotation" xml:space="preserve">GUID-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</ishfield>
    			<ishfield name="FISHANNOTATIONTYPE" level="annotation" xml:space="preserve">Editorial</ishfield>
    		</ishfields>
    	</ishobject>
    </ishobjects>

    I can't tell what is different, if anything. Or is there a step after creating it to make it visible?

    emoji
Children
No Data