Saturday, 26 March 2016

Setup an escalation to be notified of a status change on a work order

Create an escalation and fill in the following fields:

Applies to :WORKORDER
Condition: STATUS='APPR' and STATUSDATE >=(sysdate -1/1440) (USE this is on Oracle DB)
Condition: STATUS='APPR' and STATUSDATE >= dateadd(mi, -1, getdate()) (USE this if on SQL Server DB)
Schedule: 1 minute

Escalation Point section:

Elapsed Time Attribute: STATUSDATE
Escalation Point condition: 1=1
Check Repeats Box


Attached a Communication Template to my Notification Section

Communication Template specifics;

Applies to : WORKORDER
Accessible From: ALL
To: Role you choose
Send From: Maximo Administrator
Subject: :WONUM has changed status 
Message: The :WONUM has been changed status to :STATUS on :STATUSDATE

****NOTE: The REPEATS needs to be checked in order for it to notify you on the same work order being changed to APPR back to WAPPR back to APPR.....

The following query STATUSDATE >=(sysdate -1/1440)

this will check when a STATUSDATE is changed within that last minute...

Sysdate means it checks the Date on the Server

-1 means it will check for any changes to the STATUSDATE within the last minute the crontask was running as the schedule is every minute

1440 is the following calculation

1440 divided by 60 Seconds ( 1minute)= 24 HOURS

24 Hours X 60 Seconds= 1440

The Crontask runs every minute...but only will send an email when a work order's STATUSDATE is changed within the last time it ran and the work order is changed to APPR.

Reference :http://www-01.ibm.com/support/docview.wss?uid=swg21319721

Wednesday, 10 February 2016

Decreasing the downtime when upgrading Maximo 7.5.0.8 to Maximo 7.6.0.1

With the release of Maximo Fix Pack 7.6.0.1, among other things, it offers the new feature that you will be able to reduce downtime when running updatedb.
The link below contains the steps in how to take advantage of this new feature:
 
But if you go through the steps of the scenario described there, the first problem that you could face is that the Step 2 won't work when you are coming from a 7.5.0.8 version. This is because when you perform the upgrade from Maximo 7.5.0.8 to Maximo 7.6.0.1, the first thing that you must to do is to install Maximo 7.6, followed by Maximo 7.6.0.1 and any other IS/PMP that your previous environment had, all that in a new folder, not installing over your previous 7.5.0.8 folder.
(For more details about the supported upgrade process from Maximo 7.5 to 7.6 versions, check the guide available at this page:
Which means that your new 7.6.0.1 folder has not yet a maximo.properties file pointing to your database to be upgraded, when those installations are completed. In the standard upgrade process it will be created when you use the config tool, after such installations, setting through it the database parameters and finally performing the updatedb, the rebuild and redeploy the EAR files, all that through the config tool.
 
When running the upgrade approach from a English-only Maximo 7.5.0.8 version to 7.6.0.1 in the mode to decrease the downtime, you should follow these steps instead:
 
1-) Perform the installation of Maximo 7.6, Maximo 7.6.0.1 (and any IS/PMP) - follow the instructions available in the upgrade guide to perform these steps.
2-) Copy the maximo.properties file of your previous Maximo 7.5 folder to your new Maximo 7.6.0.1 folder. The file should be put in the same location in the 7.6.0.1 folder: <maximo_folder>\applications\maximo\properties.
3-) Now, with your folder having the maximo.properties file with the information pointing to your database to be upgraded, open a command prompt and run the updatedblitepreprocessor command, located in the <Maximo_Home>\tools\maximo\ directory of your Maximo 7.6.0.1 folder.
<Maximo_Home>\tools\maximo\updatedblitepreprocessor.[bat|sh]
4) Build the application EAR files.
WebLogic:
< Maximo_Home>\deployment\buildmaximoear.[cmd|sh]
< Maximo_Home>\deployment\buildmxiehsear.[cmd|sh]
WebSphere 8.x:
< Maximo_Home>\deployment\buildmaximoearwas8.[cmd|sh]
< Maximo_Home>\deployment\buildmxiehsear.[cmd|sh]

5) Stop the Maximo Asset Management application server.
6) Run the updatedblite command, located in the <Maximo_Home>\tools\maximo\ directory.
<Maximo_Home>\tools\maximo\updatedblite.[bat|sh]
7) Deploy the maximo.ear and maximoiehs.ear application EAR files through the WebLogic Server Administration Console or the WebSphere Application Server Administrative Console
8) Restart the Maximo Asset Management application server.
 
The second problem that you could face is for a non-english Maximo 7.5.0.8 database (and/or multi-language) , in case of following the instructions of the scenario described at this link: http://www-01.ibm.com/support/docview.wss?uid=swg21902458 
In this case, besides the step of copying the old maximo.properties file to your new folder,  you won't be able to perform the step  "7) Run the TDToolkit command.", because in that point, in the upgrade scenario of 7.5.0.8 to 7.6.0.1, the files which for tdtoolkit uses to perform his actions successfully are not there yet in your new 7.6.0.1 folder. They are only added through the config tool.
 
