internal package Foswiki::Configure::UI

See PublishedAPI for packages intended to be used by Plugin and Contrib authors, or browse all packages.
See also Developing plugins, Developer's Bible, Technical Overview

internal package Foswiki::Configure::UI

This is both the factory for UIs and the base class of all UI objects. A UI is the V part of the MVC model used in configure.

Each structural entity in a configure screen has a UI type, either stored directly in the entity or indirectly in the type associated with a value. The UI type is used to guide a visitor which is run over the structure to generate the UI.

ClassMethod new($item)

Construct a new UI, attaching it to the given $item in the model.

StaticMethod reset($isFirstTime)

Called from the main configure script, this method resets the total error and warning counts. This method is provided primarily for testing support.

ObjectMethod findRepositories()

Build descriptive hashes for the repositories listed in $Foswiki::cfg{ExtensionsRepositories}

ObjectMethod getRepository($name) → \%repository

Gets the hash that describes a named repository

StaticMethod loadUI($id, $item) → $ui

Loads the Foswiki::Configure::UIs subclass for the given $id. For example, given the id 'BEANS', it will try and load Foswiki::Configure::UIs::BEANS

$item is passed on to the constructor for the UI.

StaticMethod loadChecker($id, $item) → $checker

Loads the Foswiki::Configure::Checker subclass for the given $id. For example, given the id '{Beans}{Mung}', it will try and load Foswiki::Configure::Checkers::Beans::Mung

If the id doesn't have a subclass defined, the item's type class may define a generic checker for that type. If so, it is instantiated for this item.

Returns the checker created or undef if no such checker is found.

Will die if the checker exists but fails to compile.

$item is passed on to the checker's constructor.

ObjectMethod getUrl() → $response

Returns a response object as described in Foswiki::Net

ObjectMethod setting(...) → $html

Generate the HTML for a key-value row in a table.

ObjectMethod makeID($id) → $encodedID

Encode a string to make a simplified unique ID useable as an HTML id or anchor

ObjectMethod NOTE(...)

Generate HTML for an informational note.

ObjectMethod NOTE_OK(...)

Generate HTML for a note, but with the class configureOK

ObjectMethod WARN(...)

Generate HTML for a warning, and flag it in the model.

ObjectMethod ERROR(...)

Generate HTML for an error, and flag it in the model.

ObjectMethod hidden($value) → $html

Used in place of CGI::hidden, which is broken in some CGI versions. HTML encodes the value

ObjectMethod urlEncode($data) → $encodedData

URL encode a value.

StaticMethod authorised () → ($isAuthorized, $messageType)

Invoked to confirm authorisation, and handle password changes. The password is changed in $Foswiki::cfg, a change which is then detected and written when the configuration file is actually saved.

Topic revision: r1 - 19 Apr 2011, ProjectContributor
 
This site is powered by FoswikiCopyright © CC-BY-SA by the contributing authors. All material on this collaboration platform is copyrighted under CC-BY-SA by the contributing authors unless otherwise noted.
Ideas, requests, problems regarding Foswiki? Send feedback