Gets the site associated with a site ID.
Class Name |
|
---|---|
Component |
|
Input Parameters
siteId
The ID of the site to get.
Output Parameters
output
Rendered if the site is found.
empty
Rendered if the site is not found or siteId
is null.
error
Rendered if an error occurs.
errorMessage
If an error occurs, set with the error message, if any.
site
Set to the site
object of the returned site.
Usage Notes
Given a valid site ID, GetSiteDroplet returns a site
object—an implementation of interface atg.multisite.Site
—which encapsulates a site configuration. The output
parameter enables access to that site’s properties.
You can obtain the current site and its configuration through the Nucleus component /atg/multisite/Site
. For example, you can obtain the current site’s ID as follows:
<dsp:tomap bean="/atg/multisite/Site.id" var="siteID"/>
Example
The following JSP code obtains the configuration of the site mySite
. The output parameter site
provides access to all site configuration properties. In this example, the code obtains the site’s closingDate
property and compares it to the current date to determine whether the site is active:
<%-- Get the current site configuration and look at its closingDate property --%> <%@ taglib uri="http://www.atg.com/taglibs/daf/dspjspTaglib1_0" prefix="dsp" %> <%@ page import="java.util.Date;"%> <dsp:page> <dsp:droplet name="/atg/dynamo/droplet/multisite/GetSiteDroplet"> <dsp:param name="siteId" value="mySite"/> <dsp:oparam name="output"> <dsp:getvalueof var="closeDate" param="site.closingDate" vartype="java.util.Date"> <c:choose> <c:when test="${System.currentTimeMillis() < closeDate.getTimeInMillis()}"> Site is still active </c:when> <c:otherwise> Site is no longer active </c:otherwise> </dsp:oparam> </dsp:droplet> </dsp:page>