ctrl = template.getControl(WIDGET_ID);
if (!getWorkspace().isValidUserSession())
{
// Configura la url del login
URL url = new URL(getWorkspace().getProperties().getSecurityProperties().getLoginPage());
url.addParameter("tourl", getWorkspace().getRequestedUrl());
// Genera el XHTML del widget
xhtml += ctrl.getElement(WPART_LOGIN);
xhtml = Control.replaceTag(xhtml, TAG_HREF, url.build(getWorkspace().getCharset()));
}
else
{
// Configura la url del login
URL url = new URL("LogoutPage");
url.addParameter("tourl", getWorkspace().getRequestedUrl());
// Genera el XHTML del widget
xhtml += ctrl.getElement(WPART_LOGOUT);
xhtml = Control.replaceTag(xhtml, TAG_HREF, url.build(getWorkspace().getCharset()));
xhtml = Control.replaceTag(xhtml, TAG_USER, getWorkspace().getUserSession().getCurrentUser().getLogin());
}
return xhtml;
}