How to get all attributes in IMatch Anywhere?

Started by BaliDave, January 26, 2017, 12:50:14 PM

Previous topic - Next topic

BaliDave

I can't see how to get all the attributes for a file that I am viewing in IMatch Anywhere.  I see there's an endpoint for attributes, but don't know how to reference that to retrieve all the attributes.  Am I missing something?

Mario

The /attributes endpoint allows you to retrieve attribute data for one or more files.
The set name is mandatory. If you have multiple sets, call it once for each set.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

BaliDave

But how do I get the fileID?  And what are the set names? 

BTW, I tried the two links in the generated help file (one for the FileInfo set and the other for just the Notes and Comments attributes) and both give me error messages immediately with missing set name:
{
   "error" : {
      "code" : 1102,
      "message" : "Invalid parameter.",
      "details" : {
         "parameter" : "set",
         "description" : "The set parameter is missing or does not contain a valid set name. This method can only retrieve data from global Attribute Sets. Use /files/attributes to access 'per-file' attribute data."
      }
Problem may arise due to some file mapping errors I'm seeing (see attached).  I don't understand the messages tho since both C and G are internal hard drives, so they're not mapped. 

Mario

#3
The /attributes endpoint allows you to retrieve attribute data for a given global or per-file attribute set.
If you want to query data for the Attribute set 'Notes' you specify 'Notes' as the set name.
If you want only specific Attributes from that Set, you can specify their names in the attributes parameter.

If you want to query a global Attribute set, don't use id.
For a per-file set, specify the id of the file(s) for which you want to retrieve the data.

http://your-pc:8081/v1/attributes?auth_token=ABCD&set=Notes&id=1-10

returns the Attribute data from the Attribute Set 'Notes' for the files with the ids 1,2,3,4,5,6,7,8,9,10

You have to get the file ids from somewhere before of course.
All endpoints which returns sets of files return this id. For example, if you query the files in a folder or category, or you perform a search, the endpoints returns a list of files. If you request the id field, you can then use these ids to query the attributes for these files.

Note: The /attributes/schema endpoint returns information about the Attribute schemata in your database. This allows you to discover which Attribute schemata exist, their names, and the name and type of their attributes.

You can try that out directly from the Discover IMatch Anywhere screen. All the links there are "live" and work with your database.
If you click on the example link for /attribute/schema it opens a new window and tries to retrieve the data for the set named 'Clients'. If you just remove the set=Clients parameter and reload, you'll get info about all sets in your database.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

BaliDave

OK, good I now can find attributes and the sets. 

Maybe I'm being dense but what I'd like is a point-and-click way to get attributes, metadata, ... from images I select in the Viewer.  Now all I can get this way are filename, keywords, title, description, photo info of these and can download the files.  And this if fine for many uses.  But even here I don't have file id's available AFAIK, just the above info. So how should I go about getting the file id's when I've seen the photos I want info on?

For example, if I select one or more categories, I view the pictures there.  The numbers above each pic are apparently not the file-ids.  So if I want to find out more about one or more of these pics (not all), I then need to use endpoints (in some way I don't presently understand) to get to these file id's (not clear to me why and how I have to duplicate my previous selection of these pics), and then endpoints again to retrieve the info about them.  Is this the operating scenario for IMA now?  I know this is Version 1 of IMA, but want to understand what I can reasonably use this for.

And I still have those ominous-sounding warning messages about using mapped drives.  So far ignoring them seems to work, but maybe that's the cause of my confusion.

Thanks,
Dave

Mario

#5
I'm not sure that I can follow.

QuoteMaybe I'm being dense but what I'd like is a point-and-click way to get attributes, metadata, ... from images I select in the Viewer. 

When you say "Viewer", what do you mean? The Viewer in IMatch? The Viewer feature in IMatch Anywhere?
Do you want to extend IMatch WebViewer?

What are you trying to accomplish?


The file window in IMatch WebViewer of course knows the id of each file it displays. It just does not show it because the file is is meaningless for the user. The index above each file is just that - the index of the file in the file window. You can show additional metadata for each file if you switch to one of the two custom layouts and then configure the layout to show the data you want to see in the Settings. You can also customize the information displayed in the Viewer in IMatch WebViewer via the Settings.

You can use  a free mix of HTML and standard IMatch variables to customize the layout and Viewer.


QuoteAnd I still have those ominous-sounding warning messages about using mapped drives.  So far ignoring them seems to work, but maybe that's the cause of my confusion.
There are not ominous. Either some of your folders are off-line or IMWS is unable to access them. If it cannot access folders, it cannot create cache or thumbnail files. This is not good. Hence the messages are important. Solve them by making sure IMWS can access all folders. If you are using mapping drives: Windows services like IMWS cannot access mapped drives. Switch your database to using proper UNC paths instead.

See the IMatch Anywhere documentation and the IMatch Anywhere FAQ for more info.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

BaliDave

OK, progress again.   Now I can get the file LTID displayed.
Thanks for your patience -- other than viewing/rating photos, I don't dig into other aspects of IM at most every year or two, so it's always  a challenge to get back into the inner-workings.

QuoteWhen you say "Viewer", what do you mean? The Viewer in IMatch? The Viewer feature in IMatch Anywhere?
Do you want to extend IMatch WebViewer?
What are you trying to accomplish?
I meant the IMA WV, not IM Viewer.  I'm trying to select files via the navigator and then be able to see the attributes and the metadata of some of them.  With custom layouts I can now get the LTID and the metadata too.  But the attributes, it looks like then I need to access the endpoint by copying the LTID's and pasting into the URL for the attributes of interest, correct?  I don't see how to get to attributes in the Custom Layouts, tho I can get metadata there.

QuoteQuote
And I still have those ominous-sounding warning messages about using mapped drives.  So far ignoring them seems to work, but maybe that's the cause of my confusion.
There are not ominous. Either some of your folders are off-line or IMWS is unable to access them. If it cannot access folders, it cannot create cache or thumbnail files. This is not good. Hence the messages are important. Solve them by making sure IMWS can access all folders. If you are using mapping drives: Windows services like IMWS cannot access mapped drives. Switch your database to using proper UNC paths instead.
Well these drives are not mapped and are accessible by IMWS.  And things seem to be working OK even with these messages.  "C" is my system drive. and G is to contain only the cache folder and is an internal drive.  I verified these settings are OK by only changing the database I'm looking at in IMWS in the Configuration settings, and I then do NOT get these warnings in IMA WV.. So something with one of my DB's  is confusing IMWS, tho the messages are about where I want IMWS to store the cache and the document root.  The doc root is set as
C:\ProgramData\photools.com\IMatchAnywhere\IMWS\docroot
and cache as
G:\IMatchAnywhere
Both of these settings work with another IMatch database without any warnings.
Ideas?

Mario

I would need the precise message. Also check the IMWS log file (click on the link in the Controller to open it) to see what IMWS is complaining about.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

BaliDave

#8
Errors I see in IMWV:
QuoteDrive/Media off-line: 'C: (D436-B81F)'. Note: drive mappings cannot be used in Windows services.
Jan 30, 2017 11:29:05 AM (drive.unavailable)
Drive/Media off-line: 'G: (45C-D149)'. Note: drive mappings cannot be used in Windows services.
Jan 30, 2017 11:29:05 AM (drive.unavailable)

I don't see any errors indicated in the IMWS log file
Attached is a screenshot of the IMWS panel, and a zip of the IMWS log file
And all seems to be functioning OK, just these messages.

And I see it's the files OID not LTID that's needed for getting attributes via an endpoint -- I missed that bit.

BTW: I did get all the attributes displayed now with a Custom Layout, so I'm basically a happy camper now with IMA for one specific use; it'll be great with the others.  Kudos.

[To those who are looking at this thread due to wanting to display attributes and are a bit lost and are not so conversant with using IMatch variables/... -- here's my admittedly rather crude Custom Layout to display ones I have defined (YMMV).  You can modify as needed:
Header: <Run FontSize="10pt">{File.NameExt}/ {File.DateTime|format:YYYY/MM}<br>
{File.Categories|level:leaf;prefix: <Run FontSize='9pt'>Categories:  ;postfix:</Run>}<br>
Rating: <Run FontSize="10pt">{File.Rating|cast:int; replace:-1==X;replace:0==NR}</Run><br>
 <Run FontSize='8pt'>({File.Width} x {File.Height} - {File.Size})</Run><br>
AttrEndPt: &set=Image&id={File.OID}</Run>

Footer:<Run FontSize='10pt'><b>{File.AT.Image.Address} {File.AT.Image.Description}/{File.AT.Image.Miscellaneous} Ph: {File.AT.Image.Telp} /  {File.AT.Image.HPhone} <br>Added: {File.AT.Image.WhenAdded} {File.AT.Image.EmailWeb}</Run><br>
Notes: {File.AT.Notes.Comment}/{File.AT.Notes.Note}

]

Mario

The web service log is clean. But the IMatch engine reports that the folder C: is off-line.

Did you move your files to another disk?
Do you use IMWS on another PC than IMatch?

You may need to relocate or setup the portability options so IMWS can automatically relocate your files from C: to C:
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

BaliDave

QuoteDid you move your files to another disk?
Do you use IMWS on another PC than IMatch?
Originally the DB was on another machine.  I moved it to mine, relocated image files in IMatch (files are on my drive F tho, not C nor G), and use IMatch with it on my machine for a long time. All seems to work fine in IMatch.

I've only run IMWS on my machine.

I looked at the portability option but am totally lost as to what to do there.  See attached for what I'm seeing in that -- lots of warnings about folders in C: & G: that I don't recognize,  but  the locations there are NOT where things were on the other machine nor on mine.  Any ideas?

Mario

IMatch obviously cannot find the disks C: and G:  (yellow off-line marker).
Did you relocate them correctly? This does not look like it.

For an explanation about the portability options: Press <F1> in the dialog. Everything that you need to know is explained in the help. I cannot copypaste that here.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

BaliDave

QuoteIMatch obviously cannot find the disks C: and G:  (yellow off-line marker).
Did you relocate them correctly? This does not look like it.
IMatch finds everything fine and has no problems nor does it report any problems.  It's only IMWV that's seeing problems, tho it appears to work OK too.

But the portability options in IMatch only show me "problem files" (those with the yellow warning symbol, on C & G) that do NOT exist on either machine (see screenshot in my  previous post); those on F are fine.  And that is the same whether I choose Folders or Disks.  I did choose the portability option for the folder on F and mapped it to itself; still same results.   Note that all images in this DB are in the one folder on F -- nothing is, or ever was, on G or C -- and that's true for both machines where this db is. And everything works flawlessly in IMatch, just IMWV shows error messages, but works OK.  So I can't see how to set anything in portability options at all that will do anything.

I went into Maintenance mode on IMWV and ran Database Diagnosis, and that reported 0 warnings and 0 errors. 

Any ideas how to work around this? I can give you access by pm if you want. 

Mario

The folder dialog (in IMatch) shows all folders in your database. The folders with the off-line icon are in the database, but don't exist on your computer.
Please look at the Media & Folders View of that database It should also show yellow off-line icons.

Of course IMatch and IMWS will "function" with off-line folders. They have been designed that way. But IMWS will be unable to create cache files (images) for the built-in Viewer. Thumbnails are produced from the thumbnails contained in the database and thus will work whether or not IMWS can access the original files.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

BaliDave

Ah ha, that's it!  Those folders were part of some other db that's long gone.  I must've copied that db to start for this one when I first got IMatch.  Anyhow that resolves the error messages.  Thanks for your persistence.  I think I'm all set now.

Mario

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook