0% found this document useful (0 votes)
307 views

Mincom LinkOne WinView Technical Reference

Uploaded by

Eric Henrique
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
307 views

Mincom LinkOne WinView Technical Reference

Uploaded by

Eric Henrique
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 105

LinkOne WinView Technical Reference

5.11
Copyright 2010 by Mincom®. All rights reserved.
No part of this document may be reproduced, transferred, sold, or otherwise disposed of without the
written permission of Mincom Pty Ltd.
All trademarks are the copyright of their respective owners.
LinkOne is a registered trademark of Mincom Pty Ltd.
Microsoft, Windows, and the .NET Framework are registered trademarks of Microsoft Corporation.
Every effort has been made to ensure the accuracy of this manual. However, Mincom Pty Ltd makes
no warranties with respect to this documentation and disclaims any implied warranties of
merchantability and fitness for a particular purpose. Mincom Pty Ltd shall not be liable for any errors or
for incidental or consequential damages in connection with the furnishing, performance, or use of this
manual or the examples herein. The information in this document is subject to change without notice.

Mincom Pty Ltd


GPO Box 1397
Brisbane QLD 4001
Australia
Ph: +61 7 3303 3333
Fax: +61 7 3303 3232
Web: http://www.mincom.com/linkone
Email: linkone.info@mincom.com
Published in Australia - 26/05/2010, 11:49.
Contents i

Contents
Technical Reference Copyright ................................................................................................................3
Technical Reference Requirements .........................................................................................................4
Overview ...................................................................................................................................................5
Working With Plugins ...............................................................................................................................6
Plugin Licensing ....................................................................................................................................7
Plugin Development Guidelines ............................................................................................................8
Using the LinkOne Dom ........................................................................................................................9
Overview of the Dom Library .............................................................................................................9
Reading Parts List Entries .................................................................................................................9
Reading an Entire Book ..................................................................................................................16
Conclusion .......................................................................................................................................21
Listening to LinkOne Events ...............................................................................................................22
Overview of LinkOne Controls ........................................................................................................22
Creating the Custom Control ...........................................................................................................22
Plugging in the control .....................................................................................................................28
Testing the control ...........................................................................................................................28
Customizing the Selection List ............................................................................................................30
Overview of the Selection List .........................................................................................................30
Creating the Selection List Plugin ...................................................................................................30
The ISelectionListService ................................................................................................................33
The Complete Plugin Source Listing ...............................................................................................35
Testing the Plugin............................................................................................................................37
Automating LinkOne WinView ................................................................................................................39
Remoting Configuration ......................................................................................................................40
Automation Reference ........................................................................................................................41
Connect ...........................................................................................................................................41
Execute ...........................................................................................................................................41
GetValue .........................................................................................................................................42
SetValue ..........................................................................................................................................42
HookEvent .......................................................................................................................................42
UnhookEvent ...................................................................................................................................43
HasEvent .........................................................................................................................................44
CreateEventHandler ........................................................................................................................44
LinkOne Configuration Manager ............................................................................................................45
Overview of IConfigurationManager ...................................................................................................46
Connecting to External Systems .....................................................................................................46
Slots ................................................................................................................................................46
IConfigurationManager Reference......................................................................................................47
ResolveObject .................................................................................................................................47
ResolveLink .....................................................................................................................................47
ResolveSlot .....................................................................................................................................48
DBMan ................................................................................................................................................49
The DBMan Database .....................................................................................................................49
Database Diagram of DBMan .........................................................................................................52
Dynamic Derived Books .........................................................................................................................53
The Book Structure .............................................................................................................................54
Book.Net.dll Assembly Requirements ................................................................................................55
Book.Net Methods ..............................................................................................................................56
DynamicDerivedBookProvider ........................................................................................................56
PrepareBook ...................................................................................................................................56
BookXML .........................................................................................................................................57
ii Contents

Example DynamicDerivedBookProvider Class ...................................................................................58


Changes from Book32.dll to Book.Net.dll ...........................................................................................60
Book.Net Sequence Diagram .............................................................................................................61
Re-branding LinkOne WinView ..............................................................................................................62
The Splash Screen .............................................................................................................................63
Customizing the Splash Screen ......................................................................................................64
Customizing the Configuration File Locations ....................................................................................66
Customizing the Document Folder Locations .....................................................................................67
User Interface Translations .................................................................................................................68
Customizing the User Interface Translations ..................................................................................68
Renaming Files ...................................................................................................................................69
Installation...............................................................................................................................................70
Command Line Installation Options ....................................................................................................71
Command Line Arguments .............................................................................................................71
Setting Installer Properties on the Command Line .........................................................................73
Command Line Installation Examples .............................................................................................74
Installation Configuration Files ............................................................................................................76
Installation Configuration File Reference ........................................................................................76
Using Install Properties In Installation Configuration Files ..............................................................79
Sample Installation Configuration Files ...........................................................................................80
Network Installation.............................................................................................................................82
Configuration ..........................................................................................................................................83
Optimization ........................................................................................................................................84
Hiding Configuration From Users .......................................................................................................85
LinkOne Command Strings ....................................................................................................................86
Command String Reference ...............................................................................................................87
LinkOne WinView Technical Reference

Technical Reference Copyright


Mincom provides the following samples 'as is' and does not include any warranty, either expressed or
implied. Mincom LinkOne does not guarantee that the source code provided in these guides will work
for all situations.
We encourage all users to alter and distribute any source code and technical information in this
technical reference freely, and ask that users give feedback on new features they would like to see
included in future versions of the LinkOne development libraries.

3
LinkOne WinView Technical Reference

Technical Reference Requirements


You will need the following software installed to run these applications:
 LinkOne WinView 5.11 or later,
 Microsoft Visual Studio 2005 or later,
 Microsoft .Net Framework 2.0 or later
The examples in this manual will require that you are familiar with the Microsoft.Net framework, the C#
programming language, and the Visual Studio 2005 IDE, or a similar IDE. It is also recommended that
you are familiar with XML, Relational Database Systems, and Object Oriented Programming
principles.
Mincom does not provide support for the examples in this manual, and only limited direct support for
aiding your use of the API. But Mincom does offer consulting services to assist with integrating
LinkOne applications into your organization's infrastructure. For more information on these services
and related fees, please contact Mincom LinkOne Sales (mailto:linkone-sales@mincom.com).

4
LinkOne WinView Technical Reference

Overview
The articles in this document demonstrate the power and flexibility of LinkOne WinView and how
developers can take advantage of functionality within the LinkOne .Net development libraries and
integrate this into other applications.

5
LinkOne WinView Technical Reference

Working With Plugins


LinkOne WinView is built using a plug-in infrastructure. The advantage of this is that any developer is
able 'plug' their own applications into LinkOne WinView, listen to events, manipulate LinkOne content,
and extend functionality provided by LinkOne WinView that is valuable to their organization.
For detailed information on the LinkOne WinView API that plugins are written with, please refer to the
WinView 5.11 API Reference available on the Windows Start menu under Mincom LinkOne Winview
5.11 | WinView 5.11 API Reference.
Throughout the following plugin coding examples, you will be developing a number of small .Net
assemblies and editing the LinkOne.exe.config file. These assemblies will be loaded by LinkOne
WinView as plugins that add extra functionality to the viewer.

6
LinkOne WinView Technical Reference

Plugin Licensing
Creating a plugin for Linkone WinView requires either:
 a publisher linked plugin license, which lets your plugin work only with books from a specific
publisher (you must have a Publisher Linked Viewer license or Media Linked Viewer license for
the same publisher installed as well)
 an open plugin license, which lets your plugin work with all published books (you must have an
Open Viewer license installed as well)
Please contact your LinkOne reseller for details and associated costs of these two licenses.
Mincom can issue a plugin license when it obtains a copy of a signed plugin assembly from you.
Mincom extracts your signature from your plugin assembly and uses that signature within the plugin
license in order to differentiate your plugin from someone else's plugin.
If you have never signed an assembly, then follow the steps below:
1. use Visual Studio 2005 or later to create your first plugin from one of the coding examples in this
document
2. open up the properties window of your plugin project
3. select the Signing tab
4. select Sign the assembly option
5. select the <New..> option
6. enter a key file name, say key.snk
7. select OK and rebuild your plugin project to create the signed assembly
Once you have sent us your signed assembly, and you have received your license in return, you then
have two options on how to use it. Either:
 install your plugin with LinkOne WinView and then add your license to the licenses in the
Configuration window, or
 compile your license into your plugins.
If you choose the later method, then in your plugin projects, you will decorate your plugin classes with

[Plugin(License="......")]
public class MyPluginClass
{
}

where ...... is your plugin license.

7
LinkOne WinView Technical Reference

Plugin Development Guidelines


When developing custom plugins for use with LinkOne WinView 5.11, the following guidelines should
be followed to produce plugins.
 Plugin developers should only reference the interfaces declared in the Api assemblies. This will
ensure the best possible chance for the plugin to operate in the same manner across different
versions of LinkOne WinView 5.
So only reference the Api assemblies:
 Mincom.LinkOne.Api.dll
 Mincom.LinkOne.Provider.Api.dll
 Mincom.LinkOne.WinView.Api.dll
 Mincom.Windows.Shell.Api.dll
 Referencing explicit implementations of the Api interfaces could result in the need to re-build your
plugins with version changes in WinView.
So avoid the referencing the non-Api assemblies such as:
 Mincom.LinkOne.Dom.dll
 Mincom.LinkOne.WinView.Plugins.dll
 Mincom.LinkOne.Provider.dll
 It is not advisable to reference any of the plugin classes supplied by Mincom. Mincom can not
guarantee the behavior and signature of those plugins will not change with future versions of
LinkOne WinView.

8
LinkOne WinView Technical Reference

Using the LinkOne Dom


Ever since LinkOne WebView 2.0 was released, developers have been able to use the LinkOne
Document Object Model, commonly referred to as the Dom. The Dom is an object oriented .Net library
that represents LinkOne libraries, books, pages, pictures, parts lists, layouts, notes and all other
LinkOne information that is contained within a book. Each Dom object contains information which can
be read and used by other applications.
By including a reference to the Mincom.LinkOne.Dom assembly in your LinkOne WinView plugin
projects, you are able to 'break open' books in your LinkOne libraries and read book information with
your own code. Be aware that you will still need the necessary licenses and security keys to read any
secured book.
In the following example, we will be writing a LinkOne WinView plugin that will extract parts list
information into a CSV (Comma Separated Values) file for use in an Excel spreadsheet. As an extra
exercise, we will extract sections of an entire book into an XML file.

Overview of the Dom Library


A Dom library object represents the entire collection of content found in all of the libraries specified in
the LinkOne WinView Configuration dialog. A library can contain any number of books. Each book can
contain any number of pages, formats, notes. Each page contains pictures, parts list, and embedded
documents and notes.
LinkOne WinView ships with API (Application Programming Interface) documentation which gives
detailed information on Dom classes and how to program with them. We strongly recommend that you
refer to this when developing applications that will talk to LinkOne applications. By default, this is
available on the Windows Start menu under Mincom LinkOne Winview 5.11 | WinView 5.11 API
Reference.

Reading Parts List Entries


In this example, we want to click a custom command button and read in all information from the parts
list entries. This information will then be formatted into a CSV file so that it can be tabulated neatly into
Microsoft Excel.
There are many methods of extracting information from LinkOne, however the purpose of this example
is to quickly demonstrate how to access information inside the Linkone Dom. We encourage you to
extend this example in your own applications and experiment with different methods of extracting
information.

Creating the Plugin Project


1. Start up Visual Studio 2005 and create a new C# Windows Class Library project called
PartsListReader.
2. After the project has been created, rename the file Class1.cs to PartsListReader.cs in the Solution
Explorer. This will rename the class from Class1 to PartsListReader inside the file as well.
3. You will need to add references to .Net libraries that we will be using for this sample. Right click on
the References folder of your project and select Add References. Navigate to your LinkOne
WinView installation directory and inside the Bin folder select the following libraries:
 Mincom.LinkOne.Api
 Mincom.LinkOne.WinView.Api
 Mincom.Windows.Shell.Api

9
LinkOne WinView Technical Reference

 N.b. You will also need to add the following Microsoft .Net libraries: System.Windows.Forms

Figure 1: Adding References to Project


4. Add the following using clauses at the top of your file.

using System.IO;
using System.Windows.Forms;
using Mincom.LinkOne.Dom;
using Mincom.LinkOne.WinView.Services;
using Mincom.Windows.Shell.Services;

5. Add a Plugin attribute to the PartsListReader class to identify the class as a plugin to LinkOne.

[Plugin]
public class PartsListReader

6. Create a parameterless constructor for your class.


 When LinkOne WinView hooks up a click event to a command button, it checks to see if the
specified event handler method is a static. If the method is not static, then LinkOne WinView
will create a new instance of the class using the parameterless constructor.

public PartsListReader()
{
}

7. Create a new method called ExtractPartsList. It should accept a single argument of type object
which will be the LinkOne WinView graphical shell object passed to you, and it should not return
anything (i.e. void). Add the following code to your method:

public void ExtractPartsList( object shell )


{
IShellForm shellForm = shell as IShellForm;
if( shellForm != null )
{
IBookService bookService = (IBookService)shellForm.Services.GetService(
typeof( IBookService ) );
}
}

 The IBookService is a LinkOne WinView service that provides access to the Linkone content.
You can access the library, pages, pictures, formats, notes, etc of the currently opened book
and control the current view state of the viewer. We need to access to PageObject property
which will return the currently viewed Mincom.LinkOne.Dom.IPage object. We will then read
the parts list entries from the page and format these into a CSV file.
8. Add a new method to your class called ReadPage which returns a string and accepts a
Mincom.LinkOne.Dom.IPage object as a single argument. This method will be responsible for

10
LinkOne WinView Technical Reference

reading through the current page entries and tabulating them into CSV format. Enter the following
code into the method:

private string ReadPage( IPage page )


{
// add initial entry headings
StringBuilder csvString = new StringBuilder( "Item ID, Part Number, Description"
+ Environment.NewLine );

// append entry data to our csv string.


foreach( IEntry entry in page.Entries )
{
csvString.Append( entry.ItemId + "," + entry.PartNumber + "," + entry.Description
+ Environment.NewLine );
}
return csvString.ToString();
}

9. Now we need a method to write our CSV values to a file. In this example we will use a basic
StreamWriter object and create a temporary file on C:\. We will name the file in the following
format Publisher Code - Book Code - Page References.csv. Please note that we have not included
proper exception handling - this is only for brevity's sake. You should always follow Microsoft's
guidelines for exception handling.
10. Create a new method called WriteToCsvFile that accepts two arguments, the first being a string
named data, the second also a string named fileName. It should not return anything (i.e. void).
Enter the following code into the method:

private void WriteToCsvFile( string data, string fileName )


