June 20, 2014

Invoke an Action when a button is pressed

In this article I explain how to attach/associate an action to a push button in an application.

  1. Create the Action you have to call if not already done (Go To - System Configuration - Platform Configuration - Actions).
  2. Open your application with the Application Designer and create a Signature Option with the same name of the Action you want to call (Actions - Add/Modify Signature Options - New Row).
  3. Expand the 'Advanced Signature Options' section and set 'This is an action that must be invoked by user in the UI'.
  4. Create a Push Button on the application with the following settings
    1. Event: enter the action name
    2. Signature Option: READ 
  5.  Grant the Signature Option to appropriate users in Security Groups.

June 10, 2014

Attachments (DOCLINKS) Configuration

This procedure describes how to set up attached documents in Maximo 7.1 and above with IBM WebSphere Application Server.

In this procedure I will use [IHSDIR] and [DOCLINKSDIR] tags to identify IBM HTTP Server and attachments home directory respectively. Replace those tags according to your environment. Here are the default values.

Windows
  • [IHSDIR] - C:\Program Files\IBM\HTTPServer
  • [DOCLINKSDIR] - C:\doclinks

UNIX
  • [IHSDIR] -  /home/IBMHTTPD
  • [DOCLINKSDIR] - /home/doclinks


Attachment repository

First of all you have to create the create the [DOCLINKSDIR] directory to store your attachments. For example: C:\doclinks for Windows or /home/doclinks for UNIX.

This directory must be accessible from both the application servers and from the web servers. If you have a simple environment running on a single system you are done. Otherwise you have to share this directory and mount it on all the involved servers.
A procedure to automatically mount shared DOCLINKS folder on Windows is described in this article.



IBM HTTP Server configuration

The second step is to publish the [DOCLINKSDIR] directory through the HTTP Server. This will allow to retrieve the attachments stored in it from the users web browser.
  1. Locate the configuration directory of the IBM HTTP Server . For example C:\Program Files\IBM\HTTPServer\conf for Windows and /home/IBMHTTPD/conf for UNIX
  2. Backup httpd.conf file
  3. Open the httpd.conf file with a text editor
  4. Find 'DocumentRoot' and change like below
    DocumentRoot "[DOCLINKSDIR]"
  5. Find '# This should be changed to whatever you set DocumentRoot to.' and change like below
    <Directory "[DOCLINKSDIR]">
  6. Save and close httpd.conf file
  7. Restart the HTTP Server
  8. Verify that the HTTP Server is configured correctly
    1. Create a test file text.txt into [DOCLINKSDIR] directory
    2. Open a web browser and type in address: http://[MXHOSTNAME]/test.txt where [MXHOSTNAME] is the hostname of your server
    3. You should be able see your test.txt document in this window. If you cannot open the test file, you must go back and check the configuration steps.


Maximo configuration


The last step is to configure where Maximo will store the attachments and how it will retrieve them.
  1. Login to Maximo with administrative rights
  2. Go To - System Configuration - Platform Configuration - System Properties
  3. Set the following properties according to your configuration
    mxe.doclink.doctypes.defpath = [DOCLINKSDIR]
    mxe.doclink.path01 = [DOCLINKSDIR] = http://[MXHOSTNAME]

    Note: These paths in Windows and Unix are case sensistive.
  4. Reload the properties with a ‘Live Refresh’ or restart application server
The mxe.doclink.doctypes.defpath defines where Maximo is storing the attachments locally. The mxe.doclink.path01 allows to translate local paths to the correct HTTP links.

Go To any application which has attachments and select Action > Attachment Library/Folders > Manage folders. Set or check the following:
  • Attachments: [DOCLINKSDIR]\attachments
  • CAD: [DOCLINKSDIR]\cad
  • Diagrams: [DOCLINKSDIR]\diagrams
  • Images: [DOCLINKSDIR]\images
Note these Default file paths are case-sensitive and must match the case of directory structure and that of the doclink.properties file.

Finally test that everything is working fine.


References

Setting up Attached Documents for Maximo 7.1

June 9, 2014

Maximo applets and Java security

Java 6 and 7 have introduced new security features that may create some problems in Maximo/SCCD/TPAE applications that make use of Java applets. Some examples of such applications are Configuration Items, Workflow Designer and Scheduler.

First of all Start Menu > Java> Configure Java > Security > Add the server host to the trusted sites


This should be enough to fix Java related issues.

Maximo Scheduler may require an additional configuration to solve the ilogViewerApplet.initProjectDataModel error.


Edit java.policy configuration file (typically located in C:\Program Files (x86)\Java\jre7\lib\security\java.policy) and add the following lines.

grant { 
    permission java.util.PropertyPermission "user.timezone", "write"; 
};

Restart the browser and Java processes and verify everything is working fine.

May 31, 2014

Automatically rotate and clean HTTP Server log files

By default IBM HTTP Server log files always grow. This may be a problem especially on production servers where there is a large amount of HTTP requests that can quickly generate a very big access.log file. This file cannot be deleted without stopping the HTTP Server and can be practically impossible to open with a text editor.

A quick solution for this is to use the rotatelogs utility located in [HTTPHOME]/bin directory.

Open the [HTTPHOME]/bin/httpd.conf file and search for 'CustomLog' directive for access.log file. Comment this line and insert a new directive like this:
    CustomLog "|bin/rotatelogs.exe -l logs/access.%Y%m%d-%H%M%S.log 5M" common

Here is how the httpd.conf file should look like.

#CustomLog logs/access.log common
CustomLog "|bin/rotatelogs.exe -l logs/access.%Y%m%d-%H%M%S.log 5M" common

With this method a new access.log file will be generated when its size reached 5 megabytes.
More information on the rotatelog command is available here.


If you want to periodically clean the HTTP Server log files you can use the technique described hereafter.

Go to IBM HTTP Server log directory. In this example it is D:\Program Files\IBM\HTTPServer\logs.
Create an empty text file cleanlogs.cmd and paste the following code into it.

@echo off

net stop "IBM HTTP Server 6.1"
net stop "IBM HTTP Administration 6.1"

echo Waiting few seconds
ping -n 4 localhost > nul

echo Deleting log files
del /Q "%~dp0"\*log

echo.

net start "IBM HTTP Server 6.1"
net start "IBM HTTP Administration 6.1"

Test the script by manually launching it. When everything works fine you can schedule this script using Windows Task Scheduler to purge the log files each night or each Sunday.