Пример #1
0
        // Document XML
        public DocumentXML()
        {
            try
            {
                fileUtil = new FileUtil();
                documentList = new List<OKMDocument>();

                // Create default %CURRENT USER%/My documents/OpenKM/ folder
                if (!Directory.Exists(fileUtil.getConfigPath()))
                {
                    Directory.CreateDirectory(fileUtil.getConfigPath());
                }

                // Create configuration file
                if (!File.Exists(fileUtil.getDocumentFilenamePath()))
                {
                    CreateDocumentFile();
                }

                // Always we reading configuration file
                ReadDocumentFile();
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Пример #2
0
        public OpenkMAddIn()
        {
            // Initialize vars;
            configXML = new ConfigXML();
            docXML = new DocumentXML();
            fileUtil = new FileUtil();

            // Initialize forms
            configurationForm = new ConfigurationForm();
        }
Пример #3
0
        // copy document object to OKMDocument object
        public static MSOpenKMCore.bean.OKMDocument copy(document doc, String docType)
        {
            try
            {
                MSOpenKMCore.bean.OKMDocument oKMDocument = new MSOpenKMCore.bean.OKMDocument();
                FileUtil fileUtil = new FileUtil();

                oKMDocument.setUUID(doc.uuid);
                oKMDocument.setName(getDocumentName(doc));
                oKMDocument.setLocalFilename(fileUtil.getFilenameWithoutCollision(doc));
                oKMDocument.setPath(doc.path);
                oKMDocument.setType(docType);

                return oKMDocument;
            }
            catch (Exception e)
            {
                throw e;
            }
        }