Saturday, February 18, 2017

Drupal 8 Site Construction

AWS and Drupal 8 marriage

Hello all, I have been away for a while but now I am back with an update regarding my experience with installing and administering a full Drupal 8 solution via AWS!
I first encountered Drupal when looking for a CMS for a prototype I developed for the DC Government back in 2012. Back then, the Drupal community was just as alive as it is now, and I had a great time looking through the Drupal forums for help with understanding just what was Drupal. I decided to go with Joomla for that particular project because it was the only worthy CMS being provided by my web host. For that particular project, however, the addition of CMS was more an over-engineered solution, as the customer very rarely used the Web interface for interacting with the system.

Fast forward to recently, I had begun searching for a CMS again for a company called B.H. Griner, which happens to be owned by a friend of mine. This recruiting agency's website was in dire need of an upgrade, and the website administrator was unwilling to move beyond the web design technologies of the past. Recognizing that my friend's website could use a touch of CMS, I remembered my experience with learning Drupal and how easy it was for end-users to understand and add content. I suggested that she do the research as well, and she decided that my suggestion of Drupal would greatly help her business.

The requirements for her upgrade to Drupal included:
  • An overall cost reduction of 50% or more
  • An email forwarding service
  • Some recruit management system for tracking prospects
  • A system for keeping track of positions received from clients
  • The ability to have anonymous users provide simple contact information for applying to positions
  • Secure Socket Layer coverage of the site
  • Domain hosting and configuration for email records
  • Potential to scale up for higher traffic if necessary
  • 24/7 availability within the USA


So, I first looked into a hosting service for help with these requirements. Naturally, the prices were steep. Each host that met the requirements necessary to begin the migration wanted 50% more than what she was paying initially (granted, she had been grandfathered into her hosting after at least 20 years of loyalty). I informed my friend that she would benefit greatly from a custom implementation on a cloud-based service. After she reviewed the cost-benefit analysis of each host and potential cloud solution, she decided that it was the AWS custom cloud implementation made the most sense. So then I began to design an implementation using many of the AWS services. I used EC2 and ELB for the Drupal 8 cluster configuration, SES and lambda for the email forwarding, Route 53 for the domain hosting and Certificate Manager for the SSL implementation.

In all, the experience setting up the SES and coding a custom forwarding Lambda was the sticky point, but once I understood the SES requirements and applied for a limit removal, the SES system began working smoothly. Installing the SSL via CM and ELB was much easier than I could have imagined and I was successful in providing a very solid domain configuration via Route 53. Installation and configuration of Drupal 8 was a breeze with Drush and Composer! After hardening the Drupal 8 and linux box, I also set up a few custom content models and views for their recruiting management and trained them on how to add content to the site. Now everyone can hit their website via bhgriner.com!

Tuesday, July 12, 2016

Optimized XPages AMD fix

Recently, I had to use this fix for one of my projects. If you have done anything with Bootstrap in XPages, you have probably used this fix at least once. The one drawback with Kranenburg's design is that the snippet can only be used in the xp:resource section, which adds it to the top of the page. A common pattern is to load scripts at the end of the page to increase the speed of loading the page content. This pattern is used by many modern web sites. With this code snippet, you can use the AMD fix and load your client scripts using the optimized pattern with the benefits of fast loading times for your XPages.


Thursday, August 27, 2015

Win 10, My new Best Friend

