You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2024/02/22 12:27:44 UTC
(camel) 20/25: CAMEL-20410: documentation fixes for camel-wordpress
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 40cf62ddf7731642752d4b950f57ed69a735d897
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Thu Feb 22 12:05:31 2024 +0100
CAMEL-20410: documentation fixes for camel-wordpress
- Fixed samples
- Fixed grammar and typos
- Fixed punctuation
- Added and/or fixed links
- Converted to use tabs
---
.../apache/camel/catalog/components/wordpress.json | 4 +--
.../camel/component/wordpress/wordpress.json | 4 +--
.../src/main/docs/wordpress-component.adoc | 35 ++++++++++++++--------
.../component/wordpress/WordpressEndpoint.java | 4 +--
4 files changed, 29 insertions(+), 18 deletions(-)
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/wordpress.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/wordpress.json
index c6a54ea7b71..1a9abf50b04 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/wordpress.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/wordpress.json
@@ -2,8 +2,8 @@
"component": {
"kind": "component",
"name": "wordpress",
- "title": "Wordpress",
- "description": "Manage posts and users using Wordpress API.",
+ "title": "WordPress",
+ "description": "Manage posts and users using the WordPress API.",
"deprecated": false,
"firstVersion": "2.21.0",
"label": "cloud,api,cms",
diff --git a/components/camel-wordpress/src/generated/resources/org/apache/camel/component/wordpress/wordpress.json b/components/camel-wordpress/src/generated/resources/org/apache/camel/component/wordpress/wordpress.json
index c6a54ea7b71..1a9abf50b04 100644
--- a/components/camel-wordpress/src/generated/resources/org/apache/camel/component/wordpress/wordpress.json
+++ b/components/camel-wordpress/src/generated/resources/org/apache/camel/component/wordpress/wordpress.json
@@ -2,8 +2,8 @@
"component": {
"kind": "component",
"name": "wordpress",
- "title": "Wordpress",
- "description": "Manage posts and users using Wordpress API.",
+ "title": "WordPress",
+ "description": "Manage posts and users using the WordPress API.",
"deprecated": false,
"firstVersion": "2.21.0",
"label": "cloud,api,cms",
diff --git a/components/camel-wordpress/src/main/docs/wordpress-component.adoc b/components/camel-wordpress/src/main/docs/wordpress-component.adoc
index e61c7e7fd72..cf6ad79006a 100644
--- a/components/camel-wordpress/src/main/docs/wordpress-component.adoc
+++ b/components/camel-wordpress/src/main/docs/wordpress-component.adoc
@@ -1,8 +1,8 @@
-= Wordpress Component
-:doctitle: Wordpress
+= WordPress Component
+:doctitle: WordPress
:shortname: wordpress
:artifactid: camel-wordpress
-:description: Manage posts and users using Wordpress API.
+:description: Manage posts and users using the WordPress API.
:since: 2.21
:supportlevel: Stable
:tabs-sync-option:
@@ -14,7 +14,7 @@
*{component-header}*
-Camel component for https://developer.wordpress.org/rest-api/reference/[Wordpress API].
+Camel component for the https://developer.wordpress.org/rest-api/reference/[WordPress API].
Currently only the **Posts** and **Users** operations are supported.
@@ -34,13 +34,16 @@ include::partial$component-endpoint-options.adoc[]
// endpoint options: END
-Most of parameters needed when performing a read operation mirrors from the official https://developer.wordpress.org/rest-api/reference/[API]. When performing searches operations, the `criteria.` suffix is needed. Take the following `Consumer` as example:
+Most of the parameters
+needed when performing a read operation mirrors from the official https://developer.wordpress.org/rest-api/reference/[API].
+When performing searches operations, the `criteria.` suffix is needed.
+Take the following `Consumer` as example:
----
wordpress:post?criteria.perPage=10&criteria.orderBy=author&criteria.categories=camel,dozer,json
----
-== Configuring Wordpress component
+== Configuring WordPress component
The `WordpressConfiguration` class can be used to set initial properties configuration to the component instead of passing it as query parameter. The following listing shows how to set the component to be used in your routes.
@@ -61,14 +64,15 @@ public void configure() {
== Consumer Example
-Consumer polls from the API from time to time domain objects from Wordpress. Following, an example using the `Post` operation:
+Consumer polls from the API from time to time domain objects from WordPress. Following, an example using the `Post` operation:
- `wordpress:post` retrieves posts (defaults to 10 posts)
- `wordpress:post?id=1` search for a specific post
== Producer Example
-Producer performs write operations on Wordpress like adding a new user or update a post. To be able to write, you must have an authorized user credentials (see Authentication).
+Producer performs write operations on WordPress like adding a new user or update a post.
+To be able to write, you must have an authorized user credentials (see Authentication).
- `wordpress:post` creates a new post from the `org.apache.camel.component.wordpress.api.model.Post` class in the message body.
- `wordpress:post?id=1` updates a post based on data `org.apache.camel.component.wordpress.api.model.Post` from the message body.
@@ -76,15 +80,22 @@ Producer performs write operations on Wordpress like adding a new user or update
== Authentication
-Producers that perform write operations (e.g. create a new post) https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/[must have an authenticated user] to do so. The standard authentication mechanism used by Wordpress is cookie. Unfortunately this method is not supported outside Wordpress environment because it's rely on https://codex.wordpress.org/WordPress_Nonces[nonce] internal function.
+Producers that perform write operations, e.g., creating a new post,
+https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/[must have an authenticated user] to do so.
+The standard authentication mechanism used by WordPress is cookie.
+Unfortunately,
+this method is not supported outside WordPress environment
+because it relies on https://codex.wordpress.org/WordPress_Nonces[nonce] internal function.
-There's some alternatives to use the Wordpress API without nonces, but requires specific plugin installations.
+There are some alternatives to using the WordPress API without nonces, but require specific plugin installations.
-At this time, `camel-wordpress` only supports Basic Authentication (more to come). To configure it, you must install the https://github.com/WP-API/Basic-Auth[Basic-Auth Wordpress plugin] and pass the credentials to the endpoint:
+At this time, `camel-wordpress` only supports Basic Authentication (more to come).
+To configure it,
+you must install the https://github.com/WP-API/Basic-Auth[Basic-Auth WordPress plugin] and pass the credentials to the endpoint:
`from("direct:deletePost").to("wordpress:post:delete?id=9&user=ben&password=password123").to("mock:resultDelete");`
-**It's not recommend to use Basic Authentication in production without TLS!!**
+**It's not recommended to use Basic Authentication in production without TLS!!**
include::spring-boot:partial$starter.adoc[]
diff --git a/components/camel-wordpress/src/main/java/org/apache/camel/component/wordpress/WordpressEndpoint.java b/components/camel-wordpress/src/main/java/org/apache/camel/component/wordpress/WordpressEndpoint.java
index 2593e9c56b7..f1f32f1a2ed 100644
--- a/components/camel-wordpress/src/main/java/org/apache/camel/component/wordpress/WordpressEndpoint.java
+++ b/components/camel-wordpress/src/main/java/org/apache/camel/component/wordpress/WordpressEndpoint.java
@@ -43,9 +43,9 @@ import org.apache.camel.util.ObjectHelper;
import org.apache.camel.util.PropertiesHelper;
/**
- * Manage posts and users using Wordpress API.
+ * Manage posts and users using the WordPress API.
*/
-@UriEndpoint(firstVersion = "2.21.0", scheme = "wordpress", title = "Wordpress", syntax = "wordpress:operation",
+@UriEndpoint(firstVersion = "2.21.0", scheme = "wordpress", title = "WordPress", syntax = "wordpress:operation",
category = { Category.CLOUD, Category.API, Category.CMS })
public class WordpressEndpoint extends DefaultEndpoint {