Packagecom.absentdesign.core.webapis.wordpress.methodgroups
Classpublic class Comments
InheritanceComments Inheritance WPMethodGroup Inheritance MethodGroup Inheritance flash.events.EventDispatcher

concrete WPMethodGroup for manipulating Comments



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
  
Comments
  
deleteComment(commentId:int):void
Wrapper for wp.deleteComment - delete a comment

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

Comments
  
editComment(commentId:int, comment:Comment):void
Wrapper for wp.editComment - edit an existing comment

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

Comments
  
getComment(commentId:int):void
Wrapper for wp.getComment - gets an individual comment

Will dispatch a ServiceEvent of type WPServiceEvent.GET_COMMENT with a Comment as the WPServiceEvent.data once loaded

Comments
  
getComments(postId:int, status:String = "", offset:int = 0, number:int = 10):void
Wrapper for wp.getComments - gets a list of comments for a specific post

Will dispatch a ServiceEvent of type WPServiceEvent.GET_COMMENTS with an array of Comments as the WPServiceEvent.data once loaded

Comments
 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
  
newComment(postId:int, comment:Comment):void
Wrapper for wp.newComment - create a new comment

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

wp.newComment only seems to be able to add comments authored by the logged in user as per the username/password on service), and will ignore any author info on comment You can, however use editComment to change the author details on a comment, regardless of the logged in user

Comments
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
Comments()constructor
public function Comments(service:WPService)Parameters
service:WPService
Method detail
deleteComment()method
public function deleteComment(commentId:int):void

Wrapper for wp.deleteComment - delete a comment

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

Parameters
commentId:int — the id the comment
editComment()method 
public function editComment(commentId:int, comment:Comment):void

Wrapper for wp.editComment - edit an existing comment

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

Parameters
commentId:int — the id the comment
 
comment:Comment — the replacement comment
getComment()method 
public function getComment(commentId:int):void

Wrapper for wp.getComment - gets an individual comment

Will dispatch a ServiceEvent of type WPServiceEvent.GET_COMMENT with a Comment as the WPServiceEvent.data once loaded

Parameters
commentId:int — the id the comment
getComments()method 
public function getComments(postId:int, status:String = "", offset:int = 0, number:int = 10):void

Wrapper for wp.getComments - gets a list of comments for a specific post

Will dispatch a ServiceEvent of type WPServiceEvent.GET_COMMENTS with an array of Comments as the WPServiceEvent.data once loaded

Parameters
postId:int — the id of the post to edit
 
status:String (default = "") — a status string from CommentStatusList
 
offset:int (default = 0)
 
number:int (default = 10) — the number of comments to get
newComment()method 
public function newComment(postId:int, comment:Comment):void

Wrapper for wp.newComment - create a new comment

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

wp.newComment only seems to be able to add comments authored by the logged in user as per the username/password on service), and will ignore any author info on comment You can, however use editComment to change the author details on a comment, regardless of the logged in user

Parameters
postId:int — the id of the post to add the comment to
 
comment:Comment — the new comment