#################### main pod documentation begin ################### =head1 NAME Zymonic::Form::ReEncryptStatus; - Zymonic Workflow System Form 'ReEncryptStatus' module =head1 SYNOPSIS This is a module to show the status of re-encryption. =head1 DESCRIPTION This is a module to show the status of re-encryption. =head1 USAGE This module should not be called directly. =head1 BUGS NONE =head1 SUPPORT As in the license, Zymonic is provided without warranty or support unless purchased separately, however... If you email zymonic-support@zednax.com your issue will be noted and may receive a response. For security issues, please contact zymonic-security@zednax.com and someone will respond within 8 working hours. =head1 AUTHOR Alex Masidlover et al. CPAN ID: MODAUTHOR Zednax Limited alex.masidlover@zednax.com http://www.zednax.com =head1 COPYRIGHT This program is free software licensed under the... Alfresco Public License 1.0 The full text of the license can be found in the LICENSE file included with this module. Other licenses may be acceptable if including parts of Zymonic in larger projects, please contact Zednax for details. =head1 SEE ALSO perl(1). =cut #################### main pod documentation end ################### package Zymonic::Form::ReEncryptStatus; use strict; BEGIN { use Exporter (); use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); $VERSION = 'D1-r7186'; @ISA = qw(Exporter); #Give a hoot don't pollute, do not export more than needed by default @EXPORT = qw(); @EXPORT_OK = qw(); %EXPORT_TAGS = (); } use base "Zymonic::Form"; use Zymonic::Decryptor::Client; #################### subroutine header begin #################### =head2 init Usage : N/A Purpose : This is a stub for the init. Returns : nothing Argument : nothing Throws : see the 'See Also' Comment : nothing See Also : =cut #################### subroutine header end #################### sub init { my $self = shift; $self->SUPER::init; $self->populate_record( $self->{records}->[0] ) unless $self->{config}->{building_documentation} && $self->{config}->{building_documentation} eq 'Y'; } #################### subroutine header begin #################### =head2 output_navigation Usage : $self->output_navigation; Purpose : This method returns the navigation ready for transformation to XML. Returns : a hashref containing navigation. Argument : nothing Throws : nothing Comment : This is a stub as the Login form has no navigation... See Also : =cut #################### subroutine header end #################### sub output_navigation { my $self = shift; return {}; } #################### subroutine header begin #################### =head2 populate_record Usage : $form->populate_record($record); Purpose : TODO Returns : nothing Argument : nothing Throws : TODO Comment : See Also : =cut #################### subroutine header end #################### sub populate_record { my $self = shift; my $record = shift; # Switch the keys my $decryptor_ks = $self->decryptor_client()->call_decryptor( { messagetype => 'SwitchKeys' }, 'all', 'nokey' ); Zymonic::Exception::Decryptor::KeyManagement->throw( error => 'Decryptor GetKEKPart returned error', extras => $decryptor_ks, ) if $decryptor_ks->{error}; # Get the decryptor key statuses. my $decryptor_status = $self->decryptor_client()->call_decryptor( { messagetype => 'GetReEncryptStatus' }, '', 'nokey' ); Zymonic::Exception::Decryptor::KeyManagement->throw( error => 'Decryptor GetKEKPart returned error', extras => $decryptor_status, ) if $decryptor_status->{error}; # Add the re-encryption status $record->{fields}->{zz_df_left_to_reencrypt}->{parent}->get_object( $record->{fields}->{zz_df_left_to_reencrypt} ) ->value( $decryptor_status->{left_to_reencrypt} ); $self->save; } #################### subroutine header begin #################### =head2 decyptor_client Usage : $form->decryptor_client; Purpose : TODO Returns : nothing Argument : nothing Throws : TODO Comment : See Also : =cut #################### subroutine header end #################### sub decryptor_client { my $self = shift; $self->{decryptor_client} = Zymonic::Decryptor::Client->new( parent => $self, config => $self->{config}, db => $self->{DB} ) unless ( defined( $self->{decryptor_client} ) ); return $self->{decryptor_client}; } 1;