Try now Demo en
  • en
  • fr
  • de
  • Product
    • Platform
      • Software TourFeatures & capabilities overview
      • Why eXoeXo Platform key differentiators
      • InternationalisationSupporting multilingual environments
      • MobileResponsive & available on any device
    • Technology
      • No CodeTailor eXo platform to your needs
      • ArchitectureAn overview of eXo Platform technology
      • IntegrationsAvailable connectors & integration capabilities
      • SecurityeXo Platform security measures
      • Open sourceComponents & licensing
  • Solutions
    • Communication
      • Modern IntranetBuild your company culture
      • Knowledge managementCentralize and share your company knowledge
      • Community managementEngage your community
      • ExtranetInvolve your clients and partners
    • Collaboration
      • Social NetworkConnect all your employees
      • Collaboration PlatformEmpower your teams
      • Employee PortalCentralize your work environment
      • Employee EngagementEngage & empower your employees
    • For
      • Public Sector
      • Networks
      • Education
      • Enterprises
  • Pricing
  • Resources
    • Resource center
      • Case studies
      • White Papers
      • Datasheets
      • Videos
    • Migration guide
      • Alternative to Microsoft 365
      • Alternative to Sharepoint
      • Alternative to Workplace from Meta
    • From The Blog
      • eXo Platform 6.5 is released: personalized navigation, multi-sites management and more
      • eXo launches its online community platform – eXo Tribe!
      • Cloud Vs On-premise Digital Workplace: Which one is right for your business?
  • Community
    • CommunityJoin our online community platform
    • DownloadLaunch eXo platform in your infrastructure
    • Source codeSource code on github
    • FAQsAbout the software, the community and our offers
    • REST APIs & DocumentationAll REST APIs available in eXo Platform
  • Company
    • Customers
    • Partners
    • Services
    • About us
    • Contact us
    • Newsroom
  • Menu mobile
    • Pricing
    • About us
    • Careers
    • Resource center
    • Blog
    • Contact us
    • Try eXo
Platform
  • Software Tour Features & capabilities overview
  • Why eXo eXo Platform key differentiators
  • Internationalisation Supporting multilingual environments
  • Mobile Responsive & available on any device
Technology
  • No Code Tailor eXo platform to your needs
  • Architecture An overview of eXo Platform technology
  • Integrations Available connectors & integration capabilities
  • Security eXo Platform security measures
  • Open source Components & licensing
Communication
  • Modern Intranet Build your company culture
  • Knowledge management Centralize and share your company knowledge
  • Community management Engage your community
  • Extranet Involve your clients and partners
Collaboration
  • Social Network Connect all your employees
  • Collaboration Platform Empower your teams
  • Employee Portal Centralize your work environment
  • Employee Engagement Engage & empower your employees
For
  • Public Sector
  • Networks
  • Education
  • Enterprises
Resource center
  • Case studies
  • White Papers
  • Datasheets
  • Videos
Migration guide
  • Alternative to Microsoft 365
  • Alternative to Sharepoint
  • Alternative to Workplace from Meta
From The Blog
  • eXo Platform 6.5 is released: personalized navigation, multi-sites management and more
  • eXo launches its online community platform – eXo Tribe!
  • Cloud Vs On-premise Digital Workplace: Which one is right for your business?
Community Join our online community platform
Download Launch eXo platform in your infrastructure
Source code Source code on github
FAQs About the software, the community and our offers
REST APIs & Documentation All REST APIs available in eXo Platform
Customers
Partners
Services
About us
Contact us
Newsroom
Pricing
About us
Careers
Resource center
Blog
Contact us
Try eXo
  1. Accueil
  2. Uncategorized
  3. The Great Guide to Installing eXo Platform IDE and Developing Gadgets with REST Services

The Great Guide to Installing eXo Platform IDE and Developing Gadgets with REST Services

Overview of the eXo Platform IDE

eXo IDE is an online development environment inside eXo Platform, with a friendly interface developer that can easily code, deploy and run applications directly from their Platform, from writing Javascript, CSS, XML to deploying REST Services, Data Object.

