Package com.openkm.ws.client

Examples of com.openkm.ws.client.Document


    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")) {
View Full Code Here


            tableModel.removeRow(0);
        }
        FolderNodeBean folderNode = (FolderNodeBean) actualNode.getUserObject();
        try {
            for (Iterator<Document> it = okmDocument.getChilds(token, folderNode.getFolder().getPath()).getItem().iterator(); it.hasNext();) {
                Document doc = it.next();
                Object[] data = new Object[7];
                if (doc.isLocked() && !doc.isCheckedOut()) {
                    is = this.getClass().getClassLoader().getResourceAsStream("com/openkm/openoffice/images/icon/lock.gif");
                    buf = new byte[1024*10];
                    size = is.read(buf);
                    data[0] = new ImageIcon(buf);
                } else {
                    is = this.getClass().getClassLoader().getResourceAsStream("com/openkm/openoffice/images/icon/empty.gif");
                    buf = new byte[1024*10];
                    size = is.read(buf);
                    data[0] = new ImageIcon(buf);
                }
                if (doc.isCheckedOut()) {
                    is = this.getClass().getClassLoader().getResourceAsStream("com/openkm/openoffice/images/icon/edit.gif");
                    buf = new byte[1024*10];
                    size = is.read(buf);
                    data[1] = new ImageIcon(buf);
                } else {
                    is = this.getClass().getClassLoader().getResourceAsStream("com/openkm/openoffice/images/icon/empty.gif");
                    buf = new byte[1024*10];
                    size = is.read(buf);
                    data[1] = new ImageIcon(buf);
                }
                try {
                    is = this.getClass().getClassLoader().getResourceAsStream("com/openkm/openoffice/images/mime/" + doc.getMimeType() + ".gif");
                    buf = new byte[1024*10];
                    size = is.read(buf);
                    data[2] = new ImageIcon(buf);
                } catch (Exception e) {
                    // Case mime type is not in added icons !!
                    is = this.getClass().getClassLoader().getResourceAsStream("com/openkm/openoffice/images/icon/empty.gif");
                    buf = new byte[1024*10];
                    size = is.read(buf);
                    data[2] = new ImageIcon(buf);
                }
                data[3] = doc;
                data[4] = doc.getAuthor();
                data[5] = doc.getActualVersion().getName();
                DateFormat df = new SimpleDateFormat(OpenKMAddOn.get().getLang().getString("date.pattern"));
                Calendar cal = doc.getLastModified().toGregorianCalendar();
                df.format(cal.getTime());
                data[6] = df.format(cal.getTime());
                tableModel.addRow(data);
            }
            pack();
View Full Code Here

            table.getSelectionModel().addListSelectionListener( new ListSelectionListener() {
                public void valueChanged(ListSelectionEvent arg0) {
                    int selectedRow = table.getSelectedRow();
                    // clearing selection make call to listener and then selected row is -1
                    if (selectedRow>=0) {
                        Document doc = (Document) table.getValueAt(selectedRow, 3);
                        try {
                            evaluateEnabledButtonByPermissions(doc);
                        } catch (UnsupportedEncodingException ex) {
                            // Do nothing
                        }
View Full Code Here

        String token = "";
        OKMAuthService authService = null;
        OKMDocumentService docService = null;
        OKMAuth okmAuth = null;
        OKMDocument okmDocument = null;
        Document doc = new Document();

        try {
            authService = new OKMAuthService(new URL(host + "/OKMAuth?wsdl"), AuthServiceName);
            docService = new OKMDocumentService(new URL(host + "/OKMDocument?wsdl"), DocumentServiceName);
            okmAuth = authService.getOKMAuthPort();
            okmDocument = docService.getOKMDocumentPort();
            BindingProvider bpAuth = (BindingProvider) okmAuth;
            BindingProvider bpDocument= (BindingProvider) okmDocument;
            bpAuth.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, host+"/OKMAuth");
            bpDocument.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, host+"/OKMDocument");

            token = okmAuth.login(username, password);

            doc.setPath(document.getPath());
            okmDocument.create(token, doc, FileUtil.readFile(document.getLocalFilename()));

            // Logout OpenKM
            okmAuth.logout(token);
            token = "";
View Full Code Here

TOP

Related Classes of com.openkm.ws.client.Document

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.