Search my pages??

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • jh014d8230
    Forum Member
    • Jan 2005
    • 4

    Search my pages??

    Sorry if this has already been asked. Im quite new with AutoPlay Media Studio.

    I have a project and it contains many differnt pages. What I would like to do is have a seperate 'search' page where the user can search for a word and when they click on the search button it will display the page that contains that word.

    I havent got a clue on how to do this but I know that problems could ocour when more than one page has the certain word that the user shall search for. But I have this sorted, dont worry, that will not happen

    Any help aprishated

    Thanks
  • yosik
    Indigo Rose Customer
    • Jun 2002
    • 1858

    #2
    Hi,
    It's a bit difficult to help you without further details. What type of tezt do you have? Where is it located? Why is it on many pages?
    A little more description of your project would able us to help you.

    Yossi

    Comment

    • Corey
      Indigo Rose Staff Alumni
      • Aug 2002
      • 9745

      #3
      Yes Yossi's right, but anyhow I can give you a general shape of how something like this might take form, maybe that'll help *a bit*.

      Essentially you need a content pool somewhere in order to search things, this is true for any service, site, or application. Typically you would want to eliminate certain content from that pool, i.e. "and", "or", "the", etc. But this is not strictly neccesary.

      The idea is generally to create your content pool (in your case that may just be a few flat text files which contain text data from your pages) beforehand so that searches are faster, i.e. it takes much longer to parse a web site than it does to parse a database. Anyhow that's an oversimplification but you get the idea.

      So in your case let's say you had a five page project with text on each page. The best non-database method might be to create a flat text file for each page, each with the same name as it's parent page for easy handling. Then cut and paste the text from your pages into their respective flat text files. Now you can use simple actions to parse these files and get "page search" results.

      From here it's simply a matter of using a combo of TextFile and String.Find actions to manipulate the data. Hope that helps. :yes

      Comment

      • sferguson
        Indigo Rose Customer
        • Oct 2003
        • 164

        #4
        You might also want to consider a method that could "extract"/"comb-thru" or otherwise read the actual XML content that resides in the .am5 file.

        Obviously, you wouldn't be distributing or publishing the am5 file to the end
        user, but perhaps you could run a sub-routine just prior to finalizing and publishing your app that would extrapolate the search page info automatically for you - which could then be wrapped back into your deliverable. This method comes to mind assuming that whatever content you have already built into the project pages is "static" or not populated from an exteranlly referance-able source.

        You could use the XML plug-in to make short work of it (I realize of course that the last statement is a quite "relative"). However, the sample project demos the XML plug-in capabilities would probably get you 3/4 of the way their.

        Food for thought...
        -Scott F.

        Comment

        • Corey
          Indigo Rose Staff Alumni
          • Aug 2002
          • 9745

          #5
          Yes, that's an intriguing idea.

          Comment

          • sferguson
            Indigo Rose Customer
            • Oct 2003
            • 164

            #6
            Just in case the "XML" aspect sounds intimidating... XML is REALLY easy stuff to read, even with the average non-XML-savvy eye.

            For instance, right-click your .am5 file and choose "Open with...Notepad". That'll give you an idea of how XML files and tags work, and how you might use the built-in functions of the XML plug-in to seek out tags that wrap the content you'd like to automatically compile into a search-able file.
            -Scott F.

            Comment

            • yosik
              Indigo Rose Customer
              • Jun 2002
              • 1858

              #7
              Another way would be to use an ini file where the header section would be the page name and the value would be the text of the page.
              Then, searching the file you would find the text and and return the section to jump to the page.

              Yossi

              Comment

              • Corey
                Indigo Rose Staff Alumni
                • Aug 2002
                • 9745

                #8
                Yep that would work too. :yes

                Comment

                • sferguson
                  Indigo Rose Customer
                  • Oct 2003
                  • 164

                  #9
                  Nice! ( :yes :yes )
                  -Scott F.

                  Comment

                  • jh014d8230
                    Forum Member
                    • Jan 2005
                    • 4

                    #10
                    Thanks guys... but im a total noob.

                    Ill put what I want real in simple terms...

                    Lets say I have a project with 100 pages all with a "Label object" on each page, and each "Lable object" has the text of a different product. And what I'm wanting to do is to create a seperate page with a "Input Object" and a search button so the user can type in a product and click search. The results of this would be the matching product page, also if they spelled it wrong or the product is not there, it will go to a page that says "not found".

                    I hope you get where im going with this. Also as stated above, im a real noob and dont know much about the find.string function or how to use it.

                    Thanks for your time, help and effort people, I really apprishiate it.

                    Comment

                    • jh014d8230
                      Forum Member
                      • Jan 2005
                      • 4

                      #11
                      Sorry if this is considered spamming, but I really would like some help on this people. Thanks.


                      Comment

                      • Intrigued
                        Indigo Rose Customer
                        • Dec 2003
                        • 6138

                        #12
                        While you are waiting for a working-solution reply:



                        This shows a couple examples on how to use the String.Find action found in AMS.

                        Also, there are some great examples to be found on many different AMS related topics. You can access such by clicking on the Search link (in the menu across the top of this page, to the right end of such).

                        Try in the Search box: String.Find for example.

                        Sincerely,
                        Intrigued

                        Comment

                        • jh014d8230
                          Forum Member
                          • Jan 2005
                          • 4

                          #13
                          Pleeeaase help someone, i really need to get this done. :(

                          Comment

                          • Corey
                            Indigo Rose Staff Alumni
                            • Aug 2002
                            • 9745

                            #14
                            Hi. No problem, if you wish to post what you have done so far I would be happy to offer advice on how to where to proceed. If you're willing to get in there and apply a little effort, you can get this done no problem. :yes

                            Comment

                            • TJ_Tigger
                              Indigo Rose Customer
                              • Sep 2002
                              • 3159

                              #15
                              Ok, here is an idea on how you might accomplish this. I have not tried it and if I find time I will see what I can do. What if you were to get a list of all the pages in the project (Application.GetPages) and the current page of course (Applicatin.GetCurrentPage) so you know where to return. Then you set the Application.Redraw to false so the pages do not appear to move. You then activate a function that causes you to jump from page to page and probably open a dialog that lets the person know that an index is being built. While you are on a page you enumerate the objects on the page and if the object is the desired type, input or paragraph, you copy that text to a txt or xml file. You will want to note during this process the page and object that is associated with the text, or at least I think you would. Once finished with that page, wash rinse and repeat. Once you have gone through all the pages you can then jump back to the starting page and set the application redraw back to true and allow the person to now search.

                              Like I said, it is an untested idea but it might work. If I find time or if anyone else has the ambition maybe a project can be thrown together.

                              Tigg
                              TJ-Tigger
                              "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
                              "Draco dormiens nunquam titillandus."
                              Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

                              Comment

                              Working...
                              X