List<VirtualLink> listV = new ArrayList<VirtualLink>();
Iterator listvs = listVar.iterator();
if(h != null && InodeUtils.isSet(h.getInode()))
{
while (listvs .hasNext()) {
VirtualLink next = (VirtualLink) listvs .next();
if (next.getUrl().startsWith(h.getHostname()) || (next.getUrl().startsWith("/") && APILocator.getUserAPI().isCMSAdmin(user))){
listV.add(next);
}
}
}
else{
while (listvs .hasNext()) {
VirtualLink next = (VirtualLink) listvs .next();
if (next.getUrl().startsWith("/") && APILocator.getUserAPI().isCMSAdmin(user)){
listV.add(next);
}
}
}
//listV =VirtualLinkFactory.checkListForCreateVirtualLinkspermission(listV, user);
int totalVLinksToDisplay = listV.size();
req.setAttribute(WebKeys.VIRTUAL_LINK_LIST_VIEW, listV);
req.setAttribute("host_list", hosts);
return mapping.findForward("portlet.ext.virtuallinks.view_virtuallinks");
}
else{
List<VirtualLink> listTemp = new ArrayList<VirtualLink>();
List<VirtualLink> list = new ArrayList<VirtualLink>();
Host h = hostAPI.find(hostId, user, false);
if (InodeUtils.isSet(req.getParameter("inode"))) {
HTMLPage htmlPage = (HTMLPage) InodeFactory.getInode(req.getParameter("inode"),HTMLPage.class);
Identifier identifier = APILocator.getIdentifierAPI().find(htmlPage);
listTemp = VirtualLinkFactory.getIncomingVirtualLinks(identifier.getURI());
}
else{
if (UtilMethods.isSet(url)) {
listTemp = virtualLinkAPI.getVirtualLinks(null, url, orderby);
} else {
listTemp = virtualLinkAPI.getVirtualLinks(null, hosts, orderby);
}
}
Iterator listvs = listTemp.iterator();
if(h != null && InodeUtils.isSet(h.getInode()))
{
while (listvs .hasNext()) {
VirtualLink next = (VirtualLink) listvs .next();
if (next.getUrl().startsWith(h.getHostname()) || (next.getUrl().startsWith("/") && APILocator.getUserAPI().isCMSAdmin(user))){
list.add(next);
}
}
}else{
while (listvs .hasNext()) {
VirtualLink next = (VirtualLink) listvs .next();
if (next.getUrl().startsWith("/") && APILocator.getUserAPI().isCMSAdmin(user)){
list.add(next);
}
}
}