Exemplo n.º 1
0
  /**
   * Callback for creation of add dialogs. Will be invoked once the presenter has loaded the
   * resource description.
   *
   * @param address
   * @param isSingleton
   * @param securityContext
   * @param description
   */
  public void showAddDialog(
      final ModelNode address,
      boolean isSingleton,
      SecurityContext securityContext,
      ModelNode description) {

    String resourceAddress = AddressUtils.asKey(address, isSingleton);

    if (securityContext.getOperationPriviledge(resourceAddress, "add").isGranted()) {
      _showAddDialog(address, isSingleton, securityContext, description);
    } else {
      Feedback.alert(Console.CONSTANTS.unauthorized(), Console.CONSTANTS.unauthorizedAdd());
    }
  }
Exemplo n.º 2
0
  public void setChildren(
      ModelNode address,
      List<ModelNode> modelNodes,
      ModelBrowserView.ChildInformation childInformation) {

    this.currentAddress = address;
    this.childInformation = childInformation;

    String denominatorType = AddressUtils.getDenominatorType(address.asPropertyList());
    boolean isSingleton =
        denominatorType != null ? childInformation.isSingleton(denominatorType) : false;

    String text = isSingleton ? "Singleton Child Resources" : "Child Resources";
    header.setHTML(
        "<h2 class='homepage-secondary-header'>" + text + " (" + modelNodes.size() + ")</h2>");
    dataProvider.setList(modelNodes);
  }