Skip to content

Tolc/IntelliJ_Jahia_plugin

Repository files navigation

CND Language / Jahia Framework support for IntelliJ IDEA

release

definitions.cnd files syntax highlighting, code completion, and other amazing stuff.

marketplace

You can also rate it on the JetBrains Plugins Repository.

Requirements

Tested under IntelliJ IDEA from 14.1.4 to 2022.3.2

IntelliJ plugins dependencies (optional): JavaEE, JSP, Properties. Requires Java 17 or higher (Java 8 before v2.2.0).

Jahia project versions: 6.6.x, 7.x, and 8.x.

Features

CND Language

  • Syntax highlighting
  • Syntax checking and error highlighting
  • Code completion
  • Code formatting
  • Find usages (ctrl-click/cmd-click) - for namespaces, nodetypes and nodetypes properties declarations (not getting namespaces and nodetypes usages in .properties files for the moment though)
  • Go to declaration (ctrl-click/cmd-click) - for namespaces and nodetypes usages throughout the file
  • Refactoring
    • Rename (shift+f6) - for namespaces, nodetypes and nodetypes properties declarations (not renaming namespaces and nodetypes usages in .properties files for the moment though)
  • File icon CND file icon
  • Line markers for namespaces namespace and nodetypes nodetype / mixins mixin
  • Code folding - for namespaces and nodetypes
  • Brace matching - closing brackets and parenthesis are automatically inserted where authorized by the syntax
  • Commenter (ctrl+/) - to comment lines of code

Jahia Framework

Jahia

Compatible with Jahia 6.6.x, 7.x, and 8.x.

  • CND files features:

    • Helpers/Quickfixes (alt+enter on nodetype name)
      • Create nodetype and nodetype properties translations - only appears if no translation is found
      • Create new view - opens a popup that lets you choose the new view parameters, creates view and cache properties files, and also creates the folders if they don't already exist. If the view is a JSP, the new view also contains code to access all the node properties and sub nodes.
    • Nodetype folders icon in Project View (view folder or hidden view folder if mixin)
    • View files grouping (creates a virtual folder view folder - or hidden view folder if hidden view - in the Project View)
    • Completion and other features on Jahia nodetypes (embedded Jahia base and main modules .cnd files) - a local library called 'jahia-plugin-base-cnd-files' is automatically added to the module dependencies if the module contains at least one cnd file (in case you have deleted this dependency, no panic, it comes back after re-opening the project)
  • Other files/languages features:

    • JSP
      • Nodetypes usages highlighting & line markers nodetype/mixin
      • Nodetypes completion
      • Go to nodetype declaration (ctrl-click/cmd-click)
      • Unknown nodetype error highlighting
      • Create nodetype quickfix (alt+enter on nodetype name) - if known namespace but unknown nodetype
      • <template:module/> line marker, 'view' attribute completion and reference template module (both are affected by 'templateType' attribute if provided)
      • <template:include/> line marker, 'view' attribute completion and reference template include (both are affected by 'templateType' attribute if provided)
      • Properties and property type completion in ${currentNode.properties.propertyName}, ${currentNode.properties['propertyName']} and <jcr:nodeProperty/>
      • <template:addResources/> line marker, completion and reference
    • Java
      • Nodetypes usages highlighting & line markers nodetype/mixin
      • Nodetypes completion
      • Go to nodetype declaration (ctrl-click/cmd-click)
      • Unknown nodetype error highlighting
      • Create nodetype quickfix (alt+enter on nodetype name) - if known namespace but unknown nodetype
    • XML
      • Nodetypes usages highlighting & line markers nodetype/mixin
      • Nodetypes completion
      • Go to nodetype declaration (ctrl-click/cmd-click)
      • Unknown nodetype error highlighting
      • Create nodetype quickfix (alt+enter on nodetype name) - if known namespace but unknown nodetype
    • Properties (resource bundles)
      • Translations keys syntax highlighting & line markers for namespaces namespace, nodetypes nodetype/mixin and properties property
      • Translations keys nodetypes and properties completion
      • Go to namespace, nodetype or property declaration from translations keys (ctrl-click/cmd-click)
      • Error message if adding translations for a choicelist on a non-choicelist property
  • IntelliJ

    • Jahia Tool Window

Roadmap (?)

This is just the beginning.
  • Improved cache .properties support:
    • Resource bundles .properties extension, to be able to find namespaces and nodetypes usages in it
    • View cache .properties custom language
  • Plugin settings
  • Make helpers/quickfixes accessible through Actions in menus
  • Groovy support

Don't hesitate to request features / suggest enhancements by opening an Issue.

--

This plugin is neither official nor endorsed by Jahia in any way. I am just a guy who loves this CMS and wanted to make working with it easier for everyone (or at least everyone using IntelliJ, duh).