{
using( StreamWriter writer = new StreamWriter( @"c:\" + fileName + ".csv" ) )
{
try
{
writer.Write( data );
}
catch( IOException )
{
// ignore error for now - you should normally handle these errors.
}
}
}

11. We now need to go back to our original ExtractPartsList method and call our newly created
methods. After you have retrieved the IBookService object, add the following lines:

if( bookService.PageObject != null )


{
string entryData = ReadPage( bookService.PageObject );

// we now have our entry data, stream this to a new .csv file
string fileName = bookService.View.PublisherCode + "-" + bookService.View.BookCode
+ "-" + bookService.View.PageReference;
WriteToCsvFile( entryData, fileName );
MessageBox.Show( @"Parts list written to c:\" + fileName + ".csv" );
}
else
{
MessageBox.Show( "You must first open a page with a parts list" );
}

 Your final ExtractPartsListMethod should look like this.

public void ExtractPartsList( object shell )


{
IShellForm shellForm = shell as IShellForm;
if( shellForm != null )
{

11
LinkOne WinView Technical Reference

IBookService bookService = (IBookService)shellForm.Services.GetService(


typeof( IBookService ) );
if( bookService.PageObject != null )
{
string entryData = ReadPage( bookService.PageObject );

// we now have our entry data, stream this to a new .csv file
string fileName = bookService.View.PublisherCode + "-" +
bookService.View.BookCode + "-" + bookService.View.PageReference;
WriteToCsvFile( entryData, fileName );
MessageBox.Show( @"Parts list written to c:\" + fileName + ".csv" );
}
else
{
MessageBox.Show( "You must first open a page with a parts list" );
}
}
}

12. Your completed class file should look similar to this;

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Windows.Forms;
using Mincom.LinkOne.Dom;
using Mincom.LinkOne.WinView.Services;
using Mincom.Windows.Shell.Services;

namespace PartsListReader
{
[Plugin]
public class PartsListReader
{
/// <summary>
/// Constructor.
/// </summary>
public PartsListReader()
{
}

/// <summary>
/// Extracts a parts list into a formatted CSV file
/// </summary>
/// <param name="shell">The IShellForm containing the book that parts list
resides on.</param>
public void ExtractPartsList( object shell )
{
IShellForm shellForm = shell as IShellForm;
if( shellForm != null )
{
IBookService bookService = (IBookService)shellForm.Services.GetService(
typeof( IBookService ) );
if( bookService.PageObject != null )
{
string entryData = ReadPage( bookService.PageObject );

// we now have our entry data, stream this to a new .csv file
string fileName = bookService.View.PublisherCode + "-" +
bookService.View.BookCode + "-" + bookService.View.PageReference;
WriteToCsvFile( entryData, fileName );
MessageBox.Show( @"Parts list written to c:\" + fileName + ".csv" );
}
else
{
MessageBox.Show( "You must first open a page with a parts list" );
}
}
12
LinkOne WinView Technical Reference

/// <summary>
/// Reads page data into a csv string.
/// </summary>
/// <param name="page">The Mincom.LinkOne.Dom.IPage object to read entries
from.</param>
/// <returns>A formatted csv string containing the entry data.</returns>
private string ReadPage( IPage page )
{
// add initial entry headings
StringBuilder csvString = new StringBuilder( "Item ID, Part Number,
Description" + Environment.NewLine );

// append entry data to our csv string.


foreach( IEntry entry in page.Entries )
{
csvString.Append( entry.ItemId + "," + entry.PartNumber + "," +
entry.Description + Environment.NewLine );
}

return csvString.ToString();
}

/// <summary>
/// Writes our CSV data out to a file.
/// </summary>
/// <param name="data">The formatted csv data to write out.</param>
/// <param name="fileName">The filename of the file to write to.</param>
private void WriteToCsvFile( string data, string fileName )
{
using( StreamWriter writer = new StreamWriter( @"c:\" + fileName + ".csv" )
)
{
try
{
writer.Write( data );
}
catch( IOException )
{
// ignore error for now - you should normally handle these errors.
}
}
}
}

13
LinkOne WinView Technical Reference

Figure 2: The Visual Studio 2005 Finished Project

Hooking up the Plugin to a ToolButton


1. Copy the compiled plugin assembly (.dll) into your Bin\Plugins folder of your LinkOne WinView
installation folder.
2. We now need to hook up the plugin to a new tool button. Open your
Mincom.LinkOne.WinView.config file found in the Bin folder of your LinkOne WinView installation
folder.
3. Locate the linkone section of the configuration file, and add the following tools section inside the
layout section. Please note that this section may already exist, if it does then do not add a new
section.

<tools>
</tools>

4. You now have a section for adding customized tool buttons. Add the following tool definition inside
the tools section.

<tool type="ToolButton"
name="ExtractPartsList"
title="Send Parts List to CSV"
tooltip="Write parts list entries to csv file..."
handler="PartsListReader.PartsListReader.ExtractPartsList"
/>

14
LinkOne WinView Technical Reference

 Which should then appear like:

Figure 3: Add tools in Configuration XML


5. Save your Mincom.LinkOne.WinView.config file and start LinkOne WinView. Open the toolbar
Customize dialog, and from the Commands tab, locate your new button in the unassigned group
(since we did not add it to a category). Add it to a toolbar.

Figure 4: Adding our new ToolButton to a Toolbar

15
LinkOne WinView Technical Reference

6. Open a book and a page with some parts list information. Click you new command button, and
then you should see a message box telling you the file name and location of where it was saved.
Open this file from Windows Explorer and you will see your parts list in Microsoft Excel.

Figure 5: The final output in Microsoft Excel

Reading an Entire Book


You can now see how easy it is to inspect LinkOne content using the LinkOne Document Object
Model. We can extend this and extract entry and page information for an entire book. Open your
existing PartsListReader project and add a new class called BookXmlWriter.cs. This class will write
book information, along with all its pages and entries, out to an XML file.
1. In your new BookXmlWriter.cs class, add the following using clauses.

using System.IO;
using System.Xml;
using System.Windows.Forms;
using Mincom.LinkOne.Dom;
using Mincom.LinkOne.WinView.Services;
using Mincom.Windows.Shell.Services;

2. Add an empty constructor and a new method called ExtractBookToXml that accepts an object
named shell. Declare a variable and set it to the IShellForm and IBookService in the
ExtractBookToXmlMethod and add the following code to your method.

public BookXmlWriter()
{
}

public void WriteBookToXml( object shell )


{
IShellForm shellForm = shell as IShellForm;
if( shellForm != null )
{
IBookService bookService = (IBookService)shellForm.Services.GetService(
typeof( IBookService ) );
if( bookService != null && bookService.BookObject != null )
{
XmlDocument doc = ExtractBookToXml( bookService.BookObject );
WriteXmlToFile( doc );
MessageBox.Show( "Book successfully written to XML" );
}
else
{
MessageBox.Show( "Unable to write book to xml - no book opened" );
}
}
}

16
LinkOne WinView Technical Reference

3. We now need to implement the new method ExtractBookToXml. This method will iterate through
the book's pages and start writing out XML data to an XmlDocument. The ExtractBookToXml
method should look like the following code excerpt.

private XmlDocument ExtractBookToXml( IBook book )


{
XmlDocument bookXml = new XmlDocument();
bookXml.LoadXml( "<book/>" );
XmlElement root = bookXml.FirstChild as XmlElement;

// append attributes for book info


root.SetAttribute( "bookcode", book.BookCode );
root.SetAttribute( "bookdesc", book.BookDescription );
root.SetAttribute( "publishercode", book.PublisherCode );

// get all page information


root.AppendChild( ExtractPages( bookXml, book.Pages ) );
return bookXml;
}

4. After we have written our book information to XML, we need to get all of our pages from the book.
Page information is stored in the IBook.Pages property. We will pass this to a new method called
ExtractPages, along with our XmlDocument to extract this information. Complete the new method
with the following code.

private XmlElement ExtractPages( XmlDocument doc, IPageCollection pageCollection )


{
XmlElement pages = doc.CreateElement( "pages" );
foreach( IPage page in pageCollection )
{
XmlElement newPage = doc.CreateElement( "page" );
newPage.SetAttribute( "ref", page.Reference );
newPage.SetAttribute( "title", page.Title);
newPage.SetAttribute( "groupid", page.GroupId );
// strip off all entries in page
newPage.AppendChild( ExtractEntries( doc, page.Entries ) );
pages.AppendChild( newPage );
}
return pages;
}

5. For each page inside the book, the ExtractEntries method will extract all entries on that page. Add
the following method to complete our XML generation.

private XmlElement ExtractEntries( XmlDocument doc, IEntryCollection


entryCollection )
{
XmlElement entries = doc.CreateElement( "entires" );
foreach( IEntry entry in entryCollection )
{
XmlElement newEntry = doc.CreateElement( "entry" );
newEntry.SetAttribute( "itemid", entry.ItemId );
newEntry.SetAttribute( "partno", entry.PartNumber );
newEntry.SetAttribute( "description", entry.Description );

entries.AppendChild( newEntry );
}
return entries;
}

6. Lastly, we need a method called WriteXmlToFile which we are calling from our WriteBookToXml
method.

private void WriteXmlToFile( XmlDocument doc )


{
using( StreamWriter writer = new StreamWriter( @"c:\bookxmlwriter.xml" ) )
{
try
17
LinkOne WinView Technical Reference

{
writer.Write( doc.OuterXml );
}
catch( IOException )
{
// ignore error for now - you should normally handle these errors.
}
}
}

7. Our class now looks like the following.

using System.IO;
using System.Xml;
using System.Windows.Forms;
using Mincom.LinkOne.Dom;
using Mincom.LinkOne.WinView.Services;
using Mincom.Windows.Shell.Services;

namespace PartsListReader
{
public class BookXmlWriter
{
public BookXmlWriter()
{
}

public void WriteBookToXml( object shell )


{
IShellForm shellForm = shell as IShellForm;
if( shellForm != null )
{
IBookService bookService = (IBookService)shellForm.Services.GetService(
typeof( IBookService ) );
if( bookService != null && bookService.BookObject != null )
{
XmlDocument doc = ExtractBookToXml( bookService.BookObject );
WriteXmlToFile( doc );
MessageBox.Show( "Book successfully written to XML" );
}
else
{
MessageBox.Show( "Unable to write book to xml - no book opened" );
}
}
}

private XmlDocument ExtractBookToXml( IBook book )


{
XmlDocument bookXml = new XmlDocument();
bookXml.LoadXml( "<book/>" );
XmlElement root = bookXml.FirstChild as XmlElement;

// append attributes for book info


root.SetAttribute( "bookcode", book.BookCode );
root.SetAttribute( "bookdesc", book.BookDescription );
root.SetAttribute( "publishercode", book.PublisherCode );

// get all page information


root.AppendChild( ExtractPages( bookXml, book.Pages ) );
return bookXml;
}

private XmlElement ExtractPages( XmlDocument doc, IPageCollection


pageCollection )
{
XmlElement pages = doc.CreateElement( "pages" );
foreach( IPage page in pageCollection )
{
18
LinkOne WinView Technical Reference

XmlElement newPage = doc.CreateElement( "page" );


newPage.SetAttribute( "ref", page.Reference );
newPage.SetAttribute( "title", page.Title);
newPage.SetAttribute( "groupid", page.GroupId );

// strip off all entries in page


newPage.AppendChild( ExtractEntries( doc, page.Entries ) );
pages.AppendChild( newPage );
}
return pages;
}

private XmlElement ExtractEntries( XmlDocument doc, IEntryCollection


entryCollection )
{
XmlElement entries = doc.CreateElement( "entires" );
foreach( IEntry entry in entryCollection )
{
XmlElement newEntry = doc.CreateElement( "entry" );
newEntry.SetAttribute( "itemid", entry.ItemId );
newEntry.SetAttribute( "partno", entry.PartNumber );
newEntry.SetAttribute( "description", entry.Description );

entries.AppendChild( newEntry );
}
return entries;
}

private void WriteXmlToFile( XmlDocument doc )


{
using( StreamWriter writer = new StreamWriter( @"c:\bookxmlwriter.xml" ) )
{
try
{
writer.Write( doc.OuterXml );
}
catch( IOException )
{
// ignore error for now - you should normally handle these errors.
}
}
}
}
}

Hooking up a new ToolButton


Add your compiled plugin assembly to the Bin\Plugins folder and add a new tool button definition to
the Mincom.LinkOne.WinView.config file inside the tools section as follows.

<tool type="ToolButton"
name="ExtractBookXml"
title="Write Book to XML"
tooltip="Write book structure to xml file..."
handler="PartsListReader.BookXmlWriter.WriteBookToXml"
/>

19
LinkOne WinView Technical Reference

 Which should then appear like:

Figure 6: Add new ExtractBookXml tool


1. Add your toolbar button to the Navigation1 toolbar by adding the following XML to the tools
definition:

<toolbar name="Navigation 1" title="Navigation" dockstyle="Top" line="1"


offset="2">
<tools>
<tool name="ExtractBookXml" />
<tool name="OpenBookByBrowseTool" break="True" />

 Which should then appear like:

Figure 7: Add ExtractBookXml ToolButton to Navigation 1 Toolbar

20
LinkOne WinView Technical Reference

2. Save your Mincom.LinkOne.WinView.config file and start LinkOne WinView. Open a book and
click your new tool button on the Navigation toolbar. Open your new file from Windows Explorer
and you will see the contents of your book in XML format.

Figure 8: The Book XML in Internet Explorer

Conclusion
The LinkOne Dom library provides access to LinkOne content and it is easy to extract this information
quickly and to any file format. You could try developing an extension to these samples to write the data
from notes out to a database and use this information to keep all of the notes on your LinkOne
installations synchronized.
We encourage all LinkOne customers to harness the potential of the LinkOne Document Object Model
and the Mincom Windows Shell framework to integrate LinkOne WinView into their applications.

21
LinkOne WinView Technical Reference

Listening to LinkOne Events


The LinkOne .Net framework allows you to integrate small plugins into LinkOne WinView and actually
listen to LinkOne WinView events. Some common events to listen to are exposed on the IBookService
service and the ISelectionListService service and retrieve information on the part the user has
currently highlighted or added to the selection list. In this example we will be creating a plugin that
listens to the IBookService.ViewChanged event which is fired when the user changes the current view
(e.g. changes pages, selects a part from the parts list etc.).
When the user selects a part from the parts list, we will look for that part in our database which
contains pricing, stock and re-ordering information, and display the part data in a custom plugin that is
integrated into LinkOne WinView as a control that can be docked and floated inside the LinkOne
WinView application.

Overview of LinkOne Controls


Each control in the LinkOne WinView Shell, such as the parts list control or the pictures control,
derives from the System.Windows.Forms.Control which exposes a method for retrieving services,
including the hosting IShellForm service, and the book content supplying IBookService.
In this sample application we will create a new control that derives from
System.Windows.Forms.UserControl and handles the IBookService.OnViewChanged event which is
fired when the user views a new page, picture or item. Using the information about the currently
selected part, we can then search our database and display extra information on that part.

Creating the Custom Control


1. Create a new C# Windows Class Library project in Visual Studio 2005 called PartsListDBLookup.
2. Add the following references to your project by right clicking on the references folder in the
Solution Explorer and selecting Add References:
 Mincom.LinkOne.Api
 Mincom.LinkOne.WinView.Api
 Mincom.Windows.Shell.Api
 System.Drawing
 System.Windows.Forms
 System.Xml

Figure 9: Solution Explorer with References


3. Rename the default class Class1.cs to PartsListDBLookup.cs by right clicking on the file in the
Solution Explorer and selecting rename. This will also rename your class.
4. Add the following Attribute definitions above the class definition. These attributes tell LinkOne
WinView that we are a plugin and will automatically give us access to services that we require.

22
LinkOne WinView Technical Reference

[Plugin]
[Description( "DB Lookup" )]
public class PartsListDBLookup

5. Add the following using clauses to the class:

using System.ComponentModel;
using System.Xml;
using System.Drawing;
using Mincom.LinkOne.WinView.Services;

6. Our class also needs to inherit from UserControl. Alter the class declaration statement as shown
below. You will notice that we do not have a typical form in our designer. Instead we have a
container which holds all visual controls that we will be placing on our form later. When LinkOne
WinView loads our plugin it will display all of the container's controls inside a plugin form which
can be a tabbed or floating control in the same way as the parts control can be.

public class PartsListDBLookup : UserControl

7. Switch to Designer mode in the Visual Studio Editor so we can place our controls on the form. You
can do this by pressing Shift + F7 in the PartsListDBLookup.cs code window.
8. Add the following controls:
Type Name Properties to Change
label label1 Text = "Item ID"
label label2 Text = "Qty in Stock"
label label3 Text = "Price ($)"
label _itemId Text = ""
label _qty Text = ""
label _price Text = ""
9. Our control should look like the following:

Figure 10: Completed Form Design


10. We need to create an XML file that will contain the external part information, so add a new XML
file to our project by right clicking on the project folder, and selecting Add New Item. Select XML
File as the type of item and call it XmlDB.xml.
11. Add the following XML code to XmlDb.xml:

<parts>
<part itemid="1" price="34.23" qtyinstock="27" />
<part itemid="2" price="673.21" qtyinstock="5" />
<part itemid="3" price="4.99" qtyinstock="193" />
<part itemid="4" price="59.32" qtyinstock="41" />
<part itemid="5" price="9.79" qtyinstock="85" />
<part itemid="6" price="33.89" qtyinstock="32" />
</parts>

23
LinkOne WinView Technical Reference

 Note: We have used simple Item ID's in this example - The test book we are using has a
number of entries in the parts list that number from 1 to 5. If you wish to use this sample with
another book, you should use item id's that correspond to those in your book.

Figure 11: XmlDB.xml file contents


12. In PartsListDBLookup.cs add the following class variable:

private XmlDocument _xml = new XmlDocument();

13. Add a constructor to PartsListDBLookup.cs and add the following code:

public PartsListDBLookup()
{
if( File.Exists( @"plugins\XmlDB.xml" ) )
{
_xml.Load( @"plugins\XmlDB.xml" );
}
else
{
MessageBox.Show( @"Cannot find XML - Please place XmlDB.xml in your LinkOne
Bin\Plugins directory" );
}
InitializeComponent();
}

14. When LinkOne WinView loads each plugin, it is Sited which allows the LinkOne WinView Shell to
communicate with our plugin component. We need to override the Site property exposed by
UserControl and then get references the required services from the shell form. Add the following
property definition to your PartsListDBLookup.cs file:

/// <summary>
/// The Component Site
/// </summary>
public override ISite Site
{
get
{
return base.Site;
}
set
{
base.Site = value;
if( value != null )
{
// hook services
_shell = (IShellForm)GetService( typeof( IShellForm ) );
_bookService = (IBookService)GetService( typeof( IBookService ) );
// there must be a shell to add ourselves to when shown
if( _shell == null )
{
MessageBox.Show( "Cannot find LinkOne - shutting down" );
throw new Exception();
}
_shell.Shown += delegate( object sender, EventArgs args )
{
_shell.Panels.Add( this );

24
LinkOne WinView Technical Reference

_shell.Panels.Show( this ).Title = "Parts List Data";


};
// there must be a book service to watch view changes
if( _bookService == null )
{
MessageBox.Show( "Cannot find LinkOne bookservice - shutting down" );
throw new Exception();
}
_bookService.ViewChanged += delegate( object sender, ViewChangedEventArgs e
)
{
Synchronize( _bookService.View.EntryItemId );
};
}
}
}

15. In the property defined above, we have hooked up an anonymous method to show ourselves as a
panel in the Shells panel collection, and also set our title to be "Parts List Data". We have then
defined another anonymous method to synchronize data with our form using the current entry item
id.
16. Lastly, we need to implement our Synchronize method which will take the EntryItemId and search
for in our xml file. Alternatively, we could search for it in a database or text file. Add the following
method to your PartsListDBLookup.cs file:

private void Synchronize( string itemId )


{
if( !Visible )
{
_shell.Panels.Show( this );
}
_itemId.Text = itemId;
XmlNode node = _xml.SelectSingleNode( "//parts/part[@itemid='" + itemId + "']" );
if( node != null )
{
_price.Text = "$" + node.Attributes[ "price" ].Value;
_qty.Text = node.Attributes[ "qtyinstock" ].Value;
}
else
{
_price.Text = "Item not found...";
_qty.Text = "Item not found...";
}
}

17. In the Synchronize method we first make sure that we are visible, and if we aren't, we ask the
ShellForm to show us. We then find the correct corresponding node from our XML file and show
the part information from it. This method could also connect to a database however the goal here
is only to illustrate how to listen and respond to LinkOne events.
18. Build your project and copy the PartsListDBLookup.dll file and the XmlDB.xml file to your LinkOne
WinView Bin|Plugins folder.

The Complete Plugin Source Listing


For reference, the entire C# class PartsListDBLookup.cs is given below.

using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Xml;
using System.Drawing;
using System.Windows.Forms;
using Mincom.LinkOne.WinView.Services;

25
LinkOne WinView Technical Reference

using Mincom.Windows.Shell.Services;

namespace PartsListDBLookup
{
[Plugin]
[Description( "DB Lookup" )]
public class PartsListDBLookup : UserControl
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label _qty;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label _price;
private System.Windows.Forms.Label _itemId;
private IShellForm _shell;
private IBookService _bookService;
private XmlDocument _xml = new XmlDocument();

/// <summary>
/// Constructor.
/// </summary>
public PartsListDBLookup()
{

if( File.Exists( @"plugins\XmlDB.xml" ) )


{
_xml.Load( @"plugins\XmlDB.xml" );
}
else
{
MessageBox.Show( @"Cannot find XML - Please place XmlDB.xml in your LinkOne
Bin\Plugins directory" );
}
InitializeComponent();
}

/// <summary>
/// The Component Site
/// </summary>
public override ISite Site
{
get
{
return base.Site;
}
set
{
base.Site = value;
if( value != null )
{
// hook services
_shell = (IShellForm)GetService( typeof( IShellForm ) );
_bookService = (IBookService)GetService( typeof( IBookService ) );

// there must be a shell to add ourselves to when shown


if( _shell == null )
{
MessageBox.Show( "Cannot find LinkOne - shutting down" );
throw new Exception();
}
_shell.Shown += delegate( object sender, EventArgs args )
{
_shell.Panels.Add( this );
_shell.Panels.Show( this ).Title = "Parts List Data";
};

// there must be a book service to watch view changes


if( _bookService == null )
{
26
LinkOne WinView Technical Reference

MessageBox.Show( "Cannot find LinkOne bookservice - shutting down" );


throw new Exception();
}
_bookService.ViewChanged += delegate( object sender, ViewChangedEventArgs
e )
{
Synchronize( _bookService.View.EntryItemId );
};
}
}
}

/// <summary>
/// Syncronize entry item id data with xml data.
/// </summary>
private void Synchronize( string itemId )
{
if( !Visible )
{
_shell.Panels.Show( this );
}
_itemId.Text = itemId;
XmlNode node = _xml.SelectSingleNode( "//parts/part[@itemid='" + itemId + "']"
);
if( node != null )
{
_price.Text = "$" + node.Attributes[ "price" ].Value;
_qty.Text = node.Attributes[ "qtyinstock" ].Value;
}
else
{
_price.Text = "Item not found...";
_qty.Text = "Item not found...";
}
}

/// <summary>
/// Designer Generated Code
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this._itemId = new System.Windows.Forms.Label();
this._qty = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this._price = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point( 28, 5 );
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size( 41, 13 );
this.label1.TabIndex = 0;
this.label1.Text = "Item ID";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point( 3, 29 );
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size( 66, 13 );
this.label2.TabIndex = 1;
this.label2.Text = "Qty In Stock";
//
// _itemId
//
27
LinkOne WinView Technical Reference

this._itemId.AutoSize = true;
this._itemId.Location = new System.Drawing.Point( 77, 5 );
this._itemId.Name = "_itemId";
this._itemId.Size = new System.Drawing.Size( 0, 13 );
this._itemId.TabIndex = 2;
//
// _qty
//
this._qty.AutoSize = true;
this._qty.Location = new System.Drawing.Point( 77, 29 );
this._qty.Name = "_qty";
this._qty.Size = new System.Drawing.Size( 0, 13 );
this._qty.TabIndex = 3;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point( 23, 52 );
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size( 46, 13 );
this.label3.TabIndex = 4;
this.label3.Text = "Price ($)";
//
// _price
//
this._price.AutoSize = true;
this._price.Location = new System.Drawing.Point( 77, 52 );
this._price.Name = "_price";
this._price.Size = new System.Drawing.Size( 0, 13 );
this._price.TabIndex = 5;
//
// PartsListDBLookup
//
this.Controls.Add( this._price );
this.Controls.Add( this.label3 );
this.Controls.Add( this._qty );
this.Controls.Add( this._itemId );
this.Controls.Add( this.label2 );
this.Controls.Add( this.label1 );
this.Name = "PartsListDBLookup";
this.Size = new System.Drawing.Size( 310, 83 );
this.ResumeLayout( false );
this.PerformLayout();
}
}
}

Plugging in the control


The last thing required is to copy our plugin to the Bin\Plugins folder located in your LinkOne WinView
installation folder. When LinkOne WinView loads, it will find our plugin, call the constructor, and then
be 'sited'. Our plugin will now be able to access the LinkOne WinView Shell services.

Testing the control


We are now ready to test our control. When we start LinkOne WinView, our plugin will be created and
added to the panels of the hosting IShellForm. When we open a book, we will hook the
IBookService.ViewChanged event and check that a parts list entry has been selected. We will then use
the IBookService.View.EntryItemId to search for a corresponding entry in our xml file, read the price
and quantity information from the xml and display this in our control.
1. Start LinkOne WinView and open the book that contains matching Item ID's to those in our XML
file.
28
LinkOne WinView Technical Reference

2. You will now see our control, however no information will be displayed as we have not yet
selected an entry from the parts list.

Figure 12: Our new Control


3. If we select a part list entry, our form will look up information from our XML file, and we can see
the price and quantity information.

Figure 13: Our Control showing extra Parts Information


4. We can also make our control a dockable control by right clicking on its tab and selecting the
Dockable option.

Figure 14: Custom floating control


This example application has shown us how easy it is to create a custom plugin control that quickly
and easily integrates into LinkOne WinView. Our plugin can listen to LinkOne events enabling us to
integrate external information into the Viewer that is relative to the current information displayed in
LinkOne WinView.

29
LinkOne WinView Technical Reference

Customizing the Selection List


In this example we will be adding a custom column to the selection list and populating it with data from
an external source. This information can come from any source, be it a text file, XML file, web service
or database.
At times you might want to use the selection list to display extra parts list information instead of using a
custom plugin control. This solution is more suitable since we are only going to display a small amount
of information.

Overview of the Selection List


Typically, the selection list displays parts list information from parts that have been added to the
selection list. When a part is added, the fields in the selection list are mapped to information stored in
the parts list, book, page, picture, value notes or static text.
At times, you will want to use information available in the book to look up dynamic information from an
external source such as stock-on-hand or pricing information. While you can create a new plugin that
can hook the ISelectionListService.PartAdded event, it is not always best practice to clutter the user
interface with small panels that only display one or two pieces of information.
Instead, you can plug directly into the selection list and add information into the selection list layout
thus avoiding the need to write a new plugin. This demonstration will walk you through what's involved
in coding, testing and extending this scenario.

Creating the Selection List Plugin


To create our plugin we will be using Visual Studio 2005.

30
LinkOne WinView Technical Reference

1. Start Visual Studio and create a new C# Windows Class Library. Call your project
MySelectionListPlugin and click OK to create your project. Once the project has been created,
rename Class1.cs to MySelectionListPlugin.cs.

Figure 15: Creating the project


2. Right-click on the references folder in the Solution Explorer and click the Add Reference menu
item. Locate the following dll files in the Bin folder of your LinkOne WinView installation directory.
 Mincom.LinkOne.Api.dll - This will be used to access Selection List functionality.
 Mincom.LinkOne.WinView.Api.dll - This will allow us to access common LinkOne WinView
features.
 Mincom.Windows.Shell.Api.dll - This will allow us to plug in to the LinkOne WinView Shell.
3. Add the following using statements to the top of your class.

using System.ComponentModel;
using System.IO;
using System.Xml;
using Mincom.LinkOne.Dom.SelectionList;
using Mincom.LinkOne.WinView.Services;
using Mincom.Windows.Shell;
using System.Reflection;

4. Add the [Plugin] attribute above your class declaration. This signals to LinkOne WinView that we
are a plugin and can be loaded. Take note that all plugins must have an empty constructor.
5. Inherit from the Component class by adding : Component after your class declaration.
6. Your class should now build with no errors or warnings. If it does not, please refer to the skeletal
class below to locate any errors.

using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.IO;

31
LinkOne WinView Technical Reference

using System.Xml;
using Mincom.LinkOne.Dom.SelectionList;
using Mincom.LinkOne.WinView.Services;
using Mincom.Windows.Shell;
using System.Reflection;

namespace MySelectionListPlugin
{
[Plugin]
public class MySelectionListPlugin : Component
{
public MySelectionListPlugin()
{
}
}
}

Linking to the Data Source


Once our class has been created by LinkOne WinView it needs to initialize its data source. In the
majority of cases, this will be a database, but for the purpose of this sample we will use an XML file.
When the class is initially created, it will load the information from our XML file into an XmlDocument
object and prepare it to be queried for part information. The XML data is in the following format.

<?xml version="1.0" encoding="utf-8" ?>


<parts>
<part partnumber="1" price="99.95" soh="1000" />
...
...
</parts>

1. To load this XML information, add the following class variable.

private XmlDocument _xml = new XmlDocument();

2. Inside the constructor we will need to load the files contents into our XML document.

string selectionsDbPath = Path.Combine( Path.GetDirectoryName(


Assembly.GetExecutingAssembly().Location ), "selectionsDB.xml" );
if( File.Exists( selectionsDbPath ) )
{
_xml.Load( selectionsDbPath );
}
else
{
throw new FileNotFoundException( @"Cannot find XML - Please place selectionsDB.xml
in your LinkOne Bin\Plugins directory" );
}

Accessing LinkOne WinView Services


Previously, we inherited from the Component object which is located in the System.ComponentModel
namespace. This allows us to be treated like a pluggable component by LinkOne WinView. When we
are plugged in by LinkOne WinView we will have access to services and components running inside
LinkOne WinView, we can accomplish this when we are 'sited'. When this occurs we will gain access
to the ISelectionListService component if one is available.
1. Add the following class variable so we can keep a reference to the ISelectionListService running
inside LinkOne WinView.

ISelectionListService _selectionListService;

32
LinkOne WinView Technical Reference

2. Next, override the Site property and we will obtain a reference to the selection list service running
in LinkOne WinView.

public override ISite Site


{
get
{
return base.Site;
}
set
{
base.Site = value;
if( Site != null )
{
_selectionListService = (ISelectionListService)GetService( typeof(
ISelectionListService ) );
}
}
}

The ISelectionListService
The ISelectionListService interface exposes events and properties that can be accessed by other
plugins inside the LinkOne WinView application. When we are sited we can ask the LinkOne WinView
hosting shell to find services that may be running and then reference these from our plugin. When we
find the SelectionListService service, we will do the following:
 Add our new custom columns to the selection list.
 Hook the event for when a selection list is loaded.
 Hook the event for when a part is added to the selection list.
 Hook the event for when a part is changed within the selection list.

Hooking Selection List Events


1. To add our columns we need to declare new Dom Column objects at the class level.

Column _stockOnHandColumn = new Column( "SOH" );


Column _totalColumn = new Column( "Total" );

2. We next need to have a method called AddColumns which will check that our columns are not
currently existing in the selection list and if not, add them.

private void AddColumns()


{
// If the selection list was loaded it may already have definitions for these columns
// only add them if they don't already exist
if( !_selectionListService.CurrentSelectionList.Columns.Contains(
_stockOnHandColumn ) )
{
_selectionListService.CurrentSelectionList.Columns.Add( _stockOnHandColumn );
}
if( !_selectionListService.CurrentSelectionList.Columns.Contains( _totalColumn )
)
{
_selectionListService.CurrentSelectionList.Columns.Add( _totalColumn );
}
}

3. Next we need to call AddColumns when we are sited, and then hook our events in the setter.

set
{
33
LinkOne WinView Technical Reference

base.Site = value;
if( Site != null )
{
_selectionListService = (ISelectionListService)GetService( typeof(
ISelectionListService ) );
if( _selectionListService == null )
{
throw new Exception( "Selection List Service is not present" );
}
AddColumns();
_selectionListService.PartAdding += new PrePartEventHandler(
_selectionListService_PartAdding );
_selectionListService.PartChanged += new PostPartEventHandler(
_selectionListService_PartChanged );
_selectionListService.SelectionListLoaded += new EventHandler(
_selectionListService_SelectionListLoaded );
}
}

4. To handle our events, we have defined a number of methods. If a part is added or changed, we
need to populate our column information each time and update it. If a new selection list is loaded
however, we only need to make sure that our columns are present in the selection list.

private void _selectionListService_SelectionListLoaded( object sender, EventArgs e


)
{
AddColumns();
}

private void _selectionListService_PartAdding( object sender, PrePartEventArgs e )


{
PopulateSelectionList( e.Part );
}

private void _selectionListService_PartChanged( object sender, PostPartEventArgs e


)
{
PopulateSelectionList( e.Part );
}

Looking up IPart Information


Finally we need to look up our database, or in this case XML file and fill out added or changed part
with additional information. The code to look up our XML file for this information and populate our part
with it is given below.

private void PopulateSelectionList( IPart part )


{
if( part != null && part.Fields.Count > 0 )
{
string partNumber = part.Fields[ "Part Number" ].Value;
XmlElement node = _xml.SelectSingleNode( "//parts/part[@partnumber='" +
partNumber + "']" ) as XmlElement;
if( node != null )
{
// Get the SOH in the warehouse
part.Fields[ "SOH" ].Value = node.GetAttribute( "soh" );

// Calculate the total


string requested = part.Fields[ "Requested" ].Value;
double price = Convert.ToDouble( node.GetAttribute( "price" ) );
double total = string.IsNullOrEmpty( requested ) ? 0 : Convert.ToInt32(
requested ) * price;
part.Fields[ "Total" ].Value = total.ToString();
}
else
34
LinkOne WinView Technical Reference

{
// Just a simple message to let the user know we couldn't find the part in the
data source
part.Fields[ "SOH" ].Value = "Not Found";
part.Fields[ "Total" ].Value = "Not Found";
}
}
}

The Complete Plugin Source Listing


The entire MySelectionListPlugin class along with comments is listed below for reference.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Text;
using System.Xml;
using Mincom.LinkOne.Dom.SelectionList;
using Mincom.LinkOne.WinView.Services;
using Mincom.Windows.Shell;
using System.Reflection;

/// <summary>
/// This sample demonstrates adding user defined fields to the selection list.
/// The plugin will add stock-on-hand (soh) and a total (price * quantity) fields.
/// When a part is added to the selection list, the price and soh fields
/// are populated from an external data source (an XML file).
/// </summary>
[Plugin]
public class MySelectionListPlugin : Component
{
ISelectionListService _selectionListService;

// The columns to add


Column _stockOnHandColumn = new Column( "SOH" );
Column _totalColumn = new Column( "Total" );

private XmlDocument _xml = new XmlDocument();

/// <summary>
/// Creates an instance of the <see cref="MySelectionListPlugin"/>.
/// </summary>
public MySelectionListPlugin()
{
// Read the data
string selectionsDbPath = Path.Combine( Path.GetDirectoryName(
Assembly.GetExecutingAssembly().Location ), "selectionsDB.xml" );
if( File.Exists( selectionsDbPath ) )
{
_xml.Load( selectionsDbPath );
}
else
{
throw new FileNotFoundException( @"Cannot find XML - Please place
selectionsDB.xml in your LinkOne Bin\Plugins directory" );
}
}

/// <summary>
/// Gets or sets the site that hosts us.
/// </summary>
public override ISite Site
{
get
35
LinkOne WinView Technical Reference

{
return base.Site;
}
set
{
base.Site = value;
if( Site != null )
{
_selectionListService = (ISelectionListService)GetService( typeof(
ISelectionListService ) );
if( _selectionListService == null )
{
throw new Exception( "Selection List Service is not present" );
}
AddColumns();
_selectionListService.PartAdding += new PrePartEventHandler(
_selectionListService_PartAdding );
_selectionListService.PartChanged += new PostPartEventHandler(
_selectionListService_PartChanged );
_selectionListService.SelectionListLoaded += new EventHandler(
_selectionListService_SelectionListLoaded );
}
}
}

/// <summary>
/// Handles the selection list loaded event.
/// </summary>
private void _selectionListService_SelectionListLoaded( object sender, EventArgs
e )
{
AddColumns();
}

/// <summary>
/// Handles a part being added to the selection list.
/// </summary>
private void _selectionListService_PartAdding( object sender, PrePartEventArgs e
)
{
PopulateSelectionList( e.Part );
}

/// <summary>
/// Handles a part being changed.
/// </summary>
private void _selectionListService_PartChanged( object sender, PostPartEventArgs
e )
{
PopulateSelectionList( e.Part );
}

/// <summary>
/// Adds the columns to the selection list.
/// </summary>
private void AddColumns()
{
// If the selection list was loaded it may already have definitions for these
columns
// only add them if they don't already exist
if( !_selectionListService.CurrentSelectionList.Columns.Contains(
_stockOnHandColumn ) )
{
_selectionListService.CurrentSelectionList.Columns.Add( _stockOnHandColumn
);
}
if( !_selectionListService.CurrentSelectionList.Columns.Contains(
_totalColumn ) )
{
36
LinkOne WinView Technical Reference

_selectionListService.CurrentSelectionList.Columns.Add( _totalColumn );
}
}

/// <summary>
/// Populate our user-defined columns with data.
/// </summary>
/// <param name="part">The selection list part entry to update.</param>
private void PopulateSelectionList( IPart part )
{
if( part != null && part.Fields.Count > 0 )
{
string partNumber = part.Fields[ "Part Number" ].Value;
XmlElement node = _xml.SelectSingleNode( "//parts/part[@partnumber='" +
partNumber + "']" ) as XmlElement;

if( node != null )


{
// Get the SOH in the warehouse
part.Fields[ "SOH" ].Value = node.GetAttribute( "soh" );

// Calculate the total


string requested = part.Fields[ "Requested" ].Value;
double price = Convert.ToDouble( node.GetAttribute( "price" ) );
double total = string.IsNullOrEmpty( requested ) ? 0 : Convert.ToInt32(
requested ) * price;
part.Fields[ "Total" ].Value = total.ToString();
}
else
{
// Just a simple message to let the user know we couldn't find the part in
the data source
part.Fields[ "SOH" ].Value = "Not Found";
part.Fields[ "Total" ].Value = "Not Found";
}
}
}
}

Testing the Plugin


Once you have built our solution, copy the MySelectionListPlugin.dll file to the Bin|Plugins folder of
your LinkOne WinView installation folder. Once this is done, start LinkOne WinView and open a book
which has part numbers which match those in your XML file. Feel free to edit the XML file with
information prior to testing but ensure that you re-start LinkOne WinView as your plugin will only load
the XML file once when LinkOne WinView starts.

Figure 16: New Columns in Selection List


Once you have opened a book, add a part with a part number you know to be in the XML file and you
will notice your extra columns.

37
LinkOne WinView Technical Reference

38
LinkOne WinView Technical Reference

Automating LinkOne WinView


LinkOne WinView can be controlled by an external application via the Automation plugin. Controlling
LinkOne via the Automation plugin removes the need to write a custom plugin to perform simple tasks
within the viewer, and also removes the need to use the legacy COM control.
The Automation plugin offers a simple interface that exposes the functionality that was available
through the legacy COM control in previous versions of LinkOne WinView. This lets you query
LinkOne for predefined values, or user defined values if they exist. It also lets you interact with the
selection list, letting you query the list, update the list, clear the list, etc. Automation also allows
execution of LinkOne commands within the viewer, so that you can essentially take control of the
viewer. Finally, most events that are fired from within LinkOne can be listened to through the
Automation plugin, letting you respond to user actions.
An automation sample client application is included with Technical Reference samples.

39
LinkOne WinView Technical Reference

Remoting Configuration
Your external application will connect to LinkOne WinView using Microsoft .Net remoting, and then talk
directly to the Automation plugin. The configuration of the remoting communications for the
Automation plugin is found in the LinkOne.exe.config file, and by default, the section looks like:

<system.runtime.remoting>
<application>
<channels>
<channel ref="ipc" portName="Mincom.LinkOne.WinView">
<!--channel ref="http" port="8080"-->
<clientProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</clientProviders>
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>

You need an equivalent matching remoting configuration for any controlling client application, similar
to:

<system.runtime.remoting>
<application>
<client>
<!--wellknown type="Mincom.LinkOne.WinView.Common.Automation,
Mincom.LinkOne.WinView.Common" url="http://localhost:8080/Automation" /-->
<wellknown type="Mincom.LinkOne.WinView.Common.Automation,
Mincom.LinkOne.WinView.Common" url="ipc://Mincom.LinkOne.WinView/Automation" />
</client>
<channels>
<!--channel ref="http" port="0" -->
<channel ref="ipc" portName="Mincom.LinkOne.WinView.Client">
<clientProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</clientProviders>
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>

This default configuration is useful for controlling LinkOne WinView when it is running on the same PC
as the controlling client application. By commenting out the ipc channel tags, and uncommenting the
http channel tags, you will instantly get the ability to control LinkOne WinView over a HTTP channel
between different PCs. You can experiment with controlling multiple instances of LinkOne WinView
on the same server PC by altering the port name (ipc) or port number (http) between instances.

40
LinkOne WinView Technical Reference

Automation Reference
Connect
Method Overview
Connect to the LinkOne WinView Process.

Exceptions
RemotingException - An error trying to connect to LinkOne WinView.
TimeoutException - A connection could not be established in time.
FileNotFoundException - LinkOne WinView could not be found to start.

Method Signatures

static Automation Connect( int timeoutSeconds )


static Automation Connect( int timeoutSeconds, string applicationFileName, string
arguments )

Method Parameters
timeoutSeconds - The time to wait while trying to connect. Supplying a value of:
 less than 0, means don't start LinkOne WinView if needed
 0, means do start LinkOne WinView if needed, but don't wait for a connection
 greater than 0, means do start LinkOne WinView if needed, and then wait up until the
specified time to connect
applicationFileName - The full path where the LinkOne WinView application is found if it is to be
started, or null to use the application found in the directory this assembly is in.
arguments - The command line arguments for the LinkOne WinView application if it is to be started, or
null or empty string for no arguments.

Example

Automation automation = Automation.Connect( 30 );

Execute
Method Overview
This method executes a LinkOne command on the connected LinkOne WinView.
It is possible that a call to Execute could block with a dialog popping up on LinkOne WinView. It is
also possible that events could also be fired during the execution.

Method Signature

void Execute( string command )

Method Parameters
command - The LinkOne Command to execute, enclosed in square brackets (i.e. '[' and ']'). Please
refer to the LinkOne Command Strings reference for details of all LinkOne commands that can be
executed.

41
LinkOne WinView Technical Reference

Example

automation.Execute( "[APP.MINIMIZE]" )

GetValue
Method Overview
This method gets a named value from LinkOne WinView for the current view state. The value can be a
pre-defined value or a user defined value.

Method Signature

string GetValue( string name )

Method Parameters
name - The name of the value to return. Please refer to the Mincom LinkOne WinView 5.11 API
Reference for details of all predefined value names.

Example

string value = automation.GetValue( "BOOK_TITLE" )

SetValue
Method Overview
This method sets a named value into LinkOne WinView.

Method Signature

void SetValue( string name, string value )

Method Parameters
name - The name of the value to set. The only available name is "SELECTIONS" to set the selection
list content.
value - The value to set.

Example

string selections = automation.GetValue( "SELFILE", )


... // update selections
automation.SetValue( "SELECTIONS", selections )

HookEvent
Method Overview
This method hooks an event on LinkOne WinView and calls the given event handler.
The event handler will usually be called a background thread, so any user interface manipulation will
need to be invoked through to the foreground thread.
The event will also be received asynchronously during a call to other methods on the Automation
class. For example, during a call to
42
LinkOne WinView Technical Reference

Automation.Execute( "[Go.Direct(MyPublisherCode,MyBookCode)]")

the

BookService.ViewChanged

event will most likely fire.


The available events to hook are:

ATTENTION.CLICKED
BOOKSERVICE.CATEGORIESCHANGED
BOOKSERVICE.NOTESCHANGED
BOOKSERVICE.VIEWCHANGED
SELECTIONLISTSERVICE.PARTADDED
SELECTIONLISTSERVICE.PARTCHANGED
SELECTIONLISTSERVICE.PARTREMOVED
SELECTIONLISTSERVICE.SELECTIONLISTCLEARED
SELECTIONLISTSERVICE.SELECTIONLISTLOADED
SHELLFORM.CLOSED

Please refer to the Mincom LinkOne WinView 5.11 API Reference for details on when these events
are fired.

Method Signature

void HookEvent( string eventName, EventHandler eventHandler )

Method Parameters
eventName - The name of the event to hook.
eventHandler - The event handler to call when the event is fired on LinkOne WinView.

Example

EventHandler viewChangedHandler = Automation.CreateEventHandler(


ViewChangedHandler );
automation.HookEvent( "BOOKSERVICE.VIEWCHANGED", viewChangedHandler );

UnhookEvent
Method Overview
This method unhooks an event on LinkOne WinView that was previously hooked with a call to
HookEvent.

Method Signature

void UnhookEvent( string eventName, EventHandler eventHandler )

Method Parameters
eventName - The name of the event to unhook.
eventHandler - The event handler used in the prior call to HookEvent for the same event name.

Example

EventHandler viewChangedHandler = Automation.CreateEventHandler(


ViewChangedHandler );
automation.HookEvent( "BOOKSERVICE.VIEWCHANGED", viewChangedHandler );
...

43
LinkOne WinView Technical Reference

automation.UnhookEvent( "BOOKSERVICE.VIEWCHANGED", viewChangedHandler );

HasEvent
Method Overview
This method determines if the given event can be hooked.

Method Signature

bool HasEvent( string eventName )

Method Parameters
eventName - The name of the event to test for.

Example

bool bookServiceViewChangedEventAvailable = automation.HasEvent(


"BOOKSERVICE.VIEWCHANGED" );

CreateEventHandler
Method Overview
Creates an event handler for remoting.

Method Signature

static EventHandler CreateEventHandler( EventHandler eventHandler )

Method Parameters
eventHandler - The event handler to be called when an event is hooked with HookEvent.

Example

EventHandler viewChangedHandler = Automation.CreateEventHandler(


ViewChangedHandler );
automation.HookEvent( "BOOKSERVICE.VIEWCHANGED", viewChangedHandler );

void ViewChangedHandler( object sender, EventArgs e )


{
...
}

44
LinkOne WinView Technical Reference

LinkOne Configuration Manager


The Configuration Manager interface allows users to open a LinkOne book using equipment
identifying information that is external to LinkOne WinView. For example, a piece of equipment can be
associated with a LinkOne book allowing you to quickly navigate to the correct book which resides in a
potentially large library containing many books. A publisher might also send you new books with
updated information and you want to be able to ensure that users of LinkOne are looking at the most
up-to-date version of LinkOne content.
A configuration manager allows users wanting to integrate information from an external enterprise
management system (e.g. Mincom Ellipse, or mySAP) to associate a LinkOne book with information
from their database so they can quickly extract information from a LinkOne book and then display this
inside their enterprise management system.
The IConfigurationManager interface defines the method that LinkOne WinView communicates with
3rd party assemblies for retrieving extra part or book information. DBMan is a small optional add-on
that serves as a working example of how the IConfigurationManager interface is implemented.
In this guide, we will show you how to configure DBMan to work with your current enterprise
management system, and we will also develop our own Configuration Manager by implementing the
IConfigurationManager interface and linking it into a real relational database built in SQL Server.

45
LinkOne WinView Technical Reference

Overview of IConfigurationManager
The IConfigurationManager interface provides a link interface to the LinkOne DOM by means of three
methods; ResolveObject, ResolveLink, and ResolveItem. The purpose of each implemented method is
to dynamically link information from a database or a LinkOne book to a point in a LinkOne book.
This provides developers with a common interface which allows them to develop an adapter which
provides a bridge to send information from an external ERP/EAM system to and from LinkOne
applications.
Because the bridge allows LinkOne to receive and send information an external application can also
provide links to dynamic content inside a LinkOne book. This allows a books content to change without
the need to republish LinkOne content.

Connecting to External Systems


The IConfigurationManager allows you to create a link between information in an ERP/EAM database
and a LinkOne library. An example of where this is useful is when you want to use information that
identifies an item in your Enterprise Database to link to a particular book from a certain publisher. The
configuration manager also allows you to apply Option Filters when opening books, as well as
grouping common books together although they may be from different publishers.

Slots
A slot is a dynamic entry inside a parts list which contains a link to information that is provided from an
external source such as a database from an ERP/EAM system. When a user clicks on the entry inside
a LinkOne Viewer, instead of accessing information from the book, LinkOne will pass the request to
any component implementing the IConfigurationManager interface.
This allows the configuration manager component to determine where the slot should link to, and then
pass this information back into the Viewer to open the appropriate location, thus making it a dynamic
entry.
An example of where using slots is useful is a Materials Plant which contains a range of equipment
each of which have their own LinkOne book. A master book that describes the entire plant will contain
a number of slots for each piece of equipment inside the plant.
If a piece of equipment breaks down, for example a water pump, and a different model and type of
water pump is installed in its place, you will need to change the book location that the slot entry points
to. This information can be stored inside a database which is managed by your ERP/EAM system.
Using configuration manager you can request information about the equipment location where the
water pump resides and re-direct the link to the correct LinkOne book.

46
LinkOne WinView Technical Reference

IConfigurationManager Reference
ResolveObject
Method Overview
This method resolves a link between an object identifier (often referred to as an equipment id) and a
LinkOne book. The method can supply the publisher code, book code, page reference and filters for
the book.
If a publisher and book can be found using the object identifier the method will return the boolean
value true and all method out parameters will be populated with the values of the publisher, book,
page and filters collection. If a book cannot be found the method will return the boolean value false and
all method out parameters will be empty.

Method Signature

bool ResolveObject( string objectIdentifier, bool includeFilters, out string


publisherCode, out string bookCode, out string pageReference, out
NameValueCollection filters )

Method Parameters
objectIdentifier - The object identifier to resolve.
includeFilters - True to also return the option filters, False to ignore option filters.
publisherCode - The resolved publisher code of the object identifier.
bookCode - The resolved book code of the object identifier.
pageReference - The resolved page reference of the object identifier, or null or an empty string if there
is no specific page.
filters - The resolved filters of the object identifier, or null or an empty collection if there are no specific
filters.

ResolveLink
Method Overview
This method resolves a link between a slot on a page and an object identifier (often referred to as an
equipment id). A slot is a single entry on a page which is identified by a page reference and an item id.
If a slot can be found, then linkObjectIdentifier will be supplied and the method will return the boolean
value true. If a slot cannot be found, then the method will return the boolean value false.

Method Signature

bool ResolveLink( string objectIdentifier, string pageReference, string


itemIdentifier, out string linkObjectIdentifier )

Method Parameters
objectIdentifier - The object identifier to resolve.
pageReference - The page reference of the page that contains the item that is to be resolved.
itemIdentifier - The item id of the item to be resolved.
linkObjectIdentifer - The equipment code of the resolved item.

47
LinkOne WinView Technical Reference

ResolveSlot
Method Overview
This method dynamically substitutes cross reference links on a slot in a LinkOne book. A slot
represents a unique item on a page and is identified by a page reference and an item id. The method
looks at where the component (in this case a linked entry on a page) links to, and if the component slot
that is linked to exists, then the method will supply linkObjectIdentifier.
If the linked component can be found, then linkObjectIdentifier will be supplied and the method will
return true. If the linked component cannot be found, then method will return false.

Method Signature

bool ResolveSlot( string objectIdentifier, string slotIdentifier, out string


linkObjectIdentifier )

Method Parameters
objectIdentifier - The object identifier that the component belongs to.
slotIdentifier - The slot identifier where the component links to.
linkObjectIdentifier - The object identifier the slot links to.

48
LinkOne WinView Technical Reference

DBMan
DBMan is an example implementation of the IConfigurationManager interface which uses CSV files as
a database to store configuration manager data.
In this release we have included DBMan pre-compiled along with full source. You will find both listed
as optional features when you select to perform a Custom installation. Your can look through the
DBMan source code and we encourage you to customize it to suit your business needs.
Due to the open architecture of the latest LinkOne Viewers and the supplied development libraries we
are encouraging all users of DBMan to use the IConfigurationManager interface to leverage the power
of the LinkOne development framework and closely couple their existing Enterprise Systems with
LinkOne Viewers directly.

The DBMan Database


DBMan uses a number of CSV files that combine to make a small database which can be used by an
external program to link external information to information stored inside a LinkOne library, book or
item - this information is referred to as an equipment ID. DBMan also facilitates grouping information in
your enterprise system and using these groups to search particular libraries and books - this is
commonly referred to as an equipment class.
The Database is broken up into five tables which correspond directly to five CSV files. Each row in a
table corresponds to a row in the CSV file, and each column the CSV file corresponds to a column in
the database.

BOOK Table
Overview
The book table relates an equipment class or id to a book or page inside a library.

Fields
Field Name Required Description
Object Yes The equipment ID or the equipment class (which is a
foreign key reference the CLASS table).
Publisher Yes The publisher code of the book which contains
Code information about the equipment ID or class.
Book Code Yes The book code of the book which contains information
about the equipment ID or class.
Reference No The page reference of the page which contains
information about the equipment ID or class.

Example
Assume that we have two equipment classes, one called TRUCK for all trucking equipment and one
called EARTH for all earth moving equipment. We will also use equipment id's CRANE, ENGINE1,
ENGINE2 and ENGINE3 for direct links to books containing information about engine types.
Our CSV file would look something like the following:

TRUCK,KOMATSU,KOM-TRUCK
EARTH,KOMATSU,KOM-EARTH,REF-EARTH01
CRANE,KOMATSU,KOM-CRANE
ENGINE1,KOMATSU,BK_E1
ENGINE2,KOMATSU,BK_E2

49
LinkOne WinView Technical Reference

ENGINE3,KOMATSU,BK_E3

CLASS Table
Overview
The class table creates a relationship between an equipment class and an equipment ID. This allows
you to create a relationship between a class and a book in the BOOKS table, and refer to this book
from more than one equipment ID.

Fields
Field Name Required Description
Equipment Id Yes The equipment ID which will belong to the equipment
class.
Equipment Yes The equipment class which is related to the equipment
Class ID.

Example
Assume that we have an equipment class called TRUCK for all trucking equipment and another class
called EARTH for all earth moving equipment. We can assign a number of equipment codes to each
class. Our CSV file will look something like the following:

BIGTRUCK,TRUCK
SMALLTRUCK,TRUCK
MEDTRUCK,TRUCK
BIGEXCAVATOR,EARTH
SMALLEXCAVATOR,EARTH
BOBCAT,EARTH

Notice that we have now created a link between an equipment ID and a book by using the equipment
class to look up the book in the BOOK table.

OPTION Table
Overview
The option table allows you to define option filters for an equipment class or ID. When a book is
opened via an equipment class or ID, its option filters from this table will be applied. Where a piece of
equipment has a class, both the equipment ID and equipment class option filters are selected, with
precedence given to the equipment ID option filters if a value is set for the same option filter.

Fields
Field Name Required Description
Object Yes The equipment ID or the equipment class to apply the
option filter to.
Option Filter Yes The name of the option filter to apply the value to.
Value Yes The value to apply to the option filter.

Example
Assume that we have an equipment class called TRUCK for all trucking equipment and an option filter
CNTRY which determines the country that a part number applies to, along with the default option
filters SN and PSN. Our CSV file would look something like the following:

TRUCK,SN,4400
50
LinkOne WinView Technical Reference

TRUCK,PSN,4000
CRANE_AUS,CNTRY,AUS
CRANE_USA,CNTRY,USA
CRANE_JPN,CNTRY,JPN
CRANE_SMALL,SN,6593

SLOT Table
Overview
The slot table allows you to define a dynamic link from an item in a book, which is exchangeable for a
different item. An example would be a truck that has a parts list entry called engine which is a link to
another book containing information about that engine. Because the truck can have a number of
different engines each with their own LinkOne book, a slot is defined on the engine entry and will
determine which engine book the link will point to. When a different engine is used in the truck, the slot
can be updated and the correct book will be displayed when following the link from the parent truck
book to the engine part list entry link.
Whenever a book is opened via the equipment ID or class in the Object field and a link is followed
from the parts list, this table will be checked to see if a slot exists on the current part entry.

Fields
Field Name Required Description
Object Yes The equipment ID or the equipment class which will be
used for the slot.
Slot Name Yes The unique name for the slot.
Page Yes The page reference of the page that contains the link
Reference origin.
Item Id Yes The item id of the item that contains the link origin.

Example
Assuming that we have an equipment class called TRUCK for all trucking equipment and we want to
map the engine entry in page reference 5 on item id 12. Our CSV file would look something like the
following:

TRUCK,TRUCK_ENGINE,PGREF5,12

COMPONENT Table
Overview
The component table defines information about a slot that is defined in the SLOT table. When an entry
link is followed from LinkOne, DBMan will look up the component table to check the equipment ID or
class that contains link information about where to link to. This information is then used to find the
publisher code, book code, and page reference from the BOOK and CLASS tables. A link will be
constructed and the viewer will be forwarded to the final link location.

Fields
Field Name Required Description
Object Yes The equipment ID or the equipment class that the slot
belongs to.
Slot Name Yes The unique name for the slot.

51
LinkOne WinView Technical Reference

Component Yes The equipment ID that is used to look up the link


location from the BOOK and CLASS tables.

Example
In this example below, a user has clicked on a slot TRUCK_ENGINE which resides on item ID 12 from
page reference PGREF5 in the book from the TRUCK class. DBMan will now look for ENGINE3 in the
BOOK table and link to the KOMATSU book with book code BK_E3.

TRUCK,TRUCK_ENGINE,ENGINE3

Database Diagram of DBMan


This diagram models the DBMan database and the relationships between each table.

Figure 17: The DBMan Database

52
LinkOne WinView Technical Reference

Dynamic Derived Books


A Derived Book is a sub-set of another LinkOne book (base book). The derived book consists of
references to pages in the base book. Usually a publisher would create a derived book by creating a
BOOK.INF file with these references listed.
A Dynamic Derived Book is a derived book implemented as a .Net Assembly. When the LinkOne
WinView finds an assembly file called book.net.dll in the same folder as a LinkOne book, it binds to it
and calls that assembly, which dynamically creates and supplies the contents of a BOOK.INF file as
XML.
LinkOne WinView passes several inputs to the book.net assembly. The assembly then acts on these
inputs and creates and returns a book.inf image in XML format. This image is then built into a book by
LinkOne and treated it as if it was a standard derived book.
In this manner a publisher can supply one generic book (the base book) and one .NET assembly that
creates smaller books derived from the base book. The derived books can be based on data supplied
by LinkOne, or data stored in the same folder as the assembly or anywhere else that the assembly
knows how to access. The assembly could also request information from the user, by displaying a
suitable user dialog.

53
LinkOne WinView Technical Reference

The Book Structure


The following folder and file structure describes the layout of LinkOne base book, and its related
Dynamic Derived book. The Base Book Folder contains a standard LinkOne book, which would
normally be built by LinkOne Publisher as either a Single File book, or a Multiple File book. The
Dynamic Derived Book Folder contains the book.net.dll assembly and any supporting files that may be
required by the assembly:

Publisher-Directory
- MAN.DEF
- Base Book Folder
- BOOK.DEF
- BOOK.BBI
- *.PIX
- *.ILG
- *.BLI
- Dynamic Derived Book Folder
- BOOK.DEF
- book.net.dll
- Publisher Specific Data Files

54
LinkOne WinView Technical Reference

Book.Net.dll Assembly Requirements


For LinkOne WinView 5 to open the dynamic derived book, book.net.dll must be a Microsoft .Net
assembly.
The assembly must expose at least one method (PrepareBook) as a public method and one property
(BookXml) as a public property in a class called DynamicDerivedBookProvider in the Mincom.LinkOne
namespace. The structure of this class is important because LinkOne WinView will attempt to access
methods inside Book.Net assembly based upon the namespace, class name, method name, and
property name.

55
LinkOne WinView Technical Reference

Book.Net Methods
DynamicDerivedBookProvider
Overview
The DynamicDerivedBookProvider class must contain a public constructor with no arguments.
LinkOne WinView will use this constructor to create a DynamicDerivedBookProvider instance.

Signature

public DynamicDerivedBookProvider()

Parameters
None.

PrepareBook
Overview
This method will attempt to prepare the book based upon publisherCode, bookCode, pageReference,
itemId, currentPublisherCode, currentBookCode and filters parameters passed to the method. The
assembly can then use these values to create a dynamic derived book, for example through user
interaction or database interaction, which can be used by LinkOne WinView. The method will return
an integer value describing the result of the preparation.

Signature

public int PrepareBook( string publisherCode, string bookCode, string pageReference,


string itemId, string currentPublisherCode, string currentBookCode, string filters,
string languageCode )

Parameters
publisherCode The publisher code of the wanted book.
bookCode The book code of the wanted book.
pageReference The page reference of the wanted page.
itemId The item id of the wanted item.
currentPublisherCode The publisher code of the current book.
currentBookCode The book code of the current book.
currentFilters The current filters.
The filters are comma delimited, the format of each filter is
FilterName:FilterValue:FilterType:FilterScope:FilterAccess.
For more information on the formatting of the filters see
Mincom.LinkOne.Dom.FilterCollection in the LinkOne WinView
API documentation.
languageCode The language code of the current file provider's library.

56
LinkOne WinView Technical Reference

Return Type
int The return type signifies the outcome of preparing the book.
The return value can be:
 0 if the book was prepared successfully.
 1 if loading the book failed.
 2 if the loading was aborted by the user.

BookXML
Overview
The BookXml property will get the book XML for the derived book. LinkOne WinView will access this
property only after it has called PrepareBook() and if that call was successful in preparing a derived
book. The string that is returned must be properly formatted XML, which is then parsed by LinkOne
into a derived book.

Sample Output

<?xml version='1.0' encoding='utf-8'?>


<book publishercode="PUBA" bookcode="BOOKA"
publisherdescription="The publisher Description" bookdescription="The book
description">
<includedpages>
<page bookcode="Master" pagereference="PageX" />
</includedpages>
<optionvalues>
<optionvalue name="OptionName" value="OptionValue" />
</optionvalues>
<licenses>
<license value='123-456' />
<license value='456-789' />
</licenses>
<attributes>
<attribute name='BookAttribute1' value='Value' />
<attribute name='BookAttribute2'>
Value 2 as inner text
</attribute>
</attributes>
</book>

57
LinkOne WinView Technical Reference

Example DynamicDerivedBookProvider Class


The following is an example of the basic structure of the DynamicDerivedBookProvider class:

using System;

namespace Mincom.LinkOne
{
/// <summary>
/// Summary description for DynamicDerivedBookProvider.
/// </summary>
public class DynamicDerivedBookProvider
{
/// <summary>
/// Constructor.
/// </summary>
public DynamicDerivedBookProvider ()
{
//
// TODO: Add constructor logic here
//
}

#region Required Book.Net Methods

/// <summary>
/// Prepare the Dynamic Derived Book
/// </summary>
/// <param name="publisherCode">The publisher code of the wanted book.</param>
/// <param name="bookCode">The book code of the wanted book.</param>
/// <param name="pageReference">The wanted page.</param>
/// <param name="itemId">The wanted item.</param>
/// <param name="currentPublisherCode">The wanted publisher code.</param>
/// <param name="currentBookCode">The current book code.</param>
/// <param name="currentFilters">The currently applied filters.</param>
/// <returns>
/// The outcome of preparing the book, LinkOne expected values are:<br/>
/// 0 for success<br/>
/// 1 for failure<br/>
/// 2 for aborted.<br/>
/// </returns>
public int PrepareBook(
string publisherCode,
string bookCode,
string pageReference,
string itemId,
string currentPublisherCode,
string currentBookCode,
string currentFilters )
{
//
// TODO: Add PrepareBook Logic here
//
}

/// <summary>
/// Gets the book xml.
/// </summary>
public string BookXml
{
get
{
//
// TODO: add return string here.
//
}
}
58
LinkOne WinView Technical Reference

#endregion
}
}

59
LinkOne WinView Technical Reference

Changes from Book32.dll to Book.Net.dll


The architecture of dynamic derived books has changed significantly between LinkOne version 4
Dynamic Derived Books and LinkOne Version 5 Dynamic Derived Books. Major changes are:
1. Book.Net is a Microsoft .Net assembly instead of Windows 32-bit Dynamic Linked Library.
2. Parameters are passed into Book.Net instead of a structure that can be modified.
3. The number of parameters Book.Net is able to be passed has been reduced. The Book32.dll
structure that was passed had parameters that are now redundant in LinkOne version 5.
4. LinkOne no longer passed a global handle to the LinkOne Options. Instead PrepareBook() takes
the filters as a string (generated from a Mincom.LinkOne.Dom.FilterCollection) that represents the
current filters. If the dynamic derived book needs different filters, they are now to be defined in
the return book XML.

60
LinkOne WinView Technical Reference

Book.Net Sequence Diagram


This is a sequence diagram of the calls to and from Book.Net from the LinkOne WinView application
when a request for a resource from a Dynamic Derived Book is made.

Figure 18: UML Sequence Diagram

61
LinkOne WinView Technical Reference

Re-branding LinkOne WinView


LinkOne WinView provides users with the ability to customize the viewer allowing them to integrate it
into their own applications quickly and easily. LinkOne WinView now provides further flexibility for
customers who wish to re-brand LinkOne WinView for distribution to their own customers.
In these examples we will look at:
 Customizing the splash screen
 Changing the configuration and document directories
 Customizing phrases on the forms
 Renaming files

62
LinkOne WinView Technical Reference

The Splash Screen


The LinkOne splash screen can be customized to display different text and background image.
There are eight properties on the About plugin that determine the text, text location, and background
image that will be displayed on startup and in the About window.

Figure 19: The Default Splash Screen and its Customizable Components

Each component is explained in more detail in the following table.

No Component Configuration Keys Customization Notes


Text Location

1 Image imagefile You can replace the image by supplying:


 an absolute path
e.g. C:\myimage.jpg
e.g. \\server\share\myimage.png
 a path relative to the LinkOne.exe
folder
e.g. myimage.gif
e.g. ..\images\myimage.bmp
You can also use environment variables in
this path.
The splash screen and About window will
resize themselves to accommodate the
images dimensions.
If the image file can't be loaded then the
image will be left blank.

63
LinkOne WinView Technical Reference

2 Version version versionlocation The text value that is placed inside the
configuration file will replace '{versiontext}'
in the image above. The 'Version' text in
the image above is static and cannot be
changed.
3 File Version fileversionlocation The content can't be customized.
4 Status statuslocation The content can't be customized.
5 Copyright copyright copyrightlocation The text value that is placed inside the
configuration file will replace
'{copyrighttext}' in the image above.
6 Copyright copyrightlegallocatio The content can't be customized.
Legal n
Company company Not shown on the About dialog or splash
screen, but used elsewhere in the product.
Product product Not shown on the About dialog or splash
screen, but used elsewhere in the product.
Icon iconfile Not shown on the About dialog or splash
screen, but used elsewhere in the product.
You can replace the product icon by
supplying:
 an absolute path
e.g. C:\myicon.ico
e.g. \\server\share\myicon.ico
 a path relative to the LinkOne.exe
folder
e.g. myicon.ico
e.g. ..\icons\myicon.ico
You can also use environment variables in
this path.
If the icon file can't be loaded then the icon
will be left blank.

Customizing the Splash Screen


The Mincom.LinkOne.WinView.config configuration file is located in the bin directory of your LinkOne
WinView installation directory. This file contains all of the default settings that are used when LinkOne
WinView runs. To customize the Splash and About screens you will need to add entries to the
mincom.linkone\winview\plugins\about section of the configuration file.

64
LinkOne WinView Technical Reference

The following is an example customized About screen:

Figure 20: Example Custom Splash Screen


The configuration file section for the example is as follows:

<mincom.linkone>
<winview>
....
<plugins>
<about>
<imagefile value="myimage.png" />
<version value="1.0" />
<copyright value="(C) 2006 My Company" />
<versionlocation value="140,10" />
<fileversionlocation value="140,35" />
<copyrightlocation value="140,50" />
<copyrightlegallocation value="999,999" />
</about>
</plugins>
...
</winview>
</mincom.linkone>

65
LinkOne WinView Technical Reference

Customizing the Configuration File Locations


By default, the configuration files are stored in two areas of the Documents and Settings folder on your
computer.
The configuration file which contains settings that are shared by all users is found in the following file.
These settings can only be altered by an administrator.

C:\Documents and Settings\All Users\Application Data\Mincom\LinkOne


WinView\5.11\user.config

The configuration file which contains settings for the individual user is found in the following file.
These are settings that an administrator has not locked down.

C:\Documents and Settings\<username>\Application Data\Mincom\LinkOne


WinView\5.11\user.config

<username> is the current users login name.


These file names can be changed by editing the LinkOne.exe.config file, found in the bin folder of your
LinkOne WinView installation folder.
If you want to place the configuration in ..\OurCompany\OurProduct instead of ..\Mincom\LinkOne
WinView\5.11 you will need to add the following XML to LinkOne.exe.config:

<add key="PrivateConfigurationFile"
value="%appdata%\OurCompany\Product\user.config" />
<add key="PublicConfigurationFile" value="%allusersprofile%\Application
Data\OurCompany\Product\user.config" />

The value string will also be resolved for any environment variables (e.g. %appdata%).

66
LinkOne WinView Technical Reference

Customizing the Document Folder Locations


LinkOne WinView uses common documents folders for loading and saving such things as Layouts,
Selection List Definitions, Selection List Layouts, and Notes.
These documents folders are rooted to two folders. The first folder relates to all users (public
documents) and is the following default.

C:\Documents and Settings\All Users\Documents\LinkOne

The second folder relates to the individual user (private documents) and is the following default.

C:\Documents and Settings\<username>\My Documents\LinkOne

<username> is the current users login name.


These folders can be changed by editing the LinkOne.exe.config file, found in the bin folder of your
LinkOne WinView installation folder.
If you want to make the document root folders in ..\OurProduct instead of ..\LinkOne you will need to
add the following XML to LinkOne.exe.config:

<add key="PrivateDocumentsDirectory" value="%userprofile%\My Documents\OurProduct"


/>
<add key="PublicDocumentsDirectory"
value="%allusersprofile%\Documents\OurProduct" />

The value string will also be resolved for any environment variables (e.g. %appdata%).

67
LinkOne WinView Technical Reference

User Interface Translations


LinkOne WinView can be run in one of 16 languages. WinView will identify the best language to run
in when it starts. Alternatively, you can override the chosen language by use the -lc command line
argument like:

LinkOne.exe -lc <language-region>

The supported language-region codes are:


 da-dk (Danish)
 de-de (German)
 en-us (English-US)
 es-es (Spanish)
 fi-fi (Finnish)
 fr-ca (French-Canada)
 fr-fr (French)
 it-it (Italian)
 ja-jp (Japanese)
 ko-kr (Korean)
 nb-no (Norwegian-Bokmal)
 nl-nl (Dutch-Netherlands)
 pt-br (Portuguese-Brazil)
 ru-ru (Russian)
 sv-se (Swedish)
 zh-cn (Chinese-China)
For example, to start WinView in French Canadian, use:

LinkOne.exe -lc fr-ca

The -lc command line argument must be the first argument specified after LinkOne.exe.
If you require LinkOne WinView in a language that was not listed above, please contact us to discuss
the options.

Customizing the User Interface Translations


If there are minor changes to the labels, titles, phrases, etc that you require, then LinkOne WinView
supports a simple external look-up file for these changes.
When you choose the Technical Reference Samples option during installation, a translation file named
All.Mincom.LinkOne.WinView.translations can be found in the bin folder of your LinkOne WinView
installation folder. This file lists all phrases that can be translated.
The intention is that you create a new file named Mincom.LinkOne.WinView.translations, and copy into
it those phrases from the All.Mincom.LinkOne.WinView.translations file that you want to customize.
This new file should then be put in either the bin folder (to apply for any language), or the sub-folder
for the language you are customizing. When LinkOne WinView starts, it will probe for this file in the
following locations and order:
1. <installation-folder>\bin\<language-region>\Mincom.LinkOne.WinView.translations
2. <installation-folder>\bin\<language>\Mincom.LinkOne.WinView.translations
3. <installation-folder>\bin\Mincom.LinkOne.WinView.translations
Once the file has been located, LinkOne WinView stops searching. It does not merge further
translation files if they exist.

68
LinkOne WinView Technical Reference

Renaming Files
When re-branding LinkOne WinView, it is common to rename files to names that correspond to those
of your organization. The table below lists the files that can be renamed when re-branding. The default
installation directory is C:\Program Files\Mincom\LinkOne WinView\5.11. All locations in the table
below are given with respect to the installation folder.

Filename Location Description


LinkOne.exe \Bin The main LinkOne executable to start
LinkOne WinView.
LinkOne.exe.conf \Bin The configuration for the executable. This file
ig contains information about application
configuration settings and where these will be
stored. This file should be named exactly as
the original LinkOne executable is with the
'.config' extension appended to it.
Important: You should not rename any of the .dll files nor should you rename
Mincom.LinkOne.WinView.config as this will cause LinkOne to fail when loading.
Important: You should not rename LinkOne.exe or LinkOne.exe.config if you are using the legacy
COM interface, because it will specifically look for LinkOne.exe.config for startup configuration.

69
LinkOne WinView Technical Reference

Installation
Mincom LinkOne WinView 5.11 uses Microsoft Installer technology for its install process. The
installation program is a multi-lingual application which includes modify, repair, redundancy checking
and command line support.

70
LinkOne WinView Technical Reference

Command Line Installation Options


While the Mincom LinkOne WinView install can be initiated by simply starting it as a normal application
without any command line parameters, it also supports the inclusion of various command line
arguments. This is particularly useful when initiating the install to run under the following conditions:
 Silent install - used to minimise or prevent the number of dialogs that are displayed during the
install process.
 Distributive install - typically used in medium to large corporations where the IT group push an
install onto all or a selection of corporate machines.
 Installing custom settings - used when custom settings need to be applied to the LinkOne
configuration, such as setting specific scheme options, adding licenses, configuring corporate
libraries, etc.
 Setting public installer properties - such as a different default install location or the default features
to install.

Command Line Arguments


The following tables define the command line arguments that can be specified for a Mincom LinkOne
WinView install. The Mincom LinkOne WinView install program uses Microsoft Installer technology,
which launches a separate process called MsiExec.exe to perform the install tasks. Any arguments
for the MsiExec.exe process must be specified with the /v switch.

/a Option
Causes WinView511.exe to perform an administrative installation. An administrative installation
copies (and uncompresses) data files to a directory specified by the user, but it does not create
shortcuts, register COM servers, or create an uninstallation entry in the Add/Remove programs list.

/j Option
Causes WinView511.exe to perform an advertised installation. An advertised installation creates
shortcuts, registers COM servers, and registers file types, but does not install your product's files until
the user invokes one of these

/x Option
Causes WinView511.exe to uninstall a previously installed product.

/s Option
Suppresses the WinView511.exe initialization window only. The Installation user interface will still be
shown. To prevent any user interface from being shown, run the command line WinView511.exe /s
/v/qn.

/v Option
Passes options to the Msiexec.exe process that WinView511.exe creates to run the embedded MSI
install program.
The following table lists commonly used MsiExec.exe command line arguments that may be used in
the context of a Mincom LinkOne WinView installation. For a complete list of the MsiExec.exe
command Line arguments, please search the Microsoft web site.

71
LinkOne WinView Technical Reference

/l Writes logging information into a log file at the specified existing path. The path to the
log file location must already exist, but the file will be created if it does not exist. Flags
indicate which information to log. If no flags are specified, the default is 'iwearmo.'

The flags have the following meanings:


i - Status messages.
w - Nonfatal warnings.
e - All error messages.
a - Start up of actions.
r - Action-specific records.
u - User requests.
c - Initial UI parameters.
m - Out-of-memory or fatal exit information.
o - Out-of-disk-space messages.
p - Terminal properties.
v - Verbose output.
x - Extra debugging information. Only available on Windows Server 2003.
+ - Append to existing file.
! - Flush each line to the log.
"*" - Wildcard, log all information except for the v and x options. To include the v and x
options, specify "/l*vx".
/q Sets the User Interface level to show the user.

The user interface level can be one of the following values:


q or qn - No user interface.
qb - Basic user interface. Use qb! to hide the Cancel button.
qr - Reduced user interface with no modal dialog box displayed at the end of the
installation.
qf - Full user interface and any authored fatal error, user exit or exit modal dialog boxes
at the end.
qn+ - No user interface except for a modal dialog box displayed at the end.
qb+ - Basic user interface with a modal dialog box displayed at the end. The modal box
is not displayed if the user cancels the installation. Use qb+! or qb!+ to hide the Cancel
button.
qb- - Basic user interface with no modal dialog boxes. Please note that /qb+- is not a
supported user interface level. Use qb-! or qb!- to hide the Cancel button.

/l Option
Users can use the /L option with the decimal language ID to specify the language used by a
multi-language installation program. For example, the command to specify German is
WinView511.exe /L1031
Language codes supported in Mincom LinkOne WinView include:
Language Language Code
Chinese (Simplified) 2052
Danish 1030
Dutch 1043
English 1033

72
LinkOne WinView Technical Reference

Finnish 1035
French (Canada) 3084
French (France) 1036
German 1031
Italian 1040
Japanese 1041
Korean 1042
Norwegian 1044
Portuguese (Brazil) 1046
Russian 1049
Spanish 1034
Swedish 1053

Setting Installer Properties on the Command Line


One of the benefit of using Microsoft Windows Installer technology in the Mincom LinkOne WinView
install gives us access to a number of Name-Value pairs called properties. Properties are used to
store and control the install process. They exist as either public or private properties. Public
properties have an all uppercase name, while any property with a lowercase character in its name is a
private property.
It is sometimes useful to specify public install properties on the command line. A common example is
to specify a custom Installation Configuration file to use during the install. Another example is to
specify an alternative default install location, or to identify a different default feature set to install. This
is particularly important when a silent install is being performed. Only public properties can be
specified on the command line. Specifying a private property on the command line will not change
the property value during the install process as would be expected.
To set a property on the command line use the following syntax: PROPERTY=Value. in the context of
the /v command line switch. If you wanted to change the value of COMPANYNAME, you would enter:

WinView511.exe /v”COMPANYNAME=\”Mincom Pty Ltd\””

The following table is a list of common public install properties that might be used in the context of a
LinkOne installation. Note that property names are case sensitive
INSTALLDIR This is the target folder when LinkOne WinView will be installed by
default. If not specified, it defaults to the \Mincom\LinkOne
WinView\5.11\ folder within the Program Files folder structure. The user
can change this value in the install user interface. Alternatively, a new
value can be specified on the command line by providing a new folder for
the INSTALLDIR property. It is typically used for silent installs.
COMPANYNAME This is the name of the company to show in the install user interface. If
not specified on the command line, the install gets the value from the
operating system.
USERNAME This is the name of the user to show in the install user interface. If not
specified, the install gets the value of the currently logged on user from
the operating system.
ALLUSERS This property defines if the installation if for All Users or only the current
user. If set to 1 it is for all users. If set to blank, it is only for the current
user.

73
LinkOne WinView Technical Reference

L1SETTINGSFILE This is the path and name of the Installation Configuration file to use
during the install.
L1DISABLESHORTC Specifies that LinkOne menu shortcuts should not be created by the
UTS install. This is useful when LinkOne is integrated with another system,
which will provide the access to the application files.
ADDLOCAL The ADDLOCAL property identifies a list of all the features that are to be
installed locally on the machine. It can either contain the value ALL, or
a comma separated list of the feature names.
Feature names include:
WinView
TechnicalReference
Samples
COMControl
COMControlSample
DBMan
DBManSource
EllipseIntegration
Specifying a feature, selects that feature and its parents to be installed.

Command Line Installation Examples


The following command line installs Mincom LinkOne WinView silently, using the default target and
feature set.

WinView511.exe /s /v”/qn”

The following command line silently installs WinView and the COM Control, using a custom target
folder.

WinView511.exe /s /v"/qn ADDLOCAL=WinView,COMControl INSTALLDIR=\"C:\Corporate


Products\Mincom\""

A good way to test if the command line arguments will have the right effect is the specify them with out
the /s and /qn arguments. This will allow the user interface to display and allow you to confirm that
the correct properties have been set. For example if you specify the following command line
arguments, then you would expect to see John Smith as the user name, Global Limited as the
company name and the install will default to current user for the install type.

WinView511.exe /v”COMPANYNAME=\”Global Limited\” USERNAME=\”John Smith\”


ALLUSERS=\”\””

To generate a log file of the installation process, saving the log file to C:\Temp Files\WinView.log, use
the following command line:

WinView511.exe /v”/l* \”C:\Temp Files\WinView.log\””

Note that in the above example, the C:\Temp Files\ folder must already exist. If the WinView.log file
does not exist, it will be created, and if it does exist, it will be overwritten.
To specify additional configuration settings to apply during the installation, such as adding licenses, or
library locations, create an Installation Configuration file, and specify the name of the file in the
L1SETTINGSFILE property, as shown in the following example:

WinView511.exe /v”L1SETTINGSFILE=\”C:\Custom Settings.xml\””

The following example is the accumulation of all the above examples:


74
LinkOne WinView Technical Reference

WinView511.exe /s /v”/qn /l* \”C:\Temp Files\WinView.log\”


ADDLOCAL=WinView,COMControl INSTALLDIR=\"C:\Corporate Products\Mincom\"
COMPANYNAME=\”Global Limited\” USERNAME=\”John Smith\” ALLUSERS=\”\”
L1SETTINGSFILE=\”C:\Custom Settings.xml\””

75
LinkOne WinView Technical Reference

Installation Configuration Files


During the LinkOne install a default configuration is applied to the installed LinkOne application. The
default configuration is suitable for most users, and after installation only requires the user to specify a
license and point to a library of books, to have a fully operational LinkOne application. In some
instances, particularly in corporate environments, it may be useful to automatically set the License and
Library information at install time, negating the manual steps required by the user. This can be done
with the aid of an installation configuration file.
Installation configurations files are XML files that describe the settings to be applied to target
configuration files at install time. The target files are also expected to XML configuration files. You
cannot use installation configuration files to modify text of .INI configuration files.

Installation Configuration File Reference


Installation Configuration files use XML elements and attributes to define the requirements. The
element names and attributes are defined below. Note that both element and attribute names are
case sensitive, and must be specified in lower case characters.

<configeditor> Element
This is the root element of the installation configuration file.
The <configeditor> element indicates the root node of the installation configuration file. There can be
only one instance of this element in the configuration file.
Attributes: None
Possible parent elements: None (Root element)
Possible child elements: <changeset>

<changeset> Element
A <changeset> element defines a set of actions that must be applied to a specific target configuration
file, and the context upon which they should be applied. Change sets are useful for isolating one
group of changes from another, or for applying one set of changes only during an install process, while
a different set might only be applied during an uninstall process. Additionally, a change set could be
related to a specific installation feature. There can be many change sets in a configuration file, acting
on a combination of different target files or the same target file.
Attributes:
filename The filename of the target configuration file to apply the settings to. If not
specified, the change set is ignored. If the target file and folder do not exist, then
they will be created automatically.
Action Adding - indicates that the change set should only be applied when settings are
being added.
Removing - indicates that the change set should only be applied when settings are
being removed.
If not specified the default is adding.
condition True - this is an optional condition that can be used to indicate if the change set
should be applied. If not specified, the change set is applied. If specified, it must
be set to true or use a property that may have a value of true. Any other value
indicates false, and the changeset will not be applied. This is useful when you
only what the change set applied when a specific installation feature is installed or
uninstalled.

76
LinkOne WinView Technical Reference

Possible parent elements: <configeditor>


Possible child elements: <set> <remove>

<set> Element
The <set> element identifies the target configuration file node that must be modified. If the target
node does not exist, then it is automatically created, including any missing parent nodes. Other <set>
elements can be nested inside parent <set> elements to further identify the specific node to modify.
This allows changes in the child set element to be scoped to that element only.
Attributes:
xpath The XPath string which identifies the target configuration node to operate on. If the
target node is not found, then it is automatically created. If the element is a child of
a parent <set> element, then the xpath should not repeat the parents xpath
component. It should only include the additional component.
For example,
<set xpath=”mincom.linkone/winview”>
<set xpath=”forms/selectbook”>
<set xpath=”publishercode” />
</set>
<set xpath=”plugins/recentbooks” />
</set>
identifies 4 set references where:
the first set refers to xpath=”mincom.linkone”;
the second set refers to xpath=”mincom.linkone/forms/selectbook”
the third set refers to xpath=”mincom.linkone/forms/selectbook/publishercode”
the forth set refers to xpath=”Mincom.linkone/winview/plugins/recentbooks”
The xpath is a required attribute. If not specified, then the set is ignored.
The xpath attribute uses standard XML XPath syntax, and can also include attribute
and value references. Refer to the Microsoft XML specification for more information
Possible parent elements: <changeset>, <set>
Possible child elements: <set>, <attribute>, <value>, <xml>

<remove> Element
The <remove> element identifies the target configuration file nodes that must be removed if they exist.
Attributes:
xpath The XPath string which identifies the configuration node to remove. Only that node
and child nodes can be removed. Any parent nodes will not be removed, unless
explicitly specified in their own <remove> element.
The xpath is a required attribute. If not specified, then the remove is ignored.
The xpath uses standard XML XPath syntax, and can also include attribute and value
references. Refer to the Microsoft XML specification for more information
when Always - indicates that the target node if found should always be removed, even if it
includes child nodes.
Empty - indicates that the target node should only be removed if it does not include
any child nodes.
Possible parent element: <set>
Possible child element: None

77
LinkOne WinView Technical Reference

<attribute> Element
The <attribute> element is used to create, modify or delete an attribute of a target node in the context
of the current set element.
Attributes:
name The name of the attribute of the target element to set or remove. This is a required
attribute. If not specified, then the attribute element is ignored. The <attribute>
element requires either the value and/or remove attribute also be specified,
otherwise the element is ignored.
value The value of the attribute of the target element to set.
remove True - indicates that the attribute should be removed. Any other value indicates that
the attribute should remain. Can be used with installer properties to conditionally
remove a target attribute.
Possible parent element: <set>
Possible child element: None

<value> Element
The <value> element is used to create or modify the value associated with a target node in the context
of the current set element. If multiple value elements are specified in the same set context, then only
the last value is applied. The value of the <value> element is the value that will be applied as the
value of the target node.
Attributes: None
Possible parent element: <set>
Possible child element: None

<xml> Element
The <xml> element is used to identify a block of XML that should be copied to the target node
identified in the context of the current set. The XML to copy is enclosed in the <xml> elements, and
can include installer properties that are resolved at install time.
Attributes:
action Append - indicates that the enclosed xml should be appended to any existing xml in
the target file at the element specified in the current set context.
Prepend - indicates that the enclosed xml should be inserted before any existing xml
in the target file at the element specified in the current set context.
Replace - indicates that the enclosed xml should replace any existing xml in the
target file at the element specified in the current set context.
If not specified, the default action is to append the xml.
Possible parent element: <set>
Possible child element: None

78
LinkOne WinView Technical Reference

Using Install Properties In Installation Configuration Files


A significant benefit of installation configuration files is that installer properties can be specified in
them, allowing the configuration file to use values from the installer at the time of applying the
configuration settings. An example is using the user settings folder, while not actually knowing who
the user is. Property names are used by specifying them in curly {} braces. Both public and private
properties can be used in the Installation Configuration file. Just before any settings are applied, the
entire installation configuration file is checked and any property names (including the curly braces) are
replaced with their property values.
For example, if the following properties are defined as:
L1DataFolder = C:\Documents and Settings\John\Application Data\Mincom\LinkOne
WinView\5.11\
L1DataFileName = user.config
Then the following configuration file segment:

<changeset filename=”{L1DataFolder}{L1DataFileName}”>

Would be translated into:

<changeset filename=”C:Documents and Settings\John\Application Data\Mincom\LinkOne


WinView\5.11\user.config”>

It is useful to first run the install and capture the install log to get a list of all the properties that are
available during the install process. The available properties are typically listed towards the end of
the log files as either 'Property(C)' client properties or 'Property(S)' server properties. The installation
configuration file is applied during the install process, and in the context of server properties, therefore
only server properties should be referenced in the installation configuration files. Most client
properties are also available as server properties.
The following table lists a selection of installer properties that are useful with Installation Configuration
files:
L1CommonDataFolder
The path to the 'All Users' LinkOne configuration folder for the version of LinkOne being installed.
So for version 5.11 on Windows XP this would be:
'C:\Documents and Settings\All Users\Application Data\Mincom\LinkOne WinView\5.11\'
L1DataFolder
The path to the current users LinkOne configuration folder for the version of LinkOne being
installed. So for a user named John installing version 5.11 on Windows XP, this would be:
'C:\Documents and Settings\John\Application Data\Mincom\LinkOne WinView\5.11\'
L1DataFileName
This is the name of the configuration file that would be located in the above paths, typically
'user.config'
INSTALLDIR
INSTALLDIR.EF142472_A861_4D34_B822_3C7F5BFBBD28
The path to the installation folder of the version of LinkOne being installed. So for a default
installation of version 5.11 on Windows XP, this would be:
'C:\Program Files\Mincom\LinkOne WinView\5.11\'
BIN
BIN.EF142472_A861_4D34_B822_3C7F5BFBBD28
The path to the installation Bin folder of the version of LinkOne being installed. So for a default
installation of version 5.11 on Windows XP, this would be:
'C:\Program Files\Mincom\LinkOne WinView\5.11\Bin\'

79
LinkOne WinView Technical Reference

PLUGINS.EF142472_A861_4D34_B822_3C7F5BFBBD28
The path to the installation Plugins folder of the version of LinkOne being installed. So for a
default installation of version 5.11 on Windows XP, this would be:
'C:\Program Files\Mincom\LinkOne WinView\5.11\Bin\Plugins\'
L1AddWinViewMM.EF142472_A861_4D34_B822_3C7F5BFBBD28
This property equals 'True' when the LinkOne feature is selected for installation, or blank when
not selected for installation.
L1RemoveWinViewMM.EF142472_A861_4D34_B822_3C7F5BFBBD28
This property equals 'True' when the LinkOne feature is selected for uninstallation, or blank when
not selected for uninstallation.
L1AddCOMControlMM.DD86978A_1CD4_4699_94A3_8299EAF11E76
This property equals 'True' when the LinkOne COM Control feature is selected for installation, or
blank when not selected for installation.
L1RemoveCOMControlMM.DD86978A_1CD4_4699_94A3_8299EAF11E76
This property equals 'True' when the LinkOne COM control feature is selected for uninstallation,
or blank when not selected for uninstallation.
L1AddDBManMM.23683AA4_79FE_49CC_8999_4A28DEB353E1
This property equals 'True' when the LinkOne DBMan feature is selected for installation, or blank
when not selected for installation.
L1RemoveDBManMM.23683AA4_79FE_49CC_8999_4A28DEB353E1
This property equals 'True' when the LinkOne DBMan feature is selected for uninstallation, or
blank when not selected for uninstallation.
L1AddEllipseMM.84BE8020_1EF6_40BC_AA89_5A443A2C7296
This property equals 'True' when the LinkOne Ellipse Integration feature is selected for
installation, or blank when not selected for installation.
L1RemoveEllipseMM.84BE8020_1EF6_40BC_AA89_5A443A2C7296
This property equals 'True' when the LinkOne Ellipse Integration feature is selected for
uninstallation, or blank when not selected for uninstallation.

Sample Installation Configuration Files


The following sample installation configuration file would install a linkOne license against the current
user. The {L1DataFolder} and {L1DataFileName} identifiers refer to installer properties that will be
resolved at installation time and substituted with real values. The sample uses the xml element to
copy its contents into the mincom.linkone/winview/services/bookservice/licenses element, replacing any
existing content in the licenses element.

<configeditor>
<changeset filename="{L1DataFolder}{L1DataFileName}" action="adding">
<set xpath="mincom.linkone/winview/services/bookservice/licenses">
<xml action="replace">
<license id="7317cc3d53604541b37871d15f8efb2d" licensee="Dummy License"
type="ViewerLicense" version="5." issued="20070321"
signature="amaHqboIdROtvQY3vpwoxJ0Bg/VWjufmkufbekynreDmLZHVZI85sOFVsrVDX4v6LkK37
9FC3yOWe3gWhdSK73igsC0SO22wI2Ql0XmWJa1Ik+NVLSH63m6XrQOKBhpa73BAdO5GvO0qAjfSkP3qb
h2HkBtJnq8yQ8+C5XGptBM35M=" restriction="Open" />
</xml>
</set>
</changeset>
</configeditor>

The following example removes a MyPlugin entry in the plugin configuration and updates it with new
plugin details.
80
LinkOne WinView Technical Reference

<configeditor>
<changeset filename="{L1DataFolder}{L1DataFileName}" action="adding">
<!-- Remove any previous instance of MyPlugin control -->
<remove
xpath="mincom.linkone/winview/shell/plugins/plugin[@type='MyCompany.MyPlugin.MyC
ontrol, MyPlugins']" when="always" />
<!-- Update plugins configuration -->
<set xpath="mincom.linkone/winview/shell/plugins">
<!-- Enable the tracer control -->
<set xpath="plugin[@type='Mincom.LinkOne.WinView.Controls.Tracer,
Mincom.LinkOne.WinView.Plugins']">
<attribute name="disable" remove="true" />
</set>
<!-- Add MyPlugin control -->
<set xpath="plugin[@type='MyCompany.MyPlugin.MyControl, MyPlugins']">
<attribute name="disable" value="False" />
</set>
</set>
</changeset>
</configeditor>

81
LinkOne WinView Technical Reference

Network Installation
Mincom LinkOne WinView 5.11 can be installed to a network location. When following the install
wizard, choose a custom configuration and change the target directory to the desired network location.

82
LinkOne WinView Technical Reference

Configuration

83
LinkOne WinView Technical Reference

Optimization
Mincom LinkOne WinView 5.11 memory usage can be optimized by configuring the maximum allowed
cache memory allocation. To optimize the cache memory usage, add the following to the configuration
element in the linkone.exe.config file located in the bin folder of the Mincom LinkOne WinView 5.11
installation:

<system.web>
<caching>
<cache percentagePhysicalMemoryUsedLimit="20"/>
</caching>
</system.web>

The percentagePhysicalMemoryUsedLimit attribute may be configured to best suite the end users'
requirements. The example above allows a 20% maximum allowable usage of the users' physical
memory for the Mincom LinkOne WinView 5.11 cache.
Note: The percentagePhysicalMemoryUsedLimit setting does not limit the total amount of memory used
for the whole linkone application, merely the amount used for caching frequently accessed data.
Note: When Mincom LinkOne WinView 5.11 is run from a network location and memory is optimized
using the above configuration setting, the user must ensure the the Microsoft .Net Code Access
Security settings for the network location allow the full execution of Managed applications. For more
information regarding the management of Microsoft .Net Code Access Security settings please see
http://msdn.microsoft.com/en-us/library/930b76w0(VS.80).aspx

84
LinkOne WinView Technical Reference

Hiding Configuration From Users


At times you may want to hide configuration nodes on the Configuration window on Tools >
Configuration. Each of these nodes can hidden individually by specifying the name of the node to hide
in the Mincom.LinkOne.WinView.config file found in the bin folder. By adding one or entries from the
<page> config entries below to the config file, the associated configuration node will be hidden in the
Configuration window.

<mincom.linkone>
<winview>
<plugins>
<configuration>
<pages>
<page value="~Mincom.LinkOne.WinView.Configure.ConfigurePlugins" />
<page value="~Mincom.LinkOne.WinView.Configure.ConfigureLicenses" />
<page value="~Mincom.LinkOne.WinView.Configure.ConfigureCommonLicenses"
/>
<page value="~Mincom.LinkOne.WinView.Configure.ConfigureLayouts" />
<page value="~Mincom.LinkOne.WinView.Configure.ConfigureNotes" />
<page value="~Mincom.LinkOne.WinView.Configure.ConfigureNoteDefaults"
/>
<page value="~Mincom.LinkOne.WinView.Configure.ConfigureLayoutPaths" />
<page
value="~Mincom.LinkOne.WinView.Configure.ConfigureInternetConnection" />
<page value="~Mincom.LinkOne.WinView.Configure.ConfigureContent" />
<page value="~Mincom.LinkOne.WinView.Configure.ConfigureNotesPaths" />
<page value="~Mincom.LinkOne.WinView.Configure.ConfigureProvider" />
<page value="~Mincom.LinkOne.WinView.Configure.ConfigurePrint" />
<page value="~Mincom.LinkOne.WinView.Configure.ConfigureSearchSet" />
<page value="~Mincom.LinkOne.WinView.Configure.ConfigureSelectionList"
/>
<page
value="~Mincom.LinkOne.WinView.Configure.ConfigureSelectionListPaths" />
<page
value="~Mincom.LinkOne.WinView.Configure.ConfigureConfigurationManager" />
<page value="~Mincom.LinkOne.WinView.Configure.ConfigureParts" />
<page value="~Mincom.LinkOne.WinView.Configure.ConfigurePictures" />
<page value="~Mincom.LinkOne.WinView.Configure.ConfigureStartup" />
<page value="~Mincom.LinkOne.WinView.Configure.ConfigureRecentBooks" />
<page value="~Mincom.LinkOne.WinView.Configure.ConfigureCaption" />
<page value="~Mincom.LinkOne.WinView.Configure.ConfigureHistory" />
<page value="~Mincom.LinkOne.WinView.Configure.ConfigurePosition" />
<page value="~Mincom.LinkOne.WinView.Configure.ConfigureShell" />
</pages>
</configuration>
</plugins>
<winview>
<mincom.linkone>

85
LinkOne WinView Technical Reference

LinkOne Command Strings


LinkOne WinView 5 supports a number of commands which can automate the LinkOne Viewer via a
Legacy COM interface or within the viewer from commands embedded into a LinkOne WinView HTML
page.
Each command string must be enclosed within brackets (i.e. "[" and "]") to be read successfully. There
are a number of commands which were available in LinkOne WinView 4 but were never implemented
correctly and these have been deprecated for version 5.
Please note that we strongly discourage the use of these commands via the Legacy COM interface,
and encourage use of the new LinkOne .Net libraries because they provide more functionality. The
Legacy COM interface has been deprecated and no further development will take place for future
versions.

86
LinkOne WinView Technical Reference

Command String Reference

Command [APP.ACTIVATE]
Arguments None
Description Sets focus to the LinkOne WinView window.

Command [APP.EXIT]
Arguments None
Description Causes LinkOne WinView to immediately terminate and exit. If there are
unsaved selections you will be asked if you wish to save these.

Command [APP.MAXIMIZE]
Arguments None
Description Maximizes the LinkOne WinView window.

Command [APP.MINIMIZE]
Arguments None
Description Minimizes the LinkOne WinView window to the taskbar.

Command [APP.RESTORE]
Arguments None
Description Restores the LinkOne WinView window from a minimized status.

Command [ATTENTION( action, label )]


Arguments action
 Determines if command button is enabled or disabled. Use ENABLE
to enable the button or DISABLE to disable it.
label
 Determines the caption text on the command button. Default value is
blank.
Description Enables or disables the blank command button.
Even if you have enabled the blank command button, it will have no
function unless an COM client application does an Advise or Request of
the ATTENTION or SEL&ATTN items.
Example [ATTENTION(enable,caption)]
This will enable the command button and the caption text will be 'caption'.

87
LinkOne WinView Technical Reference

Command [AUTO.QUERY(object, slot, allow_selections, force_generic,


retain_superseded, pic_when_icon)]
Arguments object
 The equipment number or equipment class code in the Configuration
Manager’s database. Default is None.
slot
 The Slot code for the slot in the equipment, as specified in the
Configuration manager’s database. Default is No specific slot.
allow_selections
 TRUE or FALSE; Determines if LinkOne WinView will allow parts to
be added to the selection list. Default is True.
force_generic
 TRUE or FALSE; Determines if LinkOne WinView will suppress the
application of Option Filters relevant to the specific equipment.
Default is True.
retain_superseded
 TRUE or FALSE; Determines if LinkOne WinView will show
superseded parts. Default is FALSE.
pic_when_icon
 No longer has any effect.
Description Opens the book for a specific piece of equipment, or for an equipment
class. The Configuration Manager component must be in use for this to
work correctly.
If a slot is specified, LinkOne WinView will then follow the Link for the Slot
in the equipment (as specified by the Configuration Manager’s database).
Example [AUTO.QUERY(42201,,TRUE)]
This will display book for object 42201 and enable selections.

Command [APP.WINDOWPOS(left,top,width,height,z-order)]
Arguments left
 Determines the location of the left edge of the LinkOne WinView
window.
top
 Determines the location of the top edge of the LinkOne WinView
window.
width
 Determines the width in pixels of the LinkOne WinView window.
height
 Determines the height in pixels of the LinkOne WinView window.
z-order
 Determines the z-order of the window.
Description Determines the position and size of the LinkOne Viewer on the Display
Monitor.
Example [APP.WINDOWPOS(10,10,50,100,1)]
This will place the LinkOne WinView window at the location 10,10 on the
Windows Desktop with a width of 50 pixels and height of 100 pixels. It will
be placed in the foreground of the desktop.

88
LinkOne WinView Technical Reference

Command [BACKUP]
Arguments None
Description Executes the navigate back command button.

Command [CLEAR.SEL]
Arguments None
Description Clears all entries in the selection list.

Command [COPY.SEL]
Arguments None
Description Copies all entries in the selection list to the Windows Clipboard in
tabulated format.

Command [CUT.SEL]
Arguments None
Description Copies all entries in the selection list to the Windows Clipboard in
tabulated format and deletes them from the selection list.

89
LinkOne WinView Technical Reference

Command [DIRECT.QUERY(publisher, book, page_reference, item_id,


allow_selections, retain_superseded, pic_when_icon)]
Arguments publisher
 The publisher code for the desired book. Default is the publisher code
of the book currently opened.
book
 The book code of the book to be opened. Default is the book code of
the book currently opened.
page_reference
 The reference code of the desired List. Default is the table of contents
page.
item_id
 The item id of the item to be highlighted in the parts list. Default is
empty.
allow_selections
 TRUE or FALSE; Determines if the allow selections option is
switched on or off. Default is TRUE.
retain_superseded
 TRUE or FALSE; Determines if superseded parts will be shown in
the parts list. Default is FALSE.
pic_when_icon
 No longer has any effect.
Description Opens a book at a specified location.
If a page reference is given, the book is opened at that page, otherwise it
is opened to the table of contents page or first page.
If an item id is specified, then that item will be highlighted in the parts list.
If you specify a DIRECT.QUERY with both the manufacturer and book
empty, it will open the Select Books dialog.
Example: [DIRECT.QUERY(KDC,PC220-6,,,TRUE)] displays the book for
KDC PC220-6 and enables selections.
Example [DIRECT.QUERY(KOMATSU,D355A-3,toc,,TRUE,FALSE,)]
This will open the Komatsu D355A-3 Bulldozer book to the table of
contents and allow selections to be made. No entry in the parts list will be
highlighted.

Command [EDIT.SEL]
Arguments None
Description Selects the first editable field in the selection list and allows it to be
edited.

90
LinkOne WinView Technical Reference

Command [EXPORT.SEL(filename, format)]


Arguments filename
 The path and filename to write the selection list entries to.
format
 The format to write the entries in; can be TAGGED, TEXT, or CSV.
Description Write the Selection List to the specified file in the specified format.
Note: If you wish to export the selections to a .sel file (Selection List File
format) then use the [SAVE.SEL(file)] command.
Example [EXPORT.SEL( c:\temp\mysellist.csv, csv)]
This will export the current selection list to a file located in c:\temp in csv
format called mysellist.csv.

Command [FILTER.SET(option, value)]


Arguments option
 The option filter name.
value
 The new value of the option filter.
Description Sets the specified option filter with the specified value as a temporary
filter. Both arguments are case in-sensitive.
An unknown option code or irrelevant value will be ignored.
Setting a value for an existing option code will over-write the existing
value for that option code.
Attempts to set the value for a permanent option code will be ignored.
Example [FILTER.SET(myfilter,111)]
This will set the temporary filter named 'myfilter' to 111.

Command [FLOAT.NAV(float)]
Arguments None
Description This command is no longer supported.

91
LinkOne WinView Technical Reference

Command [GOTO.DIRECT(publisher, book, page_reference, item_id)]


Arguments publisher
 The publisher code for the desired book. Default is the publisher code
of the book currently opened.
book
 The book code of the desired book. Default is the book code of the
book currently opened.
page_reference
 The reference code of the desired List. Default is the table of
contents.
item_id
 The item id of the item to be highlighted in the parts list. Default is
empty.
Description Displays the specified page. If the specified book is not open, it will be
opened.
If a page reference is specified, the corresponding parts list is opened,
otherwise the table of contents page is opened.
If an item id is specified, then the entry with that item id on the page will
be highlighted.
Example [GOTO.DIRECT(KOMATSU, D355A-3,,)]
This will open the Komatsu D355A-3 Bulldozer book to the table of
contents page.

Command [GOTO.BOOKMARK(publisher, book, bookmark)]


Arguments publisher
 The publisher code for the desired book. Default is the publisher code
of the book currently opened.
book
 The book code of the desired book. Default is the book code of the
book currently opened.
bookmark
 The name of the bookmark to go to.
Description Opens a book via bookmark that is located within a book. If the bookmark
specifies an item this will be highlighted in the parts list.
Example [GOTO.BOOKMARK(MYPUB,MYBOOK,MYBOOKMARK)]
This will open the bookmark named MYBOOKMARK located in MYBOOK
published by MYPUB and then open where the bookmark points to.

Command [HIGHLIGHT.ITEM(item)]
Arguments item
 The item id of the parts list item to be highlighted.
Description Highlights the specified item in the parts list.
Example [HIGHLIGHT.ITEM(5)]
This will highlight the item number 5 in the parts list if it exists.

92
LinkOne WinView Technical Reference

Command [MORE]
Arguments None
Description Runs the 'More' command button function.

Command [NEXTPAGE]
Arguments None
Description Runs the 'Next Page' command button function.

Command [NEW.SEL]
Arguments None
Description Clears the existing selection list entries and creates a new blank selection
list.

Command [NOTE.VIEW(name, x, y)]


Arguments name
 The name of the note you wish to view.
x
 The x-coordinate of the top left edge of the note view dialog. Default
is 0.
y
 The y-coordinate of the top left edge of the note view dialog. Default
is 0.
Description Views note details. The note is identified by the name argument. This
only works for text notes and will display the note at the specified x,y
location with respect to the LinkOne WinView window.
Example [NOTE.VIEW(mynote,5,5)]
This will open the text note 'mynote' at the location 5,5 on the Windows
Desktop.

Command [OPEN.SEL(filename)]
Arguments filename
 The path and filename to the .sel file to open
Description Opens the selection list file and loads its contents into the selection list.
Example [OPEN.SEL(c:\temp\newsel.sel)]
This will open the selection list from the c:\temp folder\newsel.sel file.

Command [PREVPAGE]

Arguments None
Description Runs the 'Previous Page' command button function.

93
LinkOne WinView Technical Reference

Command [PRINT.BOOK( showDialog )]


Arguments showDialog
 Determines if the print dialog is shown. If NODLG is supplied then the
default print settings will be used and no dialog will be shown.
Description Prints the currently opened book.
Example [PRINT.BOOK(nodlg)]
This will print the entire book without showing the print dialog.

Command [PRINT.DRAWING( showDialog )]


Arguments showDialog
 Determines if the print dialog is shown. If NODLG is supplied then the
default print settings will be used and no dialog will be shown.
Example [PRINT.DRAWING(nodlg)]
This will print the current drawing without showing the print dialog.

Command [PRINT.PAGE( showDialog )]


Arguments showDialog
 Determines if the print dialog is shown. If NODLG is supplied then the
default print settings will be used and no dialog will be shown.
Description Prints the currently displayed page including all pictures and parts lists.
Example [PRINT.PAGE(nodlg)]
This will print the current page without showing the print dialog.

Command [PRINT.LIST( showDialog )]


Arguments showDialog
 Determines if the print dialog is shown. If NODLG is supplied then the
default print settings will be used and no dialog will be shown.
Description Prints the currently displayed parts list.
Example [PRINT.LIST(nodlg)]
This will print the current parts list without showing the print dialog.

Command [PRINT.SEL( showDialog )]


Arguments showDialog
 Determines if the print dialog is shown. If NODLG is supplied then the
default print settings will be used and no dialog will be shown.
Description Prints the current selection list entries.
Example [PRINT.SEL(nodlg)]
This will print the current selection list without showing the print dialog.

94
LinkOne WinView Technical Reference

Command [PRINT.ZOOMED( showDialog )]


Arguments showDialog
 Determines if the print dialog is shown. If NODLG is supplied then the
default print settings will be used and no dialog will be shown.
Description Prints the current zoomed area of the picture.
Example [PRINT.ZOOMED(nodlg)]
This will print the current zoomed area of the picture control without
showing the print dialog. If no zoomed area exists, the entire picture will
be printed.

Command [SAVE.PICTURE]
Arguments None
Description Opens a Save Picture dialog allowing the user to save the current picture
to a file.

Command [SAVE.SEL]
Arguments None
Description Saves the selection list to the current selection list file.

Command [SAVE.SEL.AS(filename)]
Arguments filename
 The path and filename of the file to save the selection list contents to.
Description Saves the selection list to the selection list file supplied and sets this file
to the current selection list file for further save commands.
Example [SAVE.SEL.AS(c:\temp\newsel.sel)]
This will save the current selection list to newsel.sel in the c:\temp folder.
Any further changes that are saved will be saved to this file.

95
LinkOne WinView Technical Reference

Command [SEARCH(set, search, multi, do, goto, key1, exact1, match1, key2, exact2,
match2, multi-pub, multi-books, save-file, save-flags, category-code)]

96
LinkOne WinView Technical Reference

Arguments set
 The name of the search set to be used. Use DEFAULT_SEARCHES,
or blank for the default search set.
search
 The name of the search within the search set to be used.
multi
 0 = perform a single book search (default). 1 = performs a multi-book
search.
do
 0 = do not execute the search (default). 1 = execute the search
immediately.
goto
 0 = only show the search results (default). 1 = go to the first found
search result.
key1
 The value for key1 of the search.
exact1
 0 = key1 may be a partial match (default). 1 = key1 must be an exact
match.
match1
 0 = key1 may match upper or lower case (default). 1 = key1 must
match on case.
key2
 The value for key2 of the search. This is only valid for a multi-key
search.
exact2
 0 = key2 may be a partial match (default). 1 = key2 must be an exact
match.
match2
 0 = key2 may match upper or lower case (default). 1 = key2 must
match on case.
multi-pub
 Deprecated and ignored - Must be left blank.
multi-books
 Deprecated and ignored - Must be left blank.
save-file
 Valid only when the search has been executed, i.e. “do=1” (optional).
Specifies the name of the file to which the search results will be
saved.
save-flags
 Specifies the actions to take when saving the search results
(optional). May be one or more of the following strings, combined with
a “+”. ALL, LOCN, APPEND, CLOSE e.g. ALL+CLOSE
category-code
 The category used to restrict multi-book searches to a set of books in
a category (optional).
Multi-book search must also be specified, i.e. “multi=1”.
 The category is listed as an entry in the book.def file:
CAT,PUB,category
or is listed as an entry in the book.lst file:
book,bookdescription,category
The books chosen for searching will belong to the specified category
and its sub-categories, e.g. specifying CategoryA will choose all
books in CategoryA and CategoryA\CategoryAA and 97
CategoryA\CategoryAB, etc.
 If the category does not exist, the search will default to a normal
multi-book search and choose all books of the current publisher.
LinkOne WinView Technical Reference

Description Displays the LinkOne Search dialog which is populated with the current
following settings as supplied in the arguments.

Command [SELECT]
Arguments None
Description Runs the 'Select' command button function and adds the currently
selected entry in the parts list to the selection list if this action can be
performed.

Command [SELECT.FITTED]
Arguments None
Description Runs the 'Select Qty Fitted' command button and adds the currently
selected entry in the parts list to the selection list using the 'Qty Fitted'
function.

Command [SELECTIONS.FLOAT(x, y, w, h)]


Arguments x
 The x-coordinate of the top left edge to float the selection list at.
y
 The y-coordinate of the top left edge to float the selection list at.
w
 The width of the floated selection list control.
h
 The height of the floated selection list control.
Description Switches the selection list to a floating window pane positioned at the
supplied coordinates.
Example [SELECTIONS.FLOAT(5,5,100,500)]
This will float the selection list at the location 5,5 with a width of 100
pixels and 500 pixels wide in relation to the Windows Desktop.

Command [SELECTIONS.DOCK]
Arguments None

Description Docks the selection list control to the main LinkOne WinView shell.

Command [SELECTIONS.HIDE]
Arguments None

Description Hides the selection list control. To open it again, the user can go to the
View menu and check the Selections option.

Command [SELECTIONS.REFRESH]
Arguments None

Description Deprecated. This command no longer performs any function.

98
LinkOne WinView Technical Reference

Command [SELECTIONS.SHOW]
Arguments None

Description Shows the selection list control if the control is previously hidden.

Command [TOOLBAR.DOCK(toolbar-name)]
Arguments toolbar-name
 The name of the toolbar. This is the name of the toolbar as seen in
the customize tools dialog.
Description Docks the toolbar to the top edge of the window.
Example [TOOLBAR.DOCK(navigation)]
This will dock the Navigation toolbar to the top of the LinkOne WinView
application window.

Command [TOOLBAR.HIDE(toolbar-name)]
Arguments toolbar-name
 The name of the toolbar. This is the name of the toolbar as seen in
the customize tools dialog.
Description Hides the toolbar. The toolbar can be shown again by right clicking on
another toolbar and selecting the hidden toolbar from the menu list.
Example [TOOLBAR.HIDE(navigation)]
This will hide the Navigation toolbar.

Command [TOOLBAR.FLOAT(toolbar-name, x, y, w, h)]


Arguments toolbar-name
 The name of the toolbar. This is the name of the toolbar as seen in
the customize tools dialog.
x
 The x-coordinate of the top left edge to float the toolbar at.
y
 The y-coordinate of the top left edge to float the toolbar at.
w
 The width of the floated toolbar.
h
 The height of the floated toolbar.
Description Floats the toolbar inside the LinkOne WinView shell with the dimensions
at the location as specified by the arguments.
Example [TOOLBAR.FLOAT(navigation, 10, 10, 50, 10)]
This will float the Navigation toolbar at location 10,10 with a width and
height of 50 pixels in relation to the Windows Desktop.

99
LinkOne WinView Technical Reference

Command [TOOLBAR.SHOW(toolbar-name)]
Arguments toolbar-name
 The name of the toolbar. This is the name of the toolbar as seen in
the customize tools dialog.
Description Shows the toolbar if the toolbar is hidden. previously hidden.
Example [TOOLBAR.SHOW(navigation, 10, 10, 50, 10)]
This will show the Navigation toolbar at its default docked location if it has
been hidden.

Command [TOP]
Arguments None

Description Runs the 'First Book View' command button function which opens the first
page in the table of contents control.

Command [UP]
Arguments None

Description Runs the 'Parent Page' command button function which opens the parent
page of the currently selected page in the table of contents control.

Command [VIEW.LIST-ONLY]
Arguments None

Description Hides the picture control ensuring that only the parts list control is visible.

Command [VIEW.PICTURE-AND-LIST]
Arguments None

Description Ensures that both the parts list and pictures controls are visible.

Command [VIEW.PICTURE-ONLY]
Arguments None

Description Hides the parts list control ensuring that only the pictures control is
visible.

Command [ZOOM.BY(zoom-factor)]
Arguments zoom-factor
 The zoom factor to zoom the picture by
Description Zooms the current picture by the specified zoom factor (i.e. 1 = 100%, 2 =
200%, 0.25 = 25%).
Example [ZOOM.BY(2)]
This will zoom the current picture to 200%

100
LinkOne WinView Technical Reference

Command [ZOOM.FIT]
Arguments None

Description Zooms the current picture to fit within the current picture control
dimensions.

Command [ZOOM.FULL]
Arguments None

Description Zooms the current picture to its default scale as specified in the book.

101

You might also like