Home

Microtech`s API

image

Contents

1. lt MicrotechJobRequest gt MicrotechJob job MicrotechCDRemoteManager getInstance submitJob xmlJob System out println Successfully submitted a job Attach a job listener The job object was returned by the submitJob method above Alternatively the job listener could be attached during the submitJob call above The job listener object is defined at the top of this source file JobListener jobListener new JobListener MicrotechCDRemoteManager getInstance listenForJob job jobListener System out println Successfully attached a job listener Now the job listener should get a call back about every two seconds until it completes or the user presses return below System out println Press return to quit while System in read n Stop the job listener MicrotechCDRemoteManager getInstance stopListening job System out println Successfully stopped job listener Disconnect from the server ay MicrotechCDRemoteManager getInstance disconnect System out println Successfully disconnected from the server catch MicrotechBaseException b Just catch and display any Microtech exceptions ay System out printlin Error communcating with CDRemote server System out printin Message b getMessage System out printin Cause b getCause toString catch IOException io October 2 200
2. lt MicrotechResponse gt lt JobStatus gt lt Job Name Administ141007 DiscName MyJob iso Requested 1 Completed 0 Failed 0 State PENDING Priority 4 TotalPercentComplete 0 DateTime 01 16 07 13 42 gt lt JobStatus gt lt MicrotechResponse gt Event Updates Event call backs are invoked whenever an event listener has been attached to the server by a MicrotechCDRemoteManager listenForEvents or MicrotechProcessingServer listenForEvents All the following event call back response XML strings conform to the MicrotechEvent dtd DTD Pending Job Added When an event listener is attached to the server the MicrotechEventListener onPendingJobAdded call back method will be executed whenever a job is added to the pending queue lt xml version 1 0 gt lt DOCTYPE MicrotechEvent SYSTEM C Icdr Mj XML MicrotechEvent_1 0 dtd gt lt MicrotechEvent gt lt PendingJobAdded Name Administ154127 Type Write gt lt MicrotechEvent gt Pending Job Removed When an event listener is attached to the server the MicrotechEventListener onPendingJobRemoved call back method will be executed whenever a job is removed from the pending queue This would occur when the job is aborted before it begins lt xml version 1 0 gt lt DOCTYPE MicrotechEvent SYSTEM C Icdr Mj XML MicrotechEvent_1 0 dtd gt lt MicrotechEvent gt lt PendingJobRemoved Name Administ154127 gt lt MicrotechEvent gt
3. connectTo disconnect request submitJob logToFile listenForEvents stopListeningForEvents listenForJob stopListening This object can only connect to one server at a time To connect to another server first disconnect from the current server Multiple Server Interface To communicate with multiple servers simultaneously the API object to use is the MicrotechSearcherManager This object is needed to find and manage all the existing CD Remote servers on the network attached server listeners and return the MicrotechProcessingServer objects that are used connect query etc each individual server October 2 2007 Microtech API Manual Page 3 MicrotechSearcherManager Main multi server API object see documentation for subset Search NewServer RemoveServer Find ContainsServer ConnectAll DisconnectAll ListenForEvents StopListeningForEvents system level The MicrotechProcessingServer object is used similarly to the MicrotechCDRemoteManager and is used to interact with individual servers This object is returned by MicrotechSearcherManager before use and may not be instantiated directly Listeners To get information about events in the system a server or a specific job as they occur you must attach listeners that you create from the appropriate interface System Searcher Listener Use the MicrotechSearcherManager ListenForEvents to attach a system listener T
4. Active Job Added When an event listener is attached to the server the MicrotechEventListener onActiveJobAdded call back method will be executed whenever a job is added to the active queue lt xml version 1 0 gt lt DOCTYPE MicrotechEvent SYSTEM C Icdr Mj XML MicrotechEvent_1 0 dtd gt October 2 2007 Microtech API Manual Page 12 lt MicrotechEvent gt lt ActiveJobAdded Name Administ154127 Type Write gt lt MicrotechEvent gt Active Job Cancelled When an event listener is attached to the server the MicrotechEventListener onActiveJobCanceled call back method will be executed whenever an active job is aborted lt xml version 1 0 gt lt MicrotechEvent gt lt ActiveJobRemoved Name Administ154127 gt lt MicrotechEvent gt October 2 2007 Microtech API Manual Page 13 Code Examples This section shows some simple code examples using the API These examples are simple linear code streams with emphasis on demonstration rather than elegance The larger code samples that are distributed with this API will be most useful for first time developers After reading through these simple examples 1t is recommended that the code samples be further studied C Server and Job Requests CodeExample cpp Simple code example to demonstrate the Microtech API The following API tasks are performed me dd Connect to a fixed server a Request server status a Submit a fixed j
5. gt amp _ lt Options gt amp lt ImageJob gt amp _ lt ImageFile Path LAB2 XL 1 Drive D Images MyJob iso gt amp _ lt ImageJob gt amp _ lt MicrotechJobRequest gt job MicrotechCDRemoteManager GetInstance SubmitJob xmlJob Console WriteLine Successfully submitted a job Attach a job listener The job object was returned by the submitJob method above Alternatively the job listener could be attached during the submitJob call above The job listener object is defined at the top of this source file jobListener New JobListener MicrotechCDRemoteManager GetInstance ListenForJob job jobListener Console WriteLine Successfully attached a job listener Now the job listener should get a call back about every two seconds until it completes or the user presses return below Console WriteLine Press return to quit Console ReadLine Stop the job listener 1 MicrotechCDRemoteManager GetInstance StopListening job Console WriteLine Successfully stopped job listener Disconnect from the server 1 MicrotechCDRemoteManager GetInstance Disconnect Console WriteLine Successfully disconnected from the server Catch b As MicrotechBaseException Just catch and display any Microtech exceptions Console WriteLine Error communcating with CDRemote server Console WriteLine Message amp b Message Catch e As Exception Catch any consol
6. lt MicrotechResponse gt Printer Status The GetPrinterStatus request is sent to the server to get the printers information lt xml version 1 0 gt lt MicrotechRequest gt lt GetPrinterStatus gt lt MicrotechRequest gt An example response for this request would be lt MicrotechResponse gt lt PrinterStatus Configured 2 Active 2 gt lt Printer Name Rimage Printer R Number 1 Location Right Type Thermal DiscsDone 0 Active true State 0K gt lt InkLevels Cyan 1 Magenta 1 Yellow 1 Black 1 gt lt Printer gt lt Printer Name Rimage Printer L Number 2 Location Left Type Thermal DiscsDone 0 Active true State 0K gt lt InkLevels Cyan 1 Magenta 1 Yellow 1 Black 48 gt lt Printer gt lt PrinterStatus gt lt MicrotechResponse gt Drive Status The GetDriveStatus request is sent to the server to get the output drives information lt xml version 1 0 gt lt MicrotechRequest gt lt GetDriveStatus gt lt MicrotechRequest gt An example response for this request would be lt MicrotechResponse gt lt DriveStatus TotalDrives 6 Active 6 gt lt Drive Number 0 Id 1 Type DVD ROM Enabled true CompletedDiscs 0 FailedDiscs 0 MaxConsecutiveFailedDiscs 0 gt lt Drive Number 1 Id D2 Type CD DVD Enabled true CompletedDiscs 0 FailedDiscs 0 MaxConsecutiveF
7. JobList gt lt Job Name Administ141007 DiscName MyJob iso Requested 1 Completed 0 Failed 0 State PENDING Priority 4 TotalPercentComplete 0 DateTime 01 16 07 13 42 gt lt Job Name Administ105416 DiscName MyJobName Requested 10 Completed 4 Failed 0 State PROCESSING Priority 5 TotalPercentComplete 44 DateTime 01 16 07 gic ae i ee lt Job Name Administ154127 DiscName YourJobName Requested 5 Completed 5 Failed 0 State COMPLETE TotalPercentComplete 100 DateTime 01 16 07 13 26 gt lt Job Name Administ291913 DiscName 50MB iso Requested 2 Completed 2 Failed 0 State COMPLETE TotalPercentComplete 100 DateTime 01 16 07 13 17 gt lt JobList gt lt MicrotechResponse gt To request the status of a single job s lt xml version 1 0 gt lt DOCTYPE MicrotechRequest SYSTEM C Icdr MJ XML MicrotechRequest_1 1 dtd gt lt MicrotechRequest gt lt GetJobStatus gt lt GetSingleJobStatus Name Administ154126 gt lt GetSingleJobStatus Name Administ154127 gt lt GetJobStatus gt lt MicrotechRequest gt And the response might be lt MicrotechResponse gt lt JobStatus gt lt MissingJob Name Administ154126 gt lt Job Name Administ154127 DiscName YourJobName Requested 5 Completed 5 Failed 0 State COMPLETE Priority 5 TotalPercentComplete 100 DateTime 01 16 07 13 26 gt lt JobStatus gt lt MicrotechResponse gt Job Request The following
8. etc The emulator does not interact with any Microtech production system hardware but only simulates the CD Remote program The simplest use of the emulator would be to execute it concurrently on the development PC and connect to it using localhost as the server name The emulator directory contains the files required to run the emulator and these file should always be kept together CDRemoteEmulator exe Emulator executable which will run in a command shell CDRemoteEmulator config xml The configuration file for the emulator This may be edited to define the environment to emulate dil Library files used by the emulator Configuration The configuration XML file can be modified to simulate a specific Microtech production system The default configuration file distributed with the API contains all the valid parameters which should be used as the starting point template for any developer The following configuration XML elements are described lt Server gt Contains the emulated server status settings These are the values that would be returned in response to a GetServerStatus request lt Jobs gt Contains the emulated system s jobs that already exist in the system These will always be added to the system with a PENDING state status The PercentIncrementRate value indicates the rate at which the percent complete value will be incremented during a job listener call back for example to simulate job progressi
9. job requests are sent to the server using the API call MicrotechCDRemoteManager submitJob or MicrotechProcessingServer submitJob to October 2 2007 Microtech API Manual Page 10 submit a job to the server These requests conform to the MicrotechJobRequest dtd DTD Note The DTD path must be present in the XML The specified DTD file path should be the path on the server where the DTD files reside Image Job A simple image job request might be lt xml version 1 0 gt lt DOCTYPE MicrotechJobRequest SYSTEM C Icdr Mj XML MicrotechJobRequest_1 0 dtd gt lt MicrotechJobRequest gt lt Options Quantity 10 gt lt GeneralOptions ImageName MyJobName MediaType CD IncludeFailures TRUE Priority 4 gt lt Options gt lt ImageJob gt lt ImageFile Path LAB2 XL 1 Drive D Images MyJob iso gt lt ImageJob gt lt MicrotechJobRequest gt Audio Job An example audio disc job might be lt xml version 1 0 gt lt DOCTYPE MicrotechJobRequest SYSTEM C Icdr Mj XML MicrotechJobRequest_1 0 dtd gt lt MicrotechJobRequest gt lt Options JobName SampleAudioJob Quantity 5 gt lt GeneralOptions IncludeFailures TRUE Copy TRUE LeaveBsyFiles TRUE gt lt Options gt lt LayoutFile LayoutFilePath D Layouts SampleLay lay gt lt AudioDiscJob gt lt AudioFile FullPath C WINDOWS Media Chimes wav Pause 150 gt lt AudioFile FullPath C WINDOWS Media Chord wav Pause 250 gt lt Audi
10. 7 Microtech API Manual Page 18 Catch any console read errors System out println I O Error System out printin Message io getMessage System out printin Cause io getCause toString Multi Server Discovery import MicrotechInterfaces IMicrotechProcessingServer import MicrotechObjects MicrotechSearcherManager public class Discovery The default CD Remote discovery port is configured at 3518 private static final int SEARCH PORT 3518 Depending on the system and network the search timeout may have to be extended in order to find all the available servers The search will continue until the time out duration is complete oy private static final int SEARCH_TIMEOUT 5000 5 secs 1000 counts sec A true value will clear any servers found from a previous search A false value will append newly discovered servers to the existing list of servers ard private static final boolean CLEAR CURRENT true public static void main String args perform server discovery MicrotechSearcherManager getInstance search SEARCH PORT SEARCH TIMEOUT CLEAR CURRENT display number of servers found int serverCount MicrotechSearcherManager getInstance count System out println Number of servers found serverCount display each server by name for int i 0 i lt serverCount i IMicrotechProcessingServer server MicrotechSear
11. API will accept all the parameters from a Rimage command but may ignore them if they don t have a comparable translation on the Microtech production system The Rimage SDK must be installed on the development system this should already be the case for an existing application The existing application still uses all the include files and all the DTD files from the Rimage SDK so these files must be accessible to the compiler include files and run time environment DTD files The language being used will determine which Microtech API library should replace the existing Rimage library C Link with the Microtech RmClient 7 0_n 2 liband RmMsg 7 0 n 2 lib or the Unicode equivalents Java Add the Microtech ClientApi jar file to the CLASSPATH C NET Reference the Microtech Rimage Client Api dll file The Microtech C VB NET run time libraries are also used in NET applications It would also be useful to read the previous sections pertaining to each specific language for relevant details October 2 2007 Microtech API Manual Page 33 CD Remote Emulator To assist the API developer Microtech has included in the API package a CD Remote emulator This stand alone program can be run on any PC and serves to act as a virtual CD Remote The emulator will appear to the API program as a true CD Remote executing program and will mimic all its functionality including server status and response job submission attaching event and job listeners
12. MICROTECH Microtech s API Application Programming Interface User s Manual Microtech Systems Inc 2 Davis Drive Belmont CA 94002 USA Phone650 596 1900 Fax 650 596 1915 Web microtech com email info microtech com CONTENTS Ii A A A 1 O O 2 OBS na ia 3 Single Server Interface sisvecessscsscscsedksceasecsiectsscseccssesdcostiscsadastseuloassast scetceettavssseasechacestesssscvacessedebees 3 Multiple Server Interface iscsieisciscccescsscsessssdsnccsatstestescchendesesansutetecestba nei ees iia esias iee 3 A RENO 4 System Searcher Listener cinni i AR A A E a i o a iiae 4 Individual Server LiStener cccccccesscsssesceseecesecssesecsseesesccnsesecsseeseesecsessecsseeessaseseesecsessecssseesaeseseaseaeaes 4 Al AA A E A E A E SONS Ne cay uc aie 5 Molea o 1o EEEE EEE RRA 5 AMAL COMMUNICA Oi danna odias 6 Sample API XML SUAS sasiiicino aca basan ende acia cies 8 Server A A A eo E ae Es s e S EiS 8 SOVer al ca it 8 DOVER e teh enon Leaded eas a ao a Ud nd el 8 PESAS e er nat net 9 Drive Status uo ad Seta a a o thea a Delete tera cae 9 MINUS TAT S cinta iii 9 JOD Status ri na ria 10 JOD REQUES A O RO 10 Mage Jobe ra A AAA A TA 11 AUdIO JODA AA A A A A tad 11 Premaster JOD oo cccccccccsscsssesceseeseesecseeecsseeeesecsseeseaecsessecseesecsaeeecsaecsessecsecsesseeceeaecsessecsecaeseeeeesaeeneeaes 11 Job U Pate vinicncccssvicccusscsssassseacsnncscnssoesseccoecesbecsnecescenstosnassunoeeedondsvendooss suep
13. ML MicrotechJobRequest_1 0 dtd gt _ lt MicrotechJobRequest gt lt Options Quantity 10 gt lt GeneralOptions ImageName MyJobName IncludeFailures TRUE Priority 4 gt lt Options gt lt ImageJob gt lt ImageFile Path LAB2 XL 1 Drive D Images MyJob iso E lt ImageJob gt lt MicrotechJobRequest gt MicrotechJob job MicrotechCDRemoteManager GetInstance SubmitJob xmlJob Console WriteLine Successfully submitted a job pa Attach a job listener The job object was returned by the submitJob method above Alternatively the job listener could be attached during the submitJob call above The job listener object is defined at the top of this source file al JobListener jobListener new JobListener MicrotechCDRemoteManager GetInstance ListenForJob job jobListener Console WriteLine Successfully attached a job listener Now the job listener should get a call back about every two seconds until it completes or the user presses return below eS Console WriteLine Press return to quit while Console Read n Stop the job listener ay MicrotechCDRemoteManager GetInstance StopListening job Console WriteLine Successfully stopped job listener Disconnect from the server af MicrotechCDRemoteManager GetInstance Disconnect Console WriteLine Successfully disconnected from the server
14. StatusXml append TAO A serverStatusXml appenad _T lt GetServerStatus GetAutoloaderStatus true IN 7 serverStatusXml append _T lt ProductionServerRequest gt LPTSTR xmlResponse ServerManager getInstance gt executeServerRequest SERVER_ID serverStatusXml c_str cout lt lt T Successfully sent server status request n Output the response this will not be parsed gt if xmlResponse NULL cout lt lt T Error requesting server status n else cout lt lt _T Response n lt lt xmlResponse lt lt _T n n Submit a fixed job This is basic print job The XML string argument conforms to the ProductionOrder dtd DTD ay string xmlJob _T lt xml version 1 0 gt n xmlJob append _T lt DOCTYPE ProductionOrder SYSTEM C Program Files RimageSDK ApiSdk XML ProductionOrder_1 3 dtd gt n xmlJob append _T lt ProductionOrder Copies 1 OrderId Norm Print Only2 ClientId xmlJob append CLIENT ID xmlJob append T Priority Normal Originator xmlJob append a CLIENT_1D xmlJob append T gt n xmlJob append _T lt Media Size 120mm Type CDR gt n xmlJob append _T lt Target Cluster DefaultProductionCluster gt n xmlJob append _T lt Action gt n xmlJob append _T lt Label Filename C Icdr MJ 30MinPhoto lay gt n xmlJob append _T lt BTW SaveAfte
15. ailedDiscs 0 gt lt Drive Number 2 Id D3 Type CD DVD Enabled true CompletedDiscs 0 FailedDiscs 0 MaxConsecutiveFailedDiscs 0 gt lt Drive Number 3 Id D4 Type CD DVD Enabled true CompletedDiscs 0 FailedDiscs 0 MaxConsecutiveFailedDiscs 0 gt lt Drive Number 4 Id D5 Type CD DVD Enabled true CompletedDiscs 0 FailedDiscs 0 MaxConsecutiveFailedDiscs 0 gt lt Drive Number 5 Id D6 Type CD DVD Enabled true CompletedDiscs 0 FailedDiscs 0 MaxConsecutiveFailedDiscs 0 gt lt DriveStatus gt lt MicrotechResponse gt Input Status The GetInputStatus request is sent to the server to get the input drives information lt xml version 1 0 gt lt MicrotechRequest gt October 2 2007 Microtech API Manual Page 9 lt GetInputStatus gt lt MicrotechRequest gt An example response for this request would be lt MicrotechResponse gt lt InputStatus Active 2 gt lt Input Number 1 Station 1 Status Active Type CD MediaSize Standard gt lt Input Number 3 Station 2 Status Active Type DVD MediaSize Standard gt lt InputStatus gt lt MicrotechResponse gt Job Status The Get JobList request is sent to the server to get the status of all jobs on the server lt xml version 1 0 gt lt MicrotechRequest gt lt GetJobList gt lt MicrotechRequest gt A shortened example response for this request would be lt MicrotechResponse gt lt
16. ary is referenced by the application the API calls may be used by specifying the appropriate classes either directly or through imports statements Imports MicrotechApi Objects Contains the CD Remote manager and the job and logger objects Imports MicrotechApi Interfaces Contains the event and job listeners Imports MicrotechApi Exceptions Contains all the Microtech specific exceptions Note The NET security permissions must be correctly set on the client machine running the Microtech API application These settings are accessed using the Microsoft NET Framework Configuration tool found in the Control Panel Administration Tools It is beyond the scope of this document to cover this topic so further familiarity of this tool may be required A symptom of a problem might be a run time error referencing System Security Permissions SecurityPermission October 2 2007 Microtech API Manual Page 32 Rimage The Rimage interface to the Microtech API has been designed to be as transparent as possible to the developer It is the intent that little or no source code modification would be required to rebuild an existing Rimage API application to become a Microtech API application The only build requirement is that the Microtech libraries must replace the Rimage SDK libraries Because of the architectural differences between the Rimage and Microtech systems some parameters to statuses and jobs will not be meaningful The Microtech
17. brary The following Microtech API provided directories contain files required to build an application The API include directory must be accessible to the compiler the API library directory Alib must be accessible to the linker and the API Abin directory containing the API dll Dynamic Link Library file s must be accessible at run time include The include file MicrotechCDRemoteManager h will usually be sufficient to make the API classes accessible Use the include statement in your source file s Mib The library file Microtech_Client_Api lib or Microtech Client Api Unicode lib will usually be sufficient for linking the API application Add this library directory to your linker invocation Depending on your C development system you may be required to add this library as a dependency bin The dll file Microtech Client _Api dll or Microtech Client Api Unicode dll will usually be sufficient for running the API application Make this directory available in the PATH environment variable or put the dll file s into an accessible directory The Microtech C API uses MicroSoft s MSXML4 parser internally to interpret the XML text strings that are used for communication between the API and CDRemote The parser dll file is required for use by the API and is also used by the sample programs supplied by Microtech This parser should be downloaded and installed by visiting this site http ww
18. catch MicrotechBaseException b Just catch and display any Microtech exceptions es Console Writeline Error communcating with CDRemote server Console WriteLine Message b Message October 2 2007 Microtech API Manual Page 21 Multi Server Discovery using System Console using MicrotechApi Objects MicrotechSearcherManager MicrotechProcessingServer namespace MTApiDiscovery class Discovery The default CD Remote discovery port is configured at 3518 const int SEARCH PORT 3518 Depending on the system and network the search timeout may have to be extended in order to find all the available servers The search will continue until the time out duration is complete const int SEARCH_TIMEOUT 5000 5 seconds 1000 counts second A true value will clear any servers found from a previous search A false value will append newly discovered servers to the existing list of servers const bool CLEAR CURRENT true static void Main string args October 2 2007 perform server discovery MicrotechSearcherManager GetInstance Search SEARCH PORT SEARCH TIMEOUT CLEAR CURRENT Fe display number of servers found uint serverCount MicrotechSearcherManager GetInstance Count Console WriteLine Number of servers found serverCount display each server by name for uint i 0 i lt serverCount i MicrotechProce
19. cherManager getInstance get i System out printin i4 server getServerName At this point an individual server may be interacted with using the appropriate MicrotechProcessingServer object oy October 2 2007 Microtech API Manual Page 19 C NET Server and Job Requests SS E JTE TEJER EEE RA EAS Sy using using using using using using Connec Reques Submit Attach Stop E Discon System System Co System Te CodeExample cs Simple code example to demonstrate the Microtech API The following API tasks are performed t to a fixed server t server status a fixed job a job listener he job listener nect from the server llections Generic xt MicrotechApi Objects MicrotechCDRemoteManager MicrotechJob MicrotechApi Interfaces MicrotechJobListener MicrotechApi Exceptions MicrotechBaseException namespace CodeExample i public class Program Most conf Hy public Y k x pub pk Run x public try October 2 2007 basic possible job listener Just accept the XML response which orms to the MicrotechResponse dtd DTD and display it class JobListener MicrotechJobListener This is the lone method of the job listener interface that must be implemented This call will occur about every two seconds until the listener is stopped or the job completes possibly because of an er
20. d The chapters prior to the code sample sections are intended to be programming language independent The objects and calls have common names regardless of language used and will be referenced without regard to specific language syntax It is recommended that the sample code of the language of interest be looked at while reading this manual October 2 2007 Microtech API Manual Page 1 Overview CD Remote System Status lt 5 Client App Status Server Job Manager Microtech Client AP XML Request XML Request te De A A Language Interface XML XML Response lt _ Response IA Contro Saai a TN a w The purpose of the Microtech API is to enable a user application to interact with the Microtech production system The interaction is achieved by interfacing with the CD Remote program that is running on the Microtech server The API consists of library routines that are linked into the client application These routines perform all the networked communication between the client application and CD Remote server A single application may communicate sequentially with multiple CD Remote servers or communicate with multiple servers simultaneously The client application first connects to a CD Remote server Then other actions may be performed such as server status and settings requests to retriev
21. documentation for e onJobUpdate Job Object The final object that will be discussed in this section is the job object This object is returned when the job is submitted and can be used to query the job parameters and for attaching a job listener This object can also be created and given a name of an existing job in order to attach a listener MicrotechJob Job object see documentation for subset e getJobFile e getJobName setJobName e getJobType e getQuantity October 2 2007 Microtech API Manual Page 5 XML Communication All communication between the API and the CD Remote server is implemented by sending and receiving XML strings The XML strings must be created to send requests to the server and the returned response XML strings must be parsed by the application If future enhancements are made to the XML content no modification of the API will be required See the following section for XML string examples Each XML string must comply with its corresponding DTD Document Type Definition Note If the reader is not familiar with the XML and DTD formats spending some time with a tutorial is strongly recommended Try the links http www w3schools com xml default asp http www w3schools com dtd default asp Or perform a search for xml tutorial and dtd tutorial The DTD files distributed with the API must be placed in a known directory on the system running the client application The API use
22. e MicrotechRequest dtd DTD The response will also be an XML string conforming to the MicrotechResponse dtd DTD 7 LPCTSTR serverStatusxml _T lt xml version 1 0 gt lt MicrotechRequest gt lt GetServerStatus gt lt MicrotechRequest gt LPCTSTR xmlResponse MicrotechCDRemoteManager GetInstance gt Request serverStatusXml cout lt lt Successfully requested server status n Output the response this will not be parsed 7 cout lt lt xmlResponse lt lt n Submit a fixed job This is basic image job where the image file must already exist on the server The XML string argument conforms to the MicrotechJobRequest dtd DTD string xmlJob lt xml version 1 0 gt xmlJob append lt DOCTYPE MicrotechJobRequest SYSTEM C Icdr Mj XML MicrotechJobRequest_1 0 dtd gt xmlJob append lt MicrotechJobRequest gt xmlJob append lt Options Quantity 10 gt xmlJob append lt GeneralOptions ImageName MyJobName IncludeFailures TRUE Priority 4 gt xmlJob append lt Options gt xmlJob append lt ImageJob gt xmlJob append lt ImageFile Path LAB2 XL 1 Drive D Images MyJob iso gt xmlJob append lt ImageJob gt xmlJob append lt MicrotechJobRequest gt MicrotechJob job MicrotechCDRemoteManager GetInstance gt SubmitJob xmlJob c_str cout lt lt Successfully submitt
23. e job completes possibly because of an error param orderStatusXml The order status XML response from the server I void onStatus LPCTSTR xmlOrderStatus Output the response this will not be parsed cout lt lt T Order Status gt cout lt lt xmlOrderStatus lt lt _T n y pk Run the Microtech Code Example program void main int argc char argv try Connect to the server using a fixed name and port number MicrotechCDRemoteManager is implemented as a singleton object that can be accessed via the getInstance method oy SystemManager getInstance gt connect CLIENT ID SERVER_ID SERVER_PORT October 2 2007 Microtech API Manual Page 26 cout lt lt _T Successfully connected to the server n Request server status The XML string for the request is hard coded here and conforms to the ProductionServerRequest dtd DTD The response will also be an XML string conforming to the MicrotechResponse dtd DTD ay string serverStatusXml T lt xml version 1 0 gt n serverStatusXml append _T lt DOCTYPE ProductionServerRequest SYSTEM C Program Files RimageSDK ApiSdk XML ProductionServerRequest_1 0 dtd gt n serverStatusXml append _T lt ProductionServerRequest ServerId serverStatusxXml append SERVER _ID serverStatusXml append _T ClientId serverStatusXml appenad CLIENT ID server
24. e read errors Console WriteLine I O Error Console WriteLine Message e Message End Try End Sub End Module Multi Server Discovery Imports MicrotechApi Objects Module Discovery Sub Main The default CD Remote discovery port is configured at 3518 Dim SEARCH_PORT As Integer 3518 Depending on the system and network the search timeout may have to be extended in order to find all the available servers The search October 2 2007 Microtech API Manual Page 24 will continue until the time out duration is complete Dim SEARCH_TIMEOUT As Integer 5000 5 seconds 1000 counts second A true value will clear any servers found from a previous search A false value will append newly discovered servers to the existing list of servers Dim CLEAR CURRENT As Boolean True perform server discovery MicrotechSearcherManager GetInstance Search SEARCH PORT _ SEARCH_TIMEOUT CLEAR CURRENT display number of servers found Dim serverCount As Ulnteger serverCount MicrotechSearcherManager GetInstance Count Console WriteLine Number of servers found serverCount ToString display each server by name Dim i As UInteger For i 1 To serverCount Dim server As MicrotechProcessingServer server MicrotechSearcherManager GetInstance Get i 1 Console WriteLine i ToString server ServerName Next At this point an individual server may be interacted with using t
25. e server parameters job status requests to retrieve job parameters and job submittal requests which enter jobs into the system for processing To receive real time status from the server or from a specific job the API allows the client application to attach a server event listener and a job listener Finally the client application can disconnect from the server The next section contains some of these details October 2 2007 Microtech API Manual Page 2 Objects The objects discussed here are a subset of the API The entire API with syntax and calls are explained in the documentation that is distributed with the API and will not be duplicated here However as an overview here are some of the key components Single Server Interface The starting point and main API object used for communicating with a single CD Remote server is the MicrotechCDRemoteManager This object is needed to connect to and disconnect from the CD Remote server request server and job status submit jobs set up log files and attach event and job listeners There are a few calls that will allow the application to directly query the server see the documentation for MicrotechCDRemoteManager However most of the information returned by the server is in response to requests sent by the client application see the section on XML Communication MicrotechCDRemoteManager Main single server API object see documentation for subset
26. ed a job n Attach a job listener The job object was returned by the submitJob method above Alternatively the job listener could be attached during the submitJob call above The job listener object is defined at the top of this source file af JobListener jobListener MicrotechCDRemoteManager GetInstance gt ListenForJob job amp jobListener cout lt lt Successfully attached a job listener n Now the job listener should get a call back about every two seconds until it completes or the user presses return below cout lt lt Press return to quit n string textLine getline cin textLine Stop the job listener 7 MicrotechCDRemoteManager GetInstance gt StopListening job cout lt lt Successfully stopped job listener n Disconnect from the server ay October 2 2007 Microtech API Manual Page 15 MicrotechCDRemoteManager GetInstance gt Disconnect cout lt lt Successfully disconnected from the server n catch MicrotechBaseException b Just catch and display any Microtech exceptions cout lt lt Error communcating with CDRemote server n cout lt lt N Message lt lt b GetExceptionMessage lt lt An Multi Server Discovery include lt iostream gt cout include lt MicrotechSearcherManager h gt MicrotechSearcherManager MicrotechProcessingServer using namespace std cout The de
27. fault CD Remote discovery port is configured at 3518 static int SEARCH PORT 3518 Depending on the system and network the search timeout may have to be extended in order to find all the available servers The search will continue until the time out duration is complete ay static int SEARCH_TIMEOUT 5000 5 seconds 1000 counts second A true value will clear any servers found from a previous search A false value will append newly discovered servers to the existing list of servers ey static bool CLEAR CURRENT true void main int argc char argv perform server discovery MicrotechSearcherManager GetInstance gt Search SEARCH PORT SEARCH TIMEOUT CLEAR CURRENT H display number of servers found size_t serverCount MicrotechSearcherManager GetInstance gt Count cout lt lt Number of servers found lt lt serverCount lt lt An display each server by name for size t i 0 i lt serverCount i MicrotechProcessingServer server MicrotechSearcherManager GetInstance gt Get i cout lt lt lt lt i lt lt e lt lt server gt GetServerName lt lt An At this point an individual server may be interacted with using the appropriate MicrotechProcessingServer object g October 2 2007 Microtech API Manual Page 16 Java Server and Job Requests SS YE E BTECERR RE EEE RARAS Ss CodeExample java Simp
28. he XML response sent back from the server will conform to the format in the file MicrotechResponse dtd This includes every server response except those received from the event listener The XML event response is sent back from the server via a call back routine whenever there is an event listener attached to the server The format of this XML can be found in the file MicrotechEvent dtd Microtech API Manual Page 7 Sample API XML Strings As previously mentioned all communication between the API and the CD Remote server are implemented by sending and receiving XML strings The XML strings must be created to send requests to the server and the returned response XML strings must be parsed by the application Each XML string must comply with its corresponding DTD Document Type Definition All the examples below contain line feeds and tabs for readability these are not necessary for validation purposes There are several existing XML parsers that can be found on the web depending on the programming language used Any of these may be used but will not be discussed here Note If using C see the section on building your application later in this manual Server Requests The following information requests are sent to the server using the API call MicrotechCDRemoteManager request or MicrotechProcessingServer request All these requests conform to the MicrotechRequest dtd DTD The responses that are returned by the server c
29. he appropriate MicrotechProcessingServer object End Sub End Module October 2 2007 Microtech API Manual Page 25 Rimage C This code example demonstrates how to connect to the Microtech API using Rimage API calls This would most likely be used if an existing Rimage API application is required to connect to a Microtech production system This example uses C but the other languages could be used instead CodeExample cpp Simple code example to demonstrate the Rimage interface to the Microtech API The following API tasks are performed e Connect to a fixed server s Request server status E Submit a fixed job E Attach a job listener id Stop the job listener g Disconnect from the server ed include lt fstream gt for ofstream include lt iostream gt or cin cout include lt string gt for string include lt ClientApilnclude h gt Rimage API using namespace std for string cin cout define SERVER_ID _T lab2 EL 1 define SERVER_PORT E 3 51 9 define CLIENT ID _T MyClientID JER Most basic possible job listener Just accept the XML response which conforms to the ProductionOrderStatus dtd DTD and display it y class RimageOrderListener public OrderStatusListener public This is the lone method of the order status listener interface that must be implemented This call will occur about every two seconds until the listener is stopped or th
30. his will cause call back methods to be executed whenever certain system events occur as described in the documentation for the interface MicrotechSearcherListener MicrotechSearcherListener System event listener see documentation for e onServerAdded e onServerRemoved e onServerConnected e onServerDisconnected Individual Server Listener Use the MicrotechCDRemoteManager single server application or MicrotechProcessingServer multi server application listenForEvents to attach the server event listener This will cause call back methods to be executed whenever certain server events occur as described in the documentation for the interface MicrotechEventListener MicrotechEventListener Server event listener see documentation for subset onActiveJobAdded onPendingJobAdded onError onPause onQuit October 2 2007 Microtech API Manual Page 4 Job Listener Use the MicrotechCDRemoteManager single server application or MicrotechPocessingServer multi server application listenForJob to attach a listener to a specific job Each job should have its own listener This will cause a call back method to occur about every two seconds until the job has completed This is described in the documentation for the interface MicrotechJobListener It is recommended that the listener process its onJobUpdate method quickly so that the next call back is not missed MicrotechJobListener Job listener see
31. icrotechCDRemoteManager is implemented as a singleton object that can be accessed via the getInstance method MicrotechCDRemoteManager getInstance connectTo lab2 x1 1 3519 System out println Successfully connected to the server Request server status The XML string for the request is hard coded here and conforms to the MicrotechRequest dtd DTD The response will also be an XML string conforming to the MicrotechResponse dtd DTD Microtech API Manual Page 17 String xmlResponse MicrotechCDRemoteManager getInstance request lt xml version 1 0 gt lt MicrotechRequest gt lt GetServerStatus gt lt MicrotechRequest gt System out println Successfully requested server status Output the response this will not be parsed y System out printin xmlResponse Submit a fixed job This is basic image job where the image file must already exist on the server The XML string argument conforms to the MicrotechJobRequest dtd DTD y String xmlJob lt xml version 1 0 gt lt DOCTYPE MicrotechJobRequest SYSTEM C Icdr Mj XML MicrotechJobRequest_1 0 dtd gt _ lt MicrotechJobRequest gt lt Options Quantity 10 gt lt GeneralOptions ImageName MyJobName IncludeFailures TRUE Priority UNS lt Qptions gt lt ImageJob gt lt ImageFile Path LAB2 XL 1 Drive D Images MyJob iso gt lt ImageJob gt
32. le code example to demonstrate the Microtech API The following API tasks are performed Connect to a fixed server Request server status Submit a fixed job Attach a job listener Stop the job listener Disconnect from the server import MicrotechObjects Microtech classes MicrotechCDRemoteManager import MicrotechException Microtech classes MicrotechBaseException import MicrotechInterfaces Microtech classes IMicrotechJobListener import MicrotechJobs MicrotechJob Microtech classes MicrotechJob import java io IOException public class CodeExample pk Most basic possible job listener Just accept the XML response which conforms to the MicrotechResponse dtd DTD and display it f public static class JobListener implements IMicrotechJobListener ii de de x This is the lone method of the job listener interface that must be implemented This call will occur about every two seconds until the listener is stopped or the job completes possibly because of an error param jobXml The job update XML response from the server public void onJobUpdate String jobXml dee Output the response this will not be parsed System out printin jobXm1 Run the Microtech Code Example program ld public static void main String args October 2 2007 try j Connect to the server using a fixed name and port number M
33. ns the CD Remote manager and the job and logger objects using MicrotechApi Interfaces Contains the event and job listeners using MicrotechApi Exceptions Contains all the Microtech specific exceptions Note The NET security permissions must be correctly set on the client machine running the Microtech API application These settings are accessed using the Microsoft NET Framework Configuration tool found in the Control Panel Administration Tools It is beyond the scope of this document to cover this topic so further familiarity of this tool may be required A symptom of a problem might be a run time error referencing System Security Permissions SecurityPermission October 2 2007 Microtech API Manual Page 31 VB NET When building an application using Visual Basic NET the API objects and functions are accessed using the Microtech API NET libraries these are the same libraries that are used for C The NET libraries also use the C run time libraries so the section on C application building and run time dll files should also be referenced The NET libraries are distributed in the bin directory MicrotechApi Net dll This is the primary library that must be referenced by the application using the referenced name of MicrotechApi Net Microtech Client Api Unicode dll This library is used by MicrotechApi Net dll and must be present though not directly referenced by the application Once the above libr
34. nual for an introduction to the emulator October 2 2007 Microtech API Manual Page 36
35. oFile FullPath C WINDOWS Media Ding wav Pause 200 gt lt AudioDiscJob gt lt MicrotechJobRequest gt Premaster Job An example premaster job might be lt xml version 1 0 gt lt DOCTYPE MicrotechJobRequest SYSTEM C Icdr Mj XML MicrotechJobRequest_1 0 dtd gt lt MicrotechJobRequest gt lt Options JobName SamplePremaster Quantity 2 gt lt GeneralOptions IncludeFailures FALSE MediaType DVD ImageName MyDataJob LeaveBsyFiles TRUE gt lt WritingOptions TestWrite TRUE gt lt VerifyOptions Verify TRUE gt lt Options gt lt DataDiscJob PremasterOnly FALSE gt lt MMOptions Joliet TRUE UDF TRUE ISOLevel 2 VolumeName SamplePremaster gt lt IncludeFiles gt lt IncludeFolder FullPath C WINDOWS Cursors LocalPath Cursors gt lt Exclude Path 3dgno cur Type File gt lt IncludeFolder gt lt IncludeFolder FullPath C system32 LocalPath System gt lt PathChange Path DirectX LocalPath DX gt lt Exclude Path Microsoft Type Folder gt lt IncludeFolder gt lt IncludeFile FullPath C Windows Clock avi LocalPath Winn clock avi gt lt IncludeFiles gt lt DataDiscJob gt October 2 2007 Microtech API Manual Page 11 lt MicrotechJobRequest gt Job Update When a job listener is attached to a job the MicrotechJobListener onJobUpdate call back method will be executed about every two seconds See also the MicrotechResponse dtd DTD
36. ob s Attach a job listener x Stop the job listener w Disconnect from the server include lt iostream gt for cin cout include lt string gt 7 for string include lt MicrotechCDRemoteManager h gt for Microtech API using namespace std for string cin cout Most basic possible job listener Just accept the XML response which conforms to the MicrotechResponse dtd DTD and display it class JobListener public MicrotechJobListener public This is the lone method of the job listener interface that must be implemented This call will occur about every two seconds until the listener is stopped or the job completes possibly because of an error param jobXml The job update XML response from the server void OnJobUpdate LPCTSTR jobXm1 Output the response this will not be parsed cout lt lt jobXml y Run the Microtech Code Example program a void main int argc char argv try Connect to the server using a fixed name and port number October 2 2007 Microtech API Manual Page 14 MicrotechCDRemoteManager is implemented as a singleton object that can be accessed via the getInstance method MicrotechCDRemoteManager GetInstance gt ConnectTo _T lab2 x1 1 3519 cout lt lt Successfully connected to the server n Request server status The XML string for the request is hard coded here and conforms to th
37. on See below for more details lt Printers gt Contains the emulated system s printer definitions for simulated printing lt Drives gt Contains the emulated system s output drive definitions for simulated disc writing October 2 2007 Microtech API Manual Page 34 lt Inputs gt Contains the emulated system s input drive definitions for simulated disc reading Directories Contains the emulated system s directory path definitions The Jobs directory will be used for newly submitted jobs job files Usage The emulator will execute in its own command console shell via start run or other While running status messages will be displayed in this window There are just a few commands that can be invoked in the emulator command shell These are displayed in a simple menu pause the server resume the server raise an error While running the emulator will receive and respond to commands from the API program All server requests and job requests will be handled appropriately including event and job listener call backs All responses will be returned with the appropriate data conforming to the relevant DTD When invoked the emulator will load simulated jobs into the system that are defined in the configuration file and any job files that appear in the Jobs directory Jobs submitted from the API also cause a job file to be created To remove a job from the emulated system delete the job file and then resta
38. onform to the MicrotechResponse dtd DTD Server Status The GetServerStatus request is sent to the server to get status information lt xml version 1 0 gt lt MicrotechRequest gt lt GetServerStatus gt lt MicrotechRequest gt An example response for this request would be lt MicrotechResponse gt lt ServerStatus Serverld CDRemote ServerName LAB2 DEV ServerType Xpress XL SoftwareVersion 3 06 10 SoftwareRelease 3 11 ListeningPort 3519 Status Running OutOfMedia false gt lt MicrotechResponse gt Server Settings The GetServerSettings request is sent to the server to get the server settings information lt xml version 1 0 gt lt MicrotechRequest gt lt GetServerSettings gt lt MicrotechRequest gt An example response for this request would be lt MicrotechResponse gt lt ServerSettings EmailNotificationEnabled false PremasteringEnabled true NetworkingEnabled true MP3ConversionEnabled true BTWEnabled false SonicEngineEnabled false gt lt DirectorySettings JobDirectory LAB2 XP1 Drive D Jobs ImageDirectory LAB2 XP1 Drive D Images LayoutDirectory LAB2 XP1 Drive D Layouts ResultDirectory LAB2 XP1 Drive D Jobs gt lt TemporaryImageDirectory Path D Images gt lt TemporaryImageDirectory Path D TmpImgs gt October 2 2007 Microtech API Manual Page 8 lt DirectorySettings gt lt DiscoveryServer Enabled true Port 3518 gt lt ServerSettings gt
39. rRendering default gt n xmlJob append _T lt Label gt n xmlJob append _T lt Action gt n xmlJob append _T lt ProductionOrder gt n cout lt lt Submitting job n lt lt xmlJob lt lt n n RimageOrderListener orderListener OrderDescription orderDescription OrderManager getInstance gt submitOrder xmlJob c_str amp orderListener cout lt lt Successfully submitted a job n cout lt lt Successfully attached a job listener n Now the job listener should get a call back about every two seconds until it completes or the user presses return below cout lt lt Press return to quit n string textLine getline cin textLine October 2 2007 Microtech API Manual Page 27 Stop the job listener OrderManager getInstance gt stopListeningForOrder orderDescription cout lt lt Successfully stopped job listener n Disconnect from the server F7 SystemManager getInstance gt disconnect cout lt lt Successfully disconnected from the server n catch BaseException be Catch and display any Rimage exceptions 5 cout lt lt API exception n cout lt lt Message lt lt be getMessage lt lt An October 2 2007 Microtech API Manual Page 28 Building Your Application C When building an application using C the API objects and functions are accessed using the Microtech API li
40. ror param jobXml The job update XML response from the server lic void OnJobUpdate string jobXml Output the response this will not be parsed ty Console WriteLine JobXml the Microtech Code Example program static void Main string args Connect to the server using a fixed name and port number MicrotechCDRemoteManager is implemented as a singleton object that can be accessed via the GetInstance method E MicrotechCDRemoteManager GetInstance connectTo lab2 x1 1 3519 Console WriteLine Successfully connected to the server Request server status The XML string for the request is hard Microtech API Manual Page 20 coded here and conforms to the MicrotechRequest dtd DTD The response will also be an XML string conforming to the MicrotechResponse dtd DTD ef string xmlResponse MicrotechCDRemoteManager GetInstance Request lt xml version 1 0 gt lt MicrotechRequest gt lt GetServerStatus gt lt MicrotechRequest gt Console WriteLine Successfully requested server status Output the response this will not be parsed id Console WriteLine xmlResponse Submit a fixed job This is basic image job where the image file must already exist on the server The XML string argument conforms to the MicrotechJobRequest dtd DTD af string xmlJob lt xml version 1 0 gt lt DOCTYPE MicrotechJobRequest SYSTEM C Icdr Mj X
41. rt the emulator All jobs will begin with a state of PENDING Each job s state will automatically transition to PROCESSING and then to COMPLETE These are the only job state values that the emulator supports While processing the job s percent complete will increment based on the configuration PercentIncrementRate value see above October 2 2007 Microtech API Manual Page 35 What s Next This manual is intended to be a quick start for a Microtech API programmer to become familiar with the interface The basic overview of a program is discussed with some very basic code examples provided For the programmer to be successful the recommended next steps are to study the remaining API pieces including Class Reference The class reference files are distributed in multiple formats These should appear as standardized documentation describing each class along with 1ts methods and calling arguments Sample Code The provided sample code should provide the programmer more examples of API calls and usage These may be used as a template or code snippets to be used during development DTD Files These files are essential for use when coding the creation and parsing of the request and response XML strings As noted in this manual these files must also be used by the API libraries Emulator The emulator will be very useful for trying out API code while avoiding interacting with hardware See the prior section of this ma
42. s the DTD for XML validation when submitting a job for example There are five DTD formats that are used in the API Vote In each description below the object MicrotechProcessingServer may be substituted for MicrotechCDRemoteManager for multi server applications Server request Server request XML strings must be created by the application and sent to the server This will be used to request status from the server The API call used to send a request to the server is MicrotechCDRemoteManager request The format of this XML can be found in the file MicrotechRequest dtd Server command Server command XML strings must be created by the application and sent to the server This will be used to send server commands such as pause resume and cancel job s The API call used to send a request to the server is the same as the for the server request MicrotechCDRemoteManager request The format of this XML can be found in the file MicrotechCommand dtd Job request A job request XML string must be created by the application and sent to the server to submit a job The call used to submit the job request is MicrotechCDRemoteManager submitJob The format of this XML can be found in the file MicrotechJobRequest dtd Vote The DTD path must be specified in the job request XML see example job request XML in the next section October 2 2007 Microtech API Manual Page 6 Server response Server event October 2 2007 T
43. siesdeoed suesvoaconsaseensdeidessens 12 SAA O 12 Pending Job AddEd anane R taa eae 12 Pending JOD Removed c oooocoococcocoocoocconcononononocnnoononnonnco nono no noon nro non non n cono rn rana nn nro non rna nro rene na nn on rra nan rrn rra ncnnnanos 12 Active Job Added E 12 Active Job Cancelled 00 0 cc ccccccssesscssesscsseescnseescssecsessecsevsecsaeseesaecsesnscsevsecnseeesasesseascsessesseeeeseseessenecnees 13 Code Example accsiscccdessspcineconsicacvivwavenecaul csevusyctucbanstenssbunai on teiuhdeesssvaceteenscascuunsieaisueeeianeanes 14 RN 14 Server ANG TOD REQUESTS aiii aaa idad 14 Multi Server DISCOVEOTY ascuas is dr Kintera Mee 16 A RR ON 17 SEMVEMANG JOD REQUCSIS ii cielo 17 M lti Server DISCOVE Yidis 19 OES IN EAEE E bi 20 Server ANP JOD Requests vecsiccscdasssesseaiesredsvesbuteendcouasenevbcbeddetty E ends pose cuasncd lees a a aon a eenen aa 20 Multi Server Discovery ccceceeccessessesscssesecsseesceseeseesecsessecssesecnsesesaecsessecsscsesnssessaecaesaecsecaessaeeeseaeeataes 22 O A NN 23 Multi Server DISCOVETY e e oe RR nd Re le deis a lea 24 RIMAGE CPF AE E EE E T E E EE E AE 26 Building Your Application ia 29 MOE O 29 TIVA A AAA AAA AAA AAA A 30 CANE o 31 A SI 32 ONO 33 CD Romote Emulator iii nia 34 e ON 34 A satewebesecsesescesuasdasucs sutbeasuectiesensbessesesneds E 35 What s Next A eS 36 Introduction This manual is intended for programmers who have a requirement to in
44. ssible from your development environment such as the CLASSPATH environment variable in Windows Within the application source code the following packages may be imported to access the corresponding pieces of the API import MicrotechObjects Contains the CD Remote manager import MicrotechInterfaces Contains the event and job listeners import MicrotechException Contains all the Microtech specific exceptions import MicrotechJobs Contains the job and job creator objects import MicrotechLogger Contains the log file manager October 2 2007 Microtech API Manual Page 30 C NET When building an application using C NET the API objects and functions are accessed using the Microtech API NET libraries The NET libraries also use the C run time libraries so the section on C application building and run time dll files should also be referenced The NET libraries are distributed in the bin directory MicrotechApi Net dll This is the primary library that must be added as a reference to the application using the referenced name of MicrotechApi Net Microtech Client Api Unicode dll This library is used by MicrotechApi Net dll and must be present though not directly referenced by the application Once the above library is referenced by the application the API calls may be used by specifying the appropriate classes either directly or through using statements using MicrotechApi Objects Contai
45. ssingServer server MicrotechSearcherManager GetInstance Get i Console WriteLine i server ServerName At this point an individual server may be interacted with using the appropriate MicrotechProcessingServer object ed Microtech API Manual Page 22 VB NET Server and Job Requests CodeExample vb Simple code example to demonstrate the Microtech API The following API tasks are performed Connect to a fixed server Request server status y Submit a fixed job y Attach a job listener g Stop the job listener Disconnect from the server Imports MicrotechApi Exceptions Imports MicrotechApi Interfaces Imports MicrotechApi Objects Module CodeSample Most basic possible job listener Just accept the XML response which conforms to the MicrotechResponse dtd DTD and display it Public Class JobListener Implements MicrotechJobListener This is the lone method of the job listener interface that must be implemented This call will occur about every two seconds until the listener is stopped or the job completes possibly because of an error param jobXml The job update XML response from the server Public Sub OnJobUpdate ByVal jobXml As String Implements MicrotechApi Interfaces MicrotechJobListener OnJobUpdate 1 Output the response this will not be parsed Console WriteLine jobXml End Sub End Class Run the Microtech Code Example program Sub Main Dim
46. teract with Microtech s production system from their proprietary software It is assumed that the reader is familiar with at least one of the programming languages that are supported by the Microtech API Application Programming Interface and has read the Microtech User s Guide or is familiar with the capabilities of the system At this time the API includes support for C C Java Microsoft Net C and Microsoft Visual Basic The Microtech API was designed to allow a software interface between a client application and the Microtech production system thus providing a means to create tightly integrated customized solutions that include disc creation and printing Before introducing the programmatic interface to the API it should be noted that there is a text file based job submittal interface to the Microtech production system This is achieved by building JOB text files and placing them into the job directory of the production system server The JOB file contains all the parameters for the job submission and can be created by an executable script file or manually in a text editor The job directory is automatically scanned and any new JOB files encountered will be processed by the system The format and description for this text base method of job submission is covered in depth in the ImageMaker Technical Reference User s Manual If server and or job status and feedback are required however the API described in this manual should be use
47. w microsoft com downloads details aspx FamilyID 3144b72b b4f2 46da b4b6 c5d7485f2b428 amp DisplayLang en Or perform a web search using microsoft msxml4 The MSXML parser uses the COM library so use Coinitialize at the beginning and CoUninitialize at the end of each thread of your application using the parser This includes the callback thread that is implicitly created when attaching a job listener object The one exception is when the server listener callback thread is created This thread will already have called Coinitialize because of internal parsing requirements from CDRemote Of course you can always check the results back from the Coinitialize call and compare it against S_OK for success Only call CoUninitialize if the result from Coinitialize was S_OK See the msdn Microsoft documentation for more details October 2 2007 Microtech API Manual Page 29 Java When building an application using Java the API objects and methods are accessed using the following JAR Java ARchive library files MicrotechApiJ jar Contains classes for the CD Remote Manager and event and job listeners See packages MicrotechObjects and MicrotechInterfaces MicrotechApiJGlobals jar Contains classes for the various Microtech exceptions job objects and log manager See packages MicrotechException MicrotechJobs and MicrotechLogger MicrotechApiJInternal jar Contains classes for internal Microtech use These JAR files must be acce
48. xmlResponse xmlJob As String Dim job As MicrotechJob Dim jobListener As JobListener Try Connect to the server using a fixed name and port number MicrotechCDRemoteManager is implemented as a singleton object that can be accessed via the getInstance method MicrotechCDRemoteManager GetInstance ConnectTo lab2 x1 1 3519 Console WriteLine Successfully connected to the server Request server status The XML string for the request is hard coded here and conforms to the MicrotechRequest dtd DTD The response will also be an XML string conforming to the MicrotechResponse dtd DTD xmlResponse MicrotechCDRemoteManager GetInstance Request _ lt xml version 1 0 gt lt MicrotechRequest gt lt GetServerStatus gt lt MicrotechRequest gt Console WriteLine Successfully requested server status Output the response this will not be parsed Console WriteLine xmlResponse Submit a fixed job This is basic image job where the image file must already exist on the server The XML string argument conforms October 2 2007 Microtech API Manual Page 23 to the MicrotechJobRequest dtd DTD xmlJob _ n lt oxml version 1 0 2 gt e lt DOCTYPE MicrotechJobRequest SYSTEM C Icdr Mj XML MicrotechJobRequest_1 0 dtd gt _ amp _ lt MicrotechJobRequest gt amp _ lt Options Quantity 10 gt amp _ lt GeneralOptions ImageName MyJobName IncludeFailures TRUE Priority 4

Download Pdf Manuals

image

Related Search

Related Contents

カバーレスタイプ ループコード式 取扱説明書  BS-4000 / BS-4000m Remote Communication Station User`s Manual  Télécharger le communiqué  Philips WAS7500    User's Manual  Leso-DIAL: outil d`aide à la conception en éclairage naturel  Spot Vital Signs® LXi Service Manual  Chief SL236SP project mount  

Copyright © All rights reserved.
Failed to retrieve file