getting activity forms into a working condition
This commit is contained in:
parent
6ee05b85af
commit
5be7a021d8
7 changed files with 159 additions and 65 deletions
|
|
@ -80,6 +80,45 @@ sub create {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 definition ( session, definition )
|
||||
|
||||
Sets up the parameters of the activity for use in forms in the workflow editor. This is a class method.
|
||||
|
||||
=head3 session
|
||||
|
||||
A reference to the current session.
|
||||
|
||||
=head3 definition
|
||||
|
||||
An array reference containing a list of hash hreferences of properties.
|
||||
|
||||
=cut
|
||||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session, "Workflow_Activity");
|
||||
push (@{$definition}, {
|
||||
name=>$i18n->get("topicName"),
|
||||
properties=>{
|
||||
title=>{
|
||||
defaultValue=>"Untitled",
|
||||
label=>$i18n->get("title"),
|
||||
hoverHelp=>$i18n->get("title help")
|
||||
},
|
||||
description=>{
|
||||
defaultValue=>undef,
|
||||
label=>$i18n->get("description"),
|
||||
hoverHelp=>$i18n->get("description help")
|
||||
}
|
||||
}
|
||||
});
|
||||
return $definition;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 delete ( )
|
||||
|
||||
Removes this activity from its workflow.
|
||||
|
|
@ -180,20 +219,10 @@ A reference to the current session.
|
|||
=cut
|
||||
|
||||
sub getName {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
return "Unnamed";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getType ( )
|
||||
|
||||
Returns the type of workflow that this activity may be used in. Unless this method is overriden, the type is "none". This is a class method.
|
||||
|
||||
=cut
|
||||
|
||||
sub getType {
|
||||
return "none";
|
||||
my $definition = $class->definition($session);
|
||||
return $definition->[0]{name};
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -64,6 +64,47 @@ sub checkFileAge {
|
|||
return $flag;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 definition ( session, definition )
|
||||
|
||||
See WebGUI::Workflow::Activity::defintion() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session, "Workflow_Activity_CleanTempStorage");
|
||||
push(@{$definition}, {
|
||||
name=>$i18n->get("topicName"),
|
||||
properties=> {
|
||||
storageTimeout => {
|
||||
label=>$i18n->get("storage timeout"),
|
||||
defaultValue=>6*60*60,
|
||||
hoverHelp=>$i18n->get("storage timeout help")
|
||||
}
|
||||
}
|
||||
});
|
||||
return $class->SUPER::definition($session,$definition);
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 execute ( )
|
||||
|
||||
See WebGUI::Workflow::Activity::execute() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub execute {
|
||||
my $self = shift;
|
||||
$self->recurseFileSystem($self->session->config->get("uploadsPath")."/temp");
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 recurseFileSystem ( path )
|
||||
|
|
@ -95,56 +136,6 @@ sub recurseFileSystem {
|
|||
}
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 execute ( )
|
||||
|
||||
See WebGUI::Workflow::Activity::execute() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub execute {
|
||||
my $self = shift;
|
||||
$self->recurseFileSystem($self->session->config->get("uploadsPath")."/temp");
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getEditForm ( )
|
||||
|
||||
See WebGUI::Workflow::Activity::getEditForm() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub getEditForm {
|
||||
my $self = shift;
|
||||
my $form = $self->SUPER::getEditForm();
|
||||
$form->interval(
|
||||
-name=>"storageTimeout",
|
||||
-label=>"Storage Timeout",
|
||||
-defaultValue=>6*60*60,
|
||||
-value=>$self->get("storageTimeout")
|
||||
);
|
||||
return $form;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getName ( session )
|
||||
|
||||
See WebGUI::Workflow::Activity::getName() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub getName {
|
||||
my $session = shift;
|
||||
return "Clean Temp Storage";
|
||||
}
|
||||
|
||||
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue