SlideShare uma empresa Scribd logo
1 de 44
Baixar para ler offline
Introducing AutoComplete for
Velocity and FreeMarker languages in
Liferay Portal 6.2
Liferay UI Engineer
Iliyan Peychev
Thursday, October 10, 13
A few words about me
Started as C developer ~12 years ago.
Lately turned to Java developer.
Currently working as Front-End engineer at Liferay.
Twitter: ipeychev
GitHub: ipeychev
Thursday, October 10, 13
• What we had in Liferay 6.1
• Making the AutoComplete
• Making the Palette
• Applying both to Web Content, DDM and ADT
• Extending the AutoComplete
• Future
Agenda
Thursday, October 10, 13
• Relatively complicated user interface
What we had in Liferay 6.1
Thursday, October 10, 13
Step #1:
Click on Add
Template Button
What we had in Liferay 6.1
Thursday, October 10, 13
Step #2:
Click on Launch Editor
Button
What we had in Liferay 6.1
Thursday, October 10, 13
Result:
Plain Text Editor
What we had in Liferay 6.1
Thursday, October 10, 13
Or basic
Rich Text Editor
What we had in Liferay 6.1
Thursday, October 10, 13
Click Save or
Save and Continue
If you want to edit again,
click again on Launch Editor
What we had in Liferay 6.1
Thursday, October 10, 13
• Relatively complicated user interface (true, right?)
What we had in Liferay 6.1
Thursday, October 10, 13
• Relatively complicated user interface (true, right?)
• ACE Editor without any kind of AutoComplete
What we had in Liferay 6.1
Thursday, October 10, 13
• Relatively complicated user interface (true, right?)
• ACE Editor without any kind of AutoComplete
• No Palette
What we had in Liferay 6.1
Thursday, October 10, 13
• Relatively complicated user interface (true, right?)
• ACE Editor without any kind of AutoComplete
• No Palette
• No context help, no link to external resources
What we had in Liferay 6.1
Thursday, October 10, 13
• Relatively complicated user interface (true, right?)
• ACE Editor without any kind of AutoComplete
• No Palette
• No context help, no link to external resources
As result, developers very often used external
editors to create their Templates.
What we had in Liferay 6.1
Thursday, October 10, 13
Making the AutoComplete
Thursday, October 10, 13
ACE Editor does not provide AutoComplete.
We had to build it from scratch.
Fortunately, it turned its API is powerful enough to
achieve this goal without many efforts.
Making the AutoComplete
Thursday, October 10, 13
AutoComplete architecture
ACE Editor Language processor Result list
FiltersSortersFormatters
Thursday, October 10, 13
• Fill mode
• Overwrite mode
Overwrite mode is by default, it replaces the input
string entirely.
Fill mode adds the suggestion after the input string.
AutoComplete modes
Thursday, October 10, 13
We built a new module for the AlloyUI Framework.
This module consists of Base, UI and Language
processors.
Currently we support parts of Freemarker and
Velocity languages.
ACE AutoComplete is an AlloyUI module
Thursday, October 10, 13
The Base module intercepts ACE Editor
commands, like:
- onTextInput
- golinedown
- golineup
- gotoend
- gotolineend
- gotolinestart
(and a few others)
The Base
Thursday, October 10, 13
The UI is a standard AlloyUI Overlay.
It is used to draw the suggestions in a list.
Supports keyboard navigation.
The developer can specify custom sorters or filters.
The UI
Thursday, October 10, 13
Since Freemarker and Velocity are similar and we
support part of them, they have a common ancestor.
For both languages we support Directives and
Variables.
The Language Processors
Thursday, October 10, 13
An instance of the Template editor can be modified
on the fly.
This means we can always plug and unplug the
AutoComplete functionality.
We can even replace one language with another.
Plugin Infrastructure
Thursday, October 10, 13
AutoComplete Variables example
Variable
AutoComplete UI
Thursday, October 10, 13
AutoComplete Directives example
Thursday, October 10, 13
Learning from the mistakes
Initially we implemented the AutoComplete using
Ternary Search Tree.
c
/ | 
a u h
| | | 
t t e u
/ / | / |
s p e i s
Source: Wikipedia
Thursday, October 10, 13
Learning from the mistakes
Searching was fast.
Constructing the Tree turned to be slow, so we
discarded it from the Editor.
However, it is now AlloyUI module and all
developers can use it.
Hint - use it when you construct the tree rarely (or
once), but search often.
Thursday, October 10, 13
Making the Palette
Thursday, October 10, 13
Making the Palette
Represents the most often used:
• General variables
• Utilities
• Web Content Services
• Portal Services
• Data List Variables
• Data List Record Fields
Thursday, October 10, 13
Making the Palette
Represents the most often used:
• General variables
• Utilities
• Web Content Services
• Portal Services
• Data List Variables
• Data List Record Fields
Dynamically adds the fields in Structures and Data
Definitions
Thursday, October 10, 13
The Palette – general view
Thursday, October 10, 13
The Palette – general view
Click with the
mouse (or tap) to
insert the item in
the editor
Thursday, October 10, 13
The Palette – general view
The result
goes where
the cursor
was
Thursday, October 10, 13
From Structure to Template
Let's suppose we have an example structure with
three fields:
• Name
• Image
• URL
Thursday, October 10, 13
From Structure to Template
Thursday, October 10, 13
From Structure to Template
The Palette
automatically includes
the structure fields on
creating Template.
Thursday, October 10, 13
Context help and searching
Context help with link to the Javadoc page
Search box, use it to filter the results
Thursday, October 10, 13
Applying the Palette and AutoComplete
• Applying to Web Content
• Applying to Data Definitions
• Applying to ADT (Application Display Template)
Thursday, October 10, 13
Applying to Data Definitions
Displays the previously
created fields into the Data
Definition
Thursday, October 10, 13
Extending AutoComplete
The AutoComplete is built with the idea of being
easily extendable.
One day I read this Tweet:
“Primeros pasos en el desarrollo de un editor sql
online utilizando @AlloyUI , #keepworking ”
Victor Miranda, Support Engineer, Liferay Spain
He created AutoComplete for SQL.
Thursday, October 10, 13
Extending AutoComplete
Web Based SQL Editor with
AutoComplete
Thursday, October 10, 13
The future
• Adding more language processors.
• Adding visual formatters.
• Applying the AutoComplete to other Editors.
• Show nested fields in Palette
Thursday, October 10, 13
You can contribute too!
Sometimes the chains that prevent us to be creative
and free are more mental than physical.
Thursday, October 10, 13
Thanks!
Questions?
Twitter: ipeychev
GitHub: ipeychev
Thursday, October 10, 13

