How to update an existing activity stream entry in IBM Connections - ibm-connections

I am trying to update an existing activity stream entry e.g. the title of the entry.
Here I found the code for the creation of the new entry:
Link
But I could not find any reference how do I update an existing entry?
Additional information:
I use IBM Connections 4.5 and the IBM SBT
I create the entries with a system user to other users with the flag
'actionable'
Here my questions:
Which URL?
Which Method (PUT?)?
Which Json?
And another question about the actionable flag:
How can I change the actionable flag for an entry of another user? The description for my own entries is described on slide 37 here: Link
Thank you so much !
Markus

Ok, I think I fully understand the issue now. As suggested this is not supported, but there is a way you can achieve the same result.
First of all why isn't it supported . . .
Events are a point in time (and they were accurate at that point in time)
A new event on the same object supersedes it (as it's now the most interesting) but
doesn't invalidate it (it can still be seen in history)
The Actionable view does not show a rolled up view, instead it shows all events that are marked actionable (and there may be multiple actions related to any given Object)
What you can do . . .
If you want to replace an entry in the Actionable view, you can remove the event from the actionable view (it is just removed from that view and could still be seen in event history)
You can then add another event to the actionable view (which as the latest event will also supersede events in other rolled up views)
Removing the actionable flag is here ->http://www-10.lotus.com/ldd/appdevwiki.nsf/xpDocViewer.xsp?lookupName=IBM+Connections+4.5+API+Documentation#action=openDocument&res_title=Support_for_Saved_and_Actionable_events&content=pdcontent

an activity stream object is treated an an immutable object in IBM Connections.
you can Create Delete and Read.
You can use a rollup-id in IBM Connections.
In order to address the scenario where a user posts a file and 200 people 'like' it, filling up their Activity Stream, rollup needs to be performed. This means:
Only the latest event on any given object is shown
The 2 most recent comments are returned.
http://www-10.lotus.com/ldd/appdevwiki.nsf/xpAPIViewer.xsp?lookupName=IBM+Connections+4.0+API+Documentation#action=openDocument&res_title=Support_for_Rollup&content=apicontent

Just to extend the last answer, delete is not directly supported in the Activity Stream in IBM Connections, though a means of propagating delete based on deletion of an Object was introduced in IBM Connections 4.5.
However it does seem like submitting a new event with an appropriate rollup id is what you're looking for. That way users will see the latest, but the history remains and can be seen if desired.

Related

How to log last changes in hybris when the new feed/ feeds updates come through

I'm aware that Hybris have savedvaluesmodel and savedvalueentrymodel to capture last changes of the data model and its attribute value whatever has changed recently, and it also maintains the history.
And this works only if we are modifying the data after login into Backoffice and this doesn't seem to work in case of feeds which comes via HotFolder. I'd like to know, is there any provision which comes with Hybris out of the box to capture the same information or changes that was done for a given data model through feed?
What I have observed based on OOTB code is ,this class DefaultItemModificationHistoryService is responsible for logging the changes (populate the values and saved the last changes into the saved values model table) that was done at the model level, and this is located inside the OOTB Backoffice extension and this extension is already extended by myprojectbakcoffice extension which further extends myprojectcore extension.
In order to capture the last changes done via feed we thought of handling that logic in an interceptor, however the above class isn't accessible in our myprojectcore extension as it's declared in Backoffice.
What are the other possible solutions that I can think of in order to implement this?
Found some article related to this in here.
Please advise.
You can use the hybris commerce audit framework to log all of the changes happening in the system.
The documentation here says, "Generic audit tracks every persistence action, including creation, modification, and deletion for specified types. The audit is stored as a change log that allows you to see how an item changed over time."
But this comes with a DB overhead. There are specific tables that gets heavily logged with the details of the changes.
These tables have a naming convention as <item_type>_sn.
E.g.: For Order item type, the audit table would be auto created as orders_sn
This is why it is always advisable to turn off the audit as applicable.

Create Empty Form In Jdeveloper 12c

I am using J Developer 12 c. I want to create form but without any data fetched in.I want user to enter detail in form for submission.I have tried all online solution but they are for J Developer 11.I am not able to fetch an empty form.
When I run my form it automatically fetch record from the table.I have tried use create insert but i want form to be automatically fetched with new record every time page is run.
Add a CreateInsert action in your task flow on the way into you page. This will clear the fields for data entry. Look here.
You need to understand the difference between commit and submit. You want to submit the pages - clicking a submit button - and then the page is processed and the EO/VOs are updated in memory.
The Commit operation writes the in-memory changes to the datasource (database). So, you can submit pages 1-3 then using the same data control the fields will be populated with the entered data on page 4. Now the user can commit the changes. The Commit action is located in the operations for the AppModule-DataControl.
This is the power of the ADF Data Control. Changes to fields are cached in memory and are available to any page and then those changes can be committed when you choose. Note, the Task Flow can control the transaction itself.
Sounds like you need to learn the basics of ADF. I suggest this book and this set of resources I maintain for my students and these.
And, if you will be doing a lot of ADF development, it is well worth your time to take our ADF course.
(It also seems you are unaware of how stack overflow works. When you get an response that answers you question, you up-vote the answer, so it encourages those of us taking our time to answer you question for free to continue doing so. Please note that I answered your original question and Shay reinforced that answer.
And I have now answered your second question, and provided links to resources to help you go further.
I already marked the correct answer however my second question where i was unable to commit on review page which fetch data from 3 vo i got solution thanks to http://www.baigzeeshan.com/2010/11/avoiding-jbo-26048-during-commit-in.html.Actually the first Eo is master for rest 2 Eo so it would ideally allow me to commit detail data only after i commit the master.Now i found the blog and it suggested me to do changes in association and add behaviour for composite association and cascade update for key attribute.Now i can directly commit on my last review page and navigate through task flow easily without using commit on eac individual page.thanks all who helped me.

Update Kentico document field regardless of versioning

I have a field on one of my base page types which I need to update programmatically from an external data feed, so that it can be included in my Smart Search index.
The documents are versioned, but I want to update the published value of this field regardless of checkout state, and obviously avoid any sort of overwrite when documents are checked in.
The field will not appear on the editor form -- or ideally, would conditionally display for Global Admins.
It appears that using the API to update the document without doing a CheckOut fails silently. However if I do a Checkout/Update/CheckIn on a checkout-out page, the author will lose their work I assume?
Any way to handle this "versionless" field via the Kentico data model and API?
I don't think there is a way around updating checked out pages. You can update the page type table directly, but as you mentioned, it will be overwritten when they check in. You could update the version history I believe to make changes to the current data that is checked out, but again, I think that will be lost if the user cancels.
The only way I can think of to solve your issue is to create another table that maps the values you want to the page. Then you don't have to worry about the pages being checked out, you just need to grab the documentID or something. Since the value isn't displayed to the editor, you just have a field that does a lookup on this table.
The preferred and right way is using the API but as you stated, it causes problems if a user has something already checked out and working on it or it's in workflow and not published yet.
If the field you're updating is page type specific, there is one thing specifically I can think of and that's going directly to the database to the page type's database field and perform an update to that field.
Note: this is not recommended unless you know specifically what you're doing and have done full testing on it
The down side of going direct to the database is this will not update the current version since you're using check in/out and workflow. You will also need to update the checked out and current version which means you need to:
Go to the Document itself in the cms_documents table and get the document you are working with.
Then using the fields DocumentCheckedOutVersionHistoryID and DocumentPublishedVersionHistoryID' you can get the version history IDs of the document from theCMS_VersionHistory` table.
Then you can perform an update to the CMS_VersionHistory and your custom page type fields.
You will then need to look in the CMS_WorkflowHistory table and find out if that document is in workflow and in what step.
After you have that workflow history step, use the VersionHistoryID field to go back to the CMS_VersionHistory table and update that record with your data.
Again, not an elegant solution since you are using check in/out and workflow but after some trial and error and testing you should be able to figure it out.
UPDATE
You may also be able to add a custom table or some other linked database table which will allow you to create a global handler. The linked table would be where you perform your updates via API and other calls without versioning or workflow. Then when a user updates a specific page type you could do a check to see when the last time that linked table was updated and update the field(s) you need on update of that particular page (of course by node and document IDs).
Unfortunately you'll have to check it in and out with API. See examples here.
Also you might need to publish it in order to reflect changes on the live site.

Deleting a record in javascript

I need to delete some records related to the current record when it is deactivated. I can get the the event when the record is deactivated but I have looked around for some time on Google and this site for the code to delete records in javascript but I can't find any, though I know there must be some out there.
Can anyone help?
Thanks
I would be alright with doing this with a plugin, all I would need to know is how to pick up that the record has been deactivated
You can register a plugin on the SetState and SetStateDynamic messages (recommend the Pre event in your scenario). Each of these messages will pass an EntityMoniker in the InputParameters property bag which refers to the record that is being deactivated.
In your code you will need to:
Check that the new state in the SetState request is deactivated (since of course a record can usually be reactivated and you don't want to try deleting things then too, presumably)
Pick up the EntityMoniker from IPluginExecutionContext.InputParameters
Run your query to identify and delete related records
Exit the plugin to allow the SetState transaction to complete
If you really want to delete a record with JavaScript there is a sample on the MSDN.
Its a little long winded (its a CRUD example - create, retrieve, update & delete). But it should contain the information you need.
Note there is also an example on that page which doesnt use jQuery (if using jQuery is a problem).
That said I think for this operation would will find it easier to implement, test and maintain with a plugin (so I would go for Greg's answer).
Additionally a plugin will apply in all contexts, e.g. if you deactivate the record in a workflow your JavaScript will not run, but a plugin will.

How can I get if a crm dynamics 2011 update plugin was triggered by an activate/deactivate/merge action?

I build a plugin that runs in account update message that makes some validation not to duplicate the record. But if I try to disable that account or merge with another one it triggers the plugin.
How can I tell if the plugin was triggered by an activate/deactivate/merge action, or event mode like the one in CRM Dynamics 2011 Save Event Arguments Reference?
To add to Pete Oakey's answer, you can actually tell your plugin to fire only when certain fields are changed at the registration phase, in addition to testing this in actual code # runtime, by changing the "Filtering Attributes" of the plugin step. So unless your validation logic specifically needs the StateCode/StatusCode attributes to correctly process, you can filter those two attributes out, or just include the attributes your validation logic needs.
Original answer:
I believe you can reference the IExecutionContext.Depth Property of the IPluginExecutionContext object.
Every time a running plug-in or Workflow issues a message request to
the Web services that triggers another plug-in or Workflow to execute,
the Depth property of the execution context is increased. If the depth
property increments to its maximum value within the configured time
limit, the platform considers this behavior an infinite loop and
further plug-in or Workflow execution is aborted. The maximum depth
(8) and time limit (one hour) are configurable by the Microsoft
Dynamics CRM administrator.
So you can use an if statement to check if Depth > 1.
One way would be to compare the before and after values of what's changed on the account entity in the plugin. For example if you have only have active (if that's the right property name) in the values - you can look at the after value to see what's happened.
Another way would be to add a specific plugin for these messages and set some property/flag which you can check in the update plugin. Obviously this would have to run before the update plugin.

Resources