So, at this case, you should follow these steps:
 
1-) Perform the installation of Maximo 7.6, Maximo 7.6.0.1 (and any IS/PMP) - follow the instructions available in the upgrade guide to perform these steps.
2-) Copy the maximo.properties file of your previous Maximo 7.5 folder to your new Maximo 7.6.0.1 folder. The file should be put in the same location in the 7.6.0.1 folder: <maximo_folder>\applications\maximo\properties.
3-) Now, with your folder having the maximo.properties file with the information pointing to your database to be upgraded, open a command prompt and run the updatedblitepreprocessor command, located in the <Maximo_Home>\tools\maximo\ directory of your Maximo 7.6.0.1 folder.
<Maximo_Home>\tools\maximo\updatedblitepreprocessor.[bat|sh]
4) Build the application EAR files.
WebLogic:
< Maximo_Home>\deployment\buildmaximoear.[cmd|sh]
< Maximo_Home>\deployment\buildmxiehsear.[cmd|sh]
WebSphere 8.x:
< Maximo_Home>\deployment\buildmaximoearwas8.[cmd|sh]
< Maximo_Home>\deployment\buildmxiehsear.[cmd|sh]

5) Stop the Maximo Asset Management application server.
6) Run the updatedblite command, located in the <Maximo_Home>\tools\maximo\ directory.
<Maximo_Home>\tools\maximo\updatedblite.[bat|sh]
7) Delete the maximo.properties file of your 7.6.0.1 folder (This is necessary because you will need to run the Config Tool and in case of having the 7.5.0.8 version of the maximo.properties in the folder, the tool won't run. Don't worry, the config tool will create the file again).
8) Run the Maximo 7.6 launchpad, click in the Configure Product, "Reload the Installation Locations" and finally in the Launch the Tivoli's Process Automation Suite configuration program option.
9) Click in Configure a New Deployment.
10) Perform these steps following the same approach described in the Upgrade Guide (http://www-01.ibm.com/support/docview.wss?rs=3224&context=SSLL2E&dc=DB520&dc=DB560&uid=swg21266217&loc=en_US&cs=UTF-8&lang=en&rss=ct3224tivoli) as if you were running the standard upgrade process. The only difference is that in the last screen, "Apply Deployment Operations", you will have to uncheck the "Build the selected EAR files" checkbox (then, the other checkboxes related, "Build the application EAR file" and "Build the help EAR file" will be unchecked automatically).
11) Click in the Finish button. The maximo.properties file will be created again and all the steps related to translating Maximo will be done. The traditional updatedb will be skipped automatically because it will detect that the database was already updated previously, in our scenario, through updatedblite.
12) When completed, a message asking if you want to continue the configuration is displayed. Answer No.
13) Deploy the maximo.ear and maximoiehs.ear application EAR files through the WebLogic Server Administration Console or the WebSphere Application Server Administrative Console
14) Restart the Maximo Asset Management application server.


Reference:

Tuesday, 15 December 2015

Ques: How to display information  regarding Maximo Outage on Maximo Login Screen.

Ans :Modify the login JSP file located in SMP folder and make the changes in JSP highlighted.

<%--
* Licensed Materials - Property of IBM
*
* 5724-U18
*
* (C) COPYRIGHT IBM CORP. 2006,2014 All Rights Reserved.
*
* US Government Users Restricted Rights - Use, duplication or
* disclosure restricted by GSA ADP Schedule Contract with
* IBM Corp.
--%><%@ page contentType="text/html;charset=UTF-8" buffer="128kb" autoFlush="true" import="psdi.util.*,psdi.webclient.system.runtime.*,psdi.webclient.system.session.*,psdi.webclient.system.websession.*,psdi.webclient.system.dojo.*,psdi.server.*,java.util.*,java.rmi.RemoteException" %><%!
private static class Labels
{
private static final String group = "login";

final String welcome;
final String welcomeToMaximo;
final String enterInfo;
final String username;
final String password;
final String loginButton;
final String selectLanguage;
final String onLanguageSelection;
final String forgotPassword;
final String newUserLabel;
final String newUserLink;
final String mobileLoginLink;
final String standardLoginLink;
final String adminLoginLink;

final String Maximounavailable;
final String starttime;
final String endtime;
final String copyright;
final String tenantId;
final String federalNotice;
final String nonFederalNotice;

Labels(String langCode) throws MXException, RemoteException
{
MXServer server = MXServer.getMXServer();

welcome = server.getMessage(group, "welcome", langCode);
welcomeToMaximo = server.getMessage(group, "welcomemaximomessage", langCode);
enterInfo = server.getMessage(group, "enterinfo", langCode);
username = server.getMessage(group, "username", langCode);
password = server.getMessage(group, "password", langCode);
loginButton = server.getMessage(group, "loginbutton", langCode);
selectLanguage = server.getMessage(group, "languages", langCode);
onLanguageSelection = server.getMessage(group, "onlanguageselection", langCode);
forgotPassword = server.getMessage(group, "forgotpassword", langCode);
newUserLabel = server.getMessage(group, "newuserlabel", langCode);
newUserLink = server.getMessage(group, "newuserlink", langCode);
mobileLoginLink = server.getMessage(group, "mobileloginlink", langCode);
standardLoginLink= server.getMessage(group, "standardloginlink", langCode);
copyright = server.getMessage(group, "copyright", langCode);
tenantId  = server.getMessage(group,"tenant",langCode);
federalNotice = server.getMessage(group, "federalNotice", langCode);
nonFederalNotice = server.getMessage(group, "nonFederalNotice", langCode);
adminLoginLink = server.getMessage(group, "adminLogin", langCode);

Maximounavailable = server.getMessage(group, "Maximounavailable", langCode);
starttime = server.getMessage(group, "starttime", langCode);
endtime = server.getMessage(group, "endtime", langCode);
}
}
%><%
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Cache-Control", "no-store");
response.setDateHeader("Expires", 0);
response.setHeader("Pragma", "no-cache");