Mais conteúdo relacionado

Destaque

Object Oriented Programming in JavaScript
Object Oriented Programming in JavaScriptObject Oriented Programming in JavaScript
Object Oriented Programming in JavaScript
zand3rs
 

Destaque (20)

Social Networking Presentation For Chamber Of Commerce
Social Networking Presentation For Chamber Of CommerceSocial Networking Presentation For Chamber Of Commerce
Social Networking Presentation For Chamber Of Commerce
 
Liferay 6.2 theme premium
Liferay 6.2 theme premiumLiferay 6.2 theme premium
Liferay 6.2 theme premium
 
6.2 presentation
6.2 presentation6.2 presentation
6.2 presentation
 
Building an Enterprise Content Management solution on top of liferay
Building an Enterprise Content Management solution on top of liferayBuilding an Enterprise Content Management solution on top of liferay
Building an Enterprise Content Management solution on top of liferay
 
View, Act, and React: Shaping Business Activity with Analytics, BigData Queri...
View, Act, and React: Shaping Business Activity with Analytics, BigData Queri...View, Act, and React: Shaping Business Activity with Analytics, BigData Queri...
View, Act, and React: Shaping Business Activity with Analytics, BigData Queri...
 
CTO School Networking Presentation
CTO School Networking PresentationCTO School Networking Presentation
CTO School Networking Presentation
 
Liferay Module Framework
Liferay Module FrameworkLiferay Module Framework
Liferay Module Framework
 
Introducing the new calendar app in liferay 6.2
Introducing the new calendar app in liferay 6.2Introducing the new calendar app in liferay 6.2
Introducing the new calendar app in liferay 6.2
 
Moved to https://slidr.io/azzazzel/leveraging-osgi-to-create-extensible-plugi...
Moved to https://slidr.io/azzazzel/leveraging-osgi-to-create-extensible-plugi...Moved to https://slidr.io/azzazzel/leveraging-osgi-to-create-extensible-plugi...
Moved to https://slidr.io/azzazzel/leveraging-osgi-to-create-extensible-plugi...
 
Ipsec 2
Ipsec 2Ipsec 2
Ipsec 2
 
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik HarabiEclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
 
Object Oriented Programming in JavaScript
Object Oriented Programming in JavaScriptObject Oriented Programming in JavaScript
Object Oriented Programming in JavaScript
 
Mandatory access control for information security
Mandatory access control for information securityMandatory access control for information security
Mandatory access control for information security
 
Redis vs Aerospike
Redis vs AerospikeRedis vs Aerospike
Redis vs Aerospike
 
