List Info

Thread: turn auto publish on and off




turn auto publish on and off
user name
2007-12-12 12:30:00
Is there a way to pass a custom argument to bric_soap? I
have a story  
type that auto-publishes related stories in a cleanup block.
However,  
if I am mass-republishing for the sake of minor changes, I
do not  
want all of the related stories to publish because that will
take too  
long and is unnecessary. Is there some way I could pass an
argument  
to bric_soap (or some coding I could do in the template) to
make the  
auto-publish [ i.e. publish_another() ] conditional?

--------------------

This email message is for the sole use of the intended
recipient(s) and
may contain privileged information. Any unauthorized review,
use,
disclosure or distribution is prohibited. If you are not the
intended
recipient, please contact the sender by reply email and
destroy all copies
of the original message.



RE: turn auto publish on and off
user name
2007-12-12 13:41:04
Not really, but you could fake it a few ways.
  You could create a different user to publish as
then somehow fetch who scheduled the job
and do different processing based on that.
  Or you could have a template behave differently
by fetching the number of jobs queued up; don't republish
if there are so many, do republish otherwise.
  Or if your republishes are between midnight and 02:00,
your templates could have processing depending on that.

________________________________

From: Ashlee Caul [mailto:acaulrand.org]
Sent: Wed 12/12/2007 7:30 PM
To: Bricolage Users
Subject: turn auto publish on and off



Is there a way to pass a custom argument to bric_soap? I
have a story 
type that auto-publishes related stories in a cleanup block.
However, 
if I am mass-republishing for the sake of minor changes, I
do not 
want all of the related stories to publish because that will
take too 
long and is unnecessary. Is there some way I could pass an
argument 
to bric_soap (or some coding I could do in the template) to
make the 
auto-publish [ i.e. publish_another() ] conditional?

--------------------

This email message is for the sole use of the intended
recipient(s) and
may contain privileged information. Any unauthorized review,
use,
disclosure or distribution is prohibited. If you are not the
intended
recipient, please contact the sender by reply email and
destroy all copies
of the original message.




Re: turn auto publish on and off
user name
2007-12-13 08:55:10
Ashlee Caul <acaulrand.org> writes:
> Is there a way to pass a custom argument to bric_soap?
I have a story
> type that auto-publishes related stories in a cleanup
block. However,
> if I am mass-republishing for the sake of minor
changes, I do not
> want all of the related stories to publish because that
will take too
> long and is unnecessary. Is there some way I could pass
an argument
> to bric_soap (or some coding I could do in the
template) to make the
> auto-publish [ i.e. publish_another() ] conditional?

I wrapped mass-bric_soap-scripts with a script that creates
a
temporary file during tha bulk run. Thsi temp file I tested
for
existence from inside the templates.

The file needs to be on the bricolage machine where the
templates are
run. And you have to take some care, that the temp file gets
deleted
when someone presses Ctrl-C, i.e., some kind of signal
handling.

Here are some fragments from my scripts:

bulk_super_publish.pl:
----------------------

  my $MAGIC_FILE = '/tmp/BRIC_DO_NOT_RENDER_NEWSLISTS';
  $SIG = sub {
                 print "HOWDY, WE FINISHED!!",
"n";
                 delete_magic_file();
                 exit 1;
              };

  sub create_magic_file {
    system("touch $MAGIC_FILE") and die
"Problem creating $MAGIC_FILE";
  }

  sub delete_magic_file {
    system("/bin/rm $MAGIC_FILE") and die
"Problem deleting $MAGIC_FILE";
  }

  # main
  create_magic_file();
  # ... mass republish with bric_soap
  delete_magic_file();


Inside bricolage templates(Mason):
----------------------------------

% my $MAGIC_FILE = '/tmp/BRIC_DO_NOT_RENDER_NEWSLISTS';
% unless (-e $MAGIC_FILE) {
%    # ... re-burn other stories
% }



You could also transport more detailed arguments via that
file.

GreetinX
Steffen 
-- 
Steffen Schwigon <schwigonwebit.de>

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )