*
*/
public List<Map<String,Object>> getTreeMinInfoByHostId (String hostId) throws DotRuntimeException, PortalException, SystemException, DotDataException, DotSecurityException {
UserWebAPI userWebAPI = WebAPILocator.getUserWebAPI();
WebContext ctx = WebContextFactory.get();
User user = userWebAPI.getLoggedInUser(ctx.getHttpServletRequest());
FolderAPI folderAPI = APILocator.getFolderAPI();
Host newHost = new Host();
List<Host> hosts = new ArrayList<Host>();
Role[] roles = new Role[]{};
try {
roles = com.dotmarketing.business.APILocator.getRoleAPI().loadRolesForUser(user.getUserId()).toArray(new Role[0]);
} catch (DotDataException e1) {
Logger.error(BrowserAjax.class,e1.getMessage(),e1);
}
List<Map<String,Object>> toReturn = new ArrayList<Map<String,Object>>();
if(UtilMethods.isSet(hostId)&& hostId.equalsIgnoreCase("fullTree")) {
hosts = hostAPI.findAll(user, false);
} else if(InodeUtils.isSet(hostId)) {
newHost = hostAPI.find(hostId, user, false);
hosts.add(newHost);
} else {
newHost = hostWebAPI.getCurrentHost(ctx.getHttpServletRequest());
hosts.add(newHost);
}
Collections.sort(hosts, new HostNameComparator()); // DOTCMS JIRA - 4354
for (Host host : hosts) {