Examples of ConfigOption


Examples of com.vmware.vim.binding.vim.vm.ConfigOption

            @Override
            protected Integer body() throws Exception {
               VirtualMachine vimVm = vcVm.getManagedObject();
               EnvironmentBrowser envBrowser =
                     MoUtil.getManagedObject(vimVm.getEnvironmentBrowser());
               ConfigOption configOption =
                     envBrowser.queryConfigOption(null, null);
               int hardwareVersion =
                     configOption.getHardwareOptions().getHwVersion();
               logger.info("hardware version is: " + hardwareVersion);
               return hardwareVersion;
            }
         });
      }
View Full Code Here

Examples of org.eclipse.orion.server.git.objects.ConfigOption

                null));
      Repository db = null;
      try {
        db = FileRepositoryBuilder.create(gitDir);
        URI cloneLocation = BaseToCloneConverter.getCloneLocation(baseLocation, BaseToCloneConverter.CONFIG);
        ConfigOption configOption = new ConfigOption(cloneLocation, db);
        OrionServlet.writeJSONResponse(request, response, configOption.toJSON(/* all */), JsonURIUnqualificationStrategy.ALL_NO_GIT);
        return true;
      } finally {
        if (db != null) {
          db.close();
        }
      }
    } else if (p.segment(1).equals(Clone.RESOURCE) && p.segment(2).equals("file")) { //$NON-NLS-1$
      // expected path /gitapi/config/{key}/clone/file/{path}
      File gitDir = GitUtils.getGitDir(p.removeFirstSegments(2));
      if (gitDir == null)
        return statusHandler.handleRequest(request, response,
            new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_NOT_FOUND, NLS.bind("No repository found under {0}", p.removeFirstSegments(2)),
                null));
      URI cloneLocation = BaseToCloneConverter.getCloneLocation(baseLocation, BaseToCloneConverter.CONFIG_OPTION);
      Repository db = null;
      try {
        db = FileRepositoryBuilder.create(gitDir);
        ConfigOption configOption = new ConfigOption(cloneLocation, db, p.segment(0));
        if (!configOption.exists())
          return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_NOT_FOUND,
              "There is no config entry with key provided", null));
        OrionServlet.writeJSONResponse(request, response, configOption.toJSON(), JsonURIUnqualificationStrategy.ALL_NO_GIT);
        return true;
      } catch (IllegalArgumentException e) {
        return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_BAD_REQUEST, e.getMessage(), e));
      } finally {
        if (db != null) {
View Full Code Here

Examples of org.eclipse.orion.server.git.objects.ConfigOption

        return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_BAD_REQUEST,
            "Config entry value must be provided", null));
      Repository db = null;
      try {
        db = FileRepositoryBuilder.create(gitDir);
        ConfigOption configOption = new ConfigOption(cloneLocation, db, key);
        boolean present = configOption.exists();
        ArrayList<String> valList = new ArrayList<String>();
        if (present) {
          String[] val = configOption.getValue();
          valList.addAll(Arrays.asList(val));
        }
        valList.add(value);
        save(configOption, valList);

        JSONObject result = configOption.toJSON();
        OrionServlet.writeJSONResponse(request, response, result, JsonURIUnqualificationStrategy.ALL_NO_GIT);
        response.setHeader(ProtocolConstants.HEADER_LOCATION, result.getString(ProtocolConstants.KEY_LOCATION));
        response.setStatus(HttpServletResponse.SC_CREATED);
        return true;
      } catch (IllegalArgumentException e) {
View Full Code Here

Examples of org.eclipse.orion.server.git.objects.ConfigOption

                null));
      Repository db = null;
      URI cloneLocation = BaseToCloneConverter.getCloneLocation(getURI(request), BaseToCloneConverter.CONFIG_OPTION);
      try {
        db = FileRepositoryBuilder.create(gitDir);
        ConfigOption configOption = new ConfigOption(cloneLocation, db, p.segment(0));

        JSONObject toPut = OrionServlet.readJSONRequest(request);
        JSONArray value = toPut.optJSONArray(GitConstants.KEY_CONFIG_ENTRY_VALUE);
        if (value == null || (value.length() == 1 && value.isNull(0)))
          return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_BAD_REQUEST,
              "Config entry value must be provided", null));

        // PUT allows only to modify existing config entries
        if (!configOption.exists()) {
          response.setStatus(HttpServletResponse.SC_NOT_FOUND);
          return true;
        }

        ArrayList<String> valList = new ArrayList<String>();
        for (int i = 0; i < value.length(); i++) {
          valList.add(value.getString(i));
        }

        save(configOption, valList);

        JSONObject result = configOption.toJSON();
        OrionServlet.writeJSONResponse(request, response, result);
        response.setHeader(ProtocolConstants.HEADER_LOCATION, result.getString(ProtocolConstants.KEY_LOCATION));
        return true;
      } catch (IllegalArgumentException e) {
        return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_BAD_REQUEST, e.getMessage(), e));
