Editing metadata

Post Reply
LasseThid
Advanced member
Posts: 353
Joined: Tue Mar 03, 2015 2:30 pm
Location: Molndal, Sweden

Editing metadata

Post by LasseThid »

I have a flow where I embed an xml file in a pdf using XML Pickup.
At a later stage I would like to change one parameter in the embedded xml data from one value to another. Is that possible? If so, how do I do it?
Thanks
Enfocus Switch, Enfocus PitStop Server, Enfocus PDF Review, HP SmartStream& Kodak Prinergy with RBA
Offset 72x102, Offset Large Format, Digital Large Format and Digital print.
User avatar
gabrielp
Advanced member
Posts: 645
Joined: Fri Aug 08, 2014 4:31 pm
Location: Boston
Contact:

Re: Editing metadata

Post by gabrielp »

I'm not sure about the answer to your question, but I'd also like to know.

But the way I have got around this problem is to not rely on datasets for flow logic in cases where the flow itself might want to change a value (or where the data is not static). In my flows, I'll use XML datasets but once I initially have the dataset, I'll set the values which dictate flow logic to private data. For example, I might take a CSR's email from /aob:manifest/aob:Order/aob:csr_email and set it to Job.PrivateData:Key="CSREmail". Then, maybe later on during the flow, I might have some logic which changes who the email notification goes to or who the CSR is, so I'll send the job into a private data configurator to overwrite PD key CSREmail, allowing me to send the file back into the flow to handle the job like normal, which simplifies the flow a bit.
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.
LasseThid
Advanced member
Posts: 353
Joined: Tue Mar 03, 2015 2:30 pm
Location: Molndal, Sweden

Re: Editing metadata

Post by LasseThid »

That sounds like it should work for me.

Thanks for the tip.

Edit: Works like a charm. Thanks a bunch Gabriel!
Enfocus Switch, Enfocus PitStop Server, Enfocus PDF Review, HP SmartStream& Kodak Prinergy with RBA
Offset 72x102, Offset Large Format, Digital Large Format and Digital print.
sander
Advanced member
Posts: 276
Joined: Wed Oct 01, 2014 8:58 am
Location: The Netherlands

Re: Editing metadata

Post by sander »

Ha, how cool. I was just thinking about how to do this and the only way I could think of is using PrivateData.

So let's look at the forum for some tips, same question asked a day ago, and same thoughts :D

Before I go into using PrivateData, is any of you guys running Switch 13 yet? Can it be done easier with 13?
User avatar
gabrielp
Advanced member
Posts: 645
Joined: Fri Aug 08, 2014 4:31 pm
Location: Boston
Contact:

Re: Editing metadata

Post by gabrielp »

Here's a simple PD script that makes it easy to write values to private data from element properties: https://github.com/dominickp/SwitchWriteToPrivateData

It would be nice, since scripts like these are damn near essential to many workflows, if we all used and improved the same ones over time.
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: 276
Joined: Wed Oct 01, 2014 8:58 am
Location: The Netherlands

Re: Editing metadata

Post by sander »

I agree.
I have a couple of simple scripts which have been very useful, like you say damn essential. For sure a lot of Switch users have done the same scripting lately, it can't be otherwise.
I'm not a great scripter, but most of my scripts successful passed hundreds/thousands of jobs already haha.

More people interested? Maybe we can start easy and just simple list what we have (by name), to see if there's any more interest.


Edit: forgot to thank you for the PrivateData script, so easy and so extremely useful! Thank you!
ArielRauch
Advanced member
Posts: 231
Joined: Thu Aug 07, 2014 10:04 am

Re: Editing metadata

Post by ArielRauch »

you are all so lucky - on projects with Scripting module this is the way I handle things also.

I have initiated another thread which tries to accomplish same functionality without Scripting Module capabilities.

Any ideas?

Ariel
sander
Advanced member
Posts: 276
Joined: Wed Oct 01, 2014 8:58 am
Location: The Netherlands

Re: Editing metadata

Post by sander »

When I started my job (with Switch) a year ago I was not well known with Javascript / Scripting Module.

Since I know other scripting languages I started easy and used Powershell via Execute Command.
You can pass arguments to it, that way we can update/create a XML file and use it in a XML pickup.

Export XML » Powershell pickup / change values » XML pickup.

It takes some time to create, but I guess we need to think in such a way if there's no Scripting Module.
ArielRauch
Advanced member
Posts: 231
Joined: Thu Aug 07, 2014 10:04 am

Re: Editing metadata

Post by ArielRauch »

Thank you, Sanders.

I think I will try to perl me out of the problem
LasseThid
Advanced member
Posts: 353
Joined: Tue Mar 03, 2015 2:30 pm
Location: Molndal, Sweden

Re: Editing metadata

Post by LasseThid »

I am using Switch 13 on our Developer Server and I'm going to upgrade our Production Server as soon as I see there are no big issues, so far it's only been a couple of minor things due to changes in the configurators.

Perhaps we should ask Enfocus for a Metadata editor?
Since we can embed an xml file via XML Pickup I guess it should be possible to edit the metadata as well.
Enfocus Switch, Enfocus PitStop Server, Enfocus PDF Review, HP SmartStream& Kodak Prinergy with RBA
Offset 72x102, Offset Large Format, Digital Large Format and Digital print.
sander
Advanced member
Posts: 276
Joined: Wed Oct 01, 2014 8:58 am
Location: The Netherlands

Re: Editing metadata

Post by sander »

Sounds as feature request #1!

I'll ask Enfocus to see if there's anything in the pipeline.
User avatar
gabrielp
Advanced member
Posts: 645
Joined: Fri Aug 08, 2014 4:31 pm
Location: Boston
Contact:

Re: Editing metadata

Post by gabrielp »

LasseThid wrote:Perhaps we should ask Enfocus for a Metadata editor?
Since we can embed an xml file via XML Pickup I guess it should be possible to edit the metadata as well.
I would get behind that as well. Would also be nice if there was a quicker way to inspect metadata of a job, rather than stopping a flow and editing a connector.
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: 276
Joined: Wed Oct 01, 2014 8:58 am
Location: The Netherlands

Re: Editing metadata

Post by sander »

I don't stop my flows to check metadata.

Right click the jobs column » Show columns » Custom 1/5.
Image

Next right click your column » Set column value » Define condition with variables, and go to your metadata as normal.
Image

It's not the most elegant way, but at least you don't have to stop the flow. I use the custom columns a lot when building flows so I can quickly check what's going on with the metadata.
User avatar
gabrielp
Advanced member
Posts: 645
Joined: Fri Aug 08, 2014 4:31 pm
Location: Boston
Contact:

Re: Editing metadata

Post by gabrielp »

sander wrote:I don't stop my flows to check metadata.

Right click the jobs column » Show columns » Custom 1/5.
Very cool. Did not know you could do that. Thanks for sharing.
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.
Post Reply