String responseNamespace, PortletContext portletContext) {
try {
// Get the PortletDisplay from the ThemeDisplay.
PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
// Get the p_p_col_id and save it.
portletContext.setAttribute(NAMESPACED_P_P_COL_ID, portletDisplay.getColumnId());
// Get the p_p_col_pos and save it.
portletContext.setAttribute(NAMESPACED_P_P_COL_POS, Integer.toString(portletDisplay.getColumnPos()));
// Get the p_p_col_count and save it.
portletContext.setAttribute(NAMESPACED_P_P_COL_COUNT, Integer.toString(portletDisplay.getColumnCount()));
// Get the p_p_mode and save it.
if (portletMode != null) {
portletContext.setAttribute(NAMESPACED_P_P_MODE, portletMode.toString());
}