コード例 #1
0
 public PageContentDownloader(ref XWord2003AddIn addin, string pageFullName, IXWikiClient client, Dictionary <String, ConversionManager> pageConverters)
 {
     this.addin          = addin;
     this.pageFullName   = pageFullName;
     this.client         = client;
     this.pageConverters = pageConverters;
 }
コード例 #2
0
 public AttachmentUploader(XWord2003AddIn addin, string space, string page, IXWikiClient client, string[] fileNames)
 {
     this.addin     = addin;
     this.client    = client;
     this.space     = space;
     this.page      = page;
     this.fileNames = fileNames;
 }
コード例 #3
0
 public AttachmentDownloader(XWord2003AddIn addin, string pageFullName, string attachmentName, string path, IXWikiClient client)
 {
     this.addin          = addin;
     this.pageFullName   = pageFullName;
     this.attachmentName = attachmentName;
     this.path           = path;
     this.client         = client;
     this.fileInfo       = null;
 }
コード例 #4
0
        /// <summary>
        /// Creates a dummy <code>ConverionManeger</code> to be used by unit tests.
        /// </summary>
        /// <returns>An instance of a dummy <code>ConversionManager</code></returns>
        public static ConversionManager DummyConversionManager()
        {
            IXWikiClient client = null;

            client = XWikiClientTestUtil.CreateMockInstance();
            XOfficeCommonSettings settings = new XOfficeCommonSettings();

            return(new ConversionManager(settings, serverURL, localFolder, docFullName, localFileName, client));
        }
コード例 #5
0
 /// <summary>
 /// Creates a new instance of the ConversionManager class.
 /// </summary>
 /// <param name="serverURL">The url of the server.</param>
 /// <param name="localFolder">The local folder where documents are saved/</param>
 /// <param name="docFullName">The full name of the wiki page.</param>
 /// <param name="localFileName">The local file coresponding to the edited wiki page.</param>
 /// <param name="client">IXWikiClient implementation, handling Client server communication.</param>
 public ConversionManager(XOfficeCommonSettings settings, String serverURL, String localFolder, String docFullName, String localFileName, IXWikiClient client)
 {
     states               = new BidirectionalConversionStates(serverURL);
     states.LocalFolder   = localFolder;
     states.PageFullName  = docFullName;
     states.LocalFileName = localFileName;
     xwikiClient          = client;
     this.settings        = settings;
     localToWebHtml       = new LocalToWebHTML(this);
     webToLocalHtml       = new WebToLocalHTML(this);
     newAttachments       = new List <string>();
 }
コード例 #6
0
 /// <summary>
 /// Creates a new instance of the ConversionManager class.
 /// </summary>
 /// <param name="serverURL">The url of the server.</param>
 /// <param name="localFolder">The local folder where documents are saved/</param>
 /// <param name="docFullName">The full name of the wiki page.</param>
 /// <param name="localFileName">The local file coresponding to the edited wiki page.</param>
 /// <param name="client">IXWikiClient implementation, handling Client server communication.</param>
 public ConversionManager(XOfficeCommonSettings settings, String serverURL, String localFolder, String docFullName, String localFileName, IXWikiClient client)
 {
     states = new BidirectionalConversionStates(serverURL);
     states.LocalFolder = localFolder;
     states.PageFullName = docFullName;
     states.LocalFileName = localFileName;
     xwikiClient = client;
     this.settings = settings;
     localToWebHtml = new LocalToWebHTML(this);
     webToLocalHtml = new WebToLocalHTML(this);
     newAttachments = new List<string>();
 }
コード例 #7
0
        public AttachmentUploader(XWord2003AddIn addin, string pageFullName, IXWikiClient client, string[] fileNames)
        {
            this.addin     = addin;
            this.client    = client;
            this.fileNames = fileNames;

            if (pageFullName != null)
            {
                if (!this.client.LoggedIn)
                {
                    client.Login(addin.Username, addin.Password);
                }
                int index = pageFullName.IndexOf(".");
                space = pageFullName.Substring(0, index);
                page  = pageFullName.Substring(index + 1);
            }
            else
            {
                result = false;
            }
        }
コード例 #8
0
        /// <summary>
        /// Adds to server SSX objects for the current page.
        /// </summary>
        public void UploadStyleSheetExtensions()
        {
            IXWikiClient client = pageConverter.XWikiClient;
            int          i      = 0;

            foreach (XWikiObject ssxObject in pageStyleSheetExtensions)
            {
                NameValueCollection fieldsValues = new NameValueCollection();

                fieldsValues.Add("code", ssxObject.objectDictionary["code"].ToString());
                fieldsValues.Add("name", ssxObject.objectDictionary["name"].ToString());
                fieldsValues.Add("use", ssxObject.objectDictionary["use"].ToString());
                fieldsValues.Add("parse", ssxObject.objectDictionary["parse"].ToString());
                fieldsValues.Add("cache", ssxObject.objectDictionary["cache"].ToString());

                bool ssxExists = false;
                List <XWikiObject> existingSSXObjects = RetrieveStyleSheetExtensions();
                foreach (XWikiObject existingSSX in existingSSXObjects)
                {
                    if (existingSSX.objectDictionary["name"] + "" == XOFFICE_SSX || existingSSX.prettyName == XOFFICE_SSX)
                    {
                        //
                        //client.RemoveObject(pageFullName, SSX_CLASS_NAME, existingSSX.id);
                        ssxExists = true;
                    }
                }
                if (ssxExists)
                {
                    client.UpdateObject(pageFullName, ssxObject.className, fieldsValues);
                }
                else
                {
                    client.AddObject(pageFullName, ssxObject.className, fieldsValues);
                }
            }
        }
コード例 #9
0
 public AnnotationsIO(IXWikiClient client)
 {
     this.client = client;
 }
コード例 #10
0
 public AnnotationsIO(IXWikiClient client)
 {
     this.client = client;
 }
コード例 #11
0
 public ViewPageAttachmentsFormManager(ref ViewPageAttachmentsForm viewPageAttachmentsForm)
 {
     this.viewPageAttachmentsForm = viewPageAttachmentsForm;
     this.addinActions = Globals.XWord2003AddIn.AddinActions;
     this.client = Globals.XWord2003AddIn.Client;
 }
コード例 #12
0
 public ViewPageAttachmentsFormManager(ref ViewPageAttachmentsForm viewPageAttachmentsForm)
 {
     this.viewPageAttachmentsForm = viewPageAttachmentsForm;
     this.addinActions            = Globals.XWord2003AddIn.AddinActions;
     this.client = Globals.XWord2003AddIn.Client;
 }