I have been very busy at work, trying to get our Microservices infrastructure in place. This has involved a lot of searching, following a lot of the microservices experts, and a lot of experimentation.
I will, time allowing create a series of entries about the experience of getting microservices accepted in an organization that had been primarily several monilithic APIs.
I suspect my first article, after this one, will be about Spring Boot and Spring Cloud, as they are the primary basis for what we are developing.
Once I have completed that I will start with deployment options in Amazon Web Services (AWS), and some Continuous Deployment options.
I have been using the Java Jersey framework to create a RESTful API for internal use, and eventually public consumption at work. Many of the features possible within the framework are needed, and have been implemented. Over the next several weeks, I will explain how some of the more important features were implemented. We are currently using version 2.5.1 of the framework. Stay tuned.
I have been implementing a new knowledge base ticketing system at work. The system we are using is ZenDesk. This is one of the best designed commercial systems I have ever seen. The interface and features are amazing. When organizing lists of items that will be displayed to a user the method of re-ordering them is simple drag and drop. Triggers to handle the ticketing process are amazingly powerful. And the API is RESTful and well designed as well as, amazingly, well documented. I’ll be posting on specific features of ZenDesk in future posts. I’m currently looking at the search capability of the API to do custom reporting.
I know this has been explained elsewhere, but I wanted a central location I could reference as needed.
So, let’s get started.
If you are on a page in Magento, and want to get information about the currently logged in customer, or on the admin side, the admin user:
$customer = Mage::getSingleton('customer/session')->getCustomer();
$custName = $customer->getName(); // Gets the customer's name
// Admin User
$adminUser = Mage::getSingleton('admin/session')->getUser();
$adminName = $adminUser->getName(); // Gets the admin's name.
There are other properties available on the customer and admin user, and these can be selected as well.
After having this problem several times as I installed, and re-installed Magento, I decided to post this on my own blog for future reference.
Sometimes when using Magento with a Chrome browser the cookie functionality doesn’t work, the code modification is relatively simple.
Open the app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file and find the following code, somewhere near line 78:
$cookieParams = array(
// 'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath(),
// 'domain' => $cookie->getConfigDomain(),
// 'secure' => $cookie->isSecure(),
'httponly' => $cookie->getHttponly()
Notice the three commented out lines. That is the minimum necessary to get cookies working with Chrome. You could also just comment out the whole section, as that will work as well.
That’s all there is to it. Enjoy!
If you have been using Magento for even a short time you have found the usefulness of enabling the Template Path Hints and Block Names on your website. Unfortunately those options don’t exist in the default config by default.
Thankfully, due to the very configurable and modular nature of Magento, the options to turn them on are easy to change.
The only file you will need to edit is the app/code/core/Mage/Core/etc/system.xml file.
This file contains a debug element containing a fields element. Within the fields element are two elements that will concern you, the template_hints and template_hints_block. Contained within those elements are show_in_default elements that determine whether the parent option will show up in the admin interface. If the value is 1 it will be visible, 0 will not make it visible.
Below is an excerpt of my config, with the values set to 1. See the highlighted lines.
<label>Template Path Hints</label>
<label>Add Block Names to Hints</label>
With these settings changed, you will now be able to see the options in the developer configuration screen.
This example is going to assume we are moving the poll block from the right side of the page to the left side of the page.
Assuming that you want to move a block on a magento page from its current location to another location on the same page, you need to do the following:
- Find the container the block is currently in. In this case the reference name is ‘right’.
- Find the name of the block. In this case, ‘right.poll’.
- Find the container the block is going to. In this case the reference name is ‘left’.
- Unset the current location, and insert to the new location.
A simple layout example file:
The sibling option allows you to tell the insert where in the section the block will be inserted, in this example, after the catalog block.
That’s it. Relatively simple, but very useful if you want to rearrange your Magento site.
Just a minor rant. We had just purchased Magento professional a few weeks ago, and then on the 1st of February Magento announces that they are phasing out Magento Professional. Would have been nice to mention this when we purchased it.
This is the first post on my new blog site. I will be posting on various technical topics including Magento, Subversion, Git, Java and various flavors of SQL. Stay tuned for future posts.