Skip to content

Commit

Permalink
Merge branch 'feature/workflowlog' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mrscotty committed Jun 1, 2016
2 parents 7b2eff5 + 9a219fe commit c76f654
Show file tree
Hide file tree
Showing 21 changed files with 741 additions and 59 deletions.
10 changes: 8 additions & 2 deletions config/openxpki/log.conf
Expand Up @@ -33,12 +33,18 @@ log4perl.category.openxpki.system = INFO, Logfile

## FACILITY: WORKFLOW
# INTERNAL logger for the workflow engine, conditions evaluated, actions taken
# This must not be used by implementors, log you stuff to APPLICATION!
# This must not be used by implementors, log your stuff to APPLICATION!
log4perl.category.openxpki.workflow = DEBUG, WorkflowLog

## FACILITY: APPLICATION
# info about the workflows, conditions evaluated, actions taken
log4perl.category.openxpki.application = INFO, Logfile
log4perl.category.openxpki.application = INFO, Logfile, DBI

## FACILITY: USAGE
# Poor-Mans statistcs tool to track usage of functions
# the log message should be a single token
log4perl.category.openxpki.usage = INFO, DBI


## FACILITY: Connector (outside OXI!)
# internal logging of the config layer, errors indicate missconfiguration
Expand Down
32 changes: 32 additions & 0 deletions config/sql/schema-mysql.sql
Expand Up @@ -291,6 +291,25 @@ CREATE TABLE IF NOT EXISTS `workflow_history` (
KEY (`workflow_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `application_log`
--

DROP TABLE IF EXISTS `application_log`;
CREATE TABLE IF NOT EXISTS `application_log` (
`application_log_id` bigint(20) unsigned NOT NULL,
`logtimestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`workflow_id` decimal(49,0) NOT NULL,
`priority` int(3) DEFAULT 999,
`category` varchar(255) NOT NULL,
`message` longtext,
PRIMARY KEY (`application_log_id`),
KEY (`workflow_id`),
KEY (`workflow_id`,`priority`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


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

Expand Down Expand Up @@ -423,6 +442,19 @@ CREATE TABLE IF NOT EXISTS `seq_workflow_history` (
PRIMARY KEY (`seq_number`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `seq_application_log`
--

DROP TABLE IF EXISTS `seq_application_log`;
CREATE TABLE IF NOT EXISTS `seq_application_log` (
`seq_number` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`dummy` int(11) DEFAULT NULL,
PRIMARY KEY (`seq_number`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
Expand Down
24 changes: 20 additions & 4 deletions core/i18n/de_DE/openxpki.po
Expand Up @@ -2440,6 +2440,26 @@ msgstr "Übergeordneter Workflow"
msgid "I18N_OPENXPKI_UI_WORKFLOW_LAST_UPDATE_LABEL"
msgstr "Untergeordnete Workflows"

#, fuzzy
msgid "I18N_OPENXPKI_UI_WORKFLOW_LOG"
msgstr "Übergeordneter Workflow"

#, fuzzy
msgid "I18N_OPENXPKI_UI_WORKFLOW_LOG_LABEL"
msgstr "Übergeordneter Workflow"

#, fuzzy
msgid "I18N_OPENXPKI_UI_WORKFLOW_LOG_MESSAGE_LABEL"
msgstr "Untergeordnete Workflows"

#, fuzzy
msgid "I18N_OPENXPKI_UI_WORKFLOW_LOG_PRIORITY_LABEL"
msgstr "Untergeordnete Workflows"

#, fuzzy
msgid "I18N_OPENXPKI_UI_WORKFLOW_LOG_TIMESTAMP_LABEL"
msgstr "Untergeordnete Workflows"

#, fuzzy
msgid "I18N_OPENXPKI_UI_WORKFLOW_MOTD_FIELD_LEVEL_DESCRIPTION"
msgstr "Export"
Expand Down Expand Up @@ -7381,10 +7401,6 @@ msgstr "Benutzername"
#~ msgid "I18N_OPENXPKI_UI_PROFILE_USER"
#~ msgstr "Nutzer"

#, fuzzy
#~ msgid "I18N_OPENXPKI_UI_WORKFLOW_ACTION"
#~ msgstr "Übergeordneter Workflow"

#, fuzzy
#~ msgid "I18N_OPENXPKI_UI_WORKFLOW_ACTION_AUTH_LDAP_ERR_DESC"
#~ msgstr "Arbeitsabläufe"
Expand Down
20 changes: 16 additions & 4 deletions core/i18n/en_GB/openxpki.po
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: OpenXPKI 0.9\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2004-09-08 14:02+0200\n"
"PO-Revision-Date: 2016-04-25 11:26+0100\n"
"PO-Revision-Date: 2016-05-09 19:19+0100\n"
"Last-Translator: OpenXPKI Team <i18n@openxpki.org>\n"
"Language-Team: OpenXPKI developers list <openxpki-devel@lists.sourceforge."
"net>\n"
Expand Down Expand Up @@ -1803,6 +1803,21 @@ msgstr "go back"
msgid "I18N_OPENXPKI_UI_WORKFLOW_LAST_UPDATE_LABEL"
msgstr "Last Update"

msgid "I18N_OPENXPKI_UI_WORKFLOW_LOG"
msgstr "Technical Log"

msgid "I18N_OPENXPKI_UI_WORKFLOW_LOG_LABEL"
msgstr "Technical Log"

msgid "I18N_OPENXPKI_UI_WORKFLOW_LOG_MESSAGE_LABEL"
msgstr "Message"

msgid "I18N_OPENXPKI_UI_WORKFLOW_LOG_PRIORITY_LABEL"
msgstr "Priority"

msgid "I18N_OPENXPKI_UI_WORKFLOW_LOG_TIMESTAMP_LABEL"
msgstr "Timestamp"

msgid "I18N_OPENXPKI_UI_WORKFLOW_MOTD_FIELD_LEVEL_DESCRIPTION"
msgstr ""
"The attention level of your message. This gets reflected in the color of the "
Expand Down Expand Up @@ -2468,9 +2483,6 @@ msgstr "Yes"
#~ msgid "I18N_OPENXPKI_UI_PROFILE_USER"
#~ msgstr "User Certificate"

#~ msgid "I18N_OPENXPKI_UI_WORKFLOW_ACTION"
#~ msgstr "Action"

#, fuzzy
#~ msgid "I18N_OPENXPKI_UI_WORKFLOW_ACTION_SCPERS_ADD_ESCROW_CERT_TO_PUBLISH_QUEUE_DESC"
#~ msgstr "Publish CRL"
Expand Down
23 changes: 20 additions & 3 deletions core/i18n/it_IT/openxpki.po
Expand Up @@ -1911,6 +1911,26 @@ msgstr "torna indietro"
msgid "I18N_OPENXPKI_UI_WORKFLOW_LAST_UPDATE_LABEL"
msgstr "Ultimo Aggiornamento"

#, fuzzy
msgid "I18N_OPENXPKI_UI_WORKFLOW_LOG"
msgstr "Action"

#, fuzzy
msgid "I18N_OPENXPKI_UI_WORKFLOW_LOG_LABEL"
msgstr "Workflow Id"

#, fuzzy
msgid "I18N_OPENXPKI_UI_WORKFLOW_LOG_MESSAGE_LABEL"
msgstr "Link"

#, fuzzy
msgid "I18N_OPENXPKI_UI_WORKFLOW_LOG_PRIORITY_LABEL"
msgstr "Workflow History"

#, fuzzy
msgid "I18N_OPENXPKI_UI_WORKFLOW_LOG_TIMESTAMP_LABEL"
msgstr "Contesto Workflow"

msgid "I18N_OPENXPKI_UI_WORKFLOW_MOTD_FIELD_LEVEL_DESCRIPTION"
msgstr ""
"Il livello di attenzione del tuo messaggio. Viene riflesso nel colore del "
Expand Down Expand Up @@ -2569,9 +2589,6 @@ msgstr "Chiave"
#~ msgid "I18N_OPENXPKI_UI_PROFILE_USER"
#~ msgstr "User Certificate"

#~ msgid "I18N_OPENXPKI_UI_WORKFLOW_ACTION"
#~ msgstr "Action"

#, fuzzy
#~ msgid "I18N_OPENXPKI_UI_WORKFLOW_ACTION_SCPERS_ADD_ESCROW_CERT_TO_PUBLISH_QUEUE_DESC"
#~ msgstr "Publish CRL"
Expand Down
24 changes: 20 additions & 4 deletions core/i18n/ru_RU/openxpki.po
Expand Up @@ -2436,6 +2436,26 @@ msgstr "Родительский технологический процесс"
msgid "I18N_OPENXPKI_UI_WORKFLOW_LAST_UPDATE_LABEL"
msgstr "Дочерние технологические процессы"

#, fuzzy
msgid "I18N_OPENXPKI_UI_WORKFLOW_LOG"
msgstr "Родительский технологический процесс"

#, fuzzy
msgid "I18N_OPENXPKI_UI_WORKFLOW_LOG_LABEL"
msgstr "Родительский технологический процесс"

#, fuzzy
msgid "I18N_OPENXPKI_UI_WORKFLOW_LOG_MESSAGE_LABEL"
msgstr "Дочерние технологические процессы"

#, fuzzy
msgid "I18N_OPENXPKI_UI_WORKFLOW_LOG_PRIORITY_LABEL"
msgstr "Дочерние технологические процессы"

#, fuzzy
msgid "I18N_OPENXPKI_UI_WORKFLOW_LOG_TIMESTAMP_LABEL"
msgstr "Дочерние технологические процессы"

#, fuzzy
msgid "I18N_OPENXPKI_UI_WORKFLOW_MOTD_FIELD_LEVEL_DESCRIPTION"
msgstr "Экспорт"
Expand Down Expand Up @@ -7593,10 +7613,6 @@ msgstr "Имя учетной записи"
#~ msgid "I18N_OPENXPKI_UI_PROFILE_USER"
#~ msgstr "Профиль пользователя"

#, fuzzy
#~ msgid "I18N_OPENXPKI_UI_WORKFLOW_ACTION"
#~ msgstr "Родительский технологический процесс"

#, fuzzy
#~ msgid "I18N_OPENXPKI_UI_WORKFLOW_ACTION_AUTH_LDAP_ERR_DESC"
#~ msgstr "Технологические процессы"
Expand Down
53 changes: 53 additions & 0 deletions core/server/OpenXPKI/Client/UI/Workflow.pm
Expand Up @@ -734,6 +734,54 @@ sub init_task {

}


=head2 init_log
Load and display the technical log file of the workflow
=cut

sub init_log {

my $self = shift;
my $args = shift;

my $wf_id = $self->param('wf_id');

$self->_page({
label => 'I18N_OPENXPKI_UI_WORKFLOW_LOG'
});

my $result = $self->send_command( 'get_workflow_log', { ID => $wf_id } );

$self->logger()->trace( "dumper result: " . Dumper $result);

$self->add_section({
type => 'grid',
className => 'workflow',
content => {
columns => [
{ sTitle => 'I18N_OPENXPKI_UI_WORKFLOW_LOG_TIMESTAMP_LABEL'},
{ sTitle => 'I18N_OPENXPKI_UI_WORKFLOW_LOG_PRIORITY_LABEL'},
{ sTitle => 'I18N_OPENXPKI_UI_WORKFLOW_LOG_MESSAGE_LABEL'},
],
data => $result,
empty => 'I18N_OPENXPKI_UI_TASK_LIST_EMPTY_LABEL',
}
});

$self->add_section({
type => 'text',
content => {
buttons => [{
'action' => 'redirect!workflow!load!wf_id!'.$wf_id,
'label' => 'I18N_OPENXPKI_UI_WORKFLOW_OPEN_WORKFLOW_LABEL', #'open workflow',
}]
}
});

}

=head2 action_index
=head3 instance creation
Expand Down Expand Up @@ -1568,6 +1616,11 @@ sub __render_from_workflow {
'action' => 'redirect!workflow!history!wf_id!'.$wf_info->{WORKFLOW}->{ID},
'label' => 'I18N_OPENXPKI_UI_WORKFLOW_HISTORY_LABEL',
};

push @buttons, {
'page' => 'redirect!workflow!log!wf_id!'.$wf_info->{WORKFLOW}->{ID},
'label' => 'I18N_OPENXPKI_UI_WORKFLOW_LOG_LABEL',
};

# The workflow info contains info about all control actions that
# can done on the workflow -> render appropriate buttons.
Expand Down
31 changes: 31 additions & 0 deletions core/server/OpenXPKI/Server/API.pm
Expand Up @@ -30,6 +30,7 @@ use OpenXPKI::Server::API::Profile;
use OpenXPKI::Server::API::Secret;
use OpenXPKI::Server::API::Token;
use OpenXPKI::Server::API::Visualization;
use OpenXPKI::Server::API::Housekeeping;
use OpenXPKI::Server::API::Workflow;
use OpenXPKI::Server::API::Smartcard;
use OpenXPKI::Server::API::UI;
Expand Down Expand Up @@ -1132,6 +1133,17 @@ sub BUILD {
},
},

### Housekeeping API
'purge_application_log' => {
class => 'Housekeeping',
params => {
MAXAGE => {
type => SCALAR,
regex => $re_integer_string,
},
},
},

### Workflow API
'get_workflow_instance_types' => {
class => 'Workflow',
Expand Down Expand Up @@ -1186,6 +1198,25 @@ sub BUILD {
},
},
},
'get_workflow_log' => {
class => 'Workflow',
params => {
ID => {
type => SCALAR,
regex => $re_integer_string,
},
REVERSE => {
type => SCALAR,
optional => 1,
regex => $re_boolean,
},
LIMIT => {
type => SCALAR,
optional => 1,
regex => $re_integer_string,
},
},
},
'get_workflow_history' => {
class => 'Workflow',
params => {
Expand Down

0 comments on commit c76f654

Please sign in to comment.