Social Media Marketing
Social Media MarketingSocial Media Marketing
Social Media Marketing
 
Esper - CEP Engine
Esper - CEP EngineEsper - CEP Engine
Esper - CEP Engine
 
Big Data Day LA 2016/ Big Data Track - Portable Stream and Batch Processing w...
Big Data Day LA 2016/ Big Data Track - Portable Stream and Batch Processing w...Big Data Day LA 2016/ Big Data Track - Portable Stream and Batch Processing w...
Big Data Day LA 2016/ Big Data Track - Portable Stream and Batch Processing w...
 
Liferay portals in real projects
Liferay portals  in real projectsLiferay portals  in real projects
Liferay portals in real projects
 
Siddhi: A Second Look at Complex Event Processing Implementations
Siddhi: A Second Look at Complex Event Processing ImplementationsSiddhi: A Second Look at Complex Event Processing Implementations
Siddhi: A Second Look at Complex Event Processing Implementations
 
Liferay architecture By Navin Agarwal
Liferay architecture By Navin AgarwalLiferay architecture By Navin Agarwal
Liferay architecture By Navin Agarwal
 

Semelhante a Implementing AutoComplete for Freemarker and Velocity languages in ACE Editor

Eclipse Orion: The IDE in the Clouds (JavaOne 2013)
Eclipse Orion: The IDE in the Clouds (JavaOne 2013)Eclipse Orion: The IDE in the Clouds (JavaOne 2013)
Eclipse Orion: The IDE in the Clouds (JavaOne 2013)
Murat Yener
 
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
Jeavon Leopold
 
Lotusphere 2011 Jmp103 - Jumpstart Your "Jedi Plug-in Development Skills" wi...
Lotusphere 2011  Jmp103 - Jumpstart Your "Jedi Plug-in Development Skills" wi...Lotusphere 2011  Jmp103 - Jumpstart Your "Jedi Plug-in Development Skills" wi...
Lotusphere 2011 Jmp103 - Jumpstart Your "Jedi Plug-in Development Skills" wi...
Ryan Baxter
 
2 whats-new-in-ios7-m2-xcode-slides
2 whats-new-in-ios7-m2-xcode-slides2 whats-new-in-ios7-m2-xcode-slides
2 whats-new-in-ios7-m2-xcode-slides
MasterCode.vn
 
JS Frameworks - Angular Vs Backbone
JS Frameworks - Angular Vs BackboneJS Frameworks - Angular Vs Backbone
JS Frameworks - Angular Vs Backbone
Gourav Jain, MCTS®
 

Semelhante a Implementing AutoComplete for Freemarker and Velocity languages in ACE Editor (20)

Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Javascript Frameworks Comparison - Angular, Knockout, Ember and BackboneJavascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
 
Javascript Frameworks Comparison
Javascript Frameworks ComparisonJavascript Frameworks Comparison
Javascript Frameworks Comparison
 
Eclipse Orion: The IDE in the Clouds (JavaOne 2013)
Eclipse Orion: The IDE in the Clouds (JavaOne 2013)Eclipse Orion: The IDE in the Clouds (JavaOne 2013)
Eclipse Orion: The IDE in the Clouds (JavaOne 2013)
 
Atag & drupal 8
Atag & drupal 8Atag & drupal 8
Atag & drupal 8
 
Dean4j@Njug5
Dean4j@Njug5Dean4j@Njug5
Dean4j@Njug5
 
Multimedia Accessibility - CALRG '09
Multimedia Accessibility - CALRG '09Multimedia Accessibility - CALRG '09
Multimedia Accessibility - CALRG '09
 
Building resuable and customizable Vue components
Building resuable and customizable Vue componentsBuilding resuable and customizable Vue components
Building resuable and customizable Vue components
 
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
 
Creating a compiler for your own language
Creating a compiler for your own languageCreating a compiler for your own language
Creating a compiler for your own language
 
solution Challenge design and flutter day.pptx
solution Challenge design and flutter day.pptxsolution Challenge design and flutter day.pptx
solution Challenge design and flutter day.pptx
 
From Renamer Plugin to Polyglot IDE
From Renamer Plugin to Polyglot IDEFrom Renamer Plugin to Polyglot IDE
From Renamer Plugin to Polyglot IDE
 
Beyond the Hype: 4 Years of Go in Production
Beyond the Hype: 4 Years of Go in ProductionBeyond the Hype: 4 Years of Go in Production
Beyond the Hype: 4 Years of Go in Production
 
Internship Presentation 1 Web Developer
Internship Presentation 1 Web DeveloperInternship Presentation 1 Web Developer
Internship Presentation 1 Web Developer
 
