Use a custom property in Action.isVisible or isEnabled

Sometimes, we want to use a custom property to decide if an action should be displayed, enabled or hidden. The items provided by ICN as parameters of these functions are items as they are shown in the view, as rows. They don’t have all properties fetched, only the system ones and the ones you configured to be shown as extra columns (since they have to be fetched in order to be displayed).

As you may have noticed when overriding the isVisible and isEnabled functions, they are synchronous and they expect an immediate return. That means fetching the attributes using the item.retrieveAttributes function won’t work since it’s an asynchronous function (there is one round trip made to the ICN server to fetch them).

In this post, we’ve seen how to fetch custom attributes for all rows without showing them in a column. We will now see another way to do this, by making the ContextMenu actually asynchronous. Since the isVisible and isEnabled functions are synchronous, we will actually retrieve the attributes before showing the Context Menu for the item.
Continue reading

Fetch a custom property for all objects or rows

This post explains how to fetch a custom property you’ve added on a class for all documents retrieved by ICN, before all attributes are actually retrieved using the ContentItem.retrieveAttributes function. That means all items when displayed as row in the Content List view will have this property (also named attribute in ICN) already fetched. There are use cases for this, two of them being:

  • Using a custom attribute in the isVisible or isEnable function of an action, to decide if the action should be displayed based on business logic. I wrote about this here
  • Using a custom property to display a new icon along with the lock/compound/readon-only/… icons. I wrote about this here

After spending some time investigating how ICN works to know what custom properties to fetch when retrieving the content of a folder (openFolder action), I came to the conclusion it goes through two steps:
Continue reading

Add an extra hard-drive in CentOS 6

In this post, we are going to add an extra drive to store binaries for the CTPIT installer or a full FileNet installation. I would suggest setting the new disk as type Write-Through. That means it won’t be affected by snapshots, which is convenient in that case since we don’t need to snapshot it.

To do this, edit the Virtual Machine’s settings, go to Storage, and attach a new disk. Then go to the Virtual Media Manager (Ctrl+D), modify the disk you’ve just created and set the type on Writethrough.

Now, the first time you will be using this disk on a VM, you will have to create a partition, format it and mount it.

Create the partition

First you need to find what is the device name for the OS. By default, there is a good chance it’s /dev/sdb, but you can check by running a ls in the /dev folder:

ls /dev/sd*

Here we can see sda already has 2 partitions, so that’s the main disk, and sdb has none, that’s our disk. We will use fdisk to create the main partition on our disk sdb:

fdisk /dev/sdb

Continue reading

Put any window on top

Depending on how many screens you have, sometimes it comes really handy to keep one window on top of the others without spending 30 seconds for something as simple as that.

That can be a simple console/PuTTY so you can keep track of something running or a notepad to copy-paste pieces of text without switching applications every time and so on.

To do this with a simple shortcut on Windows, I’m using AutoHotkey, which over time became vital for me and for my productivity 🙂

So this is as simple as that, edit your current script:

And add the following line to add a shortcut to keep any current window on top of the others:

^+SPACE::  Winset, Alwaysontop, , A

Of course you can change the shortcut, here I used Ctrl (^) + Shift (+) + Space.
Continue reading

Improved console for Windows

At some point I got tired of the Windows console (cmd). First, it is always in non-insert mode by default. I fixed this by checking the Insert mode in the properties, but still, no persistent history, no history search, bad auto completion, that was too much. So here is tip that could save you a lot of time when using command lines under Windows.

Project’s name is Clink. It gives you GNU read line power in cmd.exe. You can download the portable version (zip) and just unzip it somewhere.

Then, since it’s quite frequent to use the console, let’s pin it to the TaskBar. In the start menu, search for cmd, right click on it and pin it to the taskbar. Then right click on it while pressing shift and click Properties and add /c “full_path_to_clink.bat“.

clink_taskbar

Now when you clic on your pin that will open clink instead or the standard cmd.

Last but not least. Here is how to change the “Open command window here” when you’re doing right clic + shift on a folder, to open Clink.

clink_context_menu

To do this, edit the Windows register (Start menu, search regedit)

Open the key HKEY_CLASSES_ROOT\Directory\shell\cmd\command. Then edit the value to the following

cmd.exe /s /c "pushd "%V" & C:\Applis\clink\clink.bat"

Edit with the path to your clink.bat of course.

Now the Right-Clic + Shift > Open command window here should open Clink already located on the target folder.

wsadmin: import self-signed certificates from other servers

There are moments where you want to use a WebSphere server to control other servers, to remotely start/stop applications, gather statistics or do a remote configuration/deployment.

If you want to script that, you will probably have the issue that the first time you are using wsadmin to connect to another server, you will be asked to accept the certificate manually, and that will pause your execution.
WSADMIN_certificate

You could, of course, connect a first time to each server if you have a few, but if you have many of them, that wouldn’t be fun. However, you can add the certificate to the wsadmin‘s trusts tore with a command line by doing the following:

host=master1
echo "" | openssl s_client -connect $host:9043 -prexit 2>/dev/null | sed -n -e '/BEGIN\ CERTIFICATE/,/END\ CERTIFICATE/ p' > cert.txt
$JAVA_HOME/bin/keytool -import -alias $host -file cert.txt -keystore /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/etc/trust.p12 -storetype PKCS12 -storepass WebAS

You can, of course, repeat this in one script for all your servers, afterward the wsadmin won’t hang for any input when using it the first time on a server.

Install WebSphere Application Server 8.5.5 with Java 7 using command lines

This post explains how to install WebSphere Application Server 8.5.5 with the Java SDK 7.

What you need

Here are the parts you need to download to install WAS 8.5.5 with Java 7

Name Part name (for Linux x86_64) File name
IBM Installation Manager 1.6.2 CIK2GML InstalMgr1.6.2_LNX_X86_WAS_8.5.5.zip
IBM WebSphere Application Server 8.5.5 CIK1QML WAS_V8.5.5_1_OF_3.zip
IBM WebSphere Application Server 8.5.5 CIK1RML WAS_V8.5.5_2_OF_3.zip
IBM WebSphere Application Server 8.5.5 CIK1SML WAS_V8.5.5_3_OF_3.zip
IBM WebSphere SDK Java (TM) Technology Edition V7.0 CI717ML WS_SDK_JAVA_TEV7.0_1OF3_WAS_8.5.zip
IBM WebSphere SDK Java (TM) Technology Edition V7.0 CI718ML WS_SDK_JAVA_TEV7.0_2OF3_WAS_8.5.zip
IBM WebSphere SDK Java (TM) Technology Edition V7.0 CI719ML WS_SDK_JAVA_TEV7.0_3OF3_WAS_8.5.zip

Pre-requisites

For the installer to work, you need the following libraries:

  • ld-linux.so.2
  • libgcc_s.so.1

Continue reading

Create your custom attribute editor (part 6)

Last part of this tutorial will be about enhancing our editor to make it a bit nicer. The idea is to create a property editor to select a file within the repository. We will use the DocumentSelector dialog we wrote here.

We are actually really close of achieving this, we will just hook up the click event of the input field to start the DocumentSelector dialog, and we will also add a Browse button on the right of the input to make it more user-friendly.
Continue reading

Write a filtered Repository File Selector Dojo dialog

This tutorial will explain how to write a dialog allowing users to choose a file in a repository with a pretty tree selector. We will also add a feature to filter files based on extension. The tree will only show documents ending with a valid filter.

This is the final result:

ICN_FileChooser_01

Continue reading

Bug in resize of ecm.widget.FolderTree

I just noticed a bug in the FolderTree widget. It is setting its size based on the first ancestor widget, not parent dom node. That means if your FolderTree is in a div or anything not widget, it will take the size of the first ancestor widget, which can be a lot bigger than the dom element it is in and give you some weird behavior.

To fix this, wrap it in a BorderContainer, ContentPane or any sort of widget, or override the resize method to behave nicely with your configuration.
Continue reading