Commit Graph

156 Commits

Author SHA1 Message Date
Ingo Schommer
6ff1f9050d Merge pull request #1187 from dhensby/restfulservice-improvements
API Restfulservice improvements
2013-02-15 10:45:43 -08:00
Daniel Hensby
920fd71a2f Adding default curl options
Because I removed completely the static setting of SSL_VERIFYPEER I've
added the ability to declare default curl options on the class. This
means that users that really want to one line turn off SSL_VERIFYPEER
can do so without needing to pass a custom option in every request()
call.
2013-02-15 11:45:52 +00:00
Daniel Hensby
f003359047 RestfulService_Response now gets response headers
Before now, the RestfulService_Response object was never sent the
response headers. For APIs that rely on the response headers to send
back information (signatures, pagination info, etc).

This change makes the curl response have the full HTTP response
(including Headers). We then extract the body and the header information
and assign them to relevant vars and then construct the response as
before (with the addition of the headers array).

This change required two new functions:
extractResponse: This extracts the HTTP Headers and the payload from the
curl response and assigns it to the relevany vars that are passed by
reference
parseRawHeaders: This was designed to mimic http_parse_headers (a
non-standard php class). It converts the headers into an associative
array.
2013-02-15 11:45:36 +00:00
Daniel Hensby
7c189731e3 Better cache key generation
All of the arguments supplied to the request function can impact what is
returned by a restful service.

This takes account of that and makes the cache key more specific,
including basic auth details, so we don't rely on *just* the absolute
URL for caching.
2013-02-15 11:16:46 +00:00
Ingo Schommer
14a56c18e9 Merge remote-tracking branch 'origin/3.0' into 3.1
Conflicts:
	control/Director.php