Lotusphere 2011 Jmp103 - Jumpstart Your "Jedi Plug-in Development Skills" wi...
Lotusphere 2011  Jmp103 - Jumpstart Your "Jedi Plug-in Development Skills" wi...Lotusphere 2011  Jmp103 - Jumpstart Your "Jedi Plug-in Development Skills" wi...
Lotusphere 2011 Jmp103 - Jumpstart Your "Jedi Plug-in Development Skills" wi...
 
Tools/Processes for serious android app development
Tools/Processes for serious android app developmentTools/Processes for serious android app development
Tools/Processes for serious android app development
 
2 whats-new-in-ios7-m2-xcode-slides
2 whats-new-in-ios7-m2-xcode-slides2 whats-new-in-ios7-m2-xcode-slides
2 whats-new-in-ios7-m2-xcode-slides
 
Max 2010: Having Fun Flex4 Layouts
Max 2010: Having Fun Flex4 LayoutsMax 2010: Having Fun Flex4 Layouts
Max 2010: Having Fun Flex4 Layouts
 
JS Frameworks - Angular Vs Backbone
JS Frameworks - Angular Vs BackboneJS Frameworks - Angular Vs Backbone
JS Frameworks - Angular Vs Backbone
 
PHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in phpPHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in php
 
API workshop: Introduction to APIs (TC Camp)
API workshop: Introduction to APIs (TC Camp)API workshop: Introduction to APIs (TC Camp)
API workshop: Introduction to APIs (TC Camp)
 

Mais de peychevi

Dynamic User Interfaces for Desktop and Mobile
Dynamic User Interfaces for Desktop and MobileDynamic User Interfaces for Desktop and Mobile
Dynamic User Interfaces for Desktop and Mobile
peychevi
 

Mais de peychevi (7)

Client Extensions 101 - DEVCON 2023
Client Extensions 101 - DEVCON 2023Client Extensions 101 - DEVCON 2023
Client Extensions 101 - DEVCON 2023
 
Extending Kubernetes with Operators
Extending Kubernetes with OperatorsExtending Kubernetes with Operators
Extending Kubernetes with Operators
 
Best practices for creating modular Web applications
Best practices for creating modular Web applicationsBest practices for creating modular Web applications
Best practices for creating modular Web applications
 
Modern Web Developement
Modern Web DevelopementModern Web Developement
Modern Web Developement
 
Creating a WYSIWYG Editor with React
Creating a WYSIWYG Editor with ReactCreating a WYSIWYG Editor with React
Creating a WYSIWYG Editor with React
 
HTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 era
HTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 eraHTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 era
HTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 era
 
Dynamic User Interfaces for Desktop and Mobile
Dynamic User Interfaces for Desktop and MobileDynamic User Interfaces for Desktop and Mobile
Dynamic User Interfaces for Desktop and Mobile
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

