Package net.sourceforge.processdash.data.repository

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


    }

    /** @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


     * @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

        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

            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

        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

    }

    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

        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

TOP

Related Classes of net.sourceforge.processdash.data.repository.DataRepository$AllDataNamesIterator

Copyright © 2018 www.massapicom. 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.