GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
OpenXPKI::Client::UI::Result(3) User Contributed Perl Documentation OpenXPKI::Client::UI::Result(3)

Most of the following methods are accessors to attributes. Except from those starting with "set_*" they can also be called without arguments to retrieve the current value.

Please note that currently some of these attributes are of type Scalar, ArrayRef or HashRef while others are "data transfer objects" (DTOs) that use OpenXPKI::Client::UI::Response::DTO and encapsulate several values. The DTOs have a "resolve" method which recursively builds a HashRef from the encapsulated data. The HashRef gets converted to JSON (in "_render_body_to_str") and is sent to the web UI.

Enforce a client side redirect to the given page:

    $self->redirect->to('workflow!search');
    $self->redirect->external('https://...');

Enforce response to a confined request, i.e. and autocomplete query. Returns an arbitrary JSON structure to the web UI.

    $self->confined_response([1,2,3]);

Set the structure of the main contents.

    $self->main->add_section(...);
    $self->main->add_form(...);

"add_form" receives constructor parameters for OpenXPKI::Client::UI::Response::Section::Form.

Set the structure of the right hand side info box.

Usage equivalent to "main".

Set the language.

    $self->language('de');

Set the menu structure.

    $self->menu->items([ ... ]);
    # or
    $self->menu->add_item({
        key => 'logout',
        label => 'I18N_OPENXPKI_UI_CLEAR_LOGIN',
    });

Add an exception handler for HTTP codes.

    $self->on_exception->add_handler(
        status_code => [ 403, 401 ],
        redirect => $target,
    );

Set page related information.

    $self->page->label('I18N_OPENXPKI_UI_WORKFLOW_BULK_TITLE');
    $self->page->shortlabel('I18N_OPENXPKI_UI_WORKFLOW_BULK_TITLE');
    $self->page->description('I18N_OPENXPKI_UI_WORKFLOW_BULK_DESCRIPTION');
    $self->page->breadcrumb([...]);
    $self->page->css_class('important');
    $self->page->large(1);
    # set several attributes at once
    $self->set_page(
        label => 'I18N_OPENXPKI_UI_WORKFLOW_BULK_TITLE',
        description => 'I18N_OPENXPKI_UI_WORKFLOW_BULK_DESCRIPTION',
    );

Configure keepalive ping to an endpoint.

    $self->ping({ href => '...', timeout => 30 }); # timeout is in milliseconds

Configure a periodic page refresh timer.

    $self->refresh->uri("workflow!load!wf_id!$wf_id");
    $self->refresh->timeout(30);
    # set several attributes at once
    $self->set_refresh(
        uri => "workflow!load!wf_id!$wf_id",
        timeout => 30,
    );

Set the request token.

    $self->rtoken($rtoken);

Set status or error message.

    $self->status->info('I18N_OPENXPKI_UI_WORKFLOW_STATE_WATCHDOG_PAUSED_30SEC');
    $self->status->success('...');
    $self->status->warn('...');
    $self->status->error('...');

Set the tenant.

    $self->tenant($tenant);

Set user related information.

    $self->user->name(...);
    $self->user->role(...);
    $self->user->realname(...);
    $self->user->role_label(...);
    $self->user->pki_realm(...);
    $self->user->pki_realm_label(...);
    $self->user->checksum(...);
    $self->user->sid(...);
    $self->user->last_login($timestamp);
    $self->user->tenants([...]);
    # set several attributes at once
    $self->set_user(%{ $user });

Add one or more HTTP response headers.

    $response->add_header(-type => 'application/json; charset=UTF-8');

Return the string containing the HTTP headers.

    print $self->get_header_str($cgi);

Set a raw byte output (i.e. no JSON response) to send files to the client.

    $self->add_header(-type => $data->{mime}, -attachment => $data->{attachment});
    $self->raw_bytes($data);
    # to avoid storing large data in memory
    $self->raw_bytes_callback(sub {
        my $consume = shift;
        open (my $fh, "<", $source) || die "Unable to open $source: $!";
        while (my $line = <$fh>) { $consume->($line) }
        close $fh;
    });

