Thanks olav.  I now have in manifest.php:
"betaManifestVersion": 1,
  "version": "<?php echo $version ?>",
  "entries": [
<?php echo implode(",\n", $entries); ?>
 {"url": "manifest.php" , "ignoreQuery": true },
  ]

When I open manifest.php in the browser I now get a list of the files.

However, now when I click "Capture" in in go_offline.html the
createStore() function is not working.
In createStore() I have:
function createStore() {
  if (!window.google || !google.gears) {
    alert("You must install Gears first.");
    return;
  }

  store.manifestUrl = MANIFEST_FILENAME;
  store.checkForUpdate();

  var timerId = window.setInterval(function() {
    // When the currentVersion property has a value, all of the
resources
    // listed in the manifest file for that version are captured.
There is
    // an open bug to surface this state change as an event.
    if (store.currentVersion) {
      window.clearInterval(timerId);
      textOut("The documents are now available offline.\n" +
              "With your browser offline, load the document at " +
              "its normal online URL to see the locally stored " +
                                "version. The version stored is: " +
              store.currentVersion);
    } else if (store.updateStatus == 3) {
      textOut("Error: " + store.lastErrorMessage);
    }
  }, 500);
}

The variable MANIFEST_FILENAME is: var MANIFEST_FILENAME = "http://
localhost/gearsTut/manifest.php";

Not sure where to go from here?
Thanks,
TML

