INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: search album using ajax/MCWS  (Read 2454 times)

gis

  • Recent member
  • *
  • Posts: 5
search album using ajax/MCWS
« on: September 06, 2010, 09:05:55 am »


 Hai,

        I am new to this MCWS developers, I have searched lot in forum but i didn't get exact solution for my problem so, i started new topic.

my client need to search in browser as he types in an artist (or album/song depending on how they are viewing their music) the list will start to filter out content in real time.

Thank you
Logged

gis

  • Recent member
  • *
  • Posts: 5
Re: search album using ajax/MCWS
« Reply #1 on: September 07, 2010, 04:27:00 am »

Hai,
 I have done this partially that is using query MCWS/v1/Files/Search?Query=<keyword>&Output=mpl  and got an XML output but how to parse and display and one more thing they likes to filter by artists, albums and songs depending on what category they are in.

please reply

thank you
Logged

JohnT

  • Citizen of the Universe
  • *****
  • Posts: 4627
Re: search album using ajax/MCWS
« Reply #2 on: September 07, 2010, 09:04:27 am »

Have you played around with the search box in Media Center?  Any of the expressions used in the search box can be used in the MCWS query string.  For example to show all audio files with "Bob" in the artist field you can use:
.../MCWS/v1/Files/Search?Query=[Media%20Type]%3daudio%20[Artist]%3dBob

MPL is our standard xml format for describing Media Center files. As far as parsing it for custom html display, you can do this in Javascript using the browser's xml parser:
 - Microsoft MSXML: var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
 - Firefox/Opera:  var xmlDoc=document.implementation.createDocument("","",null);
Logged
John Thompson, JRiver Media Center

gis

  • Recent member
  • *
  • Posts: 5
Re: search album using ajax/MCWS
« Reply #3 on: September 08, 2010, 03:56:59 am »

Thanks for your reply and can i integrate directly XML output to Web Template Language's loop that is the coding as following as

   <!-- begin: loop(z, [Pagination.StartIndex], min([Pagination.FinishIndex], [LibraryFilesCount] - 1)) -->
          <div class="item">
               <a href="[LibraryFile([z]).IntoLink]"><img src="[LibraryFile([z]).ImageLink]&Width=64&Height=64&Square=1&FillTransparency=FFFFFF" class="item" alt="[LibraryFile([z]).Name] Image" />[/url]
               <div class="title">
                 <a href="[LibraryFile([z]).IntoLink]">[LibraryFile([z]).Name][/url]
             </div>
             <ul class="controls">
                 <li><a href="javascript:download_jump_playing_now('[LibraryFile([z]).PlayLink]')">Play[/url]</li>
                 <li><a href="javascript:download('[LibraryFile([z]).AddLink]')">Add[/url]</li>
             </ul>
          </div>
          <!-- begin: loop_no_last -->
                <div class="divider_tight"></div>
            <!-- end: loop_no_last -->
      <!-- end: loop -->

this is coding for actual output of search results so, if I can integrate with this then my work is over.
is there any necessary import files or procedure for using this language?.
Thank you
Logged

gis

  • Recent member
  • *
  • Posts: 5
Re: search album using ajax/MCWS
« Reply #4 on: September 08, 2010, 06:15:07 am »


I didn't get the 'FileKey' and 'ImageUrl' info in the XML output through search query. is there any way to get these info through search query? this is very essential to play the corresponding file.  or any other way?
please reply.

thanks
Logged

JohnT

  • Citizen of the Universe
  • *****
  • Posts: 4627
Re: search album using ajax/MCWS
« Reply #5 on: September 08, 2010, 10:26:04 am »

Matt can provide more help when he returns on Monday.  Have you tried using WebRemote and WebPlay?  Maybe if you describe in more detail what you're trying to do we could have more suggestions.

Also, please just create one topic for your question rather than creating several spread across different parts of the forum.

Thanks!
Logged
John Thompson, JRiver Media Center

gis

  • Recent member
  • *
  • Posts: 5
Re: search album using ajax/MCWS
« Reply #6 on: September 09, 2010, 02:21:38 am »

hai,
 Actually, I need to do like a WebRemote. In this when user type the keyword in library.html and press enter then it goes to search.html page and display the search result. but i don't want this, i would like to do is when user typing the keyword then simultaneously filter the results according to keyword and display the results in it's same page with some customized search. it could be done only with AJAX. I know AJAX but i don't know the Web Template Language.

thanks
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42389
  • Shoes gone again!
Re: search album using ajax/MCWS
« Reply #7 on: September 15, 2010, 10:36:08 am »

A coming build will include the file key (using "Key" as the XML name) in a coming build.

Thanks, and please share your real-time AJAX search results page if possible as it sounds pretty neat.
Logged
Matt Ashland, JRiver Media Center

Lasse_Lus

  • Citizen of the Universe
  • *****
  • Posts: 999
Re: search album using ajax/MCWS
« Reply #8 on: September 17, 2010, 02:27:33 am »

A coming build will include the file key (using "Key" as the XML name) in a coming build.

this is really good news  :)..would it not be possible to also be able to retreive the key from inside MC ?
Logged
MT5FR
Pages: [1]   Go Up