addLink.setVisible(false);
}
if (node.getDocType() == SiteTreeNode.FileType.Link)
{
ExternalLink viewLink = new ExternalLink("view", new Model(getDocument().getUrl()), new ResourceModel("common.view"))
{
@Override
protected void onComponentTag(ComponentTag tag)
{
super.onComponentTag(tag);
if (tag.getName().equalsIgnoreCase("input") && ((getLabel() != null) && (getLabel().getObject() != null)))
{
tag.put("value", getDefaultModelObjectAsString(getLabel().getObject()));
}
}
};
viewLink.setPopupSettings(new PopupSettings());
infoForm.add(viewLink);
}
else
{
RequestContext context = (RequestContext) getPortletRequest().getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
String basePath = context.getPortalURL().getBasePath().replace("portal", "configure");
ExternalLink viewLink = new ExternalLink("view", new Model(basePath + getDocument().getPath()), new ResourceModel("common.view"))
{
@Override
protected void onComponentTag(ComponentTag tag)
{
super.onComponentTag(tag);
if (tag.getName().equalsIgnoreCase("input") && ((getLabel() != null) && (getLabel().getObject() != null)))
{
tag.put("value", getDefaultModelObjectAsString(getLabel().getObject()));
}
}
};
viewLink.setPopupSettings(new PopupSettings());
infoForm.add(viewLink);
}
infoForm.add(new AjaxButton("remove",new ResourceModel("common.remove"),infoForm)
{