You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by se...@apache.org on 2021/09/11 23:22:27 UTC
[openmeetings] 01/01: OPENMEETINGS-2661 Add Rest examples and add
Node.js Module.
This is an automated email from the ASF dual-hosted git repository.
sebawagner pushed a commit to branch feature/OPENMEETINGS-2661-update-rest-examples-add-node-js-module
in repository https://gitbox.apache.org/repos/asf/openmeetings.git
commit 73a96cdf1757579d46dca4043b698504191a187d
Author: Sebastian Wagner <se...@gmail.com>
AuthorDate: Sun Sep 12 11:22:14 2021 +1200
OPENMEETINGS-2661 Add Rest examples and add Node.js Module.
---
.../src/site/xdoc/ConfluencePlugin.xml | 2 +-
openmeetings-server/src/site/xdoc/JiraPlugin.xml | 2 +-
.../src/site/xdoc/RestAPISample.xml | 58 ++++++++++++++++++++--
openmeetings-webservice/pom.xml | 16 +++++-
4 files changed, 71 insertions(+), 7 deletions(-)
diff --git a/openmeetings-server/src/site/xdoc/ConfluencePlugin.xml b/openmeetings-server/src/site/xdoc/ConfluencePlugin.xml
index 79b00c9..694e464 100644
--- a/openmeetings-server/src/site/xdoc/ConfluencePlugin.xml
+++ b/openmeetings-server/src/site/xdoc/ConfluencePlugin.xml
@@ -43,7 +43,7 @@
<section name="Demo video">
<p>The demo video of Confluence plugin show you the plugin in action </p>
- <iframe width="640" height="390" src="https://www.youtube.com/embed/YFKlXggtld0" frameborder="0" allowfullscreen=""></iframe>
+ <iframe width="640" height="390" src="https://www.youtube.com/embed/D1XOxgpfr5c" frameborder="0" allowfullscreen=""></iframe>
</section>
</body>
</document>
diff --git a/openmeetings-server/src/site/xdoc/JiraPlugin.xml b/openmeetings-server/src/site/xdoc/JiraPlugin.xml
index d1e268f..8ee41cc 100644
--- a/openmeetings-server/src/site/xdoc/JiraPlugin.xml
+++ b/openmeetings-server/src/site/xdoc/JiraPlugin.xml
@@ -43,7 +43,7 @@
<section name="Demo video">
<p>The demo video of Jira plugin show you the plugin in action </p>
- <iframe width="640" height="390" src="https://www.youtube.com/embed/xBdYj-OZvlc" frameborder="0" allowfullscreen=""></iframe>
+ <iframe width="640" height="390" src="https://www.youtube.com/embed/gbp4_Lpfrno" frameborder="0" allowfullscreen=""></iframe>
</section>
</body>
diff --git a/openmeetings-server/src/site/xdoc/RestAPISample.xml b/openmeetings-server/src/site/xdoc/RestAPISample.xml
index 07ce23b..4148841 100644
--- a/openmeetings-server/src/site/xdoc/RestAPISample.xml
+++ b/openmeetings-server/src/site/xdoc/RestAPISample.xml
@@ -22,10 +22,13 @@
<body>
<section name="Introduction">
<p> For a detailed instruction which services, methods and params are available see the list in the <a href="/openmeetings-webservice/apidocs/index.html" target="_blank">SOAP/REST API</a> .
- ALL methods that are implemented for the SOAP API are also available via REST.
+ ALL methods that are implemented for the SOAP API are also available via REST.
</p>
+ <div class="bd-callout bd-callout-info">
+ There is a <a href="https://openmeetings.apache.org/swagger/" target="_blank">OpenAPI spec</a> published in swagger format.
+ </div>
<div>
- you can query methods of each service using following suffixes
+ You can query methods of each service using following suffixes
<ul>
<li>SOAP: <tt>?wsdl</tt> suffix, for example <tt>https://localhost:5443/openmeetings/services/UserService?wsdl</tt></li>
<li>REST: as xml <tt>?_wadl</tt> for example <tt>https://localhost:5443/openmeetings/services/user?_wadl</tt></li>
@@ -36,7 +39,56 @@
</div>
</div>
</section>
- <section name="How to get room hash via REST">
+ <section name="How to integrate using Node.js">
+ <p>You can integrate OpenMeetings via the Rest API into your Node project.</p>
+ <div class="bd-callout bd-callout-info">
+ There is a community sponsored free module for integrating with Node.JS see: <a href="https://www.npmjs.com/package/openmeetings-node-client" target="_blank">openmeetings-node-client</a>
+ </div>
+ <p>Install the module</p>
+<source>
+npm install openmeetings-node-client
+</source>
+ <p>Eg generate a unique hash to enter a conference room:</p>
+ <ol>
+ <li>Login to service</li>
+ <li>Generate Hash for entering a conference room</li>
+ <li>Construct Login URL</li>
+ </ol>
+<source>
+const {UserServiceApi, Configuration} = require("openmeetings-node-client");
+const BASE_URL = "http://localhost:5080/openmeetings"
+
+const config = new Configuration({
+ basePath: BASE_URL + "/services"
+})
+// 1. Login to service
+const loginResult = await userService.login("admin", "!HansHans")
+
+// 2. Generate Hash for entering a conference room
+const hashResult = await userService.getRoomHash(sessionId, {
+ firstname: "John",
+ lastname: "Doe",
+ externalId: "uniqueId1",
+ externalType: "myCMS",
+ login: "john.doe",
+ email: "john.doe@gmail.com"
+ }, {
+ roomId: 1,
+ moderator: true
+ })
+
+// 3. Construct Login URL
+const loginUrl = `${BASE_URL}/hash?secure=${hashResult.message}`
+</source>
+ <p>Full sample source code for can be found at:
+ <ol>
+ <li>JavaScript/ES6 example using simplistic Express website see <a href="https://github.com/om-hosting/openmeetings-node-js-sample-project" target="_BLANK">Github openmeetings-node-js-sample-project</a></li>
+ <li>TypeScript example using simplistic Express website <a href="https://github.com/om-hosting/openmeetings-node-sample-project" target="_BLANK">Github openmeetings-node-sample-project</a></li>
+ </ol>
+ </p>
+ <p>More in depth examples and use cases can be found at the module page <a href="https://www.npmjs.com/package/openmeetings-node-client" target="_blank">https://www.npmjs.com/package/openmeetings-node-client</a></p>
+ </section>
+ <section name="How to get room hash via REST vis jQuery">
<ul>
<li>
First of all you need to perform login and get authorized SID to perform authorized operations
diff --git a/openmeetings-webservice/pom.xml b/openmeetings-webservice/pom.xml
index d9e94a0..ac157f2 100644
--- a/openmeetings-webservice/pom.xml
+++ b/openmeetings-webservice/pom.xml
@@ -70,11 +70,23 @@
<swaggerConfig>
<info>
<title>Apache OpenMeetings API</title>
+ <description>
+ <![CDATA[
+ Integration API enables to connect to an OpenMeetings instance, eg for generating users, create links to directly access conference rooms.<br/><br/>
+ <b>It is mainly designed for Server2Server integration, for example to integrate into your website, CMS or 3rd party application</b><br/><br/>
+ For examples how to use the Rest API see <a href="https://openmeetings.apache.org/RestAPISample.html" target="_BLANK">https://openmeetings.apache.org/RestAPISample.html</a>.<br/><br/>
+ Community contributed modules for using this API include for example:
+ <ul>
+ <li><a href="https://openmeetings.apache.org/RestAPISample.html#how-to-integrate-using-nodejs" target="_BLANK"> Node.js module for using API</a></li>
+ </ul>
+ Other community plugins using this API for Moodle, SugarCRM, Drupal, Joomla can be found in the Configuration>Plugins section at <a href="https://openmeetings.apache.org" target="_BLANK">https://openmeetings.apache.org</a>
+ ]]>
+ </description>
<version>${project.version}</version>
<contact>
<email>dev@openmeetings.apache.org</email>
- <name>Apache OpenMeetings Developer group</name>
- <url>https://openmeetings.apache.org</url>
+ <name>Apache OpenMeetings Rest Examples and Documentation</name>
+ <url>https://openmeetings.apache.org/RestAPISample.html</url>
</contact>
<license>
<url>https://www.apache.org/licenses/LICENSE-2.0</url>