NAME

BiBiServ::WSCLayout - Layout Tools for the http client WebService side of BiBiServ


SYNOPSIS


  my $WSCLayout = new BiBiServ::WSCLayout(WSCTools=>$WSCTools,Status=>$status);
  where $WSCTools and $status are references to former build BiBiServ::WSCTools and BiBiServ::Status objects.
  (for a introduction and complete documentation see "BiBiServ WebService Developers Guide")


DESCRIPTION

This module provides methods for generating a cgi-based http-interface of a BiBiServ WebService. There are a lot of standard methods for getting frames for different status of the WebService. A user can use this methods - but (e.g. for errors) would like to give proper own ErrorMessages, she is welcome to do, except mainFrame, which is supposed to use, because it creates the BiBiServ-CI.

Why should you use this module ?

We (the BiBiServ Administrators) have some rules to follow so a WebService and the http-Client can work on our system. Using BiBiServ:: is the simpliest way to follow our rules and have a complete error handling for example.


METHODS

new

This is the contructor. It requires a BiBiServ::WSCTools and a BiBiServ::Status object.

  my $WSCLayout = new BiBiServ::WSCLayout(WSCTools=>$WSCTools, Status=>$status);

Parameters:

$WSCTools : reference to former created BiBiServ::WSCTools object

$status : reference to former created BiBiServ::Status object

returns undef if an error occoured.

mainFrame

generates a stadard HTML frame page for bibiserv results depending on the sizes given.

  print $WSCLayout->mainFrame($topSize,$leftSize,$redirectParam)

returns a HTML-page as string

Parameters:

$topSize: big (default), small or no

$leftSize : big (default), small (there is no option ``no'', because we want the user to be informed about status

$redirectParam : location of where to redirect to. (useful for two or more steps of a webservice)

redirectFrame

generates a redirection frame for rerequesting of the result later, which is used for the main section of WSCLayout->mainFrame.

  print $WSCLayout->redirectFrame($redirecttarget);

By default the target of redirection is $TOOLNAME_redirect. If you want to redirect to something else (e.g. for a second step) submit: $toolname$redirecttarget

Parameters:

$redirecttarget : location of where to redirect to. (useful for 2 or more steps in a webservice)

returns a HTML-page as string.

resultFrame

generates a result frame for giving user a list of different result formats. Is used for the main section of WSCLayout->mainFrame when calculation is finished

  print $WSCLayout->resultFrame($dataDescription)

returns a HTML-page as string.

Parameters:

$dataDescription is the hashRef, which is generated also for WSCTools->writeResult and returned by WSCTools->existsResult. (so key is file and value is description)

errorFrame

generates an error frame to inform the user of an error. Is used for the main section of WSCLayout->mainFrame.

  print $WSCLayout->errorFrame($redirecttarget)

For non permanent Errors set $redirecttarget By default the target of redirection is $TOOLNAME_redirect. If you want to redirect to something else (e.g. for a second step) submit: $toolname$redirecttarget

returns a HTML-page as string.

Also sets the image of the statusFrame to errorImage. (changing color to orange instead of green)

bibiLayout

generates the general BiBiServ layout around the given $htmlString.

  print $WSCLayout->bibiLayout($htmlString)

Parameters:

$htmlString : String containing html.

returns a HTML-page as string.

toolLayout

generates the tool specific layout around the given $htmlString. This is useful, if you develop a multi-step tool.

After getting results from the first step, simply call this method with a HTMLForm of the second step (normally you will have a hidden field bibiid for referencing to results of first step.)

  print $WSCLayout->toolLayout($htmlString)

Parameters:

$htmlString : String containing html.

returns a HTML-page as string.

toolResult

generates the tool specific result page This is useful, if you develop a synchronous Tool.

  print $WSCLayout->toolResult(\%myargs)

Parameters:

$myargs{text} : heading $myargs{content} : String content of page $myargs{stylesheet} : location of stylesheet (optional) $myargs{javascript} : location of javascript file (optional)

returns a HTML-page as string.

toolError

generates the tool specific error page This is useful, if you develop a synchronous Tool.

  print $WSCLayout->toolError(\%myargs)

Parameters:

$myargs{content} : String content of Error $myargs{stylesheet} : location of stylesheet (optional) $myargs{javascript} : location of javascript file (optional) $myargs{back} : link back

returns a HTML-page as string.