Examples of DataRepository


Examples of pspdash.data.DataRepository

        data.putValue(dataName, dataValue);
    }

    /** Get a value from the data repository. */
    protected String getValue(String name) {
        DataRepository data = getDataRepository();
        String prefix = getPrefix();
        if (prefix == null) prefix = "";
        String dataName = data.createDataName(prefix, name);
        SimpleData d = data.getSimpleValue(dataName);
        return (d == null ? null : d.format());
    }
View Full Code Here

Examples of pspdash.data.DataRepository

        out.print("'></head><body>&nbsp;</body></html>");
    }


    protected void showListOfDefinedStandards() throws IOException {
        DataRepository data = getDataRepository();
        String[] standards = DefectTypeStandard.getDefinedStandards(data);

        String defaultName = DefectTypeStandard.get("", data).getName();

        writeHTMLHeader();
View Full Code Here

Examples of pspdash.data.DataRepository

    private static final String DEFAULT_PREFIX = "/To Date/PSP/All";
    private static final String DEST_URL = "//reports/table.class?qf=hist.rpt";

    /** Write the CGI header. */
    protected void writeHeader() {
        DataRepository data = getDataRepository();
        String prefix = getPrefix();
        String dataName = DataRepository.createDataName(prefix, DATA_NAME);
        SimpleData d = data.getSimpleValue(dataName);
        String subsetPrefix = null;
        if (d != null) subsetPrefix = d.format();
        if (subsetPrefix == null || subsetPrefix.length() == 0)
            subsetPrefix = DEFAULT_PREFIX;

View Full Code Here

Examples of pspdash.data.DataRepository

  void applyPostedChanges () {
    long l;

    // If there are any changes, apply them.
    if (postedChanges.size() > 0) {
      DataRepository data = dashboard.getDataRepository();
      String thePath;

      // Get the posted changes (keys) and loop through them all
      Enumeration keys = postedChanges.keys();
      while (keys.hasMoreElements ()) {
        // Store the change's key information into k, and data into l.
        PropertyKey k = (PropertyKey)keys.nextElement ();
        l = ((Long)postedChanges.get (k)).longValue();
        if (l != 0) {
          thePath = k.path() + "/Time";

          // Extract the data from the data repository that corresponds
          // to the change we are currently applying.
          Object pt = data.getValue (thePath);

          // Are they trying to log time against some node which performs
          // roll up only?  This is bad - don't allow it.
          if (pt != null &&
              (!(pt instanceof DoubleData) || pt instanceof NumberFunction)) {
            System.err.println("Error in TimeLogEditor: time must be logged " +
                               "to phases (i.e. leaves of the hierarchy).");
            continue;
          }

          if (pt != null)
            l += (long)((DoubleData) pt).getInteger ();

          // Save the new value into the data repository.
          data.putValue(thePath, new DoubleData(l, false));
        }
      }
    }
    postedChanges.clear ();
  }
View Full Code Here

Examples of pspdash.data.DataRepository

        out.print(getParameter("name"));
        out.print(finalPart);
    }

    protected void init() {
        DataRepository data = getDataRepository();
        if (data == null) return;

        TreeSet s = new TreeSet(DataComboBox.getAllDataNames(data));
        s.add("");
        OptionList opt = new OptionList(s);
View Full Code Here

Examples of pspdash.data.DataRepository

        return result;
    }

    /** Load process customization settings from data for this project. */
    private void loadGenericVariables() {
        DataRepository data = getDataRepository();
        String prefix = getPrefix();
        SimpleData d;
        d = data.getSimpleValue(prefix + "/" + SHOW_SIZE_NAME);
        showSize = (d != null && d.test());
        d = data.getSimpleValue(prefix + "/" + SHOW_DEF_NAME);
        showDefects = (d != null && d.test());
        d = data.getSimpleValue(prefix + "/" + UNITS_NAME);
        if (d == null) {
            unit = "Unit"; units = "Units";
        } else {
            units = d.format();
            int semicolonPos = units.indexOf(';');
View Full Code Here

Examples of pspdash.data.DataRepository

     * @return the XML element corresponding to the named document.
     */
    protected Element findFile(String name) throws IOException {
        // Look for an inheritable value for the FILE_XML element in the
        // data repository.
        DataRepository data = getDataRepository();
        String pfx = getPrefix();
        if (pfx == null) pfx = "/";
        StringBuffer prefix = new StringBuffer(pfx);
        ListData list;
        Element result = null;
        SaveableData val;
        for (val = data.getInheritableValue(prefix, FILE_XML_DATANAME);
             val != null;
             val = data.getInheritableValue(chop(prefix), FILE_XML_DATANAME)) {

            if (val != null && !(val instanceof SimpleData))
                val = val.getSimpleValue();

            if (val instanceof StringData)
View Full Code Here

Examples of pspdash.data.DataRepository

        }
        return result;
    }
    /** get the name of the person who owns the data in the repository */
    protected String getOwner() {
        DataRepository data = getDataRepository();
        SimpleData val = data.getSimpleValue("/Owner");
        if (val == null) return null;
        String result = val.format();
        if ("Enter your name".equals(result))
            return null;
        else
View Full Code Here

Examples of pspdash.data.DataRepository

        String prefix = (String) env.get("PATH_TRANSLATED");
        String [] dataNames = new String[dataElements.length];
        for (int e = dataElements.length; e-- > 0; )
            dataNames[e] = prefix + "/" + dataElements[e];

        DataRepository data = getDataRepository();
        ArrayList populatedRows = new ArrayList();

        int rowNum, lastPopulatedRow, i;
        rowNum = lastPopulatedRow = -1;
    ROW:
        while (true) {
            rowNum++;
            i = dataNames.length;
            while (i-- > 0)
                if (data.getValue(replaceNum(dataNames[i], rowNum)) != null) {
                    lastPopulatedRow = rowNum;
                    populatedRows.add(new Integer(rowNum));
                    continue ROW;
                }
            // if we haven't seen any data for 20 consecutive rows,
View Full Code Here

Examples of pspdash.data.DataRepository

    }

    /** @return true if the data element named by prefix/name is nonnull. */
    protected boolean hasValue(String name) {
        String prefix = (String) env.get("PATH_TRANSLATED");
        DataRepository data = getDataRepository();

        String dataName = data.createDataName(prefix, name);
        return (data.getSimpleValue(dataName) != null);
    }
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.