Examples of XPointerFactory


Examples of org.apache.lenya.xml.XPointerFactory

            return null;
        }


        Vector proxyElements = null;
        XPointerFactory xpf = new XPointerFactory();

        try {
            proxyElements = xpf.select(document.getDocumentElement(), "xpointer(/conf/Proxy)");
            if (proxyElements.size() == 0) log.info("No proxy defined (" + configFile + ")");
        } catch (Exception e) {
            log.error(e);
            return null;
        }
View Full Code Here

Examples of org.apache.lenya.xml.XPointerFactory

     */
    public ProxyConf(Element proxyElement) {
        try {
            items = new Vector();

            XPointerFactory xpf = new XPointerFactory();

            proxyHost = proxyElement.getAttribute("host");
            proxyPort = proxyElement.getAttribute("port");

            Vector filterEls = xpf.select(proxyElement, "xpointer(include|exclude)");

            for (int i = 0; i < filterEls.size(); i++) {
                ProxyItem item = new ProxyItem((Element) filterEls.elementAt(i));
                items.addElement(item);
            }
View Full Code Here

Examples of org.apache.lenya.xml.XPointerFactory

     * Creates a new ProxyItem object.
     *
     * @param itemElement DOCUMENT ME!
     */
    public ProxyItem(Element itemElement) {
        XPointerFactory xpf = new XPointerFactory();

        if (itemElement.getNodeName().equals("include")) {
            action = true;
        } else {
            action = false;
        }

        try {
            filter = new RE(xpf.getElementValue(itemElement));
        } catch (RESyntaxException e) {
            System.err.println(this.getClass().getName() + ": " + e);
        }
    }
View Full Code Here

Examples of org.apache.lenya.xml.XPointerFactory

     * @return CheckOutEntry The entry of the check out
     *
     * @throws Exception if an error occurs
     */
    public CheckOutEntry getLatestCheckOutEntry() throws Exception {
        XPointerFactory xpf = new XPointerFactory();

        Vector firstCheckOut =
            xpf.select(
                document.getDocumentElement(),
                "xpointer(/XPSRevisionControl/CheckOut[1]/Identity)xpointer(/XPSRevisionControl/CheckOut[1]/Time)");

        if (firstCheckOut.size() == 0) {
            // No checkout at all
            //
            return null;
        }

        String[] fcoValues = xpf.getNodeValues(firstCheckOut);
        long fcoTime = Long.parseLong(fcoValues[1]);

        return new CheckOutEntry(fcoValues[0], fcoTime);
    }
View Full Code Here

Examples of org.apache.lenya.xml.XPointerFactory

     * @return CheckInEntry The entry of the check in
     *
     * @throws Exception if an error occurs
     */
    public CheckInEntry getLatestCheckInEntry() throws Exception {
        XPointerFactory xpf = new XPointerFactory();

        Vector firstCheckIn =
            xpf.select(
                document.getDocumentElement(),
                "xpointer(/XPSRevisionControl/CheckIn[1]/Identity)xpointer(/XPSRevisionControl/CheckIn[1]/Time)");

        if (firstCheckIn.size() == 0) {
            // No checkin at all
            //
            return null;
        }

        String[] fciValues = xpf.getNodeValues(firstCheckIn);
        long fciTime = Long.parseLong(fciValues[1]);

        return new CheckInEntry(fciValues[0], fciTime);
    }
View Full Code Here

Examples of org.apache.lenya.xml.XPointerFactory

     * @return Vector of all check out and check in entries in this RCML-file
     *
     * @throws Exception if an error occurs
     */
    public Vector getEntries() throws Exception {
        XPointerFactory xpf = new XPointerFactory();

        Vector entries =
            xpf.select(
                document.getDocumentElement(),
                "xpointer(/XPSRevisionControl/CheckOut|/XPSRevisionControl/CheckIn)");
        Vector RCMLEntries = new Vector();

        for (int i = 0; i < entries.size(); i++) {
View Full Code Here

Examples of org.apache.lenya.xml.XPointerFactory

     * @param backupDir The backup directory
     *
     * @throws Exception if an error occurs
     */
    public void pruneEntries(String backupDir) throws Exception {
        XPointerFactory xpf = new XPointerFactory();

        Vector entries =
            xpf.select(
                document.getDocumentElement(),
                "xpointer(/XPSRevisionControl/CheckOut|/XPSRevisionControl/CheckIn)");

        for (int i = maximalNumberOfEntries; i < entries.size(); i++) {
            Element current = (Element) entries.get(i);
View Full Code Here

Examples of org.apache.lenya.xml.XPointerFactory

     * Delete the latest check in
     *
     * @throws Exception if an error occurs
     */
    public void deleteFirstCheckIn() throws Exception {
        XPointerFactory xpf = new XPointerFactory();
        Node root = document.getDocumentElement();
        Vector firstCheckIn = xpf.select(root, "xpointer(/XPSRevisionControl/CheckIn[1])");
        root.removeChild((Node) firstCheckIn.elementAt(0));
        root.removeChild(root.getFirstChild()); // remove EOL (end of line)
        setDirty();
    }
View Full Code Here

Examples of org.apache.lenya.xml.XPointerFactory

     * @return String[] the times
     *
     * @throws Exception if an error occurs
     */
    public String[] getBackupsTime() throws Exception {
        XPointerFactory xpf = new XPointerFactory();

        Vector entries =
            xpf.select(
                document.getDocumentElement(),
                "xpointer(/XPSRevisionControl/CheckIn)");
        ArrayList times = new ArrayList();

        for (int i = 0; i < entries.size(); i++) {
View Full Code Here

Examples of org.apache.lenya.xml.XPointerFactory

     * @return CheckOutEntry The entry of the check out
     *
     * @throws Exception if an error occurs
     */
    public CheckOutEntry getLatestCheckOutEntry() throws Exception {
        XPointerFactory xpf = new XPointerFactory();

        Vector firstCheckOut = xpf.select(document.getDocumentElement(),
                "xpointer(/XPSRevisionControl/CheckOut[1]/Identity)xpointer(/XPSRevisionControl/CheckOut[1]/Time)");

        if (firstCheckOut.size() == 0) {
            // No checkout at all
            //
            return null;
        }

        String[] fcoValues = xpf.getNodeValues(firstCheckOut);
        long fcoTime = new Long(fcoValues[1]).longValue();

        return new CheckOutEntry(fcoValues[0], fcoTime);
    }
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.