Internal redirection from an "action_*" method to a page ("init_*" method).

From within an "action_*" method you may do this:

    return $self->internal_redirect('home!welcome' => { name => "OpenXPKI" });

Sends the given command to the backend and returns the result.

If an error occurs while executing the command (e.g. validation error from a workflow action), the global status is set in the response sent to the client, so the UI can show the error. This can be suppressed by setting the third parameter to 1.

Parameters

  • Str $command - command
  • HashRef $params - parameters to the command
  • Bool $nostatus - Set to 1 to prevent setting the global status in case of errors. Default: 0

Returns a single input parameter, i.e. real CGI parameters and those appended to the action name using "!". Parameters from the action name have precedence.

If the input parameter has got multiple values then only the first value is returned.

Parameters

Str $key - parameter name to retrieve: a plain parameter name or a stringified hash (e.g. "key_param{curve_name}").

Please note that passing an ArrayRef is no longer supported - please use "param_from_fields" instead. Passing "undef"is also no longer supported.

Return the class logger (log4perl ref).

Deprecated alias for "log".

Assemble the return hash from the internal caches and return the result as a string.

Assemble the return hash from the internal caches and send the result to the browser.

Replace html entities in string by their encoding

__register_wf_token( wf_info, token )

Generates a new random id and stores the passed workflow info, expects a wf_info and the token info to store as parameter, returns a hashref with the definiton of a hidden field which can be directly pushed onto the field list. wf_info can be undef / empty string.

__register_wf_token_initial ( wf_type, token )

Create a token to init a new workflow, expects the name of the workflow as string and an optional hash to pass as initial parameters to the create method. Returns the full action target as string.

__fetch_wf_token( wf_token, purge )

Return the hashref stored by __register_wf_token for the given token id. If purge is set to a true value, the info is purged from the session context.

__purge_wf_token( wf_token )

Purge the token info from the session.

Persist the given response data to retrieve it after an HTTP roundtrip. Used to break out of the JavaScript app for downloads or to reroute result pages.

Returns the page call URI for "init_fetch" in OpenXPKI::Client::UI::Cache.

Get the data for the persisted response.

Generate a random uid (RFC 3548 URL and filename safe base64)

Return a pager definition hash with default settings, requires the query result hash as argument. Defaults can be overriden passing a hash as second argument.

Expects an attribtue query definition hash (from uicontrol), returns arrayref to be used as attribute subquery in certificate and workflow search.

Expects an attribtue query definition hash (from uicontrol), returns arrayref to be used as preset when reloading the search form

Replace "literal" wildcards asterisk and question mark by percent and underscore for SQL queries.

Return a decrypted JWT input parameter (whose only allowed type is HashRef).

"undef" is returned if the parameter does not exist or if it was not encrypted.

Parameters

Str $key - parameter name to retrieve.

Create the autocomplete config for a UI text field from the given workflow field configuration $wf_field.

Also returns an additional hidden, to-be-encrypted UI field definition.

Text input fields with autocompletion are configured as follows:

    type: text
    autocomplete:
        action: certificate!autocomplete
        params:
            user:
                param_1: field_name_1
                param_2: field_name_1
            persist:
                query:
                    status: { "-like": "%done" }

Parameters below "user" are filled from the referenced form fields.

Parameters below "persist" may contain data structures (HashRefs, ArrayRefs) as they are backend-encrypted and sent to the client as a JWT token. They can be considered safe from user manipulation.

Parameters

HashRef $wf_field - workflow field config

Uses the "__encrypted" request parameter to re-assemble the full hash of autocomplete parameters by decoding the encrypted static values and querying the whitelisted dynamic values.

Parameters

HashRef $input_field - input field definition

Returns a HashRef of query parameters

2025-07-15 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.