/ Development  

Exposure; The sinister secrets of in the 'Other' protocol for your rich-text hyperlink

Hi there AppWorks fans,

Welcome to a new installment of AppWorks tips.

For this week, an end-user option on the agenda which passed my journey accidentally when playing with a property of type ‘Long text’ converted into a rich-text editor on a ‘Form’. What I want to show you is the option (in runtime) to create a link (from within that rich-text editor) with the protocol option “other”; You will see it all below; I always thought hyperlinks can only have a protocol like http(s)://, or ftp://:, or news://. So, I was curious what the “Other” option was and because I didn’t get an answer from all my surrounding experts, I took a moment to experience it myself. 😁


Let get right into it…

It’s time to boot the VM and dive into your workspace with the developer account. Make sure you have a project available with basic folderstructure (as always). Create a simple entity with two properties. One is a name case_name of type ‘Text; the other property is case_description of type ‘Long text’. Generate all the other building blocks and apply your initial naming convention to it. When ready, open the ‘Create’ form and change the case_description field to a rich-text editor box:

other_link_001

Publish the entity, and try-out the field in runtime for a new entity instance (of the crafted ‘Case’ entity!). You see something like this where you can create a link from the selected text:

other_link_002

Clicking the option will show a modal dialog with this information (and the protocol options for this post; with <other> being the outlier):

other_link_003

If you ask the valid question what is the protocol <other>, we can shake hands!

Time for try-outs…I’ll simply create a new link for each type of protocol. If you watch the Chrome developer tools closely, you have a result like this:

other_link_004

This is a copy for readability:

1
2
3
4
5
6
7
<body>
<a data-cke-saved-href="appworks-tips.com" href="appworks-tips.com">OTHER</a><br>
<a data-cke-saved-href="http://appworks-tips.com" href="http://appworks-tips.com">HTTP</a><br>
<a data-cke-saved-href="https://appworks-tips.com" href="https://appworks-tips.com">HTTPS</a><br>
<a data-cke-saved-href="news://appworks-tips.com" href="news://appworks-tips.com">NEWS</a><br>
<a data-cke-saved-href="ftp://appworks-tips.com" href="ftp://appworks-tips.com">FTP</a><br>
</body>

Now what? I can save the entity instance, but if the rich-text editor is “editable”, I can’t click on the links! So, we require a workaround. I pick the quick and dirty workaround to add a second case_description field on the ‘Create’ form with a read-only checkmark:

other_link_005

The better workaround would be to add the ‘Security’ BB, add 2 roles (one who can edit, one who can only view); Attach the correct role to the correct user and test with two separate users. Comment me if you don’t have a clue how to make this work.

In runtime this results in a view where we can verify the real URLs behind our linking actions. They all look as expected, but watch the “other” protocol; This one results onto a URL like this

1
http://192.168.56.107:8080/home/appworks_tips/app/start/web/item/080027f2140da1ef818f397492b610f9.1/080027f2140da1ef818f3c263a34a55d/appworks-tips.com

Interesting…That’s the current URL with an additional appworks-tips.com value!
So, when I update my link to ../../appworks-tips.com, this (as expected) results in a URL like this http://192.168.56.107:8080/home/appworks_tips/app/start/web/item/appworks-tips.com

AHA….AND ../../../../../../../../appworks-tips.com result into http://192.168.56.107:8080/appworks-tips.com

Don’t try further as that’s the finish line!

What did we learn from the “other” protocol? Well, this makes it for end-users possible to create quick links within the current solution! 😎 I don’t know if end-users will use it that much, but now we know at least how it works.


That’s an-“Other” DONE! A done where we learned about the hyperlink option for a rich-text editor on a ‘Long text’ property type. For specific use-uses, I understand the option now and how it can benefit in those circumstances. I don’t know if I will ever use it, but I can image your end-users will. Give me a comment on your experience; I see you next week with another exposing topic at AppWorks-Tips.com

Don’t forget to subscribe to get updates on the activities happening on this site. Have you noticed the quiz where you find out if you are also “The AppWorks guy”?