I am attempting to develop a quality control tool for Infor Smart Office Mashups. In my original post I was using Python. This time I will use the Smart Office API to get the list of Mashups.
List of Mashups in Smart Office
Smart Office automatically installs the Mashups on each user’s computer:
The list is based on what is installed in LifeCycle Manager:
Smart Office uses the Mango web services CategoryFilesManager.ListAllCategoryFileInfo and ListCategoryFileInfo to get the list of Mashups:
And it stores the files locally in a temporary user based path:
The administrator can fine tune the Mashups access:
That is more than sufficient information for my needs. Let’s move on.
Smart Office API
The Smart Office API has a class PackageHelper for Mashups:
I could not find it in the Smart Office Mashup SDK Documentation, but here is a screenshot of the documentation anyway:
Source code
Here is the source code to get the list of Mashups, the Manifest, the XAML files, and the resources:
import System.IO; import System.Xml; import Mango.UI.Services.Mashup.Internal; package MForms.JScript { class Test { public function Init(element: Object, args: Object, controller : Object, debug : Object) { var mashups /*IList<FileInfo>*/ = PackageHelper.GetSharedMashupList(); for (var i: int = 0; i < mashups.Count; i++) { var mashup: FileInfo = mashups[i]; debug.WriteLine(mashup.ToString()); var manifest: Manifest = PackageHelper.GetManifest(mashup); var xml: XmlDocument = manifest.Document; var files: XmlNodeList = xml.SelectNodes("/Manifest/Files/File"); for (var j: int = 0; j < files.Count; j++) { var node: XmlElement = files[j]; var relativeUri: String = node.GetAttribute("Path"); debug.WriteLine(relativeUri); } debug.WriteLine(""); } } } }
It was inspired by PackageHelper.GetSharedMashupList and Manifest.CreateFileInformationList.
In addition to GetSharedMashupList(), we can also use GetPrivateMashupList(), GetLocalMashupList() to get the various Mashups origins: shared, private, and local.
Reminder: To deploy a shared Mashup, use LifeCycle Manager > Admin > Upload Products > Upload; to deploy a Mashup privately, use Mashup Designer > Deploy > Private; and to deploy a Mashup locally, use Smart Office > Show > My Local Applications > Install.
Result
Here is the resulting list of files: *.mashup, *.xaml, *.png, etc.:
Future work
The next steps are:
- Load the XAML and run my predicate rules
- Deal with the name scoping across multiple files, e.g. <mashup:Event SourceName=”CustomerList”> where CustomerList is in a separate file
- Instead of simple static analysis of the XAML files, do dynamic analysis as well, i.e. when the Mashups are running in Smart Office.
- Explore the UriHelper.CreateMashupUri, Package.Open, Package.GetParts, PackageHelper.GetStream, MashupInstance.CreateInstance, MashupInstance.Load, MashupNameScope, etc.
That’s it.
Please comment, like, subscribe, share, author. Thanks for your support.
Related posts
- Mashup quality control #1 – <m3:ListPanel IsListHeaderVisible=”True”>
- Mashup quality control #2 – icon buttons
- Mashup quality control #3 – Mashups
- Mashup quality control #4 – XAML
- Mashup quality control #5 – MForms Bookmark URIs
- Mashup quality control #6 – MForms Automation URIs
FWIW: if you’re not already aware, you can retrieve a list of Mashups that are deployed to the Smart Office server.
http://:/mangows/CategoryFilesManager
ListCategoryFileInfo() with arg0 set to ‘Mashup’ will return a list of the Mashups and the Change Date.
It may be useful if you’re reconciling what has been deployed to each environment.
LikeLike
Yes, that’s the same web service that Smart Office uses to retrieve the list of Mashups. Very convenient indeed. Thank you.
LikeLike
UPDATE: added Inspired by, and Reminder.
LikeLike
Where can i find the Infor Mashup SDK and Jscript SDK??
LikeLike
Did you see my reply to your question on the other post?
LikeLike