eXo IDE offers:

  • Remote File System through the Virtual File System, including Browsing, File Locking, File Searching and Versioning
  • Code Editor with syntax highlighting for many popular languages and advanced features, such as Code Auto-complete, Code Outline and WYSIWYG Editor for HTML
  • Multiple programming and descriptive languages support, such as JavaScript, HTML, XML, CSS, Groovy, and more
  • Tools for developing client side applications including technologies such as Netvibes Widgets, Google Gadgets and Groovy Templates
  • Development of server-side applications, running, and interaction with the client side via REST Service

This tutorial teaches you how to install the IDE extension from the Platform Enterprise Edition bundle, begin with a basic REST services, then an advance REST services from Forum’s services methods.

Requirement:
– Platform 4 Enterprise Edition

Installing the eXo Platform IDE

First, let’s install IDE extension with comand ./extension.sh -i ide (in Linux, Mac) or extension.bat -i ide (in Windows).

annb:platform-4> ./extension.sh -i ide
 # ===============================
 # eXo Platform Extensions Manager
 # ===============================

Installing ide extension ...
     [copy] Copying 6 files to /home/annb/platform-4/lib
     [copy] Copying /home/annb/platform-4/extensions/ide/lib/exo-ide-extension-chromattic-server-1.3.x-SNAPSHOT.jar to /home/annb/platform-4/lib/exo-ide-extension-chromattic-server-1.3.x-SNAPSHOT.jar
...
...
     [copy] Copying /home/annb/platform-4/extensions/ide/webapps/ide-extension.war to /home/annb/platform-4/webapps/ide-extension.war
Done.

 # ===============================
 # Extension ide installed.
 # ===============================
annb:platform-4>

Then start Platform with ./start_eXo.sh, in top menu Administration > IDE is installed

annb:platform-4> ./start_eXo.sh

01-IDE-Platform

Basic Actions with REST services

Inside the IDE interface, when you first make a new REST service, a new untitled file groovy script “grs” will create a hello world sample code

02-Rest-Services

@GET
@Path("helloworld/{name}")
public String hello(@PathParam("name") String name) {
   return "Hello my " + name
}

Then you go to Run > Validate

Output displays a successful validation

Run > Deploy to deploy directly in Platform’s server with my localhost:8080 and call parameter “eXo”, I can execute REST service /rest/my-service/helloworld/eXo

03-Run-Validate-Deploy

04-HelloWorld

We can go deeper with REST service. Here in advance sample, I use mainly Forum source codes to display which user is online.

You copy this code into your current groovy script.

– Who is online sample:

import org.exoplatform.forum.service.ForumService;
import org.exoplatform.commons.utils.CommonsUtils;

…
…

  @GET
  @Path("useronline")
  public String whoisonline() {
    ForumService forumService = CommonsUtils.getService(ForumService.class);
    String resultUserOnline = "";   
    List<String> allOnlineUsers = forumService.getOnlineUsers();
    for (String user : allOnlineUsers){
     resultUserOnline = user + ", " +resultUserOnline;
    }   
    return resultUserOnline;
  }

For the full source, you can use the links below in reference: https://github.com/exo-addons/resource-center/blob/master/ide-rest-gadget/basic/sample.grs

For more detail about the method to get online users, internal services, you can search in github sources: https://github.com/exoplatform/forum/

05-Code

Save > Run > Validate

Run > Deploy

Login with 2 users: root and john in two different browsers

Then call REST: /rest/my-service/useronline

06-Users

Gadgets and REST services with the eXo Platform IDE

In this example, you will learn how to use a REST service (deployed with eXo IDE) from a gadget: create, deploy, run, import, and finally display it on a home page.

Source files: https://github.com/exo-addons/resource-center/tree/master/ide-rest-gadget/gadget

1) Create a hierarchy folder and copy these files:

07-folder

Right click on dev-monit to create a subfolder name advance_tutorial