WebClientSessionManager wcsm = WebClientSessionManager.getWebClientSessionManager(session);
if (wcsm != null && wcsm.getSessionInvalidated())
{
session.removeAttribute("MXSession");
}

MXSession s = WebClientRuntime.getMXSession(session);
String skin = WebClientRuntime.getWebClientSystemProperty("mxe.webclient.skin");
String isFederal = WebClientRuntime.getWebClientSystemProperty("mxe.isFederal", "0");
String isSaasEnabled = WebClientRuntime.getWebClientSystemProperty("mxe.isSaasEnabled", "0");

boolean mtEnabled = WebClientRuntime.isMTEnabled();

if(skin==null || skin.length()==0) {
skin="classic";
}
if (!WebClientSessionFactory.getWebClientSessionFactory().hasAvailableSessions())
{
String url = new java.net.URL(new java.net.URL(WebClientRuntime.getMaximoRequestURL(request)), "loginerror.jsp").toString() + "?unavailable=true";
if (!WebClientRuntime.send503Error(response, s, url))
{
response.sendRedirect(url);
}
return;
}

s.setClientHost(request.getRemoteHost());
s.setClientAddr(request.getRemoteAddr());

Object[] settings = WebClientRuntime.getLocaleFromRequest(request);
String langcode;
if (settings[0] instanceof String)
{
langcode = (String)settings[0];
}
else
{
langcode = MXServer.getMXServer().getBaseLang();
}
Map<String,String> langNameToCodeMap = null;
String[][] langs = s.getLanguageList();
if(langs != null)
{
if(langs.length == 1)
{
langcode = langs[0][0];
}
else if(langs.length > 1)
{
langNameToCodeMap = new HashMap<String,String>();
for(int i = 0; i < langs.length; i++)
{
langNameToCodeMap.put(langs[i][1], langs[i][0]);
}
}
}
s.setLangCode(langcode);
session.setAttribute("langcode", langcode);

Locale locale = null;
if (settings[1] instanceof Locale)
{
locale = (Locale)settings[1];
session.setAttribute("_locale_", locale);
}
if (locale != null)
{
session.removeAttribute("locale");
s.setLocale(locale);
}

if (request.getParameter("langchanged") != null)
{
session.setAttribute("_langchanged", "1");
}

boolean isMobile = false;

boolean everyplace = WebClientRuntime.getWebClientRuntime().hasLicenseAccess("EVERYPLACE");
if(everyplace)
{
String mobile = request.getParameter("mobile");
if(WebClientRuntime.isNull(mobile))
{
String userAgent = request.getHeader("User-Agent").toUpperCase();
if(userAgent.contains("MOBILE") || userAgent.contains("IPHONE") || userAgent.contains("IPOD") || userAgent.contains("PLAYBOOK") || userAgent.contains("ANDROID"))
{
isMobile = true;
}
}
else if(mobile.equals("true"))
{
isMobile = true;
}
if(isMobile) {
skin = "mobile";
}
}
request.setCharacterEncoding("UTF-8");

String debug = request.getParameter("debug");
if(debug == null || debug.length() == 0)
{
debug = "0";
}

boolean formAuth = request.getParameter("appservauth") != null;
String allowInSubFrame = request.getParameter("allowinsubframe");
if (formAuth)
{
session.setAttribute("formAuth", "true");
}
String url = WebClientRuntime.getMaximoRequestContextURL(request)+"/ui/login";

String queryString = request.getQueryString();
if(queryString != null)
{
url += "?" + HTML.encode(queryString);
}
int branding = s.getBranding();
if(branding == MXServerRemote.BRAND_NONE)
{
branding = MXServerRemote.BRAND_MAXIMO_AND_TIVOLI;
}
WebClientSession wcs = null;
if(wcsm != null)
{
wcs = wcsm.getWebClientSession(request);
if(wcs != null)
{
if(wcs.usingContextInterval())
{
s.disconnect();
}
}
}
if(s.isConnected() && s.getUserName().equalsIgnoreCase(s.getProperty("mxe.system.reguser")))
{
s.disconnect();
}
if(!formAuth && (WebAppEnv.useAppServerSecurity() || s.isConnected()))
{
response.sendRedirect(url);
return;
}

