1 / 15


IBM Maximo Asset Management Jython Rocks Maximo remote method invocation example - setup PyDev in Eclipse Environment - read XLS into Maximo. Carsten Frentz - Bernt Senior Client Technical Professional IBM Software Group Cloud & Smarter Infrastructure. CONTROL. VISIBILITY. AUTOMATION.

Télécharger la présentation


An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.


Presentation Transcript

  1. IBM Maximo Asset Management Jython Rocks Maximo remote method invocation example - setup PyDev in Eclipse Environment - read XLS into Maximo Carsten Frentz - Bernt Senior Client Technical Professional IBM Software Group Cloud & Smarter Infrastructure CONTROL VISIBILITY AUTOMATION

  2. Jython Language

  3. Jython LanguageThe Definitive Guide to Jython http://www.apress.com/9781430225270 The Definitive Guide to Jython, written by the official Jython team leads, covers Jython 2.5 (or 2.5.x),from the basics to more advanced features. The Definitive Guide to Jython is organized for beginners as well as advanced users. The book provides a general overview of the Jython language itself, but it also includes intermediate and advanced topics. This book is also presented in open source and licensed through Creative Commons 3.0 You can read the book at http://jythonbook.comor check out the source at the book project on bitbucket at http://bitbucket.org/javajuneau/jythonbook/

  4. Jython Install Instructionshttp://jython.org/ Jython 2.5.4rc 1 Has Been Released (February 10, 2013)

  5. Jython LanguageIntro based on Barry’s devworks articleshttp://jython.org/

  6. PyDeveclipse based IDE

  7. setup environment PyDev (eclipse based IDE) PyDev is a third-party plug-in for Eclipse. It is an Integrated Development Environment (IDE) used for programming in Python, Jython and IronPython development. It comes with many goodies such as: Code completion with auto import Syntax highlighting Code analysis Refactoring Mark occurrences Debugger Remote debugger Tokens browser Interactive console Unittest integration and many others PyDev home : http://pydev.org/http://pydev.org/download.htmlRequirements Java 6 or higher (java 7 recommended) At least one of: Python (2.1 or newer) Jython (2.1 or newer) IronPython (2.6 or newer) and Eclipse (3.2 to 3.8/4.2)

  8. install jython, eclipse and pydev – part 1 recommended instruction http://www.ics.uci.edu/~pattis/common/handouts/pythoneclipsejava/eclipsepython.html • Install Jython and Java before installing Eclipse • Install Eclipse Standard SDK / Kepler Release v4.3Use 32 Bit Operating System for your machine (even if your Operating System is 64 Bits)This file is about 180 Mb so it might take a while to download fully. • Move this file to a more permanent location, so that you can install Eclipse. • Jython and Java should be installed before installing Eclipse. • Unzip <eclipse-SDK-4.3-win32.zip>, the file that you just downloaded and moved. • Open Eclipse and accept Workspace Launcher pop-up window. • Terminate (click X on) the Welcome tab. • Click Help and then click Install New Software. • Enter the text <http://pydev.org/updates> into the Work with text box.Select only the PyDev checkbox; do NOT select PyDev Mylyn Integration (optional) box. • Install pop-up window will appear, click NEXT and accept terms of the license agreement. • Finish and restart Ecplise.

  9. install jython, eclipse and pydev – part 2 recommended instruction http://www.ics.uci.edu/~pattis/common/handouts/pythoneclipsejava/eclipsepython.html • After Restart, click Window and then click Preferences. • Click Window, hover over Open Perspective. • Select PyDev (blue label on the Eclipse window will change to PyDev - Eclipse SDK). add libraries … businessobjects.jar [ MAXIMO business logic ] [ extract from maximo.ear ] icu4j.jar [ provides globalization technology into Java ] [ extract from maximo.ear ] jxl.jar [ xls read / write … download from http://sourceforge.net/projects/jexcelapi/ ]

  10. cookbook cornerCreate Workorder in MAXIMO via RMI if __name__ == '__main__': import psdi.util.MXSession as MXSession import psdi.util.MXException as MXException try: session = MXSession.getSession() session.setHost('') session.setUserName('maxadmin') session.setPassword('maxadmin') session.connect() except MXException, conex: print 'conex.getErrorGroup() :',conex.getErrorGroup() print 'conex.getErrorKey() :',conex.getErrorKey() print 'conex.getDetail() :',conex.getDetail() print 'conex.getDisplayMessage() :',conex.getDisplayMessage() try: woset = session.getMboSet('WORKORDER') wo = woset.addAtEnd() # wo.setValue(“WONUM","&AUTOKEY&") wo.setValue(“DESCRIPTION","test description") woset.save() except MXException, mboex: print 'mboex.getErrorGroup() :',mboex.getErrorGroup() print 'mboex.getErrorKey() :',mboex.getErrorKey() print 'mboex.getMessage(mboset) :',mboex.getMessage(woset) session.disconnect()

  11. cookbook cornerImport XLS to ALN Domain in MAXIMO via RMI if __name__ == '__main__': from java.io import File from jxl import * import psdi.util.MXSession as MXSession import psdi.mbo.MboSetRemote as MboSetRemote session = MXSession.getSession() session.setHost("") session.setUserName("maxadmin") session.setPassword("maxadmin") session.connect() maxdomain = session.getMboSet("MAXDOMAIN") maxdomain.setWhere("DOMAINID='CREWID'") maxdomain.reset() alndomainset = maxdomain.getMbo(0).getMboSet("ALNDOMAINVALUE") workbook = Workbook.getWorkbook(File("C:\\temp\\import.xls")) sheet = workbook.getSheet(0) for row in range(1, sheet.getRows()): alndomain = alndomainset.addAtEnd() alndomain.setValue("VALUE", sheet.getCell(0, row).getContents()) alndomain.setValue("DESCRIPTION", sheet.getCell(1, row).getContents()) alndomainset.save() session.disconnect() Import der Klassen - Java Basis Klasse- JXL Java API read / write XLS- MAXIMO businessobjects Referenz auf MAXIMO SessionundAufbau einer Verbindung Public interface für den Zugriff auf MAXIMO BusinessObjects Öffnen des XLS Files Lese für alle XLS Zeilen die Spaltenfelder 1+2 und lege einen neuen Datensatz in ALNDomain an Speichern und Abmelden

  12. interesting

  13. interestinghttps://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/IBM%20Maximo%20Asset%20Management/page/Configuring%20and%20customizinginterestinghttps://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/IBM%20Maximo%20Asset%20Management/page/Configuring%20and%20customizing Configuring and Customizing For information about configuring and customizing Maximo Asset Management, select from the following links. Configuring the user interface Adding a new field using Application Designer: View a beginner tutorial on how to add a new field to an application dialog using Application Designer. Customizing Headers with corporate colors and logo: Learn how to customize the Maximo Asset Management header with your corporate colors and logo. Hiding sections of the user interface: Learn how to improve usability by hiding sections of the user interface that are not needed by your users. For example, you might want the approvers of your work orders to see only the main Work Order tab of the Work Order Tracking application and not be distracted by any of the other tabs. Making long description a text field: Maximo Asset Management 7.5 added the ability to use a Rich Text Editor for the long descriptions. Learn how to configure the product to use the text area for long descriptions again. Stylize a label or text control to draw attention to a field or value: Learn how to draw attention to a particular field by stylizing its label or internal text. Application configuration best practices: Learn how to use the Application Designer to customize your user interface.Adding information to the user interface: Learn how to add additional information, such as fields or sections into an application to improve the efficiency of your users. UI Best Practices for Products Built on Tivoli's process automation engine: This document describes the screen layout features, UI style and details, and accessibility features that result in an optimally usable product UI. Follow the best practices that are provided in this document to ensure that the UI remains consistent, accessible, and easy to navigate and use. UI framework event handling: Learn how the user interface framework handles events when users press buttons or interact with widgets. Rich Text Formatting in Maximo and SmartCloud Control Desk 7.5: Learn how to add rich text to long descriptions and other parts of the user interface. Customizing help Help Customization Toolkit: Use the Help Customization Toolkit to install and develop a custom plug-in for Maximo Asset Management 7.5 and add this plug-in to your product information center. Separating Maximo Help files from WebSphere Application Server admin files: Learn how to deploy the MxEclipse application to create a standalone Eclipse information center that allows you to separate the Maximo files from the WebSphere admin files. Cloning application help in Maximo 7.1: Learn how to clone help for cloned applications in Maximo Asset Management Version 7.1. Customizing with automation scripts Customizing Maximo with Scripts: For Maximo Asset Management version 7.5, learn how to use scripting to customize many components without writing java code or rebuilding the EAR file. Maximo Scripting: Script compilation and caching: Learn how Maximo executes automation scripts saved in the database. Maximo Scripting: Date Dizziness--Part 1: Learn how to use scripts to calculate elapsed time based on date and time measurements in Maximo business objects and how to present that information in the user interface. Maximo Scripting: Date Dizziness--Part 2: Learn a Java-based approach to calculating dates through a scenario in which an escalation executes a scripted action. Maximo Scripting: Date Dizziness--Part 3: Learn how to implement a JavaScript-based script to calculate dates. Multiple language environments Attribute and domain functions: This article provides an overview of attribute and domain functions for multiple language environments, including the Maxattribute.Localizable, Maxattribute.Mlinuse and Maxattribute.Mlsupported attributes and ALN-/SYNONYMDOMAIN. Configuring a Start Center for multiple language environments: This article describes how to configure start centers for multiple language environments and provides an example that describes how to configure for Dutch and English. Hints and tips for multiple language environments: This article provides useful hints and tips for users who have multiple language environments. Customization Detection Tool: Learn how to use a tool that can locate customizations for objects, attributes, and service classes that have been extended and/or added to. Configuring Colors in Assignment Manager: Learn how to assign colors based on priorities in the Work List of the Assignment Manager application. Deploying clustered configurations: Learn how to deploy a clustered configuration for Maximo Asset Management. Introducing Email Interaction Setup: Learn how to update an object or workflow assignment by sending an email with a number prompt. This enhancement provided with Maximo Asset Management is device independent and updates can be made by laptop, smartphone, tablet and other devices on a wide range of existing networks and carriers. Maximo business object development: View best practices for developing Maximo business objects (MBOs). Skip fields during duplication: Learn how to skip user-defined fields during duplication of a record. Related pages Configuring the Maximo Enterprise Adapter for SAP Applications without SAP NetWeaver Process Integration: Learn how to configure an alternative middleware component to support integration between Maximo Asset Management and SAP ERP, version 6.0.

  14. interestinghttps://www.ibm.com/developerworks/community/groups/service/html/communityview?communityUuid=a9ba1efe-b731-4317-9724-a181d6155e3a#fullpageWidgetId=W5f281fe58c09_49c7_9fa4_e094f86b7e98&file=83c7752c-a621-4af9-bb32-d6ba7d612ab2interestinghttps://www.ibm.com/developerworks/community/groups/service/html/communityview?communityUuid=a9ba1efe-b731-4317-9724-a181d6155e3a#fullpageWidgetId=W5f281fe58c09_49c7_9fa4_e094f86b7e98&file=83c7752c-a621-4af9-bb32-d6ba7d612ab2

More Related