public HstContainerURL createURL(HstContainerURL baseContainerURL, HstURL hstUrl) { HstContainerURLImpl containerURL = (HstContainerURLImpl) ((HstContainerURLImpl) baseContainerURL).clone(); containerURL.setActionWindowReferenceNamespace(null); containerURL.setResourceWindowReferenceNamespace(null); String type = hstUrl.getType(); if (HstURL.ACTION_TYPE.equals(type)) { containerURL.setActionWindowReferenceNamespace(hstUrl.getReferenceNamespace()); mergeParameters(containerURL, hstUrl.getReferenceNamespace(), hstUrl.getParameterMap()); } else if (HstURL.RESOURCE_TYPE.equals(type)) { containerURL.setResourceWindowReferenceNamespace(hstUrl.getReferenceNamespace()); containerURL.setResourceId(hstUrl.getResourceID()); mergeParameters(containerURL, hstUrl.getReferenceNamespace(), hstUrl.getParameterMap()); } else { mergeParameters(containerURL, hstUrl.getReferenceNamespace(), hstUrl.getParameterMap()); } return containerURL; }
public HstContainerURL createURL(HstContainerURL baseContainerURL, HstURL hstUrl) { HstContainerURLImpl containerURL; try { containerURL = (HstContainerURLImpl) ((HstContainerURLImpl) baseContainerURL).clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Clone not supported on the container url. " + e); } containerURL.setActionWindowReferenceNamespace(null); containerURL.setResourceWindowReferenceNamespace(null); containerURL.setComponentRenderingWindowReferenceNamespace(null); String type = hstUrl.getType(); if (HstURL.ACTION_TYPE.equals(type)) { containerURL.setActionWindowReferenceNamespace(hstUrl.getReferenceNamespace()); mergeParameters(containerURL, hstUrl.getReferenceNamespace(), hstUrl.getParameterMap()); } else if (HstURL.RESOURCE_TYPE.equals(type)) { containerURL.setResourceWindowReferenceNamespace(hstUrl.getReferenceNamespace()); containerURL.setResourceId(hstUrl.getResourceID()); mergeParameters(containerURL, hstUrl.getReferenceNamespace(), hstUrl.getParameterMap()); } else if (HstURL.COMPONENT_RENDERING_TYPE.equals(type)) { containerURL.setComponentRenderingWindowReferenceNamespace(hstUrl.getReferenceNamespace()); mergeParameters(containerURL, hstUrl.getReferenceNamespace(), hstUrl.getParameterMap()); } else { mergeParameters(containerURL, hstUrl.getReferenceNamespace(), hstUrl.getParameterMap()); } return containerURL; }