String userFieldName = "username";
String passwordFieldName = "password";
String tenantFieldName = "tenant";
boolean tokenExpire = false;
if(WebAppEnv.useAppServerSecurity())
{
userFieldName = "j_" + userFieldName;
passwordFieldName = "j_" + passwordFieldName;
url="../../j_security_check";

if (s.isConnected()) // This is possible cause for Appserver token expiry
{
tokenExpire = true;
}
}

String userName = request.getParameter("username");
if(userName == null)
{
userName = "";
}


String tenant = request.getParameter(tenantFieldName);
if(tenant == null)
{
tenant = "";
}

Labels labels = new Labels(langcode);

String reverseAlign = "right";
String direction = "ltr";
if(BidiUtils.isGUIMirrored(langcode))
{
reverseAlign = "left";
direction = "rtl";
}

String timestamp = Long.toString(System.currentTimeMillis());
session.setAttribute("allowlogin", timestamp);

String message;
MXException loginException = (MXException)session.getAttribute("loginexception");
if (loginException != null)
{
//Issue 10-12120
message = s.getTaggedMessage(loginException);
message = WebClientRuntime.replaceString(message,"\"","\\\"");
session.removeAttribute("loginexception");
}
else
{
message = (String)request.getAttribute("signoutmessage");
if (message == null)
{
message = (String)session.getAttribute("signoutmessage");
if (message != null)
{
session.removeAttribute("signoutmessage");
}
}
else
{
request.removeAttribute("signoutmessage");
}
}
if (message != null)
{
message = WebClientRuntime.removeQuotes(message);
message = message.replace("\\n"," ");
}
//HTML 5 doctype
%><!DOCTYPE html>
<html lang="<%=langcode.toLowerCase()%>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Expires" content="0" />
<meta name="viewport" content="width=320, initial-scale=1.0" />
<meta name="format-detection" content="telephone=no" />


<link rel="apple-touch-icon" href="../images/maximo-icon.png"/>
<link rel="shortcut icon" href="../images/maximo-icon.ico"/>
<% if(branding == MXServerRemote.BRAND_MAXIMO || branding == MXServerRemote.BRAND_MAXIMO_AND_TIVOLI)
{
%> <title><%=labels.welcomeToMaximo%></title>
<% }
else
{
%> <title><%=labels.welcome%></title>
<% }
%> <link href="css/login.css" rel="stylesheet" type="text/css" />
<link href="css/<%=skin%>/login.css" rel="stylesheet" type="text/css" />
<% if(isMobile)
{
%> <link href="css/mobilelogin.css" rel="stylesheet" type="text/css" />
<% }
if(direction.equals("rtl"))
{
%> <link href="css/RTLlogin.css" rel="stylesheet" type="text/css" />
<% }
%></head>

<body <%=(tokenExpire?"":"onload=\"checkForRefresh()\"")%>>
<div role="main">
  <% if(labels.Maximounavailable.equals("10")) 
{
 %> <h4><font size="4.5" color="white"><center><%=labels.starttime%></center></font></h4>
 <% }
