Package com.adito.navigation

Examples of com.adito.navigation.WrappedFavoriteItem


        String hostField = request.getHeader("Host");
        HostService aditoHost = hostField == null ? null : new HostService(hostField);
        if (wf != null) {
            wfi = new WebForwardItem(wf, aditoHost, PolicyDatabaseFactory.getInstance().getPoliciesAttachedToResource(wf,
                sessionInfo.getUser().getRealm()), wf.sessionPasswordRequired(sessionInfo));
            return new WrappedFavoriteItem(wfi, type);
        }
        return null;
    }
View Full Code Here


                        throws Exception {
            Resource r = getResourceById(resourceId);
            if (r == null) {
                return null;
            }
            return new WrappedFavoriteItem(new SampleItem((Sample) r, CoreServlet.getServlet().getPolicyDatabase()
                .getPoliciesAttachedToResource(r)), type);
        }
View Full Code Here

  public RemoveFavoriteAction() {
    super("remove", "navigation", 100, true, "{2}.do?actionTarget=confirmRemove&selectedItem={0}");
  }

  public boolean isEnabled(AvailableTableItemAction availableItem) {
    WrappedFavoriteItem item = (WrappedFavoriteItem) availableItem.getRowItem();
    return !item.getFavoriteType().equals(AbstractFavoriteItem.GLOBAL_FAVORITE);
  }
View Full Code Here

   * (non-Javadoc)
   *
   * @see com.adito.table.TableItemAction#getPath(com.adito.table.AvailableTableItemAction)
   */
  public String getPath(AvailableTableItemAction availableItem) {
    WrappedFavoriteItem item = (WrappedFavoriteItem) availableItem.getRowItem();
    return MessageFormat.format(requiredPath, new Object[] { item.getFavoriteItem()
            .getResource()
            .getResourceType()
            .getResourceTypeId() + "_"
      + item.getFavoriteItem().getResource().getResourceId(),
      ((ActionMapping) availableItem.getRequest().getAttribute(Constants.REQ_ATTR_ACTION_MAPPING)).getName(),
      ((ActionMapping) availableItem.getRequest().getAttribute(Constants.REQ_ATTR_ACTION_MAPPING)).getPath() });
  }
View Full Code Here

                log.warn("Store that handles '" + np.getScheme() + "' cannot be found.");
            } else {
                npi = new NetworkPlaceItem(np, store.getMountPath(np.getResourceName()), PolicyDatabaseFactory.getInstance()
                                .getPoliciesAttachedToResource(np, sessionInfo.getUser().getRealm()), np
                                .sessionPasswordRequired(sessionInfo));
                return new WrappedFavoriteItem(npi, type);
            }
        }
        return null;
    }
View Full Code Here

    public FavoriteOpenWebFolderAction() {
    super("navigation");
  }

  public ResourceItem getResourceItem(AvailableTableItemAction availableItem) {
    WrappedFavoriteItem item = (WrappedFavoriteItem) availableItem
        .getRowItem();
    return item.getFavoriteItem();
  }
View Full Code Here

                    try {
                        List fl = SystemDatabaseFactory.getInstance().getFavorites(frt.getResourceTypeId(), user);
                        for (Iterator j = fl.iterator(); j.hasNext();) {
                            Favorite f = (Favorite) j.next();
                            try {
                                WrappedFavoriteItem wfi = frt.createWrappedFavoriteItem(f.getFavoriteKey(), request,
                                                AbstractFavoriteItem.USER_FAVORITE);
                                if (wfi == null) {
                                    SystemDatabaseFactory.getInstance().removeFavorite(f.getType(), f.getFavoriteKey(),
                                                    f.getUsername());
                                }
                                try {
                                    ResourceUtil.checkResourceAccessRights(wfi.getFavoriteItem().getResource(), info);
                                    getModel().addItem(wfi);
                                } catch (NoPermissionException npe) {
                                    // Skip
                                }
                            } catch (Exception e) {
                                log.error("Failed to add user favorite " + f.getFavoriteKey() + ".", e);
                            }
                        }
                    } catch (Exception e) {
                        log.error("Failed to create user favorites for resource type " + frt.getResourceTypeId());
                    }
                    try {
                        for (Iterator iter = ResourceUtil.filterResourceIdsForGlobalFavorites(
                                        PolicyDatabaseFactory.getInstance().getGrantedResourcesOfType(user, frt), rt).iterator(); iter
                                        .hasNext();) {
                            Integer element = (Integer) iter.next();
                            try {
                                WrappedFavoriteItem wfi = frt.createWrappedFavoriteItem(element.intValue(), request,
                                                AbstractFavoriteItem.GLOBAL_FAVORITE);
                                if (wfi == null) {
                                    // TODO ? sahould we do soemthoing
                                    // here?????????
                                } else {
                                    if (!getModel().contains(wfi)) {
                                        try {
                                            ResourceUtil.checkResourceAccessRights(wfi.getFavoriteItem().getResource(), info);
                                            getModel().addItem(wfi);
                                        } catch (NoPermissionException npe) {
                                            // Skip
                                        }
                                    }
View Full Code Here

            SessionInfo inf = LogonControllerFactory.getInstance().getSessionInfo(request);
            ApplicationShortcutItem it = new ApplicationShortcutItem(des, as, PolicyDatabaseFactory.getInstance()
                            .getPoliciesAttachedToResource(as, sessionInfo.getUser().getRealm()), inf.getNavigationContext(), as
                            .sessionPasswordRequired(inf));
            if (as.getApplication() != null) {
                return new WrappedFavoriteItem(it, type);
            } else {
                throw new Exception("No application.");
            }
        }
    }
View Full Code Here

            Set activeTunnels = ((TunnelingService) DefaultAgentManager.getInstance().getService(TunnelingService.class))
                            .getActiveTunnels(LogonControllerFactory.getInstance().getSessionInfo(request));
            SessionInfo sessionInfo = LogonControllerFactory.getInstance().getSessionInfo(request);
            LaunchSession launchSession = activeTunnels.contains(Integer.valueOf(tunnel.getResourceId())) ? LaunchSessionFactory
                            .getInstance().getFirstLaunchSessionForResource(sessionInfo, tunnel) : null;
            return new WrappedFavoriteItem(new TunnelItem(tunnel, null, launchSession), type);
        } else
            return new WrappedFavoriteItem(new TunnelItem(tunnel, null, null), type);

    }
View Full Code Here

TOP

Related Classes of com.adito.navigation.WrappedFavoriteItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.