<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Burak BÖLEK - Blog &#187; Maximo Backend Development</title>
	<atom:link href="http://www.burakbolek.com/blog/category/maximojava/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.burakbolek.com/blog</link>
	<description>Burak BÖLEK</description>
	<lastBuildDate>Fri, 03 Sep 2010 06:50:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Show Workorder on Google Map</title>
		<link>http://www.burakbolek.com/blog/2009/03/show-workorder-on-google-map/</link>
		<comments>http://www.burakbolek.com/blog/2009/03/show-workorder-on-google-map/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 07:06:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Maximo Backend Development]]></category>
		<category><![CDATA[Maximo Tips]]></category>
		<category><![CDATA[Maximo User Interface]]></category>
		<category><![CDATA[google maps]]></category>
		<category><![CDATA[Maximo Connections]]></category>

		<guid isPermaLink="false">http://www.burakbolek.com/blog/?p=92</guid>
		<description><![CDATA[Hello; If you store coordinates in your workorders or location etc. you can show the places on google maps in Maximo. I implemented this on Maximo 6. There are many steps to accomplish this task.. I will tell you about it step by step&#8230; 1-You have to get a Google Map api key from this [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_100" class="wp-caption alignleft" style="width: 310px"><img src="http://www.burakbolek.com/blog/wp-content/uploads/2009/03/google-maps-on-workorder-300x187.jpg" alt="Google Map in Workorder Tracking" title="google-maps-on-workorder" width="300" height="187" class="size-medium wp-image-100" /><p class="wp-caption-text">Google Map in Workorder Tracking</p></div>
<p>Hello;</p>
<p>If you store coordinates in your workorders or location etc. you can show the places on google maps in Maximo. I implemented this on Maximo 6. There are many steps to accomplish this task.. I will tell you about it step by step&#8230;<br />
1-You have to get a Google Map api key from this address: http://code.google.com/apis/maps/signup.html .. Write your maximo server address to the textbox and click Generate Key.. Note your key.. We will use it later&#8230;<br />
2-Create iframe control: Go to %MAXIMOROOT%\applications\maximo\maximouiweb\webmodule\webclient\controls and create a folder named: iframe. We will send data to google map script from this control.  I assume that longitude and latitude are stored in Workorder object as Longitude and Latitude attributes&#8230;<br />
Create a jsp file named <strong>control.jsp</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #339933;">&lt;%</span>@ include  file<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;../../common/controlheader.jsp&quot;</span> <span style="color: #339933;">%&gt;</span>
	<span style="color: #339933;">&lt;%--</span> 
		PROPERTY	GLOBAL		VALUES
		id		<span style="color: #000066; font-weight: bold;">true</span>		...
		<span style="color: #006633;">height</span> 		<span style="color: #000066; font-weight: bold;">false</span> 		###
		width		<span style="color: #000066; font-weight: bold;">false</span> 		###
		url 		<span style="color: #000066; font-weight: bold;">false</span>		...
	<span style="color: #339933;">--%&gt;</span>
	<span style="color: #339933;">&lt;</span>mro<span style="color: #339933;">:</span>handleevent eventtype<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;loadinit&quot;</span><span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>mro<span style="color: #339933;">:</span>loadglobalproperties <span style="color: #339933;">/&gt;</span>
		<span style="color: #339933;">&lt;%</span>
		<span style="color: #000066; font-weight: bold;">int</span> height <span style="color: #339933;">=</span> controlProperties.<span style="color: #006633;">getInt</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;height&quot;</span>, <span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">int</span> width <span style="color: #339933;">=</span> controlProperties.<span style="color: #006633;">getInt</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;width&quot;</span>, <span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">String</span> url <span style="color: #339933;">=</span> controlProperties.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;src&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #339933;">%&gt;</span>
	<span style="color: #339933;">&lt;/</span>mro<span style="color: #339933;">:</span>handleevent<span style="color: #339933;">&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;</span>mro<span style="color: #339933;">:</span>handleevent eventtype<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;render&quot;</span><span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;%</span>
		<span style="color: #000066; font-weight: bold;">int</span> height <span style="color: #339933;">=</span> controlProperties.<span style="color: #006633;">getInt</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;height&quot;</span>, <span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">int</span> width <span style="color: #339933;">=</span> controlProperties.<span style="color: #006633;">getInt</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;width&quot;</span>, <span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">String</span> url <span style="color: #339933;">=</span> controlProperties.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;src&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">String</span> apptitle <span style="color: #339933;">=</span> sessionContext.<span style="color: #006633;">getCurrentApp</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getAppTitle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		psdi.<span style="color: #006633;">util</span>.<span style="color: #006633;">MXSession</span> mxs<span style="color: #339933;">=</span>sessionContext.<span style="color: #006633;">getMXSession</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		psdi.<span style="color: #006633;">mbo</span>.<span style="color: #006633;">MboSetRemote</span> woSet<span style="color: #339933;">=</span>mxs.<span style="color: #006633;">getMboSet</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;WORKORDER&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		woSet.<span style="color: #006633;">setWhere</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;WOCLASS in ('WORKORDER', 'ACTIVITY') and istask=0 and boylam is not null and enlem is not null&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;WO Count: &quot;</span><span style="color: #339933;">+</span>woSet.<span style="color: #006633;">count</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		java.<span style="color: #006633;">util</span>.<span style="color: #003399;">ArrayList</span> coordinateList <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> java.<span style="color: #006633;">util</span>.<span style="color: #003399;">ArrayList</span><span style="color: #009900;">&#40;</span>woSet.<span style="color: #006633;">count</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>woSet.<span style="color: #006633;">count</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		java.<span style="color: #006633;">util</span>.<span style="color: #003399;">ArrayList</span> coordinate<span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">new</span> java.<span style="color: #006633;">util</span>.<span style="color: #003399;">ArrayList</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		psdi.<span style="color: #006633;">mbo</span>.<span style="color: #006633;">MboRemote</span> wo<span style="color: #339933;">=</span>woSet.<span style="color: #006633;">getMbo</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		coordinate.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span>,wo.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;WONUM&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		coordinate.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span>,wo.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;DESCRIPTION&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		coordinate.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2</span>,wo.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;STATUS&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		coordinate.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">3</span>,wo.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;LONGITUDE&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		coordinate.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">4</span>,wo.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;LATITUDE&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		coordinateList.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>coordinate<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #009900;">&#125;</span>
		session.<span style="color: #006633;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;CoordinatesList&quot;</span>,coordinateList<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #339933;">%&gt;</span>
		<span style="color: #339933;">&lt;</span>iframe src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;%=url%&gt;&quot;</span> height<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;%=height%&gt;&quot;</span> width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;%=width%&gt;&quot;</span><span style="color: #339933;">&gt;</span> <span style="color: #339933;">&lt;/</span>iframe<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>mro<span style="color: #339933;">:</span>handleevent<span style="color: #339933;">&gt;</span>
&nbsp;
&nbsp;
<span style="color: #339933;">&lt;%</span>@ include file<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;../../common/controlfooter.jsp&quot;</span> <span style="color: #339933;">%&gt;</span></pre></td></tr></table></div>

<p>Here we defined iframe control and we added the workorder information to the CoordinatesList variable of session.</p>
<p>Now create another file called <strong>allwoongmaps.jsp</strong> in the same folder..</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;
	    &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
	&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xmlns:v=&quot;urn:schemas-microsoft-com:vml&quot;&gt;
	  &lt;head&gt;
	    &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=utf-8&quot;/&gt;
	    &lt;title&gt;&lt;/title&gt;
	    &lt;script src=&quot;http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;key=&lt;strong&gt;KEY&lt;/strong&gt;&quot;
	            type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
	    <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
	    <span style="color: #003366; font-weight: bold;">function</span> initialize<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	      <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>GBrowserIsCompatible<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	        <span style="color: #003366; font-weight: bold;">var</span> map <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GMap2<span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;map_canvas&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			 GEvent.<span style="color: #660066;">addListener</span><span style="color: #009900;">&#40;</span>map<span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;click&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>overlay<span style="color: #339933;">,</span> point<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			 <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>point<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			     map.<span style="color: #660066;">addOverlay</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GMarker<span style="color: #009900;">&#40;</span>point<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			     <span style="color: #003366; font-weight: bold;">var</span> msg <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;Latitude: &quot;</span><span style="color: #339933;">+</span>point.<span style="color: #660066;">lat</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&lt;br&gt;&quot;</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;Longitude: &quot;</span><span style="color: #339933;">+</span>point.<span style="color: #660066;">lng</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			     document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;mypoint&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> msg<span style="color: #339933;">;</span>
			 <span style="color: #009900;">&#125;</span>  <span style="color: #006600; font-style: italic;">//close if(point)...</span>
&nbsp;
&nbsp;
		   <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #006600; font-style: italic;">//close GEvent...</span>
&nbsp;
			<span style="color: #003366; font-weight: bold;">var</span> yellowIcon <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GIcon<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	yellowIcon.<span style="color: #660066;">image</span> <span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://esa.ilmari.googlepages.com/markeryellow.png&quot;</span><span style="color: #339933;">;</span>
	yellowIcon.<span style="color: #660066;">iconSize</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GSize<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">20</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">34</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	yellowIcon.<span style="color: #660066;">iconAnchor</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GPoint<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">9</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">34</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> turqIcon <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GIcon<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	turqIcon.<span style="color: #660066;">image</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;http://www.google.com/uds/samples/places/temp_marker.png&quot;</span><span style="color: #339933;">;</span>
	turqIcon.<span style="color: #660066;">iconSize</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GSize<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">20</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">34</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	turqIcon.<span style="color: #660066;">iconAnchor</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GPoint<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">9</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">34</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
&nbsp;
	 <span style="color: #339933;">&lt;%</span>
	java.<span style="color: #660066;">util</span>.<span style="color: #660066;">ArrayList</span> CoordinateList<span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span>java.<span style="color: #660066;">util</span>.<span style="color: #660066;">ArrayList</span><span style="color: #009900;">&#41;</span> session.<span style="color: #660066;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;CoordinatesList&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>int i<span style="color: #339933;">=</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>CoordinateList.<span style="color: #660066;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			java.<span style="color: #660066;">util</span>.<span style="color: #660066;">ArrayList</span> Coordinate<span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span>java.<span style="color: #660066;">util</span>.<span style="color: #660066;">ArrayList</span><span style="color: #009900;">&#41;</span>CoordinateList.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			String wonum<span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span>String<span style="color: #009900;">&#41;</span>Coordinate.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			String description<span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span>String<span style="color: #009900;">&#41;</span>Coordinate.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			String <span style="color: #000066;">status</span><span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span>String<span style="color: #009900;">&#41;</span>Coordinate.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			String enlem<span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span>String<span style="color: #009900;">&#41;</span>Coordinate.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			String boylam<span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span>String<span style="color: #009900;">&#41;</span>Coordinate.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			double boydouble<span style="color: #339933;">=</span>Double.<span style="color: #660066;">parseDouble</span><span style="color: #009900;">&#40;</span>boylam<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			double enlemdouble<span style="color: #339933;">=</span>Double.<span style="color: #660066;">parseDouble</span><span style="color: #009900;">&#40;</span>enlem<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
			String marker<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;marker&quot;</span><span style="color: #339933;">+</span>i<span style="color: #339933;">;</span>
			String point<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;point&quot;</span><span style="color: #339933;">+</span>i<span style="color: #339933;">;</span>
			String icon<span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>wonum.<span style="color: #660066;">equalsIgnoreCase</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;1000&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			icon<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;yellowIcon&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">else</span> icon<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;turqIcon&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">==</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #339933;">%&gt;</span>
	        map.<span style="color: #660066;">setUIToDefault</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			map.<span style="color: #660066;">setCenter</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #339933;">&lt;%=</span>boydouble<span style="color: #339933;">%&gt;,&lt;%=</span>enlemdouble<span style="color: #339933;">%&gt;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #339933;">&lt;%</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">%&gt;</span>
	          <span style="color: #003366; font-weight: bold;">var</span> <span style="color: #339933;">&lt;%=</span>point<span style="color: #339933;">%&gt;</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #339933;">&lt;%=</span>boydouble<span style="color: #339933;">%&gt;,&lt;%=</span>enlemdouble<span style="color: #339933;">%&gt;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			  <span style="color: #003366; font-weight: bold;">var</span> <span style="color: #339933;">&lt;%=</span>marker<span style="color: #339933;">%&gt;=</span><span style="color: #003366; font-weight: bold;">new</span> GMarker<span style="color: #009900;">&#40;</span><span style="color: #339933;">&lt;%=</span>point<span style="color: #339933;">%&gt;,</span><span style="color: #009900;">&#123;</span>icon<span style="color: #339933;">:&lt;%=</span>icon<span style="color: #339933;">%&gt;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	          map.<span style="color: #660066;">addOverlay</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&lt;%=</span>marker<span style="color: #339933;">%&gt;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	     <span style="color: #339933;">&lt;%</span> 
	    <span style="color: #009900;">&#125;</span><span style="color: #339933;">%&gt;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	    <span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
	  &lt;/head&gt;
&nbsp;
	  &lt;body onload=&quot;initialize()&quot; onunload=&quot;GUnload()&quot;&gt;
	  &lt;div id=&quot;mypoint&quot;&gt;&lt;/div&gt;
	    &lt;div id=&quot;map_canvas&quot; style=&quot;width: 470px; height: 200px&quot;&gt;&lt;/div&gt;
&nbsp;
	  &lt;/body&gt;
	&lt;/html&gt;</pre></td></tr></table></div>

<p>On line 7 we add our own Google api key that we noted before&#8230; and we create our own map from longitude and latitude information on Workorder&#8230;<br />
Now open Application Designer and export your application as xml file.Save it and back it up. then add this line to whereever you want.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;iframe</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;http://localhost:7001/maximo/webclient/controls/iframe/allwoongmaps.jsp&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;200&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;500&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;genid_headera_4_child_1&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>localhost should be your servers ip&#8230;;<br />
Save it and import from application designer.. Rebuild and redeploy&#8230; You&#8217;re going to see map like this&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.burakbolek.com/blog/2009/03/show-workorder-on-google-map/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Creating an Action Class</title>
		<link>http://www.burakbolek.com/blog/2009/03/creating-an-action-class/</link>
		<comments>http://www.burakbolek.com/blog/2009/03/creating-an-action-class/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 09:06:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Maximo Backend Development]]></category>
		<category><![CDATA[Maximo Tips]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.burakbolek.com/blog/?p=53</guid>
		<description><![CDATA[Hello; Now I am going to tell about custom action classes&#8230; These classes help us to add custom actions to workflows&#8230; We must write these classes in the psdi.common.action package.. We extend ActionCustomClass and override applyCustomAction method to make maximo do what we want to do&#8230; 1 2 3 4 5 6 7 8 9 [...]]]></description>
			<content:encoded><![CDATA[<p>Hello;<br />
Now I am going to tell about custom action classes&#8230;<br />
These classes help us to add custom actions to workflows&#8230;<br />
We must write these classes in the psdi.common.action package.. We extend ActionCustomClass and override applyCustomAction method to make maximo do what we want to do&#8230;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">psdi.common.action</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.PrintStream</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.rmi.RemoteException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">psdi.mbo.MboRemote</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">psdi.server.MXServer</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">psdi.util.MXApplicationYesNoCancelException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">psdi.util.*</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.custom.workorder.*</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> newFlowAction
    <span style="color: #000000; font-weight: bold;">implements</span> ActionCustomClass
<span style="color: #009900;">&#123;</span>
&nbsp;
            newFlowAction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
            <span style="color: #009900;">&#123;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> applyCustomAction<span style="color: #009900;">&#40;</span>MboRemote mboremote, <span style="color: #003399;">Object</span> aobj<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
                <span style="color: #000000; font-weight: bold;">throws</span> MXException, <span style="color: #003399;">RemoteException</span>
            <span style="color: #009900;">&#123;</span>
&nbsp;
              com.<span style="color: #006633;">custom</span>.<span style="color: #006633;">workorder</span>.<span style="color: #006633;">newWORemote</span> mbo<span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span>com.<span style="color: #006633;">custom</span>.<span style="color: #006633;">workorder</span>.<span style="color: #006633;">newWORemote</span><span style="color: #009900;">&#41;</span>mboremote<span style="color: #339933;">;</span>
	       <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>mbo.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;STATUS&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">equalsIgnoreCase</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;INPRG&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                        mbo.<span style="color: #006633;">getMboSet</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;OTHEROBJECT&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">deleteAll</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                 <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Here on line 23 we cast our mbo to custom Workorder object. Now we are able to use workorder&#8217;s methods on mbo object. On line 24 we check if the status is INPRG or not&#8230;<br />
And on line 25 if the status is INPRG we select the OTHEROBJECT relationship and delete all mbo&#8217;s that came with OTHEROBJECT relationship&#8230;</p>
<p>Then we compile the code&#8230; Rebuild Maximo.ear.. Redeploy it&#8230; Now you can use it in the related workflow..</p>
<p>Have a good day&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.burakbolek.com/blog/2009/03/creating-an-action-class/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Writing a Custom Condition Class</title>
		<link>http://www.burakbolek.com/blog/2009/03/writing-a-custom-condition-class/</link>
		<comments>http://www.burakbolek.com/blog/2009/03/writing-a-custom-condition-class/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 09:20:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Maximo Backend Development]]></category>
		<category><![CDATA[Maximo Tips]]></category>
		<category><![CDATA[Condition Class]]></category>
		<category><![CDATA[Maximo 7]]></category>

		<guid isPermaLink="false">http://www.burakbolek.com/blog/?p=48</guid>
		<description><![CDATA[One of the best improvements in Maximo 7.x is conditional user interfaces. You can create your conditions in Conditional Expression Manager application. But sometimes there are some issues that you can not write sql sentences. For these cases we can write our own condition class. We must extend psdi.common.condition.CustomCondition class to write the new class. [...]]]></description>
			<content:encoded><![CDATA[<p>One of the best improvements in Maximo 7.x is conditional user interfaces. You can create your conditions  in Conditional Expression Manager application. But sometimes there are some issues that you can not write sql sentences. For these cases we can write our own condition class. We must extend psdi.common.condition.CustomCondition class to write the new class. And we need to override  evaluateCondition(MboRemote mbo, Object arg1)  method. Here is an basic example..</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.custom.workorder</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.rmi.RemoteException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">psdi.mbo.*</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">psdi.common.condition.CustomCondition</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">psdi.util.*</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> TipCondition <span style="color: #000000; font-weight: bold;">implements</span> CustomCondition <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> evaluateCondition<span style="color: #009900;">&#40;</span>MboRemote mbo, <span style="color: #003399;">Object</span> arg1<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> MXException, <span style="color: #003399;">RemoteException</span> <span style="color: #009900;">&#123;</span>
        newWORemote wo <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>newWORemote<span style="color: #009900;">&#41;</span> mbo<span style="color: #339933;">;</span>
 <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>wo.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ISSUETYPE&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">equalsIgnoreCase</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;PROBLEM&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            psdi.<span style="color: #006633;">server</span>.<span style="color: #006633;">MXServer</span> mxs <span style="color: #339933;">=</span> psdi.<span style="color: #006633;">server</span>.<span style="color: #006633;">MXServer</span>.<span style="color: #006633;">getMXServer</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            MboSetRemote loc_set <span style="color: #339933;">=</span> mxs.<span style="color: #006633;">getMboSet</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;LOCATIONS&quot;</span>, wo.<span style="color: #006633;">getUserInfo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            loc_set.<span style="color: #006633;">setWhere</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;location in('&quot;</span><span style="color: #339933;">+</span>wo.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;CENTER1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;')&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            loc_set.<span style="color: #006633;">reset</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>loc_set.<span style="color: #006633;">count</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #003399;">String</span> kanal <span style="color: #339933;">=</span> loc_set.<span style="color: #006633;">getMbo</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;CAPACITY&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>kanal.<span style="color: #006633;">startsWith</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;4&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> toWhereClause<span style="color: #009900;">&#40;</span><span style="color: #003399;">Object</span> arg0, MboSetRemote arg1<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> MXException, <span style="color: #003399;">RemoteException</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Have a good day&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.burakbolek.com/blog/2009/03/writing-a-custom-condition-class/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Import AlnDomain from Excel Sheet</title>
		<link>http://www.burakbolek.com/blog/2009/03/import-alndomain-from-excel-sheet/</link>
		<comments>http://www.burakbolek.com/blog/2009/03/import-alndomain-from-excel-sheet/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 20:04:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Maximo Backend Development]]></category>
		<category><![CDATA[Maximo Tips]]></category>
		<category><![CDATA[excel import]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Maximo Connections]]></category>

		<guid isPermaLink="false">http://www.burakbolek.com/blog/?p=33</guid>
		<description><![CDATA[Hello; Now I will explain a bit about importing from excel sheet. Here I will use Jexcel Api to read excel files. This script was written for Maximo 6.2.1, and I will use Jexcel Api 2.6.9 which can be downloaded from here. Here is the code: /* * addAlnDomain.java * * Created on September 2, [...]]]></description>
			<content:encoded><![CDATA[<p>Hello;</p>
<p>Now I will explain a bit about importing from excel sheet. Here I will use Jexcel Api to read excel files. This script was written for Maximo 6.2.1, and I will use Jexcel Api 2.6.9 which can be downloaded from <a href="http://sourceforge.net/project/showfiles.php?group_id=79926&amp;package_id=81471&amp;release_id=642912">here</a>.<br />
Here is the code:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/*
 * addAlnDomain.java
 *
 * Created on September 2, 2008, 4:00 PM
 */</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.File</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.PrintStream</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">jxl.*</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">psdi.app.system.*</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">psdi.mbo.MboRemote</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">psdi.util.MXSession</span><span style="color: #339933;">;</span>
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 *
 * @author  bbolek
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> addAlnDomain <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/** Creates a new instance of addAlnDomain*/</span>
    <span style="color: #000000; font-weight: bold;">public</span> addAlnDomain<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> add<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> filename<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
            MXSession s<span style="color: #339933;">;</span>
            s <span style="color: #339933;">=</span> MXSession.<span style="color: #006633;">getSession</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            s.<span style="color: #006633;">setHost</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;localhost:9898/MXServer&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Server Name</span>
            s.<span style="color: #006633;">setUserName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;wilson&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            s.<span style="color: #006633;">setPassword</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;wilson&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            s.<span style="color: #006633;">connect</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            Workbook workbook <span style="color: #339933;">=</span> Workbook.<span style="color: #006633;">getWorkbook</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span>filename <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;.xls&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            Sheet sheet <span style="color: #339933;">=</span> workbook.<span style="color: #006633;">getSheet</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">int</span> k <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
            <span style="color: #003399;">String</span> description, value<span style="color: #339933;">;</span>
                MaxDomainSetRemote maxdomain<span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span>MaxDomainSetRemote<span style="color: #009900;">&#41;</span> s.<span style="color: #006633;">getMboSet</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;MAXDOMAIN&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                maxdomain.<span style="color: #006633;">setWhere</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;DOMAINID='DOMAINNAME'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                maxdomain.<span style="color: #006633;">reset</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                MboRemote maxDomain<span style="color: #339933;">=</span>maxdomain.<span style="color: #006633;">getMbo</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>sheet.<span style="color: #006633;">getCell</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span>, k<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getContents</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">length</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                value <span style="color: #339933;">=</span> sheet.<span style="color: #006633;">getCell</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span>, k<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getContents</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                description <span style="color: #339933;">=</span> sheet.<span style="color: #006633;">getCell</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span>, k<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getContents</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;VALUE :&quot;</span><span style="color: #339933;">+</span>value<span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; DESCRIPTION: &quot;</span><span style="color: #339933;">+</span>description <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                ALNValueSetRemote alnSet <span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span>ALNValueSetRemote<span style="color: #009900;">&#41;</span> maxDomain.<span style="color: #006633;">getMboSet</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ALNDOMAINVALUE&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                ALNValueRemote aln <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
                aln <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>ALNValueRemote<span style="color: #009900;">&#41;</span> alnSet.<span style="color: #006633;">addAtEnd</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                aln.<span style="color: #006633;">setValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;VALUE&quot;</span>, value<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                aln.<span style="color: #006633;">setValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;DESCRIPTION&quot;</span>, description<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	        alnSet.<span style="color: #006633;">save</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                k<span style="color: #339933;">++;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> E<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            E.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * @param args the command line arguments
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">// TODO code application logic here</span>
        addAlnDomain new_AlnDomain <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> addAlnDomain<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        new_AlnDomain.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Example&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>In here; between line 28-32 server settings are set. Then on line 34 excel workbook is opened.<br />
On line 35 first sheet is selected. On line 39 the domain with name &#8220;DOMAINNAME&#8221; is selected.<br />
Line 42 shows that the loop will continue if there is a value on the first column of excel.<br />
Line 43 and 44 reads the excel and sets the variables. And on line 48 we create a new ALNDomain mbo. And on 49 we added it to the AlnDomainSet.<br />
Then we bind the variables and save the MboSet&#8230;<br />
On line 62 we set the excel filename&#8230;Here it is <a href="wp-content/uploads/2009/03/example.xls">Example.xls</a></p>
<p>All Mbo&#8217;s can be read from excel and imported to Maximo in this way. It is quite easy and customizable&#8230;For example you can set some rules to import in java like<br />
-import data that starts with 1,<br />
-import data which is like &#8216;%10%&#8217;<br />
-etc&#8230;</p>
<p>Have a good day&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.burakbolek.com/blog/2009/03/import-alndomain-from-excel-sheet/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Creating a New Mbo Class</title>
		<link>http://www.burakbolek.com/blog/2009/02/creating-new-mbo-class/</link>
		<comments>http://www.burakbolek.com/blog/2009/02/creating-new-mbo-class/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 13:03:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Maximo Backend Development]]></category>

		<guid isPermaLink="false">http://www.burakbolek.com/blog/?p=17</guid>
		<description><![CDATA[Hello; One of the basic java functionality is to create new mbo&#8217;s and changing its default behaviour. For example we can create a new mbo as the child of Workorder. And assume there is a relationship between workorder and newMbo as wonum=:wonum. When we add a new record from the user interface, new record&#8217;s wonum [...]]]></description>
			<content:encoded><![CDATA[<p>Hello;</p>
<p>One of the basic java functionality is to create new mbo&#8217;s and changing its default behaviour. For example we can create a new mbo as the child of Workorder. And assume there is a relationship between workorder and newMbo as wonum=:wonum. When we add a new record from the user interface, new record&#8217;s wonum is not populated automatically. So we have to extend  psdi.mbo.Mbo to automate this. Here is how it is done&#8230;.<br />
File :<strong>custom.newMbo.newMbo</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">custom.newMbo</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">psdi.util.*</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.*</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">psdi.mbo.*</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.rmi.*</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">psdi.server.MXServer</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> newMbo <span style="color: #000000; font-weight: bold;">extends</span> Mbo
        <span style="color: #000000; font-weight: bold;">implements</span> newMboRemote <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * Constructor
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> newMbo<span style="color: #009900;">&#40;</span>MboSet ms<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> MXException, <span style="color: #003399;">RemoteException</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span>ms<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> add<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> MXException, <span style="color: #003399;">RemoteException</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>        
        MboRemote mboremote <span style="color: #339933;">=</span> getOwner<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        setValue<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;WONUM&quot;</span>, mboremote.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;WONUM&quot;</span><span style="color: #009900;">&#41;</span>, 2L<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>File :<strong>custom.newMbo.newMboSet</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">custom.newMbo</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">psdi.mbo.*</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">psdi.util.*</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.*</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.rmi.*</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> newMboSet <span style="color: #000000; font-weight: bold;">extends</span> MboSet
<span style="color: #000000; font-weight: bold;">implements</span> newMboSetRemote
<span style="color: #009900;">&#123;</span>
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
* Constructor
*/</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> newMboSet<span style="color: #009900;">&#40;</span>MboServerInterface ms<span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">throws</span> MXException, <span style="color: #003399;">RemoteException</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span>ms<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">protected</span> Mbo getMboInstance<span style="color: #009900;">&#40;</span>MboSet ms<span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">throws</span> MXException, <span style="color: #003399;">RemoteException</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">new</span> newMbo<span style="color: #009900;">&#40;</span>ms<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// this is the key line ...</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>File :<strong>custom.newMbo.newMboRemote</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">custom.newMbo</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">psdi.mbo.*</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">psdi.util.*</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.rmi.*</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> newMboRemote <span style="color: #000000; font-weight: bold;">extends</span> MboRemote
<span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>File :<strong>custom.newMbo.newMboSetRemote</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">custom.newMbo</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">psdi.mbo.*</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">psdi.util.*</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.rmi.*</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> newMboSetRemote
<span style="color: #000000; font-weight: bold;">extends</span> MboSetRemote
<span style="color: #009900;">&#123;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Then you have to compile and rmic these files. Then Go to the database configuration find your object. Enter &#8216;custom.newMbo.newMboSet&#8217; to the class&#8230;</p>
<p>Configure DB<br />
Build Maximo.ear<br />
Deploy Maximo.ear</p>
<p>Tip: It is better to make Wonum field readonly on user interface. Users must not change the field from the user interface</p>
<p>Then you&#8217;re good to go&#8230;.</p>
<p>Have a good day&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.burakbolek.com/blog/2009/02/creating-new-mbo-class/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