%>
<table id="main_tbl" class="main_tbl" cellpadding="0" cellspacing="3" role="presentation">
<tr role="banner">
<td>
<% //Branding image
if(branding == MXServerRemote.BRAND_TIVOLI || branding == MXServerRemote.BRAND_MAXIMO_AND_TIVOLI)
{
%> <img class="defaultbrandinglogo" src="images/tivoli_brandmark.png" alt="Tivoli" />
<% }
%> </td>
<td align="<%=reverseAlign%>">
<img class="defaultibmlogo" src="images/ibm-logo-white.gif" alt="IBM" />
</td>
</tr>
<tr>
<td class="dialog" colspan="2">
<% if(branding == MXServerRemote.BRAND_MAXIMO || branding == MXServerRemote.BRAND_MAXIMO_AND_TIVOLI)
{
//  Welcome to MAXIMO
%> <h1 class="prod_name"><%=labels.welcomeToMaximo%></h1>
<% }
else
{
// Welcome,
%> <h1 class="prod_name"><%=labels.welcome%></h1>
<% }
if(!isMobile && message != null)
{
%> <div class="errorText">
<img id="error_img" src="images/st16_critical_24.png" alt="Error" align="absmiddle"/>
<%=message%>
</div>
<% }
%> <table cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td colspan="5" align="<%=reverseAlign%>">
<% if(branding == MXServerRemote.BRAND_MAXIMO || branding == MXServerRemote.BRAND_MAXIMO_AND_TIVOLI)
{
//  Welcome to MAXIMO
%> <h1 class="prod_name ext_prod_name" style="display:none"><%=labels.welcomeToMaximo%></h1>
<% }
else
{
// Welcome,
%> <h1 class="prod_name ext_prod_name" style="display:none"><%=labels.welcome%></h1>
<% } %>
</td>
</tr>
<tr>
<td valign="top"><img src="images/mx_icon<%=isMobile?"_ev":""%>.png" alt="" /></td>
<td class="input_pad">
<form id="loginform" name="loginform" method="post" action="<%=url%>" onsubmit="loginSetup();">
<input type="hidden" name="allowinsubframe" value="<%=HTML.encode(allowInSubFrame)%>"/>
<input type="hidden" name="mobile" id="mobile" value="<%=isMobile%>"/>
<input type="hidden" name="login" id="loginjsp" value="jsp"/>
<input type="hidden" name="localStorage" id="localStorage" value=""/>
<input type="hidden" name="loginstamp" id="loginstamp" value="<%=timestamp%>" /><% if (wcs != null)
{
%> <input type="hidden" name="<%=WebClientSessionManager.CSRFTOKEN%>" id="csrftoken" value="<%=wcs.getCSRFToken()%>" />
<% }
if(Integer.parseInt(debug) > 0)
{
%> <input type="hidden" name="debug" value="<%=debug%>"/>
<% }
%><label for="<%=userFieldName%>" dir="<%=direction%>"><%=labels.username%></label><br />
<% String attrs = "";
if(BidiUtils.isBidiEnabled())
{
attrs = BidiUtils.buildTagAttribute("",BidiUtils.getMboTextDirection("MAXUSER","LOGINID",true),"",true);
attrs += "onkeyup='processBidiKeys(null,this)' onfocus='input_bidi_onfocus(null, this)' onblur='input_bidi_onblur(null, this)' onchange='input_bidi_onfocus(null, this)' ";
}
%> <input <%=attrs%> style="width:<%=isMobile?145:195%>px" name="<%=userFieldName%>" id="<%=userFieldName%>" langcode="<%=langcode%>" type="text" value="<%=HTML.encode(userName)%>"  onchange="document.getElementById('forgot_<%=userFieldName%>').value = this.value;"/>
<br /><br />
<label for="<%=passwordFieldName%>" dir="<%=direction%>"><%=labels.password%></label><br />
<input style="width:<%=isMobile?145:195%>px" name="<%=passwordFieldName%>" id="<%=passwordFieldName%>" type="password"  value=""/>
<br /><br />
<%  if(mtEnabled)
{ %>
<div id="tenantinfo" style="display:none" aria-hidden="true">
<label for="<%=tenantFieldName%>"><%=labels.tenantId%></label>
<br />
<input <%=attrs%> style="width:<%=isMobile?145:195%>px" name="<%=tenantFieldName%>" id="<%=tenantFieldName%>" langcode="<%=langcode%>" type="text" value="<%=HTML.encode(tenant)%>"/>
<br /><br />
</div>
<% } %>
<div style="text-align: <%=reverseAlign%>">
<button class="tiv_btn" type="submit" id="loginbutton" value="1"><%=labels.loginButton%></button>
</div>
</form>
</td>
</tr>
<%
if ("1".equals(s.getProperty(WebClientConstants.WEBCLIENT_GUEST_LOGIN)) && !mtEnabled)        
{
String guestLoginLabel = MXServer.getMXServer().getMessage("login", "guestloginlabel", langcode);
String guestLoginURL = s.getProperty(WebClientConstants.WEBCLIENT_GUEST_LOGIN_URL);
%>
<tr>
<td align="<%=reverseAlign%>" colspan="2">
<div style="text-align: <%=reverseAlign%>">
<form name="guestform" method="get" action="<%=guestLoginURL%>" onsubmit="showWait()">
<button class="tiv_btn" type="submit" id="guestloginlink" value="1"><%=guestLoginLabel%></button>
</form>
</div>
<br />
</td>
</tr>
<% }
if(mtEnabled){ %>
<tr>
<td align="<%=reverseAlign%>" height="18" colspan="2">
<button id="adminlink" class="link" onclick="var tInfo = document.getElementById('tenantinfo'); tInfo.style.display=''; tInfo.setAttribute('aria-hidden', 'false');"><span><%=labels.adminLoginLink%></span></button>
</td>
</tr>
<% }
if((!formAuth || "1".equals(s.getProperty("mxe.AllowUserMgmt"))) && isMobile)
{
%> <tr>
<td align="<%=reverseAlign%>" height="18" colspan="2">
<form name="mobileform" method="get" action="<%=url%>" onsubmit="showWait()">
<input type="hidden" name="mobile" value="<%=!isMobile%>" />
<button id="mobilelink" class="link" type="submit" value="1"><span><%=labels.standardLoginLink%></span></button>
</form>
</td>
</tr>
<tr>
<td align="<%=reverseAlign%>" height="18" colspan="2">
<form name="selfregform" method="post" action="<%=url%>" onsubmit="showWait()">
<input type="hidden" name="event" value="loadapp" />
<input type="hidden" name="value" value="forgotpswd" />
<input type="hidden" name="login" value="selfreg" />
<input type="hidden" name="username" id="forgot_<%=userFieldName%>" />
<% if(langNameToCodeMap != null)
{
%> <input type="hidden" name="langcode" value="<%=langcode%>" />
<% }
%> <button id="forgotpwdlink" class="link" type="submit" value="1"><span><%=labels.forgotPassword%></span></button>
</form>
</td>
</tr>
<% }
if(langNameToCodeMap != null)
{
String[] langNames = langNameToCodeMap.keySet().toArray(new String[langNameToCodeMap.size()]);
Arrays.sort(langNames);
%> <tr height="<%=isMobile?"104":"30"%>px">
<td nowrap="nowrap" align="<%=reverseAlign%>" colspan="2">
<form name="langform" method="post" id="langform" >
<input type="hidden" id="languser" name="username"  value=""/>
<% if(formAuth)
{
%> <input type="hidden" name="langchanged" value="1" />
<% }
%> <label for="langselect"><%=labels.selectLanguage%>
</label>

<select id="langselect" name="langcode" onchange="selectLanguage()" title="<%=labels.onLanguageSelection%>">
<% for(int i = 0; i < langNames.length; i++)
{
String code = langNameToCodeMap.get(langNames[i]);
if(code.equals(langcode))
{
%> <option value="<%=code%>" selected="selected"><%=langNames[i]%></option>
<% }
else
{
%> <option value="<%=code%>"><%=langNames[i]%></option>
<% }
}
%> </select>
</form>
</td>
</tr>
<% }
else if(isMobile)
{
%> <tr height="104px"><td colspan="2">&nbsp;</td></tr>
<% }
if((!formAuth || "1".equals(s.getProperty("mxe.AllowUserMgmt"))) && !isMobile)
{
if(everyplace)
{
%> <tr>
<td align="<%=reverseAlign%>" height="18" colspan="2">
<form name="mobileform" method="get" action="<%=url%>" onsubmit="showWait()">
<input type="hidden" name="mobile" value="<%=!isMobile%>" />
<button id="mobilelink" class="link" type="submit" value="1"><span><%=labels.mobileLoginLink%></span></button>
</form>
</td>
</tr>
<% }
%> <tr>
<td align="<%=reverseAlign%>" height="18" colspan="2">
<form name="selfregform" method="post" action="<%=url%>" onsubmit="showWait()">
<input type="hidden" name="event" value="loadapp" />
<input type="hidden" name="value" value="forgotpswd" />
<input type="hidden" name="login" value="selfreg" />
<input type="hidden" name="username" id="forgot_<%=userFieldName%>" />
<% if(langNameToCodeMap != null)
{
%> <input type="hidden" name="langcode" value="<%=langcode%>" />
<% }
%> <button id="forgotpwdlink" class="link" type="submit" value="1"><span><%=labels.forgotPassword%></span></button>
</form>
</td>
</tr>
<tr>
<td align="<%=reverseAlign%>" height="18" colspan="2">
<form name="selfregform" method="post" action="<%=url%>" onsubmit="showWait()">
<input type="hidden" name="event" value="loadapp" />
<input type="hidden" name="value" value="selfreg" />
<input type="hidden" name="login" value="selfreg" />
<input type="hidden" name="username" id="forgot_<%=userFieldName%>" />
<% if(langNameToCodeMap != null)
{
%> <input type="hidden" name="langcode" value="<%=langcode%>" />
<% }
%>
<% if(!mtEnabled)
{
%> <%=labels.newUserLabel%> <button id="selfreglink" class="link" type="submit" value="1"><span><%=labels.newUserLink%></span></button>
<% }
%> </form>
</td>
</tr>
<% }
%> </table>
</td>
</tr>
<%
if (MXFormat.stringToBoolean(isSaasEnabled))
{
%>
<tr style="height:10px;">
</tr>
<tr>
<td colspan="2" style="text-align:justify;" >
<% if(MXFormat.stringToBoolean(isFederal)){ %>
<span><%=labels.federalNotice%></span>
<%} else {%>
<span><%=labels.nonFederalNotice%></span>
<%
}
%>
</td>
</tr>
<%
}
%>
<tr>
<td colspan="2" class="copyright" role="contentinfo"><img alt="IBM" src="images/ibm-logo-white.gif" style="display: none"><p><%=labels.copyright%></p></td>
</tr>
</table>
</div>
<% if(BidiUtils.isBidiEnabled())
{
%> <script type="text/javascript" src="../javascript/<%=Dojo.getMaximoJavascriptDirectory(request)%>bidi_library.js"></script>
<% }

