Extensis Logo SUPPORT | FORUMS | KNOWLEDGE BASE

MediaScript/API advice


#1

Hi Matt,

Richard Bamford (Extensis UK) has suggested I get in touch with you via this forum to get some advice on the MediaScript/API capabilities. We are implementing Portfolio at a client in the UK and their workflow process is dependent on what we can achieve with this.

There are three different functions they are looking to achieve:

  1. Automate the File > Import Field Values and Item > Embed Properties functionality. I have attached a diagram to explain the process they are trying to achieve.(Please note that the “Placeholder” mentioned is just a dummy image, nothing to do with the Placeholder function within Portfolio)

Questions are:
a) Will this be achievable?
b) Is it possible to schedule this to happen automatically or does it need to be user triggered?
c) Has anything like this been done before i.e. is there any code to use as a starting point or will this need to be created from scratch?
d) Do you have any recommendations or can foresee any issues with what we are trying to do?

  1. Create logic to handle their “Best Image” process. They are an apparel company and have two stages in the product development process where they take photos of the products. The first stage is when a sample comes in. This is known as a Lookbook image. The 2nd is when the production product comes in. This is called the Web image. The Web image is considered the “best” image as things like trims and colours can change between Lookbook and Web, so only Web is the final, true representation of what will be sold. It is the Lookbook images that get created in the process in point (1). The Web images get created later. Ideally Lookbook images will be stored in Catalog 1 and Web images will be stored in Catalog 2. As they have 1000’s of products they don’t want to view Lookbook images in searches if they have Web images available. What they want to do is have some sort of logic in place that filters out Lookbook images if there are Web images available instead.

What we were thinking was this:

There would be a field (custom or default renamed) called “Best Image”. When the Lookbook image was created (as per process in point 1) this field would be auto-populated to be true when image was first created. Later on down the line when a Web image was created this would also get the “best image” field auto-populated to be true, however, at the same time there would need to be logic in place that would say match up the product number from the new Web image to the Lookbook image and on the Lookbook image set the “best image” field to false.

Questions are:
a) Would this be possible?
b) If so, can Lookbook image and Web images be in different catalogs or would it be better if they were in the same one? (what the pros/cons to either approach)
c) How best to set up the configuration (custom field or rename standard field etc) in order to achieve this?
d) Could this be done automatically as soon as Web images are created or would it need to be a user triggered script?

  1. They need to be able to produce a report called the “Focus List”. I have attached an example of what this report needs to look like (layout not yet finalised). The bit that we need advice on is the size ratio grid with the colour coding (green, orange, red etc). This colour coding represents the stock levels they have for each size. For example if there are under 400 units it will be red, if it is between 401 and 1000 units it will be orange, if it is greater than 1000 units if will be green. This information comes from another system as part of the metadata import described in point 1. Ideally they want a “Make PDF” menu option that will generate this report from Portfolio for any search view i.e. they search to see all Mens Polo Tops then they would run this report.

Questions are:
a) Will this be possible to produce as a PDF from Portfolio?
b) In terms of getting the stock info per size in via meta-data they are pretty flexible in terms of how to set up the import file. For example they could have 1 field that contains all the size/stock info i.e. [S-456, M-239, L-1003, XL-388] or they could have a different field for each size i.e. [S-456] [M-239] [L-1003] [XL-388]. They could have the size and stock in different fields as well i.e. [S] [456], [M] [239]. What they would like advice on is how would be best to format the text file data import and the field configuration in Portfolio in order to facilitate creating this report.
c) They would also need the date/time of the last update (so the time the metadata import happened) stamped in either the footer or header of each page - would this possible?
d) Based on the visual I have provided, can you see anything else that would be problematic to achieve?

Apologies for all the questions - hopefully it all makes sense! We have an update call Friday am (UK time) so if you could come back to me before then that would be much appreciated.

Many thanks

Jo





#2

Hi Jo,

I’m sorry that I haven’t gotten back to you sooner, we have been on holiday here in the States.

I’m going to tackle each question one at a time. You’ve waited long enough for a response, I don’t want you waiting longer while I figure out the answer for each question.

