Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Bricolage: devel

Publish Status Via SOAP

 

 

Bricolage devel RSS feed   Index | Next | Previous | View Threaded


david at kineticode

Mar 29, 2010, 2:14 PM

Post #1 of 4 (1010 views)
Permalink
Publish Status Via SOAP

Fellow Bricoleurs,

I've just dealt with another report of issues importing stories into Bricolage via SOAP and getting failures because the imported story had its publish status set to true. It happens because of this code:

if ($update) {
if ($story->get_publish_date or $story->get_first_publish_date) {
# some publish date is set, so it must've been published
$story->set_publish_status(1);
} else {
$story->set_publish_status($sdata->{publish_status});
}
} else {
# creating, so can't have published it yet
$story->set_publish_status(0);
}

Essentially, if you're creating a new document, it always sets publish_status to false. I'm starting to think that maybe this is just a stupid idea. If someone wants to create a story and mark it as published even if it has never been published by the Bricolage instance it's being created in, why shouldn't they?

So would anyone complain if I removed this "intelligence" in favor of just

if ($story->get_publish_date or $story->get_first_publish_date) {
# some publish date is set, so it must've been published
$story->set_publish_status(1);
} else {
$story->set_publish_status($sdata->{publish_status} || 0);
}

Comments?

Best,

David


phillip at communitybandwidth

Mar 29, 2010, 2:29 PM

Post #2 of 4 (963 views)
Permalink
Re: Publish Status Via SOAP [In reply to]

On 29-Mar-10, at 5:14 PM, David E. Wheeler wrote:

> Fellow Bricoleurs,
>
> I've just dealt with another report of issues importing stories into
> Bricolage via SOAP and getting failures because the imported story
> had its publish status set to true. It happens because of this code:
>
> if ($update) {
> if ($story->get_publish_date or $story-
> >get_first_publish_date) {
> # some publish date is set, so it must've been published
> $story->set_publish_status(1);
> } else {
> $story->set_publish_status($sdata->{publish_status});
> }
> } else {
> # creating, so can't have published it yet
> $story->set_publish_status(0);
> }
>
> Essentially, if you're creating a new document, it always sets
> publish_status to false. I'm starting to think that maybe this is
> just a stupid idea. If someone wants to create a story and mark it
> as published even if it has never been published by the Bricolage
> instance it's being created in, why shouldn't they?
>
> So would anyone complain if I removed this "intelligence" in favor
> of just
>
> if ($story->get_publish_date or $story-
> >get_first_publish_date) {
> # some publish date is set, so it must've been published
> $story->set_publish_status(1);
> } else {
> $story->set_publish_status($sdata->{publish_status} ||
> 0);
> }
>
> Comments?

+1 if it makes it possible to:

bric_soap story export --all 1183 | bric_soap story create -


:-)

Phillip.

--
Phillip Smith // Simplifier of Technology // COMMUNITY BANDWIDTH
www.communitybandwidth.ca // www.phillipadsmith.com


bret at pectopah

Mar 29, 2010, 8:04 PM

Post #3 of 4 (953 views)
Permalink
Re: Publish Status Via SOAP [In reply to]

I'm all for the change.

If you're keeping your site but just migrating from one Bricolage to
another, preserving the publish status from the previous install totally
makes sense.

Or at least it means one fewer script to write to process the XML before
you SOAP it in to the new install.

Cheers,

Bret


On Mon, 2010-03-29 at 17:29 -0400, Phillip Smith wrote:
> On 29-Mar-10, at 5:14 PM, David E. Wheeler wrote:
>
> > Fellow Bricoleurs,
> >
> > I've just dealt with another report of issues importing stories into
> > Bricolage via SOAP and getting failures because the imported story
> > had its publish status set to true. It happens because of this code:
> >
> > if ($update) {
> > if ($story->get_publish_date or $story-
> > >get_first_publish_date) {
> > # some publish date is set, so it must've been published
> > $story->set_publish_status(1);
> > } else {
> > $story->set_publish_status($sdata->{publish_status});
> > }
> > } else {
> > # creating, so can't have published it yet
> > $story->set_publish_status(0);
> > }
> >
> > Essentially, if you're creating a new document, it always sets
> > publish_status to false. I'm starting to think that maybe this is
> > just a stupid idea. If someone wants to create a story and mark it
> > as published even if it has never been published by the Bricolage
> > instance it's being created in, why shouldn't they?
> >
> > So would anyone complain if I removed this "intelligence" in favor
> > of just
> >
> > if ($story->get_publish_date or $story-
> > >get_first_publish_date) {
> > # some publish date is set, so it must've been published
> > $story->set_publish_status(1);
> > } else {
> > $story->set_publish_status($sdata->{publish_status} ||
> > 0);
> > }
> >
> > Comments?
>
> +1 if it makes it possible to:
>
> bric_soap story export --all 1183 | bric_soap story create -
>
>
> :-)
>
> Phillip.
>
> --
> Phillip Smith // Simplifier of Technology // COMMUNITY BANDWIDTH
> www.communitybandwidth.ca // www.phillipadsmith.com
>
>
>
>
>
>
>
>


--
Bret Dawson
Producer
Pectopah Productions Inc.
(416) 895-7635
bret [at] pectopah
www.pectopah.com


david at kineticode

Mar 29, 2010, 10:04 PM

Post #4 of 4 (949 views)
Permalink
Re: Publish Status Via SOAP [In reply to]

On Mar 29, 2010, at 8:04 PM, Bret Dawson wrote:

> I'm all for the change.
>
> If you're keeping your site but just migrating from one Bricolage to
> another, preserving the publish status from the previous install totally
> makes sense.
>
> Or at least it means one fewer script to write to process the XML before
> you SOAP it in to the new install.

Yeah, that's the idea.

[Done](http://github.com/bricoleurs/bricolage/commit/425f09b337fd63ccf2afb9c0448812bc8b7f644a).

Best,

David

Bricolage devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.