Examples of OKMDocumentBean


Examples of com.openkm.openoffice.bean.OKMDocumentBean

    private void editButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editButtonActionPerformed
        disableAllButton();
        int selectedRow = table.getSelectedRow();
        try {
            Document doc = (Document) table.getValueAt(selectedRow, 3);
            OKMDocumentBean oKMDocumentBean = DocumentLogic.chekckout(host, username, password, doc, documentFile.getDirectoryToStoreFiles());
            documentFile.add(oKMDocumentBean);
            XComponentLoader loader = (XComponentLoader)UnoRuntime.queryInterface(XComponentLoader.class, xFrame);
            String fileName = "";
            if (Util.getOS().toLowerCase().contains("windows")) {
                fileName =  oKMDocumentBean.getLocalFilename();
            } else {
                fileName = Util.convertFileNamePathToURI(oKMDocumentBean.getLocalFilename()).toURL().getPath();
            }
            loader.loadComponentFromURL(Util.fileNameToOOoURL(fileName), "_blank", 0, new PropertyValue[0]);
        } catch (Exception ex) {
            new ErrorForm(ex);
        }
View Full Code Here

Examples of com.openkm.openoffice.bean.OKMDocumentBean

            writer = outputFactory.createXMLStreamWriter(stream,"UTF-8");
            writer.writeStartDocument("utf-8", "1.0");      // Header
            writer.writeStartElement("openkm");             // openkm node

            for (Iterator<OKMDocumentBean> it = docList.iterator(); it.hasNext();) {
                OKMDocumentBean doc = it.next();
                writer.writeStartElement("document");       // document node

                writer.writeStartElement("uuid");           // uuid
                writer.writeCharacters(doc.getUUID());
                writer.writeEndElement();

                writer.writeStartElement("path");           // path
                writer.writeCharacters(doc.getPath());
                writer.writeEndElement();

                writer.writeStartElement("localfilename")// localfilename
                writer.writeCharacters(doc.getLocalFilename());
                writer.writeEndElement();

                writer.writeStartElement("name");           // name
                writer.writeCharacters(doc.getName());
                writer.writeEndElement();

                writer.writeEndElement();                   // close document
            }
View Full Code Here

Examples of com.openkm.openoffice.bean.OKMDocumentBean

            Document doc = docBuilder.parse (new File(documentFilename));

            NodeList nodes = doc.getElementsByTagName("document");
            if (nodes.getLength()>0) {
                for (int i=0; i<nodes.getLength(); i++) {
                    OKMDocumentBean oKMDocumentBean = new OKMDocumentBean();
                    Node document = nodes.item(i);
                    Element docElement = (Element) document;
                    oKMDocumentBean.setUUID(docElement.getElementsByTagName("uuid").item(0).getChildNodes().item(0).getNodeValue());
                    oKMDocumentBean.setPath(docElement.getElementsByTagName("path").item(0).getChildNodes().item(0).getNodeValue());
                    oKMDocumentBean.setLocalFilename(docElement.getElementsByTagName("localfilename").item(0).getChildNodes().item(0).getNodeValue());
                    oKMDocumentBean.setName(docElement.getElementsByTagName("name").item(0).getChildNodes().item(0).getNodeValue());
                    docList.add(oKMDocumentBean);
                }
            }

        } catch (ParserConfigurationException ex) {
View Full Code Here

Examples of com.openkm.openoffice.bean.OKMDocumentBean

    }

    public void remove(OKMDocumentBean doc) throws OKMException {
        read();
        for (Iterator<OKMDocumentBean> it = docList.iterator(); it.hasNext();) {
            OKMDocumentBean tmpDoc = it.next();
            if (tmpDoc.getUUID().equals(doc.getUUID())) {
                docList.remove(tmpDoc);
                break;
            }
        }
        save();
View Full Code Here

Examples of com.openkm.openoffice.bean.OKMDocumentBean

    public boolean isOpenKMDocument(String localFilename) throws OKMException {
        boolean found = false;
        read();
        for (Iterator<OKMDocumentBean> it = docList.iterator(); it.hasNext();) {
            OKMDocumentBean doc = it.next();
            if (localFilename.equals(doc.getLocalFilename())) {
                found = true;
                break;
            }
        }
        return found;
View Full Code Here

Examples of com.openkm.openoffice.bean.OKMDocumentBean

    }

    public OKMDocumentBean findByLocalFileName(String localFilename) throws OKMException {
        read();
        for (Iterator<OKMDocumentBean> it = docList.iterator(); it.hasNext();) {
            OKMDocumentBean doc = it.next();
            if (localFilename.equals(doc.getLocalFilename())) {
                return doc;
            }
        }
        return null;
    }
View Full Code Here

Examples of com.openkm.openoffice.bean.OKMDocumentBean

    public void create(String path, String documentPath) throws OKMException {
        if (documentPath!=null && !documentPath.equals("")) {
            waitWindow.setVisible(true);
            ConfigBean configBean = configFile.read();
            OKMDocumentBean document = new OKMDocumentBean();
            document.setLocalFilename(documentPath);
            try {
                document.setPath(path + "/" + Util.getLocalFileName(documentPath));
            } catch (UnsupportedEncodingException ex) {
                new OKMException(ex);
            }
            DocumentLogic.create(configBean.getHost(), configBean.getUser(), configBean.getPassword(), document);
            waitWindow.setVisible(false);
View Full Code Here

Examples of com.openkm.openoffice.bean.OKMDocumentBean

    public void executeCheckin(String documentPath) {
        try {
            waitWindow.setVisible(true);
            storeToDisk();
            OKMDocumentBean oKMDocumentBean = documentFile.findByLocalFileName(documentPath);
            ConfigBean configBean = configFile.read();
            DocumentLogic.checkin(configBean.getHost(), configBean.getUser(), configBean.getPassword(), oKMDocumentBean);
            documentFile.remove(oKMDocumentBean);
            waitWindow.setVisible(false);
            m_xFrame.dispose();
View Full Code Here

Examples of com.openkm.openoffice.bean.OKMDocumentBean

    }

    public void executeCancelCheckin(String documentPath) {
        try {
            waitWindow.setVisible(true);
            OKMDocumentBean oKMDocumentBean = documentFile.findByLocalFileName(documentPath);
            ConfigBean configBean = configFile.read();
            DocumentLogic.cancelCheckout(configBean.getHost(), configBean.getUser(), configBean.getPassword(), oKMDocumentBean);
            documentFile.remove(oKMDocumentBean);
            waitWindow.setVisible(false);
            m_xFrame.dispose();
View Full Code Here

Examples of com.openkm.openoffice.bean.OKMDocumentBean

        return path.substring(path.lastIndexOf(FileUtil.getFolderPathSeparator())+1);
    }


    public static OKMDocumentBean copy(Document doc) {
        OKMDocumentBean oKMDocumentBean = new OKMDocumentBean();

        oKMDocumentBean.setUUID(doc.getUuid());
        oKMDocumentBean.setName(getOKMDocumentName(doc));
        oKMDocumentBean.setPath(doc.getPath());

        return oKMDocumentBean;
    }
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.