Using Mms Web Services
<h3 class="heading-h6"><a name="THLToolboxhomegtDevelopersZonegtRubyonRailsDevelopmentgtRoRMediaManagementMMSApplicationDevelopmentgtHowtoUseMMSWebServices" class="anchorpoint"></a><a href="/tools/wiki/home.html">THL Toolbox</a> > <a href="/tools/wiki/Developers%27%20Zone.html">Developers' Zone</a> > <a href="/tools/wiki/Ruby%20on%20Rails%20Development.html">Ruby on Rails Development</a> > RoR Media Management-MMS Application Development > How to Use MMS Web-Services</h3><p class="paragraph">
</p><h3 class="heading-h1"><a name="HowtoUseMMSWebServices" class="anchorpoint"></a>How to Use MMS Web-Services</h3><p class="paragraph"><strong class="bold">Contributor(s)</strong>: Than Grove
</p><h3 class="heading-h2"><a name="Images" class="anchorpoint"></a>Images</h3><p class="paragraph">To find out the XML metadata for a single image, locate the image in MMS and add ".xml" to the URL. This will produce an XML file that contains information about the image along with the different URLs to the various sizes. These URLs can be used when a particular size is needed to be displayed. For example, the URL <img src="/" alt="external link: " title="external link"/><span class="nobr"><a href="http://mms.thlib.org/media_objects/604.xml" target="rwikiexternal">http://mms.thlib.org/media_objects/604.xml</a></span> produces the following XML:</p><div class="code"><pre><picture>
<id>604</id>
<copyright id=<span class="xml-quote">"604"</span>>
<copyright_holder title=<span class="xml-quote">"ILCS"</span> website=<span class="xml-quote">"http://www.rub.edu.bt"</span> id=<span class="xml-quote">"3"</span>/>
<reproduction_type title=<span class="xml-quote">"only private uses permitted"</span> website=<span class="xml-quote">""</span> id=<span class="xml-quote">"4"</span>/>
</copyright>
<associated_category title=<span class="xml-quote">"Ritual Documentation"</span> id=<span class="xml-quote">"3816"</span>/>
<associated_category title=<span class="xml-quote">"Namkha Lhakhang Tang Rabney"</span> id=<span class="xml-quote">"4030"</span>/>
<associated_feature fid=<span class="xml-quote">"18104"</span> title=<span class="xml-quote">"Namkha"</span>/>
<image thumbnail=<span class="xml-quote">"compact"</span> height=<span class="xml-quote">"95"</span> url=<span class="xml-quote">"http://mms.thlib.org/images/0000/1795/604_compact.jpg"</span> size=<span class="xml-quote">"3015"</span> width=<span class="xml-quote">"95"</span>/>
<image thumbnail=<span class="xml-quote">"essay"</span> height=<span class="xml-quote">"225"</span> url=<span class="xml-quote">"http://mms.thlib.org/images/0000/1795/604_essay.jpg"</span> size=<span class="xml-quote">"21428"</span> width=<span class="xml-quote">"300"</span>/>
<image thumbnail=<span class="xml-quote">"huge"</span> height=<span class="xml-quote">"300"</span> url=<span class="xml-quote">"http://mms.thlib.org/images/0000/1795/604_huge.jpg"</span> size=<span class="xml-quote">"56051"</span> width=<span class="xml-quote">"400"</span>/>
<image thumbnail=<span class="xml-quote">"large"</span> height=<span class="xml-quote">"300"</span> url=<span class="xml-quote">"http://mms.thlib.org/images/0000/1795/604_large.jpg"</span> size=<span class="xml-quote">"35325"</span> width=<span class="xml-quote">"400"</span>/>
<image thumbnail=<span class="xml-quote">"normal"</span> height=<span class="xml-quote">"300"</span> url=<span class="xml-quote">"http://mms.thlib.org/images/0000/1795/604_normal.jpg"</span> size=<span class="xml-quote">"35325"</span> width=<span class="xml-quote">"400"</span>/>
<image thumbnail=<span class="xml-quote">"search"</span> height=<span class="xml-quote">"113"</span> url=<span class="xml-quote">"http://mms.thlib.org/images/0000/1795/604_search.jpg"</span> size=<span class="xml-quote">"5398"</span> width=<span class="xml-quote">"150"</span>/>
<image thumbnail=<span class="xml-quote">"thumb"</span> height=<span class="xml-quote">"120"</span> url=<span class="xml-quote">"http://mms.thlib.org/images/0000/1795/604_thumb.jpg"</span> size=<span class="xml-quote">"4404"</span> width=<span class="xml-quote">"120"</span>/>
</picture></pre></div><p class="paragraph">
</p><h3 class="heading-h2"><a name="Collections" class="anchorpoint"></a>Collections</h3><p class="paragraph">If one wants the information about a specific collection of images, such as those with a parameter "?keyword_id=…", append the parameter "&format=xml" to the end of the URL. This will provide an "array" of XML nodes with information about each image in that group. These nodes do not however contain the URL for each individual version of each picture. Instead, the idea for that image must be used as described above to find the individual image locations. An example of this is:</p><p class="paragraph"><img src="/" alt="external link: " title="external link"/><span class="nobr"><a href="http://mms.thlib.org/media_objects?keyword_id=32&format=xml" target="rwikiexternal">http://mms.thlib.org/media_objects?keyword_id=32&format=xml</a></span>
</p><h3 class="heading-h2"><a name="Searches" class="anchorpoint"></a>Searches</h3><p class="paragraph">One can perform a search on MMS through the URL by using GET parameters, namely by calling <img src="/" alt="external link: " title="external link"/><span class="nobr"><a href="http://mms.thlib.org/media_searches?" target="rwikiexternal">http://mms.thlib.org/media_searches?</a></span> followed by a list of key=value pairs. The most common search parameters are:</p><ul class="star"><li>media_search_title : This is the search keyword(s), such as "mountain"</li>
<li>media_search_type : this can be either "simple" or "boolean". Simple is a regular search, boolean is advanced search.</li></ul><p class="paragraph">An example is: <img src="/" alt="external link: " title="external link"/><span class="nobr"><a href="http://mms.thlib.org/media_searches?media_search_title=+mountain&media_search_type=boolean" target="rwikiexternal">http://mms.thlib.org/media_searches?media_search_title=+mountain&media_search_type=boolean</a></span>
</p><h3 class="heading-h6"><a name="ProvidedforunrestrictedusebythespanclassnobrimgsrcsakairwikitoolimagesicklearrowgifaltexternallinktitleexternallinkahrefhttpwwwthliborgtargetrwikiexternalTibetanandHimalayanLibraryaspan" class="anchorpoint"></a><em class="italic">Provided for unrestricted use by the <span class="nobr"><img src="/" alt="external link: " title="external link"/><a href="http://www.thlib.org" target="rwikiexternal">Tibetan and Himalayan Library</a></span></em></h3>