\KapostService
Class KapostService
Synopsis
class KapostService
extends Controller
implements
PermissionProvider
{
- // members
- private static boolean $check_user_agent = true;
- private static string $authenticator_class = 'MemberAuthenticator';
- private static string $authenticator_username_field = 'Email';
- private static string $kapost_media_folder = 'kapost-media';
- private static string $duplicate_assets = 'smart_rename';
- private static integer $preview_token_expiry = 10;
- private static integer $preview_data_expiry = 20;
- private static string $database_charset = 'UTF-8';
- private static boolean $filter_kapost_threads = false;
- private array $exposed_methods = ;
- private static array $allowed_actions = ;
- // methods
- public void index()
- public string preview()
- public void handleRPCMethod()
- protected bool authenticate()
- public Response httpError()
- protected array getUsersBlogs()
- protected void newPost()
- protected void editPost()
- protected void getPost()
- protected array getCategories()
- protected Response newMediaObject()
- protected void getPreview()
- protected final array struct_to_assoc()
- private array mergeResultArray()
- private array preg_grep_keys()
- public string filterKapostThreads()
- public static File find_file_by_url()
- protected string generateErrorResponse()
- public array providePermissions()
Hierarchy
Extends
- Controller
Implements
- PermissionProvider
Members
private
- $allowed_actions
-
$authenticator_class
Authenticator to be used for authenticating the Kapost account -
$authenticator_username_field
Authenticator to be used for authenticating the Kapost account -
$check_user_agent
If set to true when the service is called the user agent of the request is checked to see if it is Kapost's XML-RPC user agent -
$database_charset
Database Character Set -
$duplicate_assets
Tells the service what to do with duplicate media assets Options: smart_rename: Verifies the file is the same as the existing file and instead uses that file, otherwise it renames the file to make it unique rename: Rename the file to make it unique overwrite: Overwrite the duplicate resource ignore: Ignore's the duplicate resource and returns an error to Kapost - $exposed_methods
-
$filter_kapost_threads
Enables filtering of the kapost thread tags in the description field -
$kapost_media_folder
Authenticator to be used for authenticating the Kapost account -
$preview_data_expiry
Preview data expiry window in minutes -
$preview_token_expiry
Preview token expiry window in minutes
Methods
private
- mergeResultArray() — Merges two arrays, overwriting the keys in the left array with the right array recurrsivly. Meaning that if a value in the right array is it self an array and the key exists in the left array it recurses into it.
- preg_grep_keys() — Gets all of the values who's keys match a given expression
protected
- authenticate() — Checks the authentication of the api request
- editPost() — Handles editing of a given post
- generateErrorResponse() — Takes the xmlrpc object and generates the response to be set back
- getCategories() — Gets the categories
- getPost() — Gets the details of a post from the system
- getPreview() — Handles rendering of the preview
- getUsersBlogs() — Gets the site config or subsites for the current site
- newMediaObject() — Handles media objects from kapost
- newPost() — Handles creation of a new post
- struct_to_assoc() — Converts a struct to an associtive array based on the key value pair in the struct
public
- filterKapostThreads() — Filters the kapost content to remove the thread tags from a Kapost WYSIWYG
- find_file_by_url() — Finds a file record based on the url of the file, this is needed because Kapost doesn't seem to send anything back other than the url in the cms
- handleRPCMethod() — Handles RPC request methods
- httpError() — Converts an error to an xmlrpc response
- index() — Handles incoming requests to the kapost service
- preview() — Handles rendering of the preview for an object
- providePermissions() — Return a map of permission codes to add to the dropdown shown in the Security section of the CMS.