Implementing AutoComplete for Freemarker and Velocity languages in ACE Editor

  • 1. Introducing AutoComplete for Velocity and FreeMarker languages in Liferay Portal 6.2 Liferay UI Engineer Iliyan Peychev Thursday, October 10, 13
  • 2. A few words about me Started as C developer ~12 years ago. Lately turned to Java developer. Currently working as Front-End engineer at Liferay. Twitter: ipeychev GitHub: ipeychev Thursday, October 10, 13
  • 3. • What we had in Liferay 6.1 • Making the AutoComplete • Making the Palette • Applying both to Web Content, DDM and ADT • Extending the AutoComplete • Future Agenda Thursday, October 10, 13
  • 4. • Relatively complicated user interface What we had in Liferay 6.1 Thursday, October 10, 13
  • 5. Step #1: Click on Add Template Button What we had in Liferay 6.1 Thursday, October 10, 13
  • 6. Step #2: Click on Launch Editor Button What we had in Liferay 6.1 Thursday, October 10, 13
  • 7. Result: Plain Text Editor What we had in Liferay 6.1 Thursday, October 10, 13
  • 8. Or basic Rich Text Editor What we had in Liferay 6.1 Thursday, October 10, 13
  • 9. Click Save or Save and Continue If you want to edit again, click again on Launch Editor What we had in Liferay 6.1 Thursday, October 10, 13
  • 10. • Relatively complicated user interface (true, right?) What we had in Liferay 6.1 Thursday, October 10, 13
  • 11. • Relatively complicated user interface (true, right?) • ACE Editor without any kind of AutoComplete What we had in Liferay 6.1 Thursday, October 10, 13
  • 12. • Relatively complicated user interface (true, right?) • ACE Editor without any kind of AutoComplete • No Palette What we had in Liferay 6.1 Thursday, October 10, 13
  • 13. • Relatively complicated user interface (true, right?) • ACE Editor without any kind of AutoComplete • No Palette • No context help, no link to external resources What we had in Liferay 6.1 Thursday, October 10, 13
  • 14. • Relatively complicated user interface (true, right?) • ACE Editor without any kind of AutoComplete • No Palette • No context help, no link to external resources As result, developers very often used external editors to create their Templates. What we had in Liferay 6.1 Thursday, October 10, 13
  • 16. ACE Editor does not provide AutoComplete. We had to build it from scratch. Fortunately, it turned its API is powerful enough to achieve this goal without many efforts. Making the AutoComplete Thursday, October 10, 13
  • 17. AutoComplete architecture ACE Editor Language processor Result list FiltersSortersFormatters Thursday, October 10, 13
  • 18. • Fill mode • Overwrite mode Overwrite mode is by default, it replaces the input string entirely. Fill mode adds the suggestion after the input string. AutoComplete modes Thursday, October 10, 13
  • 19. We built a new module for the AlloyUI Framework. This module consists of Base, UI and Language processors. Currently we support parts of Freemarker and Velocity languages. ACE AutoComplete is an AlloyUI module Thursday, October 10, 13
  • 20. The Base module intercepts ACE Editor commands, like: - onTextInput - golinedown - golineup - gotoend - gotolineend - gotolinestart (and a few others) The Base Thursday, October 10, 13
  • 21. The UI is a standard AlloyUI Overlay. It is used to draw the suggestions in a list. Supports keyboard navigation. The developer can specify custom sorters or filters. The UI Thursday, October 10, 13
  • 22. Since Freemarker and Velocity are similar and we support part of them, they have a common ancestor. For both languages we support Directives and Variables. The Language Processors Thursday, October 10, 13
  • 23. An instance of the Template editor can be modified on the fly. This means we can always plug and unplug the AutoComplete functionality. We can even replace one language with another. Plugin Infrastructure Thursday, October 10, 13
  • 26. Learning from the mistakes Initially we implemented the AutoComplete using Ternary Search Tree. c / | a u h | | | t t e u / / | / | s p e i s Source: Wikipedia Thursday, October 10, 13
  • 27. Learning from the mistakes Searching was fast. Constructing the Tree turned to be slow, so we discarded it from the Editor. However, it is now AlloyUI module and all developers can use it. Hint - use it when you construct the tree rarely (or once), but search often. Thursday, October 10, 13
  • 29. Making the Palette Represents the most often used: • General variables • Utilities • Web Content Services • Portal Services • Data List Variables • Data List Record Fields Thursday, October 10, 13
  • 30. Making the Palette Represents the most often used: • General variables • Utilities • Web Content Services • Portal Services • Data List Variables • Data List Record Fields Dynamically adds the fields in Structures and Data Definitions Thursday, October 10, 13
  • 31. The Palette – general view Thursday, October 10, 13
  • 32. The Palette – general view Click with the mouse (or tap) to insert the item in the editor Thursday, October 10, 13
  • 33. The Palette – general view The result goes where the cursor was Thursday, October 10, 13
  • 34. From Structure to Template Let's suppose we have an example structure with three fields: • Name • Image • URL Thursday, October 10, 13
  • 35. From Structure to Template Thursday, October 10, 13
  • 36. From Structure to Template The Palette automatically includes the structure fields on creating Template. Thursday, October 10, 13
  • 37. Context help and searching Context help with link to the Javadoc page Search box, use it to filter the results Thursday, October 10, 13
  • 38. Applying the Palette and AutoComplete • Applying to Web Content • Applying to Data Definitions • Applying to ADT (Application Display Template) Thursday, October 10, 13
  • 39. Applying to Data Definitions Displays the previously created fields into the Data Definition Thursday, October 10, 13
  • 40. Extending AutoComplete The AutoComplete is built with the idea of being easily extendable. One day I read this Tweet: “Primeros pasos en el desarrollo de un editor sql online utilizando @AlloyUI , #keepworking ” Victor Miranda, Support Engineer, Liferay Spain He created AutoComplete for SQL. Thursday, October 10, 13
  • 41. Extending AutoComplete Web Based SQL Editor with AutoComplete Thursday, October 10, 13
  • 42. The future • Adding more language processors. • Adding visual formatters. • Applying the AutoComplete to other Editors. • Show nested fields in Palette Thursday, October 10, 13
  • 43. You can contribute too! Sometimes the chains that prevent us to be creative and free are more mental than physical. Thursday, October 10, 13