logo资料库

aras12开发手册说明书.pdf

第1页 / 共105页
第2页 / 共105页
第3页 / 共105页
第4页 / 共105页
第5页 / 共105页
第6页 / 共105页
第7页 / 共105页
第8页 / 共105页
资料共105页,剩余部分请下载后查看
Send Us Your Comments
Document Conventions
1 Introduction
1.1 The Item
1.2 The Aras Markup Language (AML)
1.3 Methods and the IOM
2 AML
2.1 Tag
2.2 Tag
2.3 Tags
2.4 Attributes
2.4.1 Item Attributes
2.4.2 Property Attributes
3 IOM Reference
3.1 IOMCredentials Class
3.2 Innovator Class
3.3 Item Class
3.3.1 Base Methods
3.3.2 Boolean Methods
3.3.3 Attribute Methods
3.3.4 Property Methods
3.3.5 Relationship Methods
3.3.6 Item Collection Methods
3.3.7 Logical Methods
3.3.8 Creating New Item Method
3.3.9 Error Methods
3.3.10 Extended Item Class methods
4 Methods
4.1 Item Actions Extend the Item Class
4.1.1 Context Item
4.1.2 Methods are Item Factories
4.1.3 Handling the Wrong ItemType
4.1.4 Methodology
4.2 Built in Action Methods
4.3 Generic Methods
4.3.1 Context Item
4.3.2 Methods are Item Factories
4.3.3 Methodology
4.4 Server Events
4.4.1 Context Item
4.4.2 Methodology
4.4.3 Available Server Events
4.4.4 Polymorphic ItemTypes Server Event Inheritance
4.4.5 Required Server Events
4.4.6 Server Event Version
4.4.6.1 onAfterUpdate, onAfterAdd, and onAfterVersion Version 2
4.4.6.2 onBeforeCopy/onAfterCopy Version 2
4.5 Client Events
4.5.1 Context Item
4.5.2 Form Events
4.5.3 Field Events
4.5.4 Grid Events
4.5.4.1 Row Events
4.5.4.2 Cell Events
4.5.5 Item Type Events
4.5.6 Item Actions and Server Event
5 Action Items
5.1 Client Side Method Rules
5.2 Server Side Method Rules
5.3 Use Cases
5.3.1 Client side - has cache Item is dirty
5.3.2 Client side - no cache Item - no item_query value
5.3.3 Client side - has cache Item not dirty - no item_query value
5.3.4 Client side - has cache Item not dirty - has item_query value
5.3.5 Client side - no cache Item - has item_query value
5.3.6 Server side - has cache Item/is dirty
5.3.7 Server side - no cache Item - no item_query value
5.3.8 Server side - has cache Item/not dirty - no item_query value
5.3.9 Server side - has cache Item/not dirty - has item_query value
5.3.10 Server side - no cache Item - has item_query value
6 Aras Innovator Methodology
7 Cookbook
7.1 Create an Aras Innovator Object
7.2 Create an Item Object
7.3 Query for an Item
7.4 Query and iterate over a set of Items
7.5 Query for an Item and return its configuration
7.6 Query using AML to construct the query
7.7 Query for the Item next promotion states
7.8 Query using relationships as search criteria
7.9 Add an Item configuration in one transaction
7.10 Add a Named Permission
7.11 Set a Private Permission for an Item
7.12 Apply a Generic Method
7.13 Need to Save text to a File
7.14 Need to Send Email from a Method
7.15 Need to Add a UI Control
7.16 Need for Speed ApplySQL
7.17 Need a callback for a Relationships Grid Row Event
7.18 Need a callback for a Relationships Grid Cell Event
7.19 Show relationships in a Grid control on the Form
7.20 Want the Identities for the User
7.21 Want a field to be either a sequence or user entered value
7.22 Want to Vault a File
7.23 Want to get an existing Vaulted File and save it with a new Document
7.24 Need to reject an Item Promote
7.25 How to build XML for grid
7.26 How to build XML for a Menu
7.27 How to handle multilingual properties
7.28 How to handle date properties
7.29 How to pass values from onBeforeX to onAfterX events
7.30 How to reference custom DLL from server method
7.31 How to add sub menus to context menu in search grid
7.32 How to Create a Dynamic List
7.33 How to Download a File from Aras Innovator to a Client Machine
7.34 How to Convert Strings
7.35 How to Load an XML File URL
7.36 How to Create a List of Nodes
7.37 How to Select a Single Node
7.38 How to Transform a Node
7.39 How to Create a NodeType
7.40 How to Get Text Associated with a Node
7.41 How to Set Text For a Node
7.42 How to Convert an Object into a String
7.43 How to Return an Error
8 Aras Innovator Solution Studio
8.1 Features
9 Debugging
9.1 Enabling Debugging in Aras Innovator
9.2 Setting up VS.NET to debug Server side Methods
9.3 Setting up VS.NET to debug Client side Methods
9.4 Setting up the server side logging
10 External APIs
10.1 .NET IOM
10.2 COM-compatible IOM
10.3 RT IOM
10.4 iOS IOM
10.5 Android IOM
11 Using CheckinManager
11.1 Submitting Images
11.2 Submitting Drawings
11.3 Async Processing
Aras Innovator 12 Programmer’s Guide Document #: 12.0.02019054101 Last Modified: 05/24/2019
Aras Innovator 12 Programmer’s Guide Copyright Information Copyright © 2019 Aras Corporation. All Rights Reserved. Aras Corporation 100 Brickstone Square Suite 100 Andover, MA 01810 Phone: 978-806-9400 Fax: 978-794-9826 E-mail: Support@aras.com Website: https://www.aras.com Notice of Rights Copyright © 2019 by Aras Corporation. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, V1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/). Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. Distribution of the work or derivative of the work in any standard (paper) book form for commercial purposes is prohibited unless prior permission is obtained from the copyright holder. Aras Innovator, Aras, and the Aras Corp "A" logo are registered trademarks of Aras Corporation in the United States and other countries. All other trademarks referenced herein are the property of their respective owners. Notice of Liability The information contained in this document is distributed on an "As Is" basis, without warranty of any kind, express or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose or a warranty of non- infringement. Aras shall have no liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this document or by the software or hardware products described herein. 2019 Aras Corporation All Copyrights Reserved. 2
Aras Innovator 12 Programmer’s Guide Table of Contents Send Us Your Comments ............................................................................................. 6 Document Conventions ................................................................................................ 7 1 Introduction .............................................................................................................. 8 The Item ....................................................................................................................................... 8 1.1 1.2 The Aras Markup Language (AML) .............................................................................................. 9 1.3 Methods and the IOM ................................................................................................................. 10 2 AML ......................................................................................................................... 11 Tag ................................................................................................................................. 11 2.1 Tag .................................................................................................................. 11 2.2 Tags ......................................................................................................................... 11 2.3 2.4 Attributes .................................................................................................................................... 12 2.4.1 2.4.2 Item Attributes ............................................................................................................. 12 Property Attributes ....................................................................................................... 14 3 IOM Reference ........................................................................................................ 16 3.1 3.2 3.3 IOMCredentials Class ................................................................................................................ 17 Innovator Class .......................................................................................................................... 17 Item Class .................................................................................................................................. 17 Base Methods .............................................................................................................. 17 3.3.1 Boolean Methods ......................................................................................................... 18 3.3.2 Attribute Methods ........................................................................................................ 18 3.3.3 Property Methods ........................................................................................................ 18 3.3.4 Relationship Methods .................................................................................................. 19 3.3.5 Item Collection Methods .............................................................................................. 19 3.3.6 Logical Methods .......................................................................................................... 20 3.3.7 Creating New Item Method .......................................................................................... 20 3.3.8 3.3.9 Error Methods .............................................................................................................. 21 3.3.10 Extended Item Class methods..................................................................................... 21 4 Methods .................................................................................................................. 23 4.1 Item Actions Extend the Item Class ........................................................................................... 23 4.1.1 Context Item ................................................................................................................ 24 4.1.2 Methods are Item Factories ......................................................................................... 24 4.1.3 Handling the Wrong ItemType ..................................................................................... 24 4.1.4 Methodology ................................................................................................................ 25 4.2 Built in Action Methods ............................................................................................................... 25 4.3 Generic Methods ........................................................................................................................ 27 4.3.1 Context Item ................................................................................................................ 27 4.3.2 Methods are Item Factories ......................................................................................... 27 4.3.3 Methodology ................................................................................................................ 28 2019 Aras Corporation All Copyrights Reserved. 3
Aras Innovator 12 Programmer’s Guide 4.4 Server Events ............................................................................................................................. 28 4.4.1 Context Item ................................................................................................................ 28 4.4.2 Methodology ................................................................................................................ 28 Available Server Events .............................................................................................. 29 4.4.3 4.4.4 Polymorphic ItemTypes Server Event Inheritance ...................................................... 32 Required Server Events .............................................................................................. 32 4.4.5 4.4.6 Server Event Version ................................................................................................... 32 4.5 Client Events .............................................................................................................................. 33 4.5.1 4.5.2 4.5.3 4.5.4 4.5.5 4.5.6 Context Item ................................................................................................................ 33 Form Events ................................................................................................................ 33 Field Events ................................................................................................................. 34 Grid Events .................................................................................................................. 35 Item Type Events ......................................................................................................... 38 Item Actions and Server Event .................................................................................... 39 5 Action Items ........................................................................................................... 40 5.1 Client Side Method Rules ........................................................................................................... 40 5.2 Server Side Method Rules ......................................................................................................... 40 5.3 Use Cases .................................................................................................................................. 42 Client side - has cache Item is dirty ............................................................................. 42 5.3.1 Client side - no cache Item - no item_query value ...................................................... 42 5.3.2 Client side - has cache Item not dirty - no item_query value ...................................... 43 5.3.3 Client side - has cache Item not dirty - has item_query value ..................................... 43 5.3.4 Client side - no cache Item - has item_query value .................................................... 44 5.3.5 Server side - has cache Item/is dirty ........................................................................... 44 5.3.6 Server side - no cache Item - no item_query value ..................................................... 45 5.3.7 Server side - has cache Item/not dirty - no item_query value ..................................... 45 5.3.8 5.3.9 Server side - has cache Item/not dirty - has item_query value ................................... 46 5.3.10 Server side - no cache Item - has item_query value ................................................... 46 6 Aras Innovator Methodology ................................................................................ 48 7 Cookbook ............................................................................................................... 49 7.1 Create an Aras Innovator Object................................................................................................ 49 7.2 Create an Item Object ................................................................................................................ 49 7.3 Query for an Item ....................................................................................................................... 50 7.4 Query and iterate over a set of Items ......................................................................................... 51 7.5 Query for an Item and return its configuration ........................................................................... 52 7.6 Query using AML to construct the query .................................................................................... 56 7.7 Query for the Item next promotion states ................................................................................... 56 7.8 Query using relationships as search criteria .............................................................................. 57 7.9 Add an Item configuration in one transaction ............................................................................. 59 7.10 Add a Named Permission .......................................................................................................... 60 7.11 Set a Private Permission for an Item ......................................................................................... 61 7.12 Apply a Generic Method ............................................................................................................. 62 7.13 Need to Save text to a File ......................................................................................................... 62 7.14 Need to Send Email from a Method ........................................................................................... 63 7.15 Need to Add a UI Control ........................................................................................................... 64 7.16 Need for Speed ApplySQL ......................................................................................................... 67 7.17 Need a callback for a Relationships Grid Row Event ................................................................ 68 2019 Aras Corporation All Copyrights Reserved. 4
Aras Innovator 12 Programmer’s Guide 7.18 Need a callback for a Relationships Grid Cell Event ................................................................. 70 7.19 Show relationships in a Grid control on the Form ...................................................................... 71 7.20 Want the Identities for the User.................................................................................................. 72 7.21 Want a field to be either a sequence or user entered value ...................................................... 72 7.22 Want to Vault a File .................................................................................................................... 73 7.23 Want to get an existing Vaulted File and save it with a new Document .................................... 75 7.24 Need to reject an Item Promote ................................................................................................. 76 7.25 How to build XML for grid ........................................................................................................... 77 7.26 How to build XML for a Menu ..................................................................................................... 79 7.27 How to handle multilingual properties ........................................................................................ 80 7.28 How to handle date properties ................................................................................................... 81 7.29 How to pass values from onBeforeX to onAfterX events ......................................................... 82 7.30 How to reference custom DLL from server method ................................................................... 83 7.31 How to add sub menus to context menu in search grid ............................................................. 85 7.32 How to Create a Dynamic List .................................................................................................... 85 7.33 How to Download a File from Aras Innovator to a Client Machine ............................................ 86 7.34 How to Convert Strings .............................................................................................................. 87 7.35 How to Load an XML File URL................................................................................................... 87 7.36 How to Create a List of Nodes ................................................................................................... 87 7.37 How to Select a Single Node ..................................................................................................... 88 7.38 How to Transform a Node .......................................................................................................... 88 7.39 How to Create a NodeType ........................................................................................................ 88 7.40 How to Get Text Associated with a Node .................................................................................. 88 7.41 How to Set Text For a Node ....................................................................................................... 89 7.42 How to Convert an Object into a String ...................................................................................... 89 7.43 How to Return an Error .............................................................................................................. 89 8 Aras Innovator Solution Studio ............................................................................ 90 8.1 Features ..................................................................................................................................... 90 9 Debugging .............................................................................................................. 91 9.1 Enabling Debugging in Aras Innovator ...................................................................................... 91 9.2 Setting up VS.NET to debug Server side Methods .................................................................... 91 9.3 Setting up VS.NET to debug Client side Methods ..................................................................... 93 9.4 Setting up the server side logging .............................................................................................. 94 10 External APIs ................................................................................................. 95 10.1 .NET IOM ................................................................................................................................... 95 10.2 COM-compatible IOM ................................................................................................................ 96 10.3 RT IOM ....................................................................................................................................... 96 10.4 iOS IOM ...................................................................................................................................... 97 10.5 Android IOM ............................................................................................................................... 97 11 Using CheckinManager ................................................................................. 99 11.1 Submitting Images ..................................................................................................................... 99 11.2 Submitting Drawings ................................................................................................................ 101 11.3 Async Processing ..................................................................................................................... 104 2019 Aras Corporation All Copyrights Reserved. 5
Aras Innovator 12 Programmer’s Guide Send Us Your Comments Aras Corporation welcomes your comments and suggestions on the quality and usefulness of this document. Your input is an important part of the information used for future revisions. o Did you find any errors? o Is the information clearly presented? o Do you need more information? If so, where and what level of detail? o Are the examples correct? Do you need more examples? o What features did you like most? If you find any errors or have any other suggestions for improvement, indicate the document title, and the chapter, section, and page number (if available). You can send comments to us in the following ways: Email: Support@aras.com Subject: Aras Innovator Documentation Or, Postal service: Aras Corporation 100 Brickstone Square Suite 100 Andover, MA 01810 Attention: Aras Innovator Documentation Or, FAX: 978-794-9826 Attn: Aras Innovator Documentation If you would like a reply, provide your name, email address, address, and telephone number. If you have usage issues with the software, visit https://www.aras.com/support/ 2019 Aras Corporation All Copyrights Reserved. 6
Aras Innovator 12 Programmer’s Guide Document Conventions The following table highlights the document conventions used in the document: Document Conventions Convention Description Bold Code This shows the names of menu items, dialog boxes, dialog box elements, and commands. Example: Click OK. Code examples appear in courier font. It may represent text you type or data you read. Yellow highlight Code highlighted in yellow draws attention to the code that is being indicated in the content. Yellow highlight with red text Red text highlighted in yellow indicates the code parameter that needs to be changed or replaced. Italics Note: Warning Reference to other documents. Notes contain additional useful information. Warnings contain important information. Pay special attention to information highlighted this way. Successive menu choices Successive menu choices may appear with a greater than sign (-->) between the items that you will select consecutively. Example: Navigate to File --> Save --> OK. 2019 Aras Corporation All Copyrights Reserved. 7
Aras Innovator 12 Programmer’s Guide 1 Introduction The purpose of this document is to provide a Guide to Programming Aras Innovator. It covers key aspects of programming Aras Innovator for implementing your own business logic within the Aras Innovator Enterprise Application Framework. This document is intended to be used as a Desktop Reference and User Guide covering the following topics:  The AML (Aras Markup Language), which is the language that drives the Aras Innovator server.  The IOM (Innovator Object Model), which is the Object API for the AML.  How Methods work and the Methodology for implementing your own business logic.  A Cookbook of recipes for performing common tasks.  The .NET controls API the Innovator Client is built on. 1.1 The Item Everything in Aras Innovator is an Item, which is an instance of an ItemType, which itself is an Item; illustrating that Aras Innovator is a self-describing system. Don't get hung up on the self-describing nature of Aras Innovator and focus on the simplicity that everything eventually is an Item. Items may have relationships to other Items illustrating that Items have structure. Relationships are defined by RelationshipType, which is an Item that has three properties to define the RelationshipType rule for the:    source (parent) Item. related (child) Item. relationship Item. When you create the RelationshipType you also create an ‘is_relationship’ ItemType which has the same name as the RelationshipType. Its id is the value of the relationship_id Property on the RelationshipType. This can get a bit confusing but simply put there is a RelationshipType/ItemType pairing to define the RelationshipType rule and an ItemType to store the relationship Items. Relationship Items have a related_id Property of type Item, which is the related (child) Item for the relationship. The related_id Property is a link that points to an Item. The relationship Item also has a source_id Property of type Item and is the source (parent) Item for the relationship. So, in Aras Innovator everything is an Item, and Items may have relationships, which are Items that have source and related Item Properties forming an Item configuration. For example, an ItemType Item has Property relationships and this Item configuration maps directly to the relational database for persistent storage of the Item instances. Every ItemType has a matching relational TABLE where the Property names are the COLUMN names. 2019 Aras Corporation All Copyrights Reserved. 8
分享到:
收藏