Examples of DataRepository


Examples of net.sourceforge.processdash.data.repository.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 = DataRepository.createDataName(prefix, name);
        SimpleData value = data.getSimpleValue(dataName);
        return (value != null && value.test());
    }
View Full Code Here

Examples of net.sourceforge.processdash.data.repository.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 net.sourceforge.processdash.data.repository.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 net.sourceforge.processdash.data.repository.DataRepository

            newNames = setDiff(newNamesToWatch, listeningToDataNames);
            this.listeningToDataNames = newNamesToWatch;
        }

        // stop listening to any elements we no longer care about.
        DataRepository data = ctx.getData();
        for (String oneName : unneededNames)
            data.removeDataListener(oneName, this);

        // begin listening to any newly identified data elements.
        for (String oneName : newNames)
            data.addDataListener(oneName, this, true);
    }
View Full Code Here

Examples of net.sourceforge.processdash.data.repository.DataRepository

        StringBuffer uri = new StringBuffer((String) env.get("SCRIPT_PATH"));
        uri.setLength(uri.length()-6);
        uri.append(".shtm");

        String unit, units;
        DataRepository data = getDataRepository();
        String prefix = getPrefix();
        SimpleData d = data.getSimpleValue(prefix + "/" + UNITS_NAME);
        units = (d != null ? d.format() : null);
        if (units == null || units.trim().length() == 0)
            units = resources.getString("Default_Units");
        
        int semicolonPos = units.indexOf(';');
View Full Code Here

Examples of net.sourceforge.processdash.data.repository.DataRepository

    }

    private Collection getExportInstructionsFromData() {
        Collection result = new LinkedList();

        DataRepository data = dashboard.getData();
        Object hints = new DataNameFilter.PrefixLocal() {
            public boolean acceptPrefixLocalName(String p, String localName) {
                return localName.endsWith(EXPORT_DATANAME);
            }};
        for (Iterator iter = data.getKeys(null, hints); iter.hasNext();) {
            String name = (String) iter.next();
            AbstractInstruction instr = getExportInstructionFromData(name);
            if (instr != null)
                result.add(instr);
        }
View Full Code Here

Examples of net.sourceforge.processdash.data.repository.DataRepository

        String content = rawBytes.toString("utf-8");
        rawBytes = null;

        // invoke the preprocessor on the content
        WebServer webServer = (WebServer) env.get(TinyCGI.TINY_WEB_SERVER);
        DataRepository data = (DataRepository) env.get(TinyCGI.DATA_REPOSITORY);
        String prefix = (String) env.get("PATH_TRANSLATED");
        HTMLPreprocessor p = new HTMLPreprocessor(webServer,
                data.getSubcontext(prefix), env);
        if (contentType != null && contentType.indexOf("html") != -1)
            p.setDefaultEchoEncoding("html");
        content = p.preprocess(content);
        byte[] resultBytes = content.getBytes("utf-8");
View Full Code Here

Examples of pspdash.data.DataRepository

            this(name, name, null, null); }
        public PathVariable(String name, String metaName, String impliedPath,
                            String defaultValue) {
            this.metaName = metaName;
            SaveableData val = null;
            DataRepository data = getDataRepository();

            if (name.startsWith("/")) {
                // The name is absolute - look it up in the data repository.
                val = data.getSimpleValue(dataName = name);

            } else {
                // Look for an inheritable value with this name in the data
                // repository.
                StringBuffer prefix = new StringBuffer(getPrefix());
                val = data.getInheritableValue(prefix, name);
                if (val != null && !(val instanceof SimpleData))
                    val = val.getSimpleValue();
                dataName = data.createDataName(prefix.toString(), name);
            }

            // Check to see if a value was POSTed to this CGI script for this
            // data element.  If so, it would override any previous value.
            String postedValue = getParameter(name);
            if (postedValue != null) {
                value = postedValue;
                if (pathStartsWith(value, impliedPath)) {
                    // the user supplied an absolute path.  Rewrite it so it
                    // is relative to the impliedPath.
                    value = value.substring(impliedPath.length());
                    if (value.startsWith(File.separator))
                        value = value.substring(1);
                }
                if (! pathEqual(value, defaultValue) || val != null) {
                    // Save this user-specified value in the repository.
                    // (Default values are not saved to the repository.)
                    data.userPutValue(dataName, StringData.create(value));
                }

            } else if (val instanceof SimpleData)
                value = ((SimpleData) val).format();
View Full Code Here

Examples of pspdash.data.DataRepository

* data.
*/
public class selectRollup extends TinyCGIBase {

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

        // get the [Use_Rollup] data element for the current
        // project. If it is null, return immediately.
        String prefix = getPrefix();   if (prefix == null) return;
        String useRollupName = data.createDataName(prefix, "Use_Rollup");
        ListData rollupIDs = getList(data, useRollupName);
        if (rollupIDs == null) return;

        String tableStart = TABLE_START, tableEnd = "", tableRow;
        for (int i = 0;   i < rollupIDs.size();   i++) {
View Full Code Here

Examples of pspdash.data.DataRepository

    protected void putValue(String name, String value) {
        putValue(name, new ImmutableStringData(value));
    }

    protected void putValue(String name, SimpleData dataValue) {
        DataRepository data = getDataRepository();
        String prefix = getPrefix();
        if (prefix == null) prefix = "";
        String dataName = data.createDataName(prefix, name);
        data.putValue(dataName, dataValue);
    }
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.