Examples of ResourceItem


Examples of com.adito.policyframework.ResourceItem

        }
    return false;
  }

  public String getPath(AvailableTableItemAction availableItem) {
    ResourceItem item = (ResourceItem) availableItem
        .getRowItem();
    PropertyProfile p = (PropertyProfile)item.getResource();
    return p.getOwnerUsername() != null || ( p.getOwnerUsername() == null && availableItem.getSessionInfo().getNavigationContext() == SessionInfo.USER_CONSOLE_CONTEXT) ? "/showUserProperties.do?selectedPropertyProfile=" + item.getResource().getResourceId() :
      "/showGlobalProperties.do?selectedPropertyProfile=" + item.getResource().getResourceId();
  }
View Full Code Here

Examples of com.adito.policyframework.ResourceItem

        super(navigationContext, messageResourcesKey);
    }

    public boolean isEnabled(AvailableTableItemAction availableItem) {
        try {
            ResourceItem item = (ResourceItem) availableItem.getRowItem();
            try {
                if (((AuthenticationScheme) item.getResource()).isSystemScheme()){
                    // it is System Authentication Scheme so cannot be deleted.
                    return false;
                }
            } catch (Exception e) {
                // there has been an error so do not display
                return false;
            }
           
            Permission[] permissions = new Permission[] { PolicyConstants.PERM_DELETE };
            ResourceUtil.checkResourceManagementRights(item.getResource(), availableItem.getSessionInfo(), permissions);
            return true;
        } catch (NoPermissionException e) {
            return false;
        }
    }
View Full Code Here

Examples of com.adito.policyframework.ResourceItem

    return (ResourceItem)availableItem.getRowItem();
  }
 

  public boolean isEnabled(AvailableTableItemAction availableItem) {
    ResourceItem item = getResourceItem(availableItem);
    HttpServletRequest request = availableItem.getRequest();
    SessionInfo sessionInfo = LogonControllerFactory.getInstance().getSessionInfo(request);
    try {
        // this is an extra check to ensure that the webDav authentication scheme is accessible to allow web folders.
        AuthenticationScheme authenticationSchemeSequence = SystemDatabaseFactory.getInstance().getAuthenticationSchemeSequence("WebDAV", sessionInfo.getRealm().getRealmID());
        boolean principalAllowed = PolicyDatabaseFactory.getInstance().isPrincipalAllowed(sessionInfo.getUser(), authenticationSchemeSequence, true);
        if (principalAllowed){
              BrowserChecker checker = new BrowserChecker(request.getHeader("user-agent"));
              if (item.getResource().getResourceType().equals(
                      NetworkPlacePlugin.NETWORK_PLACE_RESOURCE_TYPE)
                      && CoreUtil
                              .isAuthenticationModuleInUse(WebDAVAuthenticationModule.MODULE_NAME)
                      && ( checker.isBrowserVersionExpression(BrowserChecker.BROWSER_IE, "+=5") ||
                          ( Property.getPropertyBoolean(
View Full Code Here

Examples of com.alu.e3.prov.restapi.model.ResourceItem

    return mSchema;
  }

  private static final com.alu.e3.prov.restapi.model.ResourceItem fromDataModel(com.alu.e3.data.model.sub.ResourceItem item) {

    ResourceItem wsItem = new ResourceItem();
    wsItem.setName(item.getName());
    wsItem.setGrammar(item.getGrammar());
    wsItem.setIsMain(item.isIsMain());   

    return wsItem;
  }
View Full Code Here

Examples of com.alu.e3.prov.restapi.model.ResourceItem

        // loop on schema resources and store them on files
        StringBuffer buf = new StringBuffer();
        List<ResourceItem> resources = schema.getResourcesList();
        int resourcesCount = resources.size();
        for (int i = 0; i < resourcesCount; i++) {
          ResourceItem item = resources.get(i);

          if (item != null) {
            boolean isMain = item.isIsMain();
            String fileName = item.getName();
            if (isMain) {
              fileName = "main." + fileName;
            }

            // log file name
            buf.append(fileName);
            if ((i + 1) < resourcesCount) {
              buf.append(";");
            }

            addJarEntry(entries, item.getGrammar().getBytes("UTF-8"), RESOURCES_FOLDER_PATH_IN_JAR + File.separator + fileName);
          }
        }

        // if the validation is WSDL, we need to add the schemas to
        // validate the SOAP envelop
View Full Code Here

Examples of com.mojang.ld22.item.ResourceItem

public class ResourceRecipe extends Recipe {
  private Resource resource;

  public ResourceRecipe(Resource resource) {
    super(new ResourceItem(resource, 1));
    this.resource = resource;
  }
View Full Code Here

Examples of com.mojang.ld22.item.ResourceItem

    super(new ResourceItem(resource, 1));
    this.resource = resource;
  }

  public void craft(Player player) {
    player.inventory.add(0, new ResourceItem(resource, 1));
  }
View Full Code Here

Examples of com.mojang.ld22.item.ResourceItem

  public Recipe(Item resultTemplate) {
    this.resultTemplate = resultTemplate;
  }

  public Recipe addCost(Resource resource, int count) {
    costs.add(new ResourceItem(resource, count));
    return this;
  }
View Full Code Here

Examples of com.mojang.ld22.item.ResourceItem

  public void checkCanCraft(Player player) {
    for (int i = 0; i < costs.size(); i++) {
      Item item = costs.get(i);
      if (item instanceof ResourceItem) {
        ResourceItem ri = (ResourceItem) item;
        if (!player.inventory.hasResources(ri.resource, ri.count)) {
          canCraft = false;
          return;
        }
      }
View Full Code Here

Examples of com.mojang.ld22.item.ResourceItem

  public void deductCost(Player player) {
    for (int i = 0; i < costs.size(); i++) {
      Item item = costs.get(i);
      if (item instanceof ResourceItem) {
        ResourceItem ri = (ResourceItem) item;
        player.inventory.removeResource(ri.resource, ri.count);
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.