[quote]1) Automate the File > Import Field Values and Item > Embed Properties functionality. I have attached a diagram to explain the process they are trying to achieve.(Please note that the “Placeholder” mentioned is just a dummy image, nothing to do with the Placeholder function within Portfolio)

Questions are:
a) Will this be achievable?
b) Is it possible to schedule this to happen automatically or does it need to be user triggered?
c) Has anything like this been done before i.e. is there any code to use as a starting point or will this need to be created from scratch?
d) Do you have any recommendations or can foresee any issues with what we are trying to do?[/quote]

I don’t seen any reason for this not to be achievable. We have a couple of customers that have created tools to sync metadata between another database and Portfolio. Whether they are doing so by importing an XML/CSV file or having the two applications communicate directly, I do not know. (Though I suspect that it is the latter.)

Here are a couple of adjustments you might want to review in your workflow.

[ol]
[li]You are currently using an Applescript to create a folder and the placeholder. You could probably discontinue the use of the Applescript and merge steps 1 and 4 together in an API script/tool. Create the folder, create the placeholder, export the metadata and apply it to the record. At this point I would not embed the metadata into the image as the placeholder is a temporary image that will be replaced.
[/li]
[li]When you replace the placeholder, you should think about making some form of metadata change. Perhaps adding or removing a keyword. Embedding metadata is not a separate function, it is built into the UpdateFieldValues method. So when you add a keyword, and it should embed all the metadata to the image, not just the latest change.[/li][/ol]

API functions can be scheduled using different methods, depending on what kind of system that you are using. You can have maintenance functions activate via the Task Scheduler on Windows, or Crontab in the Mac OS/UNIX. You may also be able have Sample Shot Creative trigger an API tool when it replaces the placeholder image.

As for starter code, you can review the code samples that we have online here: API Code Reference
I also uploaded some placeholder sample code on this site two weeks ago. You can find that post here.

If you have anymore questions on this topic, please let me know.

Matt


#3

Hi Matt,

Thanks for getting back to me - no worries about the delay, I stupidly didn’t realize that it was Thanks Giving last week!

No further questions regarding point (1), that all makes sense. I will feed this back to the client tomorrow.

Just so I can set the expectation, please could you give me an estimate of when you may have answers to the other 2 points?

Many thanks

Jo


#4

Hi Jo,

As I mentioned, here is my initial answer to question 2.

[quote]
2) Create logic to handle their “Best Image” process. They are an apparel company and have two stages in the product development process where they take photos of the products. The first stage is when a sample comes in. This is known as a Lookbook image. The 2nd is when the production product comes in. This is called the Web image. The Web image is considered the “best” image as things like trims and colours can change between Lookbook and Web, so only Web is the final, true representation of what will be sold. It is the Lookbook images that get created in the process in point (1). The Web images get created later. Ideally Lookbook images will be stored in Catalog 1 and Web images will be stored in Catalog 2. As they have 1000’s of products they don’t want to view Lookbook images in searches if they have Web images available. What they want to do is have some sort of logic in place that filters out Lookbook images if there are Web images available instead.

What we were thinking was this:

There would be a field (custom or default renamed) called “Best Image”. When the Lookbook image was created (as per process in point 1) this field would be auto-populated to be true when image was first created. Later on down the line when a Web image was created this would also get the “best image” field auto-populated to be true, however, at the same time there would need to be logic in place that would say match up the product number from the new Web image to the Lookbook image and on the Lookbook image set the “best image” field to false.

Questions are:
a) Would this be possible?
b) If so, can Lookbook image and Web images be in different catalogs or would it be better if they were in the same one? (what the pros/cons to either approach)
c) How best to set up the configuration (custom field or rename standard field etc) in order to achieve this?
d) Could this be done automatically as soon as Web images are created or would it need to be a user triggered script?[/quote]

[ol]
[li]Yes, this is possible.[/li]
[li]Having them in separate catalogs could complicate things when applying metadata and doing searches. It is possible, but you would be making the job harder. There is also potential problems of duplicate Record IDs, since they would not be unique between Catalogs.[/li]
[li]Your suggestion of a custom field called “Best Image” would probably work best. The only caveat would be that any searches you perform would have to add the “Best Image” = True. ( “Description” contains “flower” AND “Best Image” matches “true” ) If you were to create a web interface with the API, you could add that part of the search behind the scenes.[/li][/ol]