if(tokenExpire)
{
%> <script type="text/javascript" src="../javascript/<%=WebClientRuntime.getDojoDirectory(request)%>/dojo/dojo.js"></script>
<script type="text/javascript" src="../javascript/tokenrelog.js"></script>
<% }

%> <script language="JavaScript" type="text/javascript">
var MAINDOC=document;
function checkForRefresh()
{
<% if (BidiUtils.isBidiEnabled())
{
%> setTimeout("document.getElementById('username').blur(); document.getElementById('username').focus()",100);
<% }
%> document.cookie = "TJE= ; expires=-1; path=/";
document.cookie = "TE3= ; expires=-1; path=/";
if (MAINDOC.location != document.location)
{
var hiddenFrame = parent.document.getElementById("commframe");
if (hiddenFrame != null)
{
var debugwindow = parent.document.getElementById("dockedHiddenFrame");
var hdrRow = parent.document.getElementById("debugHeaderRow");
hdrRow.style.display="none";
debugwindow.style.display="";
debugwindow.style.visibility="visible";
debugwindow.style.position="absolute";
debugwindow.style.top = -16 + "px";
debugwindow.style.left = -18 + "px";
debugwindow.style.opacity=1;
debugwindow.style.filter="alpha(opacity=100)";
debugwindow.style.width=parent.document.body.clientWidth +19 + "px";
debugwindow.style.height=parent.document.body.clientHeight + 16 + "px";
hiddenFrame.style.width=parent.document.body.clientWidth +19 + "px";
hiddenFrame.style.height=parent.document.body.clientHeight + 16 + "px";
debugwindow.style.zIndex=1001
hiddenFrame.style.display="inline";
parent.hideWait();
}
}
if(document.documentMode && (document.documentMode < 8))
alert("Either Compatibility View is turned on or you are using an unsupported browser version which can affect the performance of the product. Ensure that Compatibility View is turned off. If the issue continues, ensure that you are not using an unsupported browser version.");

<% if (message != null && isMobile)
{
%> alert("<%=message%>");
<% }

%> var userField = document.getElementById("<%=userFieldName%>");
if (<%=loginException != null%> || userField.value == "")
{
userField.focus();
userField.select();
}
else
{
var pWordField = document.getElementById("<%=passwordFieldName%>");
if (pWordField.value == "")
{
pWordField.focus();
pWordField.select();
}
else
{
document.getElementById("loginbutton").focus();
}
}
window.setTimeout("document.location='exit.jsp?logintimeout=1'", <%=(session.getMaxInactiveInterval() - 10) * 1000%>);

if (navigator.userAgent.toLowerCase().indexOf("iphone") > -1)
{
setTimeout(hideURLbar, 0);
}
}

