├── components
├── com_content
│ ├── services
│ │ ├── index.html
│ │ └── articles
│ │ │ ├── list
│ │ │ ├── embedded.json
│ │ │ └── get.php
│ │ │ ├── application.php
│ │ │ ├── transform
│ │ │ └── position.php
│ │ │ ├── get.php
│ │ │ └── resource.json
│ └── services.json
└── com_weblinks
│ ├── services
│ ├── index.html
│ └── weblinks
│ │ ├── list
│ │ ├── embedded.json
│ │ ├── get.php
│ │ └── create.php
│ │ ├── get.php
│ │ └── resource.json
│ └── services.json
├── etc
├── config.json
├── services.json
└── README.md
├── api
├── services
│ ├── menuitems
│ │ ├── list
│ │ │ ├── embedded.json
│ │ │ └── get.php
│ │ ├── resource.json
│ │ └── get.php
│ ├── categories
│ │ ├── list
│ │ │ ├── embedded.json
│ │ │ └── get.php
│ │ ├── resource.json
│ │ └── get.php
│ └── root
│ │ └── get.php
├── import.php
├── transform
│ ├── int.php
│ ├── string.php
│ ├── position.php
│ ├── datetime.php
│ ├── boolean.php
│ ├── ynglobal.php
│ ├── state.php
│ ├── transform.php
│ ├── float.php
│ ├── base.php
│ └── target.php
├── application
│ ├── hal
│ │ ├── link.php
│ │ └── joomla.php
│ ├── router.php
│ ├── includemap.php
│ ├── hal.php
│ ├── resourcemap.php
│ └── web.php
├── controller
│ ├── controller.php
│ ├── item.php
│ ├── list.php
│ └── base.php
├── index.php
├── database
│ └── query.php
└── document
│ └── hal
│ └── json.php
└── README.md
/components/com_content/services/index.html:
--------------------------------------------------------------------------------
1 |
233 |
234 | | int |
235 | Casts the definition string to an integer. |
236 |
237 |
238 | | string |
239 | Casts the definition string to a string (duh!). |
240 |
241 |
242 | | boolean |
243 | Casts the definition string to a boolean. |
244 |
245 |
246 | | datetime |
247 | Returns an ISO 8601 date/time field [NOT IMPLEMENTED YET] |
248 |
249 |
250 | | float |
251 | Returns “left”, “right”, “none” or “global”. |
252 |
253 |
254 | | state |
255 | Returns “unpublished”, “published”, “trashed” or “archived”. |
256 |
257 |
258 | | target |
259 | Returns “parent”, “new”, “popup”, “modal” or “global”. |
260 |
261 |
262 | | ynglobal |
263 | Returns “yes”, “no” or “global”. |
264 |
265 |
266 |
267 | ## Adding a custom transform
268 | Components may add custom transforms override the standard ones if required.
269 | Create a /transform directory at the same level in the component directory structure
270 | as the resource.json file and add the additional or override transform classes
271 | in it. There is an example of this in
272 |
273 | ```
274 | /components/com_content/services/transform/position.php
275 | ```
276 |
277 | ## Defining which fields to embed in a list representation
278 | Because the list representation would not normally include a full representation of each of the embeddeded objects,
279 | there is a simple JSON file that defines which fields are included. The file for com_content is
280 |
281 | ```
282 | /components/com_content/services/articles/list/embedded.json
283 | ```
284 |
285 | and it contains something like this:
286 |
287 | ```javascript
288 | {
289 | "embedded":
290 | [
291 | "/access",
292 | "/featured",
293 | "/introText",
294 | "/language",
295 | "_links/self.href",
296 | "_links/joomla:assets.href",
297 | "_links/joomla:categories.href",
298 | "_links/joomla:checkout.href",
299 | "_links/joomla:checkout.method",
300 | "_links/joomla:introImage.href",
301 | "_links/joomla:introImage.float",
302 | "_links/joomla:introImage.title",
303 | "_links/joomla:introImage.caption",
304 | "metadata/authorName",
305 | "/ordering",
306 | "publish/alias",
307 | "publish/created",
308 | "publish/publishDown",
309 | "publish/publishUp",
310 | "/state",
311 | "/title"
312 | ]
313 | }
314 | ```
315 |
316 | The array is a simple list of field names to be included in the embedded representations.
317 | Each entry must match a field name in the articles.json file. The fields definitions from the resource.json file
318 | used so that data in both single and list representations should match exactly.
319 |
320 | ## References and further reading
321 |
322 | * Joomla Web Services Working Group http://docs.joomla.org/Web_Services_Working_Group
323 | * Joomla CMS Web Services API Specification https://docs.google.com/document/d/1FVKGlV6BN6pu-YH2WR2pQHE3Ez7M6r7LD417GSw9ZSo/edit?usp=sharing
324 | * application/vnd.joomla.base.v1 media type specification https://docs.google.com/document/d/11SqH-daKQV9SrFBMEpopjBk3vM1USIHnFWZB9rjJB94/edit?usp=sharing
325 | * application/vnd.joomla.service.v1 media type specification https://docs.google.com/document/d/1wg3AcgStA26UwDcbHVV1bub4sa_BhsKfzAmX21eG-FM/edit?usp=sharing
326 | * application/vnd.joomla.item.v1 media type specification https://docs.google.com/document/d/16xwxSDDPW0U1CG9l7JcwOyGvyjm7wv5zOSd9JwgF2iQ/edit?usp=sharing
327 | * application/vnd.joomla.list.v1 media type specification https://docs.google.com/document/d/1PLym28MG5v1tWyvIyW-9483JNKh5AP21Fmsmg62plnA/edit?usp=sharing
328 | * Joomla CMS Web Service API Implementation https://docs.google.com/document/d/1d5qQ16r1Bo1BlXXuyS_eFB4BQcfuSg05pn9hsMpAgqk/edit?usp=sharing
329 | * Joomla CMS CLI Services API Specification https://docs.google.com/document/d/1wI3cSm3y4aa8n8rojJKpiF6RUpSl63WFuLgJj2WqW8o/edit?usp=sharing
330 |
--------------------------------------------------------------------------------