13 messages in com.googlegroups.google-base-data-apiRe: How to prevent item expiration?
FromSent OnAttachments
Peter228 Jan 2007 02:53 
Shuki30 Jan 2007 10:45 
anjeet02 Feb 2007 04:36 
mult...@gmail.com06 Feb 2007 11:08 
Stephane Zermatten07 Feb 2007 00:09 
mult...@gmail.com07 Feb 2007 01:55 
mult...@gmail.com07 Feb 2007 02:13 
Stephane Zermatten07 Feb 2007 02:23 
Multivector TI07 Feb 2007 02:34 
Stephane Zermatten07 Feb 2007 02:57 
Multivector TI07 Feb 2007 03:14 
Stephane Zermatten07 Feb 2007 03:29 
huniad12 Feb 2007 10:34 
Subject:Re: How to prevent item expiration?
From:Shuki (shuk@gmail.com)
Date:01/30/2007 10:45:47 AM
List:com.googlegroups.google-base-data-api

Peter, It's quite simple to do what you are asking for:

// get all your entries through query (let me know if you need the code for that)

// for each entry, get the extension or create a new one, based on your use case: GoogleBaseAttributesExtension extension = new GoogleBaseAttributesExtension(); // OR: GoogleBaseAttributesExtension extension = entry.getExtension(GoogleBaseAttributesExtension.class);

// extend exp date in three weeks: DateTime expDate = new DateTime(new Date(System.currentTimeMillis() + (21L * 24L * 60L * 60L * 1000L))); expDate.setDateOnly(true); extension.setExpirationDate(expDate);

// attach and save: entry.setExtension(extension); service.update(new URL(post.getGoogleBaseId()),entry);

Shuki

Shuki

On Jan 28, 2:54 am, "Peter2" <psmi@gmail.com> wrote:

Can I just go in, grab all my items, and essentially 'republish'?

I haven't used the API - just the web testing interface. But is it possible to do this?

I'm still confused as to how i might use Google Base, when it seems I need to constantly run 'update' commands, even if they're not needed for anything but to keep items from expiring.

Thanks.

keywords: inactive