Packagecom.absentdesign.core.webapis.wordpress.methodgroups
Classpublic class Categories
InheritanceCategories Inheritance WPMethodGroup Inheritance MethodGroup Inheritance flash.events.EventDispatcher

concrete WPMethodGroup for manipulating Categories



Public Properties
 PropertyDefined by
 InheritedblogId : int
WPMethodGroup
 Inheritedpassword : String
WPMethodGroup
 Inheritedusername : String
WPMethodGroup
Protected Properties
 PropertyDefined by
 Inheritedhelper : MethodGroupHelper
MethodGroup
 InheritedrequestArgs : Array
WPMethodGroup
 InheritedrequestFunction : Function
WPMethodGroup
 Inheritedservice : Service
MethodGroup
Public Methods
 MethodDefined by
  
Categories
  
deleteCategory(categoryId:int):void
Wrapper for wp.deleteCategory - delete a Category

Will dispatch a ServiceEvent of type WPServiceEvent.DELETE_CATEGORY with a struct as the WPServiceEvent.data once loaded

Categories
  
Wrapper for wp.getCategories - get an array of all categories

Will dispatch a ServiceEvent of type WPServiceEvent.GET_CATEGORIES with an Array of categories as the WPServiceEvent.data once loaded

Categories
  
getPostCategories(postId:uint):void
Wrapper for mt.getPostCategories - get an array of categories for a specific post

Will dispatch a ServiceEvent of type WPServiceEvent.GET_POST_CATEGORIES with an Array of Categories as the WPServiceEvent.data once loaded

Categories
 Inherited
load(request:ServiceRequest):void
MethodGroup
 Inherited
loadRequest(request:WPServiceRequest, requestFunction:Function, ... args):void
Load a WPServiceRequest

Automatically calls service.connect() and delays the request until the service is connected if the WPService does not return a valid blogId

WPMethodGroup
  
newCategory(category:Category):void
Wrapper for wp.newCategory - add a new Category

Will dispatch a ServiceEvent of type WPServiceEvent.NEW_CATEGORY with a struct as the WPServiceEvent.data once loaded

Categories
  
setPostCategories(postId:uint, categories:Array):void
Wrapper for mt.setPostCategories - set the categories for a specific post

Will dispatch a ServiceEvent of type WPServiceEvent.SET_POST_CATEGORIES with a struct of Categories as the WPServiceEvent.data once loaded

There appears to be an issue where the XML-RPC interface will occasionally return different data to the HTML interface when this method is used - if you set the categories on a post, the HTML interface will return the old category set until the user has logged in and clicked "update post" in the admin - the XML-RPC interface (and hence flash) will return the correct category set however.

Categories
  
suggestCategories(category:String, maxResults:int = 5):void
Wrapper for wp.suggestCategories - get an array of categories that start with a given string

Will dispatch a ServiceEvent of type WPServiceEvent.SUGGEST_CATEGORIES with an Array of categories as the WPServiceEvent.data once loaded

Categories
Protected Methods
 MethodDefined by
 Inherited
processAndDispatch(event:Event):void
Process the result using WPMethodGroupHelper and dispatch a ServiceEvent of type request.eventType with the parsed data
WPMethodGroup
 Inherited
Re-submits a delayed call if the service needed to connect or was connecting while the call was made
WPMethodGroup
Constructor detail
Categories()constructor
public function Categories(service:WPService)Parameters
service:WPService
Method detail
deleteCategory()method
public function deleteCategory(categoryId:int):void

Wrapper for wp.deleteCategory - delete a Category

Will dispatch a ServiceEvent of type WPServiceEvent.DELETE_CATEGORY with a struct as the WPServiceEvent.data once loaded

Parameters
categoryId:int — the id of the Category to delete
getCategories()method 
public function getCategories():void

Wrapper for wp.getCategories - get an array of all categories

Will dispatch a ServiceEvent of type WPServiceEvent.GET_CATEGORIES with an Array of categories as the WPServiceEvent.data once loaded

getPostCategories()method 
public function getPostCategories(postId:uint):void

Wrapper for mt.getPostCategories - get an array of categories for a specific post

Will dispatch a ServiceEvent of type WPServiceEvent.GET_POST_CATEGORIES with an Array of Categories as the WPServiceEvent.data once loaded

Parameters
postId:uint — the id of the post to get categories for
newCategory()method 
public function newCategory(category:Category):void

Wrapper for wp.newCategory - add a new Category

Will dispatch a ServiceEvent of type WPServiceEvent.NEW_CATEGORY with a struct as the WPServiceEvent.data once loaded

Parameters
category:Category — the new Category to add
setPostCategories()method 
public function setPostCategories(postId:uint, categories:Array):void

Wrapper for mt.setPostCategories - set the categories for a specific post

Will dispatch a ServiceEvent of type WPServiceEvent.SET_POST_CATEGORIES with a struct of Categories as the WPServiceEvent.data once loaded

There appears to be an issue where the XML-RPC interface will occasionally return different data to the HTML interface when this method is used - if you set the categories on a post, the HTML interface will return the old category set until the user has logged in and clicked "update post" in the admin - the XML-RPC interface (and hence flash) will return the correct category set however.

Parameters
postId:uint — the id of the post to set categories on
 
categories:Array — an array of categories containing int categoryId and boolean isPrimary. Using isPrimary to set the primary category is optional—in the absence of this flag, the first element in the array will be assigned the primary category for the post.
suggestCategories()method 
public function suggestCategories(category:String, maxResults:int = 5):void

Wrapper for wp.suggestCategories - get an array of categories that start with a given string

Will dispatch a ServiceEvent of type WPServiceEvent.SUGGEST_CATEGORIES with an Array of categories as the WPServiceEvent.data once loaded

Parameters
category:String — the string to use
 
maxResults:int (default = 5)