diff --git a/docs/create.sql b/docs/create.sql index 24df7b655..8b4fa01c7 100644 --- a/docs/create.sql +++ b/docs/create.sql @@ -817,6 +817,7 @@ CREATE TABLE WSClient ( templateId int(11) NOT NULL default '1', decodeUtf8 tinyint(3) unsigned NOT NULL default '0', httpHeader varchar(50) default NULL, + cacheTTL smallint(5) unsigned NOT NULL default '60', PRIMARY KEY (wobjectId) ) TYPE=MyISAM; diff --git a/docs/upgrades/upgrade_6.0.1-6.0.2.sql b/docs/upgrades/upgrade_6.0.1-6.0.2.sql index 875604274..4b2bf5b9b 100644 --- a/docs/upgrades/upgrade_6.0.1-6.0.2.sql +++ b/docs/upgrades/upgrade_6.0.1-6.0.2.sql @@ -25,7 +25,7 @@ delete from international where languageId=1 and namespace='Article' and interna insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (73,1,'Article','The following template variables are available for article templates.\r\n

\r\n\r\nnew.template
\r\nArticles have the special ability to change their template so that you can allow users to see different views of the article. You do this by creating a link with a URL like this (replace 999 with the template Id you wish to use):

\r\n<a href=\"<tmpl_var new.template>999\">Read more...</a>\r\n

\r\ndescription.full
\r\nThe full description without any pagination. (For the paginated description use \"description\" instead.)\r\n

\r\n\r\ndescription.first.100words
\r\nThe first 100 words in the description. Words are defined as characters separated by whitespace, so HTML entities and tags count as words.\r\n

\r\n\r\ndescription.first.75words
\r\nThe first 75 words in the description. Words are defined as characters separated by whitespace, so HTML entities and tags count as words.\r\n

\r\n\r\ndescription.first.50words
\r\nThe first 50 words in the description. Words are defined as characters separated by whitespace, so HTML entities and tags count as words.\r\n

\r\n\r\ndescription.first.25words
\r\nThe first 25 words in the description. Words are defined as characters separated by whitespace, so HTML entities and tags count as words.\r\n

\r\n\r\ndescription.first.10words
\r\nThe first 10 words in the description. Words are defined as characters separated by whitespace, so HTML entities and tags count as words.\r\n

\r\n\r\ndescription.first.paragraph
\r\nThe first paragraph of the description. The first paragraph is determined by the first carriage return found in the text.\r\n

\r\n\r\ndescription.first.2paragraphs
\r\nThe first two paragraphs of the description. A paragraph is determined by counting the carriage returns found in the text.\r\n

\r\n\r\ndescription.first.sentence
\r\nThe first sentence in the description. A sentence is determined by counting the periods found in the text.\r\n

\r\n\r\ndescription.first.2sentences
\r\nThe first two sentences in the description. A sentence is determined by counting the periods found in the text.\r\n

\r\n\r\ndescription.first.3sentences
\r\nThe first three sentences in the description. A sentence is determined by counting the periods found in the text.\r\n

\r\n\r\ndescription.first.4sentences
\r\nThe first four sentences in the description. A sentence is determined by counting the periods found in the text.\r\n

\r\n\r\n\r\n\r\nattachment.box
\r\nOutputs a standard WebGUI attachment box including icon, filename, and attachment indicator.\r\n

\r\n\r\nattachment.icon
\r\nThe URL to the icon image for this attachment type.\r\n

\r\n\r\nattachment.name
\r\nThe filename for this attachment.\r\n

\r\n\r\nattachment.url
\r\nThe URL to download this attachment.\r\n

\r\n\r\nimage.thumbnail
\r\nThe URL to the thumbnail for the attached image.\r\n

\r\n\r\nimage.url
\r\nThe URL to the attached image.\r\n

\r\n\r\npost.label
\r\nThe translated label to add a comment to this article.\r\n

\r\n\r\n\r\npost.URL
\r\nThe URL to add a comment to this article.\r\n

\r\n\r\nreplies.count
\r\nThe number of comments attached to this article.\r\n

\r\n\r\nreplies.label
\r\nThe translated text indicating that you can view the replies.\r\n

\r\n\r\nreplies.url
\r\nThe URL to view the replies to this article.\r\n

\r\n\r\n', 1082370724,NULL); delete from international where languageId=1 and namespace='WebGUI' and internationalId=1086; insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (1086,1,'WebGUI','Many wobjects have pagination features. Though some wobjects define their own pagination variables, most use a common set of pagination variables. These are those:\r\n\r\n

\r\n\r\npagination.firstPage
\r\nA link to the first page in the paginator.\r\n

\r\n\r\npagination.isFirstPage
\r\nA boolean indicating whether the current page is the first page.\r\n

\r\n\r\n\r\npagination.lastPage
\r\nA link to the last page in the paginator.\r\n

\r\n\r\npagination.isLastPage
\r\nA boolean indicating whether the current page is the last page.\r\n

\r\n\r\npagination.nextPage
\r\nA link to the next page in the paginator relative to the current page.\r\n

\r\n\r\npagination.previousPage
\r\nA link to the previous page in the paginator relative to the current page.\r\n

\r\n\r\npagination.pageNumber
\r\nThe current page number.\r\n

\r\n\r\npagination.pageCount
\r\nThe total number of pages.\r\n

\r\n\r\npagination.pageCount.isMultiple
\r\nA boolean indicating whether there is more than one page.\r\n

\r\n\r\npagination.pageList
\r\nA list of links to every page in the paginator.\r\n

\r\n\r\n\r\npagination.pageList.upTo20
\r\nA list of links to the 20 nearest in the paginator relative to the current page. So if you\'re on page 60, you\'ll see links for 50-70.\r\n

\r\n\r\npagination.pageList.upTo10
\r\nA list of links to the 10 nearest in the paginator relative to the current page. So if you\'re on page 20, you\'ll see links for 15-25.\r\n

\r\n\r\n', 1082370668,NULL); - - +update international set message='A Web Services Client allows a user to query data from any SOAP server to which they have access. This wobject is in development status and should not be made accessible to un-trusted site administratores.

\n\nSOAP URI/WSDL
\nFrom the SOAP::Lite manpage, \"URIs are just identifiers. They may look like URLs, but they are not guaranteed to point to anywhere and shouldn\'t be used as such pointers. URIs assume to be unique within the space of all XML documents, so consider them as unique identifiers and nothing else.\" If you specify a URI, you probably also need a proxy below. Alternatively, you can specify a WSDL file in place of a URI. This file refers to a real location at which a SOAP service description can be downloaded and used. For our purposes, the file must end in \".wsdl\" to be properly recognized. If you use a WSDL file, you probably don\'t need to specify a proxy.

\n\nSOAP Proxy
\nThe SOAP proxy is the full name of the server and/or script that is listening for SOAP calls. For example:\nhttp://mydomain.com/cgi-bin/soaplistener.pl

\n\nSOAP Method/Call
\nThe SOAP method is the name of the function to be invoked by the SOAP server. Include any extra parameters in the SOAP Call Parameters field below.

\n\nSOAP Call Parameters
\nIf your SOAP call requires any additional parameters, include them here as a valid perl hash, array or scalar. For example: \'userid\' => \'12\', companyid => \'^FormParam(\"companyid\"); Whether you need to use scalar, hash or array is entirely dependent on what your SOAP service expects as input. Likewise, what you get back is entirely dependent on what the service deems to return.\'.

\n\nExecute by default?
\nLeave this set to yes unless your page is calling itself with additional parameters. You will probably know if/when you need to turn off default execution. To force execution when it has been disabled by default, pass a form variable \"targetWobjects\" specifying the name of the SOAP call to force execution.

\n\nTemplate
\nChoose a layout for this SOAP client.

\n\nPreprocess macros on query?
\nIf you\'re using WebGUI macros in your query you\'ll want to check this box.

\n\nPagination After
\nHow many rows should be displayed before splitting the results into separate pages? In other words, how many rows should be displayed per page?

\n\nPagination Variable
\nBecause a SOAP call can return complex data structures, you\'ll need to specify which named variable is to be paginated. If none is specified, no pagination will occur.

\n\nDebug?
\nIf you want to display debugging and error messages on the page, check this box.

\n\nDecode utf8?
\nThis option will only display if you have Data::Structure::Util installed. SOAP calls return utf8 strings even if they may not have utf8 characters within them. This converts utf8 characters to that there aren\'t collisions with any character sets specified in the page header. Deocing is turned off by default, but try turning it on if you see goofy gibberish, especially with the display of copyright symbols and the like.' where namespace='WSClient' and internationalId=71 and languageId=1; +INSERT INTO international VALUES (27,'WSClient',1,'Cache expires',1055349028,NULL); diff --git a/lib/WebGUI/Wobject/WSClient.pm b/lib/WebGUI/Wobject/WSClient.pm index 96cc874a3..7615a4bfb 100644 --- a/lib/WebGUI/Wobject/WSClient.pm +++ b/lib/WebGUI/Wobject/WSClient.pm @@ -107,6 +107,10 @@ sub new { httpHeader => { fieldType => $httpHeaderFieldType, }, + cacheTTL => { + fieldType => 'integer', + defaultValue => 60, + }, }, ); bless $self, $class; @@ -205,6 +209,12 @@ sub www_edit { ); } + $properties->text ( + -name => 'cacheTTL', + -label => WebGUI::International::get(27, $_[0]->get('namespace')), + -value => $_[0]->get('cacheTTL'), + ); + return $_[0]->SUPER::www_edit ( -layout => $layout->printRowsOnly, -privileges => $privileges->printRowsOnly, @@ -333,7 +343,8 @@ sub www_view { @result = { 'result' => $return }; } - $cache->set(Storable::freeze(@result)); + $cache->set(Storable::freeze(@result), + $wobject[0]->get('cacheTTL')); }; # did the soap call fault?