View Full Code Here

Examples of org.eclipse.orion.server.git.objects.ConfigOption

                null));
      Repository db = null;
      URI cloneLocation = BaseToCloneConverter.getCloneLocation(getURI(request), BaseToCloneConverter.CONFIG_OPTION);
      try {
        db = FileRepositoryBuilder.create(gitDir);
        ConfigOption configOption = new ConfigOption(cloneLocation, db, GitUtils.decode(p.segment(0)));
        if (configOption.exists()) {
          String query = request.getParameter("index"); //$NON-NLS-1$
          if (query != null) {
            List<String> existing = new ArrayList<String>(Arrays.asList(configOption.getValue()));
            existing.remove(Integer.parseInt(query));
            save(configOption, existing);
          } else {
            delete(configOption);
          }
View Full Code Here

Examples of org.ofbiz.product.config.ProductConfigWrapper.ConfigOption

        result.put("productionRunId", productionRunId);

        Iterator options = config.getSelectedOptions().iterator();
        HashMap components = new HashMap();
        while (options.hasNext()) {
            ConfigOption co = (ConfigOption)options.next();
            //components.addAll(co.getComponents());
            Iterator selComponents = co.getComponents().iterator();
            while (selComponents.hasNext()) {
                BigDecimal componentQuantity = null;
                GenericValue selComponent = (GenericValue)selComponents.next();
                if (selComponent.get("quantity") != null) {
                    componentQuantity = selComponent.getBigDecimal("quantity");
                }
                if (componentQuantity == null) {
                    componentQuantity = BigDecimal.ONE;
                }
                String componentProductId = selComponent.getString("productId");
                if (co.isVirtualComponent(selComponent)) {
                    Map componentOptions = co.getComponentOptions();
                    if (UtilValidate.isNotEmpty(componentOptions) && UtilValidate.isNotEmpty(componentOptions.get(componentProductId))) {
                        componentProductId = (String)componentOptions.get(componentProductId);
                    }
                }
                componentQuantity = quantity.multiply(componentQuantity);
                if (components.containsKey(componentProductId)) {
                    BigDecimal totalQuantity = (BigDecimal)components.get(componentProductId);
                    componentQuantity = totalQuantity.add(componentQuantity);
                }
                components.put(componentProductId, componentQuantity);

                //  create production run notes from comments
                String comments = co.getComments();
                if (UtilValidate.isNotEmpty(comments)) {
                    resultService.clear();
                    serviceContext.clear();
                    serviceContext.put("workEffortId", productionRunId);
                    serviceContext.put("internalNote", "Y");
                    serviceContext.put("noteInfo", comments);
                    serviceContext.put("noteName", co.getDescription());
                    serviceContext.put("userLogin", userLogin);
                    serviceContext.put("noteParty", userLogin.getString("partyId"));
                    try {
                        resultService = dispatcher.runSync("createWorkEffortNote", serviceContext);
                    } catch (GenericServiceException e) {
View Full Code Here

Examples of org.ofbiz.product.config.ProductConfigWrapper.ConfigOption

        public void setupButton(XButton button) {
            this.button = button;
            List options = question.getOptions();
            if (question.isSelected()) {
                ConfigOption selectedOption = question.getSelected();
                showOption = options.indexOf(selectedOption);
            }
            ConfigOption configoption = (ConfigOption)options.get(showOption);
            button.setText(configoption.getDescription());
            return;
        }
View Full Code Here

Examples of org.ofbiz.product.config.ProductConfigWrapper.ConfigOption

        } */

        public void buttonClicked() {
            //only two choices, if the button is clicked, toggle
            List options = question.getOptions();
            ConfigOption unselectedoption = (ConfigOption)options.get(showOption);
            unselectedoption.setSelected(false);
            showOption = (showOption+1)%2;
            ConfigOption selectedoption = (ConfigOption)options.get(showOption);
            selectedoption.setSelected(true);
            button.setText(selectedoption.getDescription());
            return;
        }
View Full Code Here

Examples of org.ofbiz.product.config.ProductConfigWrapper.ConfigOption

        public void reset() {
            showOption = 0;
            List options = question.getOptions();
            if (question.isSelected()) {
                ConfigOption selectedOption = question.getSelected();
                showOption = options.indexOf(selectedOption);
            }
            ConfigOption configoption = (ConfigOption)options.get(showOption);
            button.setText(configoption.getDescription());
            return;
        }
View Full Code Here

Examples of org.ofbiz.product.config.ProductConfigWrapper.ConfigOption

            Iterator options = question.getOptions().iterator();

            DefaultListModel listModel = new DefaultListModel();

            while (options.hasNext()) {
                ConfigOption configoption = (ConfigOption)options.next();
                listModel.addElement(configoption.getDescription());
                //Debug.logInfo("Found option " + configoption.getDescription(), module);
                //Debug.logInfo("IsAvailable: "+configoption.isAvailable()+
                //    ", IsSelected: "+configoption.isSelected(), module);
            }
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.