How to embed DSL keyword highlighting and code completion into application - eclipse

I am creating custom DSL with groovy for purpose of creating rules (for rule engine). My target audience will be non-programmers.
Something like this:
when user visit page "test" within 5.days
then assign campaign 200
I would like to provide my users with at least some kind of text box where they will be able to create rules using the DSL. To make it simple and professional I am looking for a third party component to help me with the task of keywords highlighting and code completion. I read about groovy DSL descriptor but apparently thry working only inside eclipse IDE. Is there any way to incorporate required functionality into my application?

You have a bunch of code editor to put in your projects. Check the wiki http://en.wikipedia.org/wiki/Comparison_of_JavaScript-based_source_code_editors.
You can see a great example: Console Plugin source code

Related

Create new custom rule for all languages in SonarQube 6

I need to add a new custom rule which will check if email is written anywhere in code. It should work for all languages but specially for PHP. I'm confused if I've to create a plugin for it or has to create a custom rule template. Any lead can be helpful. Thanks!
The list of languages that support custom rules is here. In general, you're not going to be able to enforce this for "all languages" but you should be able to accomplish this for PHP by creating a plugin and implementing your rule in Java.

Scala - Template based run time code generation

I am looking for a good template based run-time code generation library in Scala. I need this for my ERP system to generate artifacts (html, and other code files)
Can any please point me in right direction?
You should take a look at Scalate. It has multiple syntax choices and if you use SSP you can easily create templates for text other than HTML as well.
If your app is web-based, Play has a templating system for generating the output pages.

Email Editor Similar to Campaign Monitor or Mailchimp's editor?

I looking for either an open source (or otherwise) php script/library/code that will provide me with a similar email composer that Mailchimp and Campaign Monitor have.
I've played around with lots of wysiwyg editors (eg: tinymce, ckeditor) but, they don't work very well for allowing users to compose emails.
Mosaico Editor is the first open source email template builder of this kind (AFAIK).
You can find a free to use deployment (working also as live demo) at http://mosaico.io and you can get sources at https://github.com/voidlabs/mosaico
I choose blocks from a set defined by the "master template", then you fill you contents and change their styles in a WYSIWYG style. If you're on a large window you can also have live preview for the mobile version.
The master template defines what are the blocks, what you can edit and what you can style and it contains any html trick to make it compatible with most clients: this means you can change the editor behaviour a lot by simply writing a new master template.
It is 99% javascript (IE10+, and any other modern browser) and depends on server-side functions only to do "final inlining" and "image upload/resizing"
Next generation tool for building templates without coding
Grapejs official site
GrapesJS is an open-source, multi-purpose, Web Builder Framework which combines different tools and features with the goal to help you (or users of your application) to build HTML templates without any knowledge of coding. It's a perfect solution to replace the common WYSIWYG editors, which are good for content editing but inappropriate for creating HTML structures. You can see it in action with the official demos, but using its API you're able to build your own editors.
I'm in the process of building one but as a designer it is a work in progress! I'd suggest looking at PHP template engines. They have a similar functionality. Most however will use php variables inside the html page instead of tags.
Another oprion is to check out Perch it is officially a CMS, but is really lightweight and might get the job done for you.
Hope that helps even though it is a year after you posted the question...
EDIT: Actually just stumbled across this thread which links to the new CKEditor - looks pretty cool.

Web based plugin architecture for simple user interfaces

I have a web based application using Primefaces with a very basic plug-in like architecture. The configuration of these plug-ins was all handled with xml, which is not so user friendly system.
I would now like to allow for each plug-in to be configurable via the web application, what are my options?
I have looked into Portals and Portlets but that seems like a rather big change to my application and my plug-ins do not require such complex user interfaces, a textbox or two of configuration is more than enough.
Does anyone have any suggestions or advice and what would be the best route here?
Create a simple page , per plugin that read the XML file, parse the option that you want to change , present it to the user with a simple interface, and save back the XML file.
Take care of the saving part and password-protect this page!

How to create an Export Plugin for Confluence

I'd like to create a plugin that exports into a custom document format similar to the way that export to PDF and export to Word currently work in Confluence.
Does anyone have experience creating a custom export plugin for Confluence? If so do you know of any resources or samples that describe what would be involved?
Here are the most useful resources that I've found so far:
Plugin Tutorial - Adding a custom action to Confluence - This shows how to add an action to the "Tools" menu that appears at the top of a confluence page. Additionally it shows how to interact with the Page object to get more info about the page.
Plugin Module Types - The second guide I found helpful was the list of general plugin module types. It was informative to discover that a "plugin" is really a collection of "modules" and seeing this list was helpful to understand how to apply that model to creating a plugin of the type I was looking for. Additionally the Confluence Plugin Guide was also helpful for a breakdown on Confluence specific plugin modules.
The Confluence Developer FAQ - Useful for information on how to convert wiki content from a page into HTML as well as a number of other hard-to-find gems.
Finally, it was hard to find, but in order to understand how to "target" a particular menu or area of the existing UI to extend, I found it very helpful to read about the guide for Creating your Plugin Descriptor.