Transfer the Indigo Substrate list to SQL-Database

lombert
Member
Posts: 167
Joined: Fri Feb 04, 2011 2:31 pm
Location: Sweden

Transfer the Indigo Substrate list to SQL-Database

Post by lombert »

In the Indigo you can export the substrate-list as a xml. I want that list in a mySql-database so I can from Switch Client chose the 'correct-substrate' as it's named in the Indigo. And use the list as an Translation from the "real paper name".

It looks like this;

<Substrates>
<SubstrateDefinitions>
<SubstrateDefinition>
@name = "SubstrateName"
<SubstrateDefinition>
@name = "SubstrateName"
<SubstrateDefinition>
@name = "SubstrateName"

I guess some sort of script can do this. An XSLT-transform may to. Or can I pick the list direct from the Indigo?

Anyone done this?
Between jobs!
sander
Advanced member
Posts: 302
Joined: Wed Oct 01, 2014 8:58 am
Location: Den Bosch

Re: Transfer the Indigo Substrate list to SQL-Database

Post by sander »

I use Notepad++ to do the magic;

CTRL + F
Tab: mark
Find what: <SubstrateDefinition name="
Tick: mark line
Image

Search » Bookmark » Copy Bookmarked lines
Paste in new document.

CTRL + H
Replace "<SubstrateDefinition name=" with nothing
Replace "> with nothing
Image

This leaves only the substrates :)
Sort with A-Z or whatever, and copy into Switch Client.
lombert
Member
Posts: 167
Joined: Fri Feb 04, 2011 2:31 pm
Location: Sweden

Re: Transfer the Indigo Substrate list to SQL-Database

Post by lombert »

You do it easy way, not fun! ;)

I'm om mac, Notepad++ don't exist.. Text wrangler don't do that search. Need to find other program then.. :)
Between jobs!
sander
Advanced member
Posts: 302
Joined: Wed Oct 01, 2014 8:58 am
Location: Den Bosch

Re: Transfer the Indigo Substrate list to SQL-Database

Post by sander »

Ouch man, you hurt my feelings.

Especially for you, I created this XSL transform :mrgreen:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">

<xsl:for-each select="//SubstrateDefinition">
<xsl:value-of select="@name[position()]"/><xsl:text>&#10;</xsl:text>
</xsl:for-each>

</xsl:template>
</xsl:stylesheet>
sander
Advanced member
Posts: 302
Joined: Wed Oct 01, 2014 8:58 am
Location: Den Bosch

Re: Transfer the Indigo Substrate list to SQL-Database

Post by sander »

Now find the command line to export the list, and let Switch update it on a nightly base ;)
lombert
Member
Posts: 167
Joined: Fri Feb 04, 2011 2:31 pm
Location: Sweden

Re: Transfer the Indigo Substrate list to SQL-Database

Post by lombert »

Big thanks Sander! :)

Image
Between jobs!
sander
Advanced member
Posts: 302
Joined: Wed Oct 01, 2014 8:58 am
Location: Den Bosch

Re: Transfer the Indigo Substrate list to SQL-Database

Post by sander »

You're welcome :D
lombert
Member
Posts: 167
Joined: Fri Feb 04, 2011 2:31 pm
Location: Sweden

Re: Transfer the Indigo Substrate list to SQL-Database

Post by lombert »

sander wrote:Now find the command line to export the list, and let Switch update it on a nightly base ;)
We don't change the substrate-list that often.. ;)
Between jobs!
sander
Advanced member
Posts: 302
Joined: Wed Oct 01, 2014 8:58 am
Location: Den Bosch

Re: Transfer the Indigo Substrate list to SQL-Database

Post by sander »

We neither, but it sounds fun :)
User avatar
gabrielp
Advanced member
Posts: 645
Joined: Fri Aug 08, 2014 4:31 pm
Location: Boston
Contact:

Re: Transfer the Indigo Substrate list to SQL-Database

Post by gabrielp »

Man, whoever is setting up your substrate IDs is doing a beautiful job. Ours are super inconsistent, so we have to translate them from a human-readable substrate name to the correct press ID. Dwight's CSVLookup is really nice for this!
Free Switch scripts: open-automation @ GitHub
Free Switch apps: open-automation @ Enfocus appstore

Want to hire me? I'm looking for my next gig. Contact me on LinkedIn or via email.
sander
Advanced member
Posts: 302
Joined: Wed Oct 01, 2014 8:58 am
Location: Den Bosch

Re: Transfer the Indigo Substrate list to SQL-Database

Post by sander »

Hm, we also have such a nice list. I just gave operators 2 or 3 rules and once in a while I look at it to correct some things.

Much easier in my opinion, and with 2 DFE's which are going to sync via PrintOS it needs to be 100% good looking.
cstevens
Member
Posts: 105
Joined: Tue Feb 12, 2013 8:42 pm

Re: Transfer the Indigo Substrate list to SQL-Database

Post by cstevens »

A more automated method to handle this would be through JMF queries. On the HP Production Pro product page I uploaded a simple flow that sends various JMF queries and captures the response as metadata using the XML Pickup element. You can find it here under the title "Send JMF Query and capture response as Metadata"

https://www.enfocus.com/en/products/swi ... int-server

You can capture the substrate list of an individual press using a Resource query to the Press Device's URL:

Image

where "PressDeviceID" is replaced with the network location value of the press, and the IP address at the beginning of the URL is replaced with your Production Pro System Manager's IP or hostname.

You can also capture the list of all substrates by sending a KnownDevices query (with DeviceDetails set to Full) to the Production Pro's JMF URL:

Image

Again with the IP address at the beginning of the URL replaced with the IP/Hostname of your Production Pro's System Manager server.

You would probably want to set the Timer interval to a much higher interval than every 2 minutes (120 seconds) however.
lombert
Member
Posts: 167
Joined: Fri Feb 04, 2011 2:31 pm
Location: Sweden

Re: Transfer the Indigo Substrate list to SQL-Database

Post by lombert »

Thanks 'cstevens'!

I'v got some different xml-files. :)
I don't really knew what I'm doing, but the;
gives me a xml there I can find this string there I can find my media;

Code: Select all

/dn:JMF/dn:Response/dn:DeviceList/dn:DeviceInfo/dn:Device[1]/dn:DeviceCap/dn:DevCaps[5]/dn:DevCap/dn:StringState[1]/dn:Value[1]/@AllowedValue
How can I change 'sanders' XSL transform to pickup this string instead? hum? ;)
Last edited by lombert on Wed Sep 07, 2016 10:13 am, edited 1 time in total.
Between jobs!
sander
Advanced member
Posts: 302
Joined: Wed Oct 01, 2014 8:58 am
Location: Den Bosch

Re: Transfer the Indigo Substrate list to SQL-Database

Post by sander »

I'm lazy, can you post that xml? I'll take a look if you want. Chad's sleeping now ;)
lombert
Member
Posts: 167
Joined: Fri Feb 04, 2011 2:31 pm
Location: Sweden

Re: Transfer the Indigo Substrate list to SQL-Database

Post by lombert »

sander wrote:I'm lazy, can you post that xml? I'll take a look if you want. Chad's sleeping now ;)
:) You got mail
Between jobs!
Post Reply