Wednesday, July 12, 2017

Add Documents to Case SubFolder On Add Case Page - IBM Case Manager

Hi there guys , in a previous blog i provided a nice trick to add documents to a case directly after adding a new case ,check here : http://ecmmania.blogspot.ae/2017/06/add-documents-to-case-on-add-case-page.html

today i was playing a round and trying to understanding a bit further dojo deferred and promises and at last i found a trick to be able to add documents to a case subfolder directly after adding a new case,

the main problem in my old code is that you can only add docs to the root case folder not to a sub folder and by trying to use callbacks to retrieve the case sub folder then opening the dialog you can see that the chain is broken and the code won't execute and will break

this problem arises from the fact that you can make only one asynchronous call and then use the callback to retrieve the response and do something with it

 but using deferreds and promises i can do it now , the main ideas is to make like a chain of promises that depend on each other and once a promise is fulfilled the next promise will be triggered so i first make a deferred to get the case folder then another deferred to get the case sub folder and lastly i open a add content item dialog to add document to the case sub folder

i will leave you with the code , i wrapped it inside a function you can just call and pass the payload to it , you can also change the path of the subfolder that you want to store into or maybe create your custom add content item dialog and show it

addSubFolderDocs: function(payload) {
require(["dojo/Deferred", "dojo/dom", "dojo/on", "dojo/domReady!"],function(Deferred, dom, on){
 
var getCaseFolder = function(payload){

   var deferred = new Deferred();
var caseEditable = payload.caseEditable;
console.log("caseEditable");
console.log(caseEditable);
caseEditable.getCase().retrieveCaseFolder(function(parentCaseFolder){

deferred.resolve(parentCaseFolder);

});

return deferred.promise;

};

/*var showAddDocumentDialog = function(parentCaseFolder){

   var deferred = new Deferred();
var repositroy = parentCaseFolder.repository;
console.log("repositroy");
console.log(repositroy);
var addContentItemDialog = new ecm.widget.dialog.AddContentItemDialog();  
addContentItemDialog.show(repositroy, parentCaseFolder,true, false, function(addedItem){

addToSubFolder(addedItem);

}, null, false, null);


return deferred.promise;

};*/


var getSubFolder = function(parentCaseFolder){

   var deferred = new Deferred();
   console.log("parentCaseFolder");
   console.log(parentCaseFolder);
var rootPath = parentCaseFolder.attributes.PathName;
var fullPath = rootPath + "/" + "Leasing Documents";
parentCaseFolder.repository.retrieveItem(fullPath, function(subfolder){
   console.log("Subfolder");
   console.log(subfolder);
   deferred.resolve(subfolder);

}, null, null, null, null, null);

return deferred;
};


/*var folderRetrievedCB = function(subfolder,addedItem){
console.log("enter --> folderRetrievedCB <----this items to add");
console.log(addedItem);
console.log("enter --> folderRetrievedCB <----subfolder " + subfolder);
subFolder.moveToFolder(addedItem,addedItem.parent,function(response){
console.log("Response");
console.log("response");

});
subFolder.refresh(subFolder);
};*/



var executeFn = function(payload){

var getCaseFolderPromise = getCaseFolder(payload);
getCaseFolderPromise.then(function(parentCaseFolder){
     return getSubFolder(parentCaseFolder);
}).then(function(subfolder){

console.log("Promise Sub Folder");
console.log(subfolder);
console.log("Promise Repo ID");
console.log(subfolder.repository.repositoryId);
var repository = ecm.model.desktop.getRepository(subfolder.repository.repositoryId);
console.log("Promise repository");
console.log(repository);
var addContentItemDialog = new ecm.widget.dialog.AddContentItemDialog();  
addContentItemDialog.show(repository, subfolder,true, false, function(addedItem){

console.log("addedItem");
console.log(addedItem);

}, null, false, null);
});

};


executeFn(payload);


});



return payload;
}


Saturday, July 8, 2017

ICM 5.3.1 New Markup widget and Quick Tasks

in an update to the Awesome new IBM Case Manager Version 5.3.1 , Mr Dave Perman from IBM Team has shed light to 2 new features introduced in this version : The Markup Widget and the Quick Tasks

You Can check out the new Markup widget in this ECM Blog Entry
https://www.ibm.com/developerworks/community/blogs/e8206aad-10e2-4c49-b00c-fee572815374/entry/July_7_2017_at_8_43_23_PM?lang=en

and the New Quick Tasks in This blog entry
https://www.ibm.com/developerworks/community/blogs/e8206aad-10e2-4c49-b00c-fee572815374/entry/Announcing_the_Newest_Member_of_the_IBM_Case_Manager_Task_Family?lang=en

To be honest , i can't wait to get my hands on a virtual machine with the new version installed on it so i can start exploring it ☺😃😃

Wednesday, July 5, 2017

Build Your Own Customized ICN Eclipse Plug-in for IBM Content Navigator development

Hi there, a lot of times when you want to use the icn plugin jars to allow for icn plugin development Wizard appearing in eclipse New Project Wizard , you don't get the wizard working fine for each eclipse package as  the old jars ibm provided worked for certain eclipse packages only

IBM ICN Dev team has put a new project that you can use to get a customized jars for your own eclipse package then you can drop these new plugins in the dropins folder to get the icn plugin new project wizard when you create a new project

you can find the project and the details to how to customize it here in this ibm team repository along with instructions

https://github.com/ibm-ecm/ibm-content-navigator-samples/tree/master/eclipsePlugin

one small hint that could be useful:

during update bundle-version number for your Eclipse in MANIFEST.MF , you can't get the exact version by yourself so to get it automatically just press the old version written in the manifest file and press CTRL + SPACE that will get you the exact version for your eclipse

That's it

Enjoy :) 

Saturday, July 1, 2017

New IBM Case Manager v5.3.1 !

Announced just a few days ago

IBM Case Manager v5.3.1 Now Available!


 Thanks to Dave Perman from IBM team , he puplished 2 articles in the ECM Community Blog  where he provided a summary blog for the new features in this link

https://www.ibm.com/developerworks/community/blogs/e8206aad-10e2-4c49-b00c-fee572815374/entry/IBM_Case_Manager_v5_3_1_Now_Available?lang=en

and the great surprise is the new features they provided in the user interface found at this article

https://www.ibm.com/developerworks/community/blogs/e8206aad-10e2-4c49-b00c-fee572815374/entry/Styles_and_Layouts_in_IBM_Case_Manager_5_3_1?lang=en

A New Style , New widgets containers and markup widgets ^_^  and sure they provided a list of new exciting features still to be revealed !

still we need to see it in person to believe but it's a great step towards more friendly UI 

Way to Go IBM ! :) Keep it up