On Jan 28, 5:56 am, Oblygre <[email protected]> wrote:
> If its empty, the script is not run correctly, at least the
> manifest.php should show up like this:
> {
>   "betaManifestVersion": 1,
>   "version": "1232716288",
>   "entries": [
>     {"url": "manifest.php" , "ignoreQuery": true },
>   ]
>
> }
>
> If there is an script error, your normally get an error message, but I
> think you have something else wrong somewhere.
> Try antoher script with this code to see if php is working test.php: <?
> php echo "here...."; ?>
>
> and make sure your path to the file is correct.
>
> Br
> Olav
>
> On Jan 27, 10:01 am, "Tosca Lahiri" <[email protected]> wrote:
>
> > Thanks for your help so far.
> > I have pastedhttp://localhost/gearsTut/manifest.phpintobrowser but the
> > page is blank. It is the right URL I am sure. Any further suggestions?
> > TML
>
> > > -----Original Message-----
> > > From: [email protected] [mailto:[email protected]]
> > > On Behalf Of sobolanul
> > > Sent: Tuesday, January 27, 2009 8:49 AM
> > > To: Gears Users
> > > Subject: [gears-users] Re: Managed resource store - how to build my
> > > manifest?
>
> > > There must be the path to your manifest file.
> > >http://localhost/gearsTut/manifest.php'shouldwork if that url is
> > > correct. just paste that url in browser and you should see the
> > > manifest. if not, means the url is not correct.
>
> > > On Jan 27, 6:33 am, TML <[email protected]> wrote:
> > > > In go_offline.js I have changed var MANIFEST_FILENAME =  "http://
> > > > localhost/gearsTut/manifest.php";
>
> > > > to var MANIFEST_FILENAME = "C:/Program Files/Apache Software
> > > > Foundation/Apache2.2/htdocs/gearsTut/manifest.php";
>
> > > > Now when I click on "Capture" nothing happens...i.e. the status
> > > > message does not change to tell me manifest files have been captured.
> > > >  Any suggestions?
> > > > TML
>
> > > > On Jan 27, 2:52 am, TML <[email protected]> wrote:
>
> > > > > Sussed out $_SERVER['SCRIPT_FILENAME'];
> > > > > Still have problem though with var MANIFEST_FILENAME =  "http://
> > > > > localhost/gearsTut/manifest.php";.
> > > > > The precise error message is: Status Message: Error: Download of
> > > > > 'http://localhost/gearsTut/manifest.php'failed, status code 500.
>
> > > > > Thanks for all help.
> > > > > TML
>
> > > > > On Jan 26, 8:53 pm, TML <[email protected]> wrote:
>
> > > > > > Thanks a lot.
>
> > > > > > Just a couple of follow up questions - in your new manifest.php what
> > > > > > value should be in place of SCRIPT_FILENAME? I can't find it
> > > referred
> > > > > > to anywhere else in gearpad app.
>
> > > > > > Also in go_offline.js (from the online docs) what value should be
> > in:
>
> > > > > > var MANIFEST_FILENAME = ?
>
> > > > > > I have put:
> > > > > > var MANIFEST_FILENAME =  "http://localhost/gearsTut/manifest.php";;
>
> > > > > > but I am getting a status code error 500.
>
> > > > > > Thanks for all your help.
> > > > > > TML.
>
> > > > > > On Jan 26, 8:15 pm, Oblygre <[email protected]> wrote:
>
> > > > > > > Sorry about that, I had modified it little bit, but forgot...
> > > > > > > Here the complete code:
> > > > > > > <?php
> > > > > > > // Copyright 2007, Google Inc.
> > > > > > > //
> > > > > > > // Redistribution and use in source and binary forms, with or
> > > without
> > > > > > > // modification, are permitted provided that the following
> > > conditions
> > > > > > > are met:
> > > > > > > //
> > > > > > > //  1. Redistributions of source code must retain the above
> > > copyright
> > > > > > > notice,
> > > > > > > //     this list of conditions and the following disclaimer.
> > > > > > > //  2. Redistributions in binary form must reproduce the above
> > > > > > > copyright notice,
> > > > > > > //     this list of conditions and the following disclaimer in the
> > > > > > > documentation
> > > > > > > //     and/or other materials provided with the distribution.
> > > > > > > //  3. Neither the name of Google Inc. nor the names of its
> > > > > > > contributors may be
> > > > > > > //     used to endorse or promote products derived from this
> > > software
> > > > > > > without
> > > > > > > //     specific prior written permission.
> > > > > > > //
> > > > > > > // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY
> > > EXPRESS
> > > > > > > OR IMPLIED
> > > > > > > // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
> > > WARRANTIES
> > > > > > > OF
> > > > > > > // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
> > > > > > > DISCLAIMED. IN NO
> > > > > > > // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
> > > > > > > INCIDENTAL,
> > > > > > > // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
> > > NOT
> > > > > > > LIMITED TO,
> > > > > > > // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
> > > OR
> > > > > > > PROFITS;
> > > > > > > // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> > > > > > > LIABILITY,
> > > > > > > // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
> > > > > > > NEGLIGENCE OR
> > > > > > > // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
> > > EVEN
> > > > > > > IF
> > > > > > > // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>
> > > > > > > header('Content-type: text/plain');
> > > > > > > $version = 0;
> > > > > > > $dir = dirname($_SERVER['SCRIPT_FILENAME']);
> > > > > > > $handle = opendir($dir);
> > > > > > > while (false !== ($file = readdir($handle))) {
> > > > > > >   if (file_exists("$dir/$file")) {
> > > > > > >     $v = filemtime("$dir/$file");
> > > > > > >     if ($v > $version) {
> > > > > > >       $version = $v;
> > > > > > >     }
> > > > > > >     if ($file<>'..')
> > > > > > >       $files[]=$file;
> > > > > > >   }}
>
> > > > > > > $entries = array();
> > > > > > > foreach ($files as $file) {
> > > > > > >   array_push($entries, "    {\"url\": \"$file\" , \"ignoreQuery\":
> > > > > > > true }");}
>
> > > > > > > ?>
> > > > > > > {
> > > > > > >   "betaManifestVersion": 1,
> > > > > > >   "version": "<?php echo $version ?>",
> > > > > > >   "entries": [
> > > > > > > <?php echo implode(",\n", $entries); ?>
>
> > > > > > >   ]
>
> > > > > > > }
>
> > > > > > > Br
> > > > > > > Olav B. Lygre
>
> > > > > > > On Jan 26, 7:24 pm, TML <[email protected]> wrote:
>
> > > > > > > > I have looked at Gearpad code. In Manifest.php the files are
> > > still
> > > > > > > > statically listed. I thought, I could be wrong, that Yossi
> > > wanted a
> > > > > > > > way to dynamically list the files in the web app for the
> > > manifest.json
> > > > > > > > file.
> > > > > > > > Please tell me what I am missing.Thanks.
>
> > > > > > > > On Jan 5, 8:14 pm, Oblygre <[email protected]> wrote:
>
> > > > > > > > > You can build a dynamic manifest file and put in on the
> > server,
> > > and
> > > > > > > > > all files within one or several directory(s) can be
> > > automatically
> > > > > > > > > updated in the manifest file.
> > > > > > > > > See the manifest.php in the gearpad sample for a nice example
> > > of this.
>
> > > > > > > > > Good luck!
>
> > > > > > > > > Br Olav B. Lygre
>
> > > > > > > > > On Jan 4, 11:30 am, yosrbnrt <[email protected]> wrote:
>
> > > > > > > > > > Hi,
> > > > > > > > > > I am new to google gears.
> > > > > > > > > > I would like implement google gears for a big section of our
> > > site -
> > > > > > > > > > which has static content - including html pages, PDF files,
> > > etc' in
> > > > > > > > > > order for our sales team to use the content offline......
> > > > > > > > > > I understand i should build build a manifest json file
> > > including all
> > > > > > > > > > the URL's of my pages, images, PDF files etc'.....
> > > > > > > > > > Is there a way I could include a group of URL's at once to
> > > make it
> > > > > > > > > > easier? could I define a section in the site to be stored?
> > > for example
> > > > > > > > > > if i have all my PDF files
> > > underwww.domain.com/PDF/couldIinclude
> > > > > > > > > > all the files at once? or must I define each and every file
> > > in the
> > > > > > > > > > manifest file?
>
> > > > > > > > > > Thanks,
> > > > > > > > > > Yossi.

Reply via email to