I think I have found my second favorite operating system! In this ongoing post, I want to share some tips and tricks that will enhance your love for this new gem from Microsoft. (No, I don't work for Microsoft)

Tip #1: Disable Cortana Web Search


Okay, so Cortana is supposed to be this "Ms. Smartypants" when it comes to your likes and dislikes. She also searches the web for you when you have the need to find something. Cortana is just a little bit too eager to search for things on the internet when I really just want her to find the stuff I've already put onto my PC.

I am a fan of Ubuntu 14. The taskbar in Ubuntu will allow you to do a soft search for any app in your pc by pressing the "Window" key on your keyboard. To emulate this with Cortana in Win 10, just disable her Web Search capability (She happens to be much more useful in this mode).

To disable the Web Search feature, just go to your firewall settings:

  1. Go to Control Panel by right clicking on the "Start Menu" icon in the lower left on the taskbar and select "Control Panel"
  2. If you view by category, select Network and Internet, then on the left, select System and Security.
  3. Select Windows Firewall
  4. Select Advanced Settings
  5. In the new window, select, Outbound Rules and wait for it to load
  6. Look for a single rule called "Search", right click on the rule, and select Properties
  7. In the Action grouping at the bottom, select "Block the connection"

Be warned however, you will no longer be able to search the internet via Cortana, however, she will default to finding things on your computer.

Thursday, August 20, 2015

Making a Silky Calculator

I like Silk. This dependency injection framework is just AWESOME! It is so intuitive that I just have to give it two thumbs up. Why? Because it makes dependency injection a part of the native Java language and is definitely simple to set up and use.

So I thought I would give it a go with one of my favorite web frameworks, Vaadin. I have used Vaadin off-and-on for about a year now and I have to say it is pretty slick. Vaadin is such a quick framework. When you need to get something to the screen Vaadin can build it fairly fast. And the code is so simple, it can easily simulate procedural coding. As a result, the code you write while putting up a quick prototype usually ends up a hot mess to read through the next day.

In with the fancy patterns now!

I decided to re-create the Calculator sample application on the Vaadin.com website.

Creation of a project is easy enough. I downloaded the latest version of Eclipse (Mars) and then installed the Vaadin framework through the Eclipse Marketplace.


I had an easy time using Ant to build SilkDI from www.silkDI.com. To build the Silk library, simply import the project to your eclipse workspace and run the ant task by clicking on the build.xml file and pressing Alt+Shift+X, then press the letter Q. The library, sources and Javadoc will be created. You just need the library added to your build path.



I built the user interface up using the new Vaadin Designer tool but the thing stopped working promptly after I finished the look and feel. So I had to limp by modifying the new html format manually. Not the most fun experience...



Thankfully, the interface is simple enough, what goes into a calculator other than a few numbers and some symbols? I just made all the buttons into a grid and included a text box for the display. I had to later change the text box for a label, since the text box read-only property prevents modification from the program side as well as the user side. Wish they would make up their minds on that.

I also ran into some trouble getting the Silk to work, but that was due to my sheer ignorance when it comes to actually wiring dependencies. I did some looking at the examples on the SilkDI site and managed to make it work. I had to understand how the objects were being constructed in the background and realize which examples were worth bothering with and which were for more advanced applications.

Separating the concerns of the Presenter, View and Model were easy as cake using Java 8. Passing behavior to each button was so much easier than the Calculator example on Vaadin's own site. I went the route of creating a single method that obtained the button's text then passed a communication to the model for interpretation. I would have liked to spend more time fleshing out a better separation of the business logic out of the Presenter, but in the end, I like how it turned out.

As far as the separation goes, I added a twist to the example Calculator app on the Vaadin website and created both a BigInteger and a BigDecimal model and added a button that would switch between the two types of calculators. The calculator that depends on the Integers will truncate the decimal places for us (obviously).

Check out the sample app in the links on the right.

Update: I've put the source up on GitHub

Thanks for reading.

Saturday, August 15, 2015

No Country for Old Databases

I can't get over how bad the user interface for IBM Domino Designer and Notes are. Having only used the tool for a year and a half, I can't imagine how people have been developing in this tool for so long. IBM claims that you can do pure Java development in Domino, but it was clearly just an afterthought. You can't run a debugger on your XPages beans without going through hoops, you can't properly test XPages in the Notes client if they contain iframes to classic notes forms. Many things are missing or patchwork when it comes right down to it. A throwback to the "Old West" of coding cowboy greatness.
The Cowboy Coder aspect of the Designer and Notes client integration is cool and all, but in lieu of IDE experiences like IntelliJ, IBM's shoddy Designer with their half-baked implementation of Eclipse is laughable. With almost zero integration of source control, you need yet another hack to work with modern tools like Git and Mercurial. The hack used to get those tools to play nice with the Designer IDE is DXL.
IBM's implementation of DXL is the bane of my existence. In all, we have ended up with massive data corruption, overwrites, and simple inability to control our software when attempting to use Mercurial. This is because the export of DXL attaches metadata to the file, things like last-accessed date etc. Needless to say, you receive multiple merge conflicts with this. IBM's DXL also removes pass-thru html tags in legacy code because it melds in with the DXL header. Of course, this is completely unavoidable. You either use the DXL or you need to do your version control by storing design copies...
With all these issues vented I can say that the backend Domino solution is one of the best solutions built around a NoSQL database that I have ever seen. The security model is very tightly integrated with the query logic down to the fields on documents. Building reusable business logic around Domino security model is like icing on a particularly tasty cake. Access restriction can be an afterthought in your design and still be more powerful than 80% of solutions based on NoSQL databases.
This is why I feel like IBM should do more to market this software as a NoSQL DB and make it better integrated into modern Java frameworks. While the integrated http service is great, they should do more to promote the use of Tomcat, as this is the core of some of my personal favorite frameworks. And for goodness sakes, they really need to upgrade to IBM JDK8! (I admit to this being more of a nit than anything)
I can see why they would be hesitant. I am not completely sure, but, I have noticed that there are very few 'young' notes developers nowadays. IBM would be smart to do less to alienate their current users of Domino. But I can tell you this, after attempting to build a Domino clone using MongoDB and Go, I have realized just how good these old geezers have it with the amount of tools at their disposal for making a NoSQL database work in the business world.

Thanks for reading.

Wednesday, August 12, 2015

The One Most AWESOME Thing Ever in Gaming

Games... If you are like me, you must play games a lot... Yet, for all the games that we play, there are none that have the virtual commodity that you feel like you own it "for reals". You play a game, get some laughs and enjoy it for the moment, then that's it... If you play "Free" games, you sometimes end up giving up a buck or two for that small "advantage". Do you really feel like you have something special here? If you are like me, you mostly feel good until there is something else to buy, then you suddenly feel used... That's why I want to dedicate my next project to creating this tangible item... Something that I don't have to buy. A gamer's inalienable right.
After speaking with some friends, co-workers, family, etc. I've discovered that there is pretty much nothing that can touch this feeling of ownership. Most people think of gaming as something that just exists in the virtual world, completely separate from the realm of the "real". Shame, that all those technological advances that exist now cannot bring our pretend worlds any closer. Sure there are VR headsets and AR devices, but what about these experiences is any different that what we do now? Will having something look better really provide a different stimulus? We've tried that in gaming for years now, and I can tell you, incredible visuals and great gameplay are far too often a "Rob Peter to pay Paul".
Take, for example, Evolve, a more recent 3d game with great immersive graphics and little in the way of gameplay, and compare it to Terraria, a 2d game with okay graphics but packed full of gameplay. Both games are good in their own right, but I'd wager that an amalgam of the two, Evolarria, would be AWESOME! Sadly, this would cost a lot of money and time. But what if you could take AWESOME gameplay of game A, and make it completely modular? Plug gameplay A into graphics powerhouse title B and come up with a new product C. Product C is AWESOME! Product C goes on to sell multiple millions of copies! Whatever! The idea I've been shopping around is one that gives us an item of tangibility and provides the gameplay opportunities to titles that support it.
As I sat on the porcelain throne one day, I thought, "Wouldn't it be cool if I had an avatar, pet or something on a device, and I could plug that something into a game, and all of a sudden the game is AWESOME!?" A few companies have done this before of course. There are plenty of games and products like this all over the place. What is so different about this idea than any other? Well... CLOUD! I win! Haha!
In all seriousness though, I feel like the internet-of-things will enable this unlike any other. A holographic/picture pane depicting your avatar all the time. It lives in the device. It is sellable. It is transmitted to your game (wifi to cloud to game or some mix of that). It gains experience with your gameplay. It gathers items from each of your games. When you want to transfer it to another person, you put it into a state of hibernation and turn off the device, sell it to them, then they use it in the same way you did. It is real property, a tangible benefit, something AWESOME to make your games AWESOME. You take it in your pocket to work and show it off. You take it to school and get it taken from you, but not before you show it off!
Implementation would be interesting. I had thought of keeping a checksum of all possible variations and combinations of all avatars in a sort of cloud-bank scenario inspired by virtual currency. Whenever a person's avatar gained items or customization, it would be compared to the list of registered customizations provided by partnering games. Unregistered customizations can still be supported, but will only work for certain games or offline versions. In the end though, I wish for both the client and server systems to be open-sourced. If someone wants to make money off this venture, they should work to provide the best service they can, creating custom games supporting their avatar item checksums. Their customizations should also be compatible with other servers and games and they should help to maintain the community of avatars.
When we ultimately make the move to AR-central gaming, this system will be one of the backbones that drives gameplay in the years to come.

Thanks for reading.