In your first question, you mentioned a Placeholder image. Which to me is an image that holds the records place until the true image can replace it. But from your second question, it sounds like they are two separate images that may exist in the same catalog. This brings up a couple of my own questions.
[ol]
[li]If both images exist in the catalog, will you need to migrate the metadata from the Lookbook to the Web Image.[/li]
[li]When they Web Image is added, will the Lookbook still need to be updated with metadata? Or can it be safely ignored.[/li]
[li]Do you still need the Lookbook image, or can it be replaced by the Web image?[/li]
[li]Will they have the same filename but different locations or different filenames, same location? [/li][/ol]

[quote]
d) Could this be done automatically as soon as Web images are created or would it need to be a user triggered script?[/quote]

There may be a way to automate this, but the trigger would have to be something outside of Portfolio. Perhaps the application that creates the Web Images could launch the tool when it saves the image. Perhaps a tool would launch when a file is saved in a certain folder. (Mac OS and Folder Actions? Something equivalent on Windows? ) Unfortunately, I do not have enough knowledge to say “Yay” or “Nay” on this question. Having the script be user activated would certainly be easiest to implement, but there may be better ways to do this.

Please let me know if you have any questions.

Matt


#5

[quote]In your first question, you mentioned a Placeholder image. Which to me is an image that holds the records place until the true image can replace it. But from your second question, it sounds like they are two separate images that may exist in the same catalog. This brings up a couple of my own questions.

If both images exist in the catalog, will you need to migrate the metadata from the Lookbook to the Web Image.
When they Web Image is added, will the Lookbook still need to be updated with metadata? Or can it be safely ignored.
Do you still need the Lookbook image, or can it be replaced by the Web image?
Will they have the same filename but different locations or different filenames, same location? [/quote]

Hmm, good questions! Hadn’t thought about those. In terms of the process, the Placeholder image is replaced with the Web image. The Web image is a new image, it doesn’t replace the Lookbook image. I will have to double check why, but I think they want to see the history. I will ask your questions to the client tomorrow and if they raise further questions I will come back to you.

Thanks

Jo


#6

Hi Matt,

Do you have any feedback for question 3 regarding the Focus List report requirement yet?

Thanks

Jo


#7

Jo,

I’m sorry I have not gotten back to you on this. There have been some other projects that I have been focusing on.

a) Will this be possible to produce as a PDF from Portfolio?
Currently this functionality does not exist within Portfolio. However, this feature is on our radar and is being investigated as a possible addition in a future version of the product. You could use the API to export the metadata and images from Portfolio and then create a PDF using some of the PDF java libraries that are available. PDFbox comes to mind.
b) What they would like advice on is how would be best to format the text file data import and the field configuration in Portfolio in order to facilitate creating this report.
It would depend on what the report is for. If this is supposed to be a human readable report, then you would want it to be formatted in a style that is comfortable to read. But, if this report is a source of metadata to generate a PDF file, then you should probably look at XML. XSLT and XSL-FO can be used to take XML and transform the data into PDF files.
c) They would also need the date/time of the last update:
The field Changed in Portfolio records when the records are changed. This is updated anytime the record is modified. When the Metadata import occurs, it would be updated. But that also means that if someone adds a keyword a week later, it would be updated again. If you want to have a field that only records when the Metadata import occurs, you should create a custom field and have it populated at the same time as the import. As for having it displayed in the report, that is a matter of including the date in the XML export and making sure your PDF file is taking the date and putting it in the right place.
d) Based on the visual I have provided, can you see anything else that would be problematic to achieve?
As I mentioned in question a), this report is not possible with the current version of Portfolio. If you wanted to create this in the API, then you could probably do it. But the actual generation of the PDF would have to be accomplished by a tool that you create using data exported from Portfolio.

If you have any questions about my answers, or if you feel there is an area where we can go into more detail, please let me know.

Matt