In folder advance_tutorial, create sub folders js (contains javascript), style (contains CSS) then create Google Gadget, REST Service, CSS and Javascript files.

08-js-style

Hierarchy presentation:

– advance_tutorial
— js
— jquery.simpletip-1.3.1.min.js
— style
— online.css
— OnlineGadget.xml
— WhosOnlineRestServices.grs (groovy script)

2) Run, validate and deploy your WhosOnlineRestServices and OnlineGadget

09-deploy-successful

Console output

WhosOnlineRestServices

[INFO] WhosOnlineRestServices.grs validated successfully.

[INFO] /rest/private/jcr/repository/dev-monit/advance_tutorial/WhosOnlineRestServices.grs deployed successfully.

OnlineGadget

[INFO] /rest/private/ide/gadget/deploy?gadgetURL=http%3A%2F%2Flocalhost%3A8080%2Frest%2Fprivate%2Fjcr%2Frepository%2Fdev-monit%2Fadvance_tutorial%2FOnlineGadget.xml&privateContext=%2Frest%2Fprivate&publicContext=%2Frest deployed successfully.

3) Import your gadget: Administration > Application > Import Applications

10-import-app

4) Add your gadget on the homepage: Go to home page > Edit > Page > Edit layout

11-edit-layout

Add your “Who’s Online Gadget at the top,” then save it

12-add-gadget

5) After that, your gadget is displayed in the home page

13-home-display

6) Invite some users and accept connection!

14-invite-confirm

7) Your gadget will display your friends’ connections when they are online

15-gadget-display

16-gadget-display

References:

– Download Platform 4: https://community.exoplatform.com > eXo Platform 4.0 > Downloads

– IDE documentation: https://docs.exoplatform.org/

– Forum sources: https://github.com/exoplatform/forum

– For more resources on IDE, you can follow these guides:
– How to Build, Debug and Deploy Apps for Google App Engine with Cloud IDE
– How to Build a Mashup of Twitter and Flickr Feeds Using eXo Cloud IDE

– Full source of basic action: https://github.com/exo-addons/resource-center/blob/master/ide-rest-gadget/basic/sample.grs

– Full source of gadget “Who is online”: https://github.com/exo-addons/resource-center/tree/master/ide-rest-gadget/gadget

 

Join the eXo tribe by registering for the community and get updates, tutorials, support, and access to the Platform and add-on downloads!


make-the-most-out-of-eXo-platform4

Make the most out of eXo Platform 4

Register to the next webinar and get a complete overview of what you can do with eXo Platform 4. Reserve your seat now!

Brahim Jaouane

I am a Digital Marketing specialist specialized in SEO at eXo Platform. Passionate about new technologies and Digital Marketing. With 10 years' experience, I support companies in their digital communication strategies and implement the tools necessary for their success. My approach combines the use of different traffic acquisition levers and an optimization of the user experience to convert visitors into customers. After various digital experiences in communication agencies as well as in B2B company, I have a wide range of skills and I am able to manage the digital marketing strategy of small and medium-sized companies.

Full-featured digital workplace with everything your employees need to work efficiently, smartly integrated for a compelling employee experience

  • Product
    • Software tour
    • Communication
    • Collaboration
    • Knowledge
    • Productivity
    • Open Source
    • Integrations
    • Security
  • Uses cases
    • Digital Workplace
    • Intranet software
    • Collaboration software
    • Knowledge management software
    • Entreprise Social Network
    • Employee Engagement platform
  • Roles
    • Internal Communications
    • Human Resources
    • Information Technology
  • Company
    • Product offer
    • Services Offer
    • Customers
    • Partners
    • About us
  • Resources
    • FAQs
    • Resource Center
    • Collaboration guide
    • What is a Digital workplace?
    • What is an intranet?
    • Employee engagement
  • Terms and Conditions
  • Legal
  • Privacy Policy
  • Accessibility
  • Contact us
  • Sitemap
  • Facebook
  • Twitter
  • LinkedIn
wpDiscuz