function loginSetup()
{
showWait();
<% if (s.isConnected())
{
%> hiddenFrame = parent.document.getElementById("commframe");
if (hiddenFrame != null)
{
var debugwindow = parent.document.getElementById("dockedHiddenFrame");
debugwindow.style.width=50 + "px";
debugwindow.style.height=50 + "px";
hiddenFrame.style.width=50 + "px";
hiddenFrame.style.height=50 + "px";
debugwindow.style.visibility="hidden";
hiddenFrame.style.display="none";
parent.showWait();
}
<% }
%> }
document.getElementById("localStorage").value = ('localStorage' in window && window['localStorage'] !== null);
function selectLanguage()
{
var langform = document.getElementById("langform");
var username = document.getElementById("<%=userFieldName%>");
if(username && username.value)
{
langform.languser.value = username.value;
}
langform.submit();
}

function showWait()
{
document.body.style.cursor="wait";
document.body.onkeydown = noKeys;

var lb = document.getElementById("loginbutton");
if (lb)
{
lb.disabled = true;
lb.setAttribute("aria-disabled", "true");
}

var main_tbl = document.getElementById("main_tbl");
if (main_tbl)
{
main_tbl.style.display = "none";
main_tbl.setAttribute("aria-hidden", "true");
}
}

function noKeys(event)
{
event = event || window.event;
event.cancelBubble = true;
event.returnValue = false;
return false;
}

function hideURLbar()
{
window.scrollTo(0, 1);
}
</script>
</body>
<%@ include file="../common/webreplayLogin.jsp" %>
</html>

Saturday, 10 October 2015

How to Turn off Admin Mode in Maximo 7

Question

How to Turn off Admin Mode in Maximo 7

Answer

Admin Mode is Maximo 7.5 allows you to configure your database configuration changes without having to shut down Maximo server like in Maximo 6.
Having the Admin Mode on will have impact on our areas of Maximo. You should ALWAYS turn it off once the changes have been carried out.

Do these steps to turn off Admin mode:
1) Log in as a user who has full access to the Database Configuration application.
2) Go To -> System Configuration -> Platform Configuration -> Database Configuration
3) Select Action -> Manage Admin Mode
4) Click on the "Turn Admin Mode OFF" button.
It should be noted that the permission required to set Admin Mode are not the same as the permission required for admin login security authorization, which lets you to log in when the server is in admin mode. It is possible to have Admin users who can turn admin mode on but are not be able to login once Admin Mode has started.
You grant the authorization to logon while in Admin Mode from the Security Groups application:

1 In the Security Groups application, click the Applications tab.
2 In the Applications table window, search for Start Center.
3 In the Options for Start Center table window, select Identifies whether the user is permitted to login when
server is in Admin Mode.
If you have Admin Mode ON but do not have a user who can login to turn it off, you may be able to reset it via using SetAdminMode.bat C:\ibm\SMP\maximo\tools\maximo\internal\SetAdminMode.bat
Please see the comments below on the syntax for using SetAdminMode.bat
REM Command line parameter must be one or both of the following:
REM -m (mode) Set AdminMode. The value of mode must be ON or OFF.
REM For example, -mON sets AdminMode ON.
REM -n (num sessions) Set value for mxe.adminmode.numsessions property.
REM Num sessions must be an integer.
REM For example, -n8 sets the value to 8. 

Ref :http://www-01.ibm.com/support/docview.wss?uid=swg21329036


How to Turn off Admin Mode in Maximo 7 if unable to do so through Maximo Front End through Manage Admin Mode.


Receiving errors on the Database Configuration screen when shutting down Admin Mode:

BMXAA4030I - Starting to set Admin Mode ON.
BMXAA4004I - Admin Mode is pending (turning on) for this server.
BMXAA4013I - Setting maxvar ADMINRESTART to ON.
BMXAA4008I - Notifying users to sign out.
BMXAA4036W - All users will be logged out in 1 minutes!
BMXAA4007I - Administratively logging out all remaining users.
BMXAA4011I - Waiting until all cron tasks are sleeping...
BMXAA4010I - Preventing events from firing.
BMXAA4014I - Setting this server's maxsession active flag to 0.
BMXAA4032I - Successfully set Admin Mode ON.
system#AdminModeIsConfiguring
system#AdminModeIsConfiguring
system#AdminModeIsConfiguring
system#AdminModeIsConfiguring
system#AdminModeIsConfiguring

Cause
Database in a state of configuring.

Diagnosing the problem
Run this statement on the database: select * from maxvars where varname='CONFIGURING';

Resolving the problem
If the value is 1


Run this update statement below to set the value to 0

update MAXVARS set varvalue='0' where varname='CONFIGURING';

This will reset the flag and will allow Admin Mode to be shut down.


Ref : http://www-01.ibm.com/support/docview.wss?uid=swg21473106

"Admin Mode" function in Maximo 7.x

Question

What happens in Maximo when "Admin Mode" is ON?

Answer

There is an "Admin Mode" function in Maximo 7.x. That function enables the system administrator to configure the database without having to shut the Maximo server down temporarily.
This function exists in the Database Configuration application.

When setting Admin Mode to ON, there are some limitations that the users and system administrator may run into.

1) It blocks users from the product applications. Only users with the privilege "'Can Log In During Admin Mode" can log in to Maximo.
The SQL statement below shows groups with the privilege "'Can Log In During Admin Mode" :
SELECT * FROM APPLICATIONAUTH WHERE OPTIONNAME ='ADMINMODELOGIN'

If no one can log in to Maximo, please check if "Admin Mode" is on and who has "Can Log In During Admin Mode" privileges.


2) It suspends crontasks.
Only the BBCron instance will run. You can check when each crontask instance runs last with this SQL query:
SELECT * FROM TASKSCHEDULER

If you meet the problem "crontasks are not running" without any reason, you can check "Admin Mode" and If "Admin Mode" is set to ON, change it to OFF.
The crontasks will then run again.

Below is the SQL command to check the "Admin Mode" setting":
SELECT * FROM MAXVARS WHERE VARNAME = 'ADMINRESTART'

cf ) Using a back-end SQL script , you can change "Admin Mode" setting:
UPDATE MAXVARS SET VARVALUE = 'OFF' WHERE VARNAME = 'ADMINRESTART' ; COMMIT;


3) It disables all event listeners.
When the Maximo application server starts (when services are loaded), all event listeners will be loaded . For example: PMListener, MatUseTransListener , AssetListener etc.
If "Admin Mode" is "ON", all event listeners are disabled even if they are initialized when the Maximo application server starts.
At that time, if you try to do some business processes such as Asset creation, PM creation or issue/return Inventory items, data integrity would be broken.
For example: inventory balances/cost are not updated or asset data is not inserted in ASSETANCESTOR, etc.
Also, due to broken data integrity , some unexpected errors or results will happen, for example: PM Wogen error.

* Check "Admin Mode" first when you get any unexpected result or errors.


Ref : https://www-304.ibm.com/support/docview.wss?uid=swg21377175

Sunday, 8 March 2015

Year Comparison using Automation Script

from java.util import Calendar

cal = Calendar.getInstance()
cal.setTime(actcomdateloc)
locactcomyear = cal.get(Calendar.YEAR)
currentyear = Calendar.getInstance().get(Calendar.YEAR);
val = currentyear-locactcomyear
return val
Automation Script to throw warning message for issuing items against asset under warranty:

from java.util import Calendar
from psdi.server import MXServer
from psdi.util import MXApplicationException
if mbo.getOwner().getString('WARRANTYEXPDATE') =='':
 errorgroup = ""  
 errorkey = ""
else:
 if(mbo.getOwner().getDate('warrantyexpdate') >= (Calendar.getInstance().getTime())):
  msgparams = [mbo.getOwner().getString('ASSETNUM')];
  mxae = MXApplicationException("workorder","AssetWarrantyNotice",msgparams)
  mbo.getThisMboSet().addWarning(mxae)



Steps to throw warning message using automation script

Add the line below to the imports:


from psdi.util import MXApplicationException

then add the following:


mxae = MXApplicationException(msggroup, msgkey, msgparams)
mbo.getThisMboSet().addWarning(mxae)


Choose the desired msggroup ,msgkey and pass appropriate value of msgparams