2013-02-07 21:45:16 +01:00
uniun
e249799e9a Incorrect Contant-Type header for RSS feeds
It should be application/rss+xml but not text/xml.
2013-02-05 18:11:28 +02:00
jonom
e8da9c9eb8 API: Use HTMLText as default for RSS Description
To allow for custom RSS descriptions (i.e. provided by a method rather than a DB field) and avoid double escaping a better default class for Description is 'HTMLText'. http://www.silverstripe.org/customising-the-cms/show/11606#post319519
2013-01-27 09:37:35 -07:00
Simon Welsh
b0121b541c Add codesniffer that ensures indentation is with tabs. 2012-12-12 17:33:31 +13:00
Simon Welsh
fc5dd2994c Add codesniffer that ensures indentation is with tabs. 2012-12-12 00:12:11 +13:00
Sean Harvey
fbc6e3366b Merge branch '3.0' 2012-11-05 15:11:48 +13:00
Sean Harvey
aff28eb896 BUG JSONDataFormatter should respect canView() permissions 2012-11-05 14:03:39 +13:00
Ingo Schommer
d54b1b4d86 API Removed permission checks from XML/JSON data formatters
Please handle those checks in the logic using the formatters
instead. Applied permission checks to its primary use case,
the "restfulserver" module.
2012-10-30 23:34:29 +01:00
Sam Minnee
1f7fc1f76a FIX Remove instances of lines longer than 120c
The entire framework repo (with the exception of system-generated files) has been amended to respect the 120c line-length limit.  This is in preparation for the enforcement of this rule with PHP_CodeSniffer.
2012-09-30 17:18:13 +13:00
Ingo Schommer
e2f073f38a Method visibility according to coding conventions 2012-09-20 10:46:59 +02:00
Elliot Sawyer
71758c782f ISSUE 7833: Invoke ShortcodeParser on RestfulServer output 2012-09-17 17:53:51 +12:00
Will Rossiter
7558d32da6 FIX: use standard template rendering process for RSS feeds
This changes the behaviour of output to browser to use the standard SilverStripe rendering process rather than an echo statement to enable easier testability.
2012-07-31 20:38:41 +12:00
Mateusz Uzdowski
34fdad8d50 Minor typo in RSS feed. 2012-07-20 09:08:40 +12:00
Will Rossiter
f1db65d6b6 API: add api for setting a custom template on a RSS feed.
See initial idea at http://open.silverstripe.org/ticket/6441. Added $template property and corresponding getters / setters for customizing the template used. Added relevant unit test.
2012-07-01 21:27:50 +12:00
Ingo Schommer
9e21fb8a4a API CHANGE Moved SapphireSoapServer and SOAPModelAccess into its own module at https://github.com/silverstripe/silverstripe-soapserver (fixes #7282) 2012-06-04 10:22:48 +02:00
Ingo Schommer
cb8b11812c API CHANGE Moved RestfulServer into its own module at https://github.com/silverstripe/silverstripe-restfulserver (fixes #7282) 2012-06-04 10:21:29 +02:00
Sean Harvey
6f672e5f36 MINOR Fixing use of <% control %> with <% with %> or <% loop %> as necessary. 2012-05-11 13:49:20 +12:00
Sean Harvey
0882741f54 API CHANGE Renamed setModel for DataModel instances to setDataModel for
semantics, and also to allow a field name called "Model"
2012-05-01 14:45:44 +12:00
Ingo Schommer
0e8c3acc35 MINOR Using SapphireInfo non-statically in RestfulService (fixes #7238) 2012-04-30 10:22:00 +02:00
Andrew O'Neil
fb3b03f38b MINOR: Remove support for PHP <5.3.2 2012-04-18 11:01:03 +12:00
Mateusz Uzdowski
59663f9289 BUGFIX: fix up some E_STRICT errors 2012-04-17 11:51:55 +12:00
Simon Welsh
f07258f3cf MINOR Update @package values to match renaming sapphire 2012-04-15 10:50:19 +12:00
Simon Welsh
3a6341a251 API-CHANGE sapphire folder can now be renamed. 2012-04-15 10:50:19 +12:00
Simon Welsh
f8082e4814 MINOR Add newline to end of files without one 2012-04-15 10:50:19 +12:00
Fred Condo
d370423825 Clean up trailing ?> per coding standard
All sapphire but the lang directory
2012-02-12 12:40:16 -08:00
Stig Lindqvist
e22eaec204 BUGFIX Restfulserver should use the correct way when sorting SS_Lists 2011-12-17 16:42:30 +13:00
Ingo Schommer
d30b4b1d00 BUGFIX Respecting api_access on has_one relations in RestfulServer
BUGFIX Limiting fields according to api_access on relation object (rather than the "root" object) in RestfulServer
BUGFIX Limit listing of has_one relations in RestfulServer to actual relation (was listing all objects before)
BUGFIX Creating correct object instances in RestfulServer->getHandler() for relation queries
2011-11-13 14:09:44 +01:00
Ingo Schommer
ec47cc1286 MINOR Whitespace 2011-11-13 13:52:07 +01:00
Stig Lindqvist
e38dd08ea5 MINOR: Fix docblocks to reference SS_List instead of (now deprecated) DataObjectSet where appropriate 2011-10-28 15:58:55 +13:00
Fred Condo
9bd499617b Spelling correction
Found and fixed all misspellings of "[Hh]ierarchy"
2011-10-18 15:32:52 -07:00
Will Rossiter
1732a17114 Merged new-orm into datagrid 2011-09-26 16:47:54 +13:00
nicolaas
7b56008414 BUGFIX error in RestfulServer: currentMember should be currentUser (fixes #6283)
http://open.silverstripe.org/ticket/6283
2011-09-18 23:22:13 +02:00
Ingo Schommer
ce8e72cf0e MINOR Removing executable flag from all files (thanks miiihi) 2011-09-18 22:04:02 +02:00
ajshort
3f132a105b API CHANGE: Replaced DataObjectSet instances with ArrayList. 2011-05-05 20:40:24 +10:00
ajshort
43c39bed8f MINOR: Updated RestfulServer to properly convert list instances. 2011-05-03 13:11:09 +10:00
ajshort
04e5dae22e MINOR: Updated places that expect a DataObjectSet to accept an SS_List instance. 2011-05-02 17:14:05 +10:00
Sam Minnee
7fbb919ce8 API CHANGE: Introduce DataModel object, as a representation of the project's entire data model, and tie it to $this->model an all DataObjects, Controllers, and RequestHandlers for easy non-static access.
API CHANGE: Add DataList::newObject(), which creates a new object on that DataList.
API CHANGE: RequestHandler::handleRequest() now needs to handle a $model argument, if you override it.
2011-05-01 17:33:02 +12:00
Sam Minnee
b8f736d665 ENHANCEMENT: Updated restfulserver to make use of refactored searchquery. note that searchquery will probably be bypasssed entirely in the near future. 2011-05-01 15:25:58 +12:00
ajshort
3a1c2df4e7 API CHANGE: Renamed DataObjectDecorator to DataExtension.
API CHANGE: Renamed LeftAndMainDecorator to LeftAndMainExtension.
MINOR: Replaced all references to decorators with extension.
2011-04-26 11:01:38 +10:00
Julian Seidenberg
a204c136fe API CHANGE: JSONDataFormatter builds JSON itself, changing it to use Convert::array2json() instead (fixes #5162, thanks sharvey) 2011-03-30 18:16:12 +13:00
ajshort
eb1a3fe75a API CHANGE: Separated the actual CURL request generation code from RestfulService::request() into RestfulService::curlRequest().
MINOR: Updated RestfulServiceTest to use a mock service rather than the actual site. This eliminates the need for ?usetestmanifesst.
2011-03-24 21:31:00 +11:00
Carlos Barberis
184e8bd852 ENHANCEMENT: Added allowed actions to core classes 2011-02-14 11:14:51 +13:00
Sean Harvey
2b0729d435 ENHANCEMENT XMLDataFormatter::convertDataObjectWithoutHeader() now escapes HTML fields using CDATA (thanks random-value!)
MINOR Added unit test for XMLDataFormatter::convertDataObjectWithoutHeader()


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@115229 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-12-20 04:51:24 +00:00
Sean Harvey
145d285d4b BUGFIX RestfulService CURLOPT_FOLLOWLOCATION cannot be used when open_basedir option enabled in PHP (thanks jshipman!)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@115062 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-12-15 05:23:55 +00:00
Ingo Schommer
e4a786eb1a MINOR Setting Content-Type to text/plain in various error responses for RestfulServer
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@114750 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-12-09 08:40:28 +00:00
Sam Minnee
be40e11c72 BUGFIX #6096 RSSFeed::feedContent() restores previous state of SSViewer::get_source_file_comments() after temporarily disabling it (thanks paradigmincarnate!) (from r111914)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112944 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-19 05:06:53 +00:00