Plumtree EDK (Enterprise Web Development Kit) 5.4.0 |

# IPortletBase.CreateGatewayLink Method

Creates a link in the Portlet's gateway space.

string CreateGatewayLink(
int communityID,
string URL
);

#### Parameters

communityID
  the ID of the Community in which to create the link. Use 0 if not using a community. The communityID is used to send community preferences to the gateway page if it is accessed through the community portlet.
URL
  the URL to transform (gateway).

#### Return Value

a gatewayed URL for this Portlet, the specified Community, and the specified URL.

#### Remarks

Note: This method will fail if the Portlet is new and has not been saved (i.e., the Portlet was obtained by a call to `CreatePortletInstance()` and `Save()` has not been called).

    IPortlet portlet = ...
    String gatewayLink = portlet.CreateGatewayLink(communityID, "http://www.google.com");

Yields this example gatewayLink: http://sinistar.plumtree.com:8080/portal/server.pt/gateway/PTARGS_0_272_202_0_43/http://www.google.com Note that the structure of the gateway URLs is subject to change- i.e., do not rely on the format of the structure of PTARGS or the format of the gateway URL.

#### Exceptions

Exception Type | Condition
--- | ---
HttpException | if the query interface URL is not valid
PortalException | if the operation resulted in an error on the portal
SoapException | if there is a communication problem during the execution of the remote method call

#### See Also

IPortletBase Interface | Plumtree.Remote.PRC Namespace