Category Archives: IBM Content Navigator

Changing an ICN file type filter name

Have you ever changed a File Type filter name in ICN? Well don’t, that’s not pretty. All the associations of Entry Templates you’ve done on folders will just stop working, or at least stop offering the user the right Entry Template for the document’s MIME Type. In the configuration it looks like this:

icn_filetype_filter_broken

Explanation is simple. In ICN, apparently there is no ID for File Type filter, or more specifically the name is the ID, which means where you are doing an Entry Template association in ICN, an JSON object is stored as a folder preferences annotation, persisting the File Type filter name directly. Of course if you change the File Type filter name, they won’t look for all folder preferences annotations and change the File Type filter name in it, which means they will all be broken.

Continue reading

How to access your plug-in’s ressources

There are times where you need to know the URL of a ressource within your plug-in. An example is when you want to embedded an applet and add it to your page, or get the link to an image. In order to do that, you can use the following code:

Request.getPluginResourceUrl("PluginName", "myFolderWithingWebContentFolder/path");

An example if you want to embedded an applet:

var appletHTML = '<applet alt="MyApplet" name="MyApplet" width="1px" height="1px" code="my.package.MyClass.class" codebase="'
    + Request.getPluginResourceUrl('PluginName', 'applets')
    + '" archive="MyApplet.jar" mayscript="true">';
appletHTML = appletHTML + '</applet>';
appletDiv = document.createElement("div");
appletDiv.innerHTML = appletHTML;
applet = appletDiv.firstChild;
document.body.appendChild(applet);

That can be convenient .

Get started with Selenium

Last post of a three posts series about testing, after Unit Testing and Integration Testing, let’s talk about UI testing.

Introduction

Selenium is a Browser driver, basically it does what you would do if you were manually testing, i.e. clicking, looking for elements, selecting, scrolling…, except it does it alone, and can do it for hours without a break, every night…

How it works is quite simple, you are targeting DOM elements (or node, or WebElement, or any name you would like to call them) with selectors, and then you can do various operations on those like a user would do: wait for them to be present, to be visible, to be clickable, click on them, drag and drop something, enter information in a text field, …

Keep in mind that Selenium does the same thing that you would do. So if an element is not visible on the page and you would scroll to catch it before clicking, you have to do the same with Selenium, or it will throw an exception saying the element is not clickable because it is out of the view, which makes sense.

This article is an introduction to Selenium, if you want more applied examples for ICN and Dojo, you can read this post, but I would recommend you to read this one first to get familiar with Selenium.

Get started with Selenium

Continue reading

How to install IBM CMIS

In its version 1.0, IBM CMIS was shipped as a separate application. But now, where can you get it and how can you install IBM CMIS? If you are looking for it in the Software Catalog from IBM, you won’t find it. And that’s normal because it is now part of IBM Content Navigator.

We’ll see how to install CMIS. You can follow this procedure when you install ICN, upgrade ICN, or even if you have already installed it, just re-open the configuration tool. The procedure start when you are starting the IBM Content Navigator Configuration and Deployment Tool. If you are installing/upgrading ICN, it will start by itself. If you have ICN already installed, you can launch this tool by running:
Continue reading

Test your ICN plug-in’s UI with Selenium

Lately I’ve been writing about test, and to finish this series of post, after unit tests and integration tests, I would like to talk about UI test. UI is not easy to test, because it requires a lot of user interactions. This is really important though, because UI tests make sure the final result, i.e. what the user sees, is what we want him to see. And as we all know, users remember mostly the UI defects 🙂

Update: I actually wrote an introduction on how to use Selenium, this post is meant more to give example of uses of Selenium applied to ICN and indirectly Dojo.

Not long ago, to test web application, we were writing test cases and you or any other unlucky tester was validating all of them one by one, and it was taking ages. Thanks god, there is nowadays better solutions, meaning lazy automatic solution. I will introduce in this post how to use a Web Browser automation tool to test ICN and your plug-in. We will use Selenium, which I think is a great tool. This will be applied to ICN, you can find plenty of Selenium tutorials on the web anyway, We will see how to automate basic action, like login, logout, create a folder, a document, file a document, accept message dialog. Then it will be up to you to adapt all this to your plug-ins.

Here is a quick video to give you an idea of what can be done with Selenium and ICN.

Continue reading

Integration Tests on ICN

After my few posts on Unit Testing, I would like to introduce how to do Integration Testing on ICN. Integrations Testing means interaction with other systems. in our case, it means FileNet. However for the IT, we don’t want to rely on the ICN server, because it would require user interaction, and this is the purpose of the UI test (see this post for more information).

The purpose of the Integration Tests is to call every services we wrote in our plug-in, directly and check changes made to the FileNet repository or other repositories are what we expect them to be.
Continue reading

How to debug your JavaScript in ICN

When you develop a plug-in, it is always nice to be able to debug, especially when you spent your day developing without testing, did hundreds of changes, and then got an error and there is no way to know where it comes from. We’ve seen in another post how to activate debug on the server side. Let’s see in this one how to debug the Javascript you have written.

There is two ways of doing that, a proper way fixing a Dojo defect, allowing us to see all files properly in the developer tool, or a temporary way which doesn’t require rebuilding and redeploying ICN. But I’ll tell you, after 3 weeks using the temporary way, I was almost crying and so relieved to find the right way to do that, so the temporary way is more for staging and GA platforms where you can’t apply the proper way.
Continue reading

Entry Templates inheritance not working

I had to refactor this article because it didn’t make as much sense as now in my mind when I first wrote it. This is now split in two with a main post being this one. Hopefully it will be more understandable for everyone!

Symptom

You have associated an entry template to a folder, or the ObjectStore itself. You tried to add a document into a subfolders, but your entry template never appears in the selection list of entry templates. If you go into the properties of the subfolders to see if the entry templates are correctly inherited, you can see either an empty list, or it says there are inherited entry templates but the File Types are really strange and error is displayed. Here are what you see and what you were expecting to see.

ICN_EntryTemplateIssue

What you see of one subfolder of the one you applied entry template on

ICN_EntryTemplateIssue2

What you see on a subfolder of the folder you saw the above screen shot

ICN_EntryTemplateIssue3

What you are expecting to see on your folder

Here is a video describing the problem, so you can understand better.

Cause

Continue reading

Custom MIME Type not working

Symptom

You want to use a new MIME Type in IBM Content Navigator, for example application/dita+xml. You did add a File Type filter under the settings panel from the administrator (DITA files using the dita MIME Type you just created).

ICN_customMIMEType

Then you used this file type filter to filter an entry template associated on a folder.

ICN_customMIMEType2

However the entry template is never displayed when adding a document. Instead you only see entry templates for Any type of file, or no entry template at all if you have none without filter.

ICN_customMIMEType3

Here we were expecting our entry template associated to the DITA file type filter

You’ve tried adding a MIME Type mapping to inform ICN in WebSphere virtual host, ICN’s web.xml and modify CE’s mimetypes.properties but nothing worked (well if you didn’t try these I can tell you it doesn’t).
Continue reading