예제 #1
0
 private void toolStripButtonSeePage_Click(object sender, EventArgs e)
 {
     if (this.listViewPages.SelectedItems.Count > 0 && this.listViewPages.SelectedItems[0].Tag is ResourceInfo)
     {
         ResourceInfo portletInfo = (ResourceInfo)this.listViewPages.SelectedItems[0].Tag;
         Uri          uri         = OfficeApplication.OfficeDocumentProxy.WebAddress;
         Uri          url         = new Uri(uri.Scheme + "://" + uri.Host + ":" + uri.Port + portletInfo.page.url);
         FormPreview  preview     = new FormPreview(url, portletInfo.title);
         preview.ShowDialog(this);
     }
 }
예제 #2
0
 private void toolStripButtonView_Click(object sender, EventArgs e)
 {
     if (this.listViewVersions.SelectedItems.Count > 0)
     {
         String name = null;
         try
         {
             String version = this.listViewVersions.SelectedItems[0].Text;
             String type    = document.DocumentType.ToString().ToLower();
             name = OfficeApplication.OfficeDocumentProxy.createPreview(this.document.reporitoryID, this.document.contentID, version, type);
             String urlproxy = OfficeApplication.OfficeDocumentProxy.WebAddress.ToString();
             if (!urlproxy.EndsWith("/gtw"))
             {
                 if (!urlproxy.EndsWith("/"))
                 {
                     urlproxy += "/";
                 }
                 if (!urlproxy.EndsWith("gtw"))
                 {
                     urlproxy += "gtw";
                 }
             }
             Uri         url           = new Uri(urlproxy + "?contentId=" + this.document.contentID + "&versionName=" + version + "&repositoryName=" + this.document.reporitoryID + "&name=" + name + "&type=" + type);
             String      title         = OfficeApplication.OfficeDocumentProxy.getTitle(this.document.reporitoryID, this.document.contentID);
             FormPreview dialogPreview = new FormPreview(url, false, title);
             dialogPreview.ShowDialog(this);
         }
         catch (Exception ue)
         {
             OfficeApplication.WriteError(ue);
         }
         finally
         {
             if (name != null)
             {
                 try
                 {
                     OfficeApplication.OfficeDocumentProxy.deletePreview(name);
                 }
                 catch (Exception ue)
                 {
                     OfficeApplication.WriteError(ue);
                 }
             }
         }
     }
 }
예제 #3
0
 private void toolStripButtonSee_Click(object sender, EventArgs e)
 {
     if (this.listViewFlows.SelectedItems.Count > 0)
     {
         FlowItem     item         = (FlowItem)this.listViewFlows.SelectedItems[0];
         ResourceInfo resourceinfo = item.FlowContentInformation.resourceInfo;
         String       version      = resourceinfo.version;
         if (version.Equals("*"))
         {
             version = resourceinfo.lastversion;
         }
         String name = null;
         try
         {
             name = OfficeApplication.OfficeDocumentProxy.createPreview(resourceinfo.repository, resourceinfo.contentid, version, resourceinfo.type);
             String urlproxy = OfficeApplication.OfficeDocumentProxy.WebAddress.ToString();
             if (!urlproxy.EndsWith("/gtw"))
             {
                 if (!urlproxy.EndsWith("/"))
                 {
                     urlproxy += "/";
                 }
                 if (!urlproxy.EndsWith("gtw"))
                 {
                     urlproxy += "gtw";
                 }
             }
             Uri         url         = new Uri(urlproxy + "?contentId=" + resourceinfo.contentid + "&versionName=" + version + "&repositoryName=" + resourceinfo.repository + "&name=" + name + "&type=" + resourceinfo.type);
             String      title       = OfficeApplication.OfficeDocumentProxy.getTitle(resourceinfo.repository, resourceinfo.contentid);
             FormPreview formPreview = new FormPreview(url, false, title);
             formPreview.ShowDialog(this);
         }
         finally
         {
             if (name != null)
             {
                 OfficeApplication.OfficeDocumentProxy.deletePreview(name);
             }
         }
     }
 }
예제 #4
0
 private void toolStripButtonSee_Click(object sender, EventArgs e)
 {
     if (this.listView1.SelectedItems.Count > 0 && this.treeView1.SelectedNode != null && this.treeView1.SelectedNode is CategoryNode)
     {
         CategoryNode  category   = this.treeView1.SelectedNode as CategoryNode;
         ListViewItem  selected   = this.listView1.SelectedItems[0];
         ContentInfo   content    = selected.Tag as ContentInfo;
         string        repository = category.Repository.name;
         VersionInfo[] versions   = OfficeDocument.OfficeDocumentProxy.getVersions(category.Repository.name, content.id);
         VersionInfo   version    = versions[versions.Length - 1]; // last version
         String        name       = null;
         try
         {
             name = OfficeApplication.OfficeDocumentProxy.createPreview(repository, version.contentId, version.nameOfVersion, this.documentType.ToString());
             String urlproxy = OfficeApplication.OfficeDocumentProxy.WebAddress.ToString();
             if (!urlproxy.EndsWith("/gtw"))
             {
                 if (!urlproxy.EndsWith("/"))
                 {
                     urlproxy += "/";
                 }
                 if (!urlproxy.EndsWith("gtw"))
                 {
                     urlproxy += "gtw";
                 }
             }
             Uri         url         = new Uri(urlproxy + "?contentId=" + version.contentId + "&versionName=" + version.nameOfVersion + "&repositoryName=" + repository + "&name=" + name + "&type=" + documentType.ToString());
             String      title       = OfficeApplication.OfficeDocumentProxy.getTitle(repository, version.contentId);
             FormPreview formPreview = new FormPreview(url, false, title);
             formPreview.ShowDialog(this);
         }
         finally
         {
             if (name != null)
             {
                 OfficeApplication.OfficeDocumentProxy.deletePreview(name);
             }
         }
     }
 }
예제 #5
0
        private void toolStripButtonViewVersion_Click(object sender, EventArgs e)
        {
            if (this.listViewVersions.SelectedItems.Count > 0 && this.listViewVersions.SelectedItems[0].Tag is VersionInfo)
            {
                VersionInfo version = (VersionInfo)this.listViewVersions.SelectedItems[0].Tag;
                String      name    = null;
                try
                {
                    String type = document.DocumentType.ToString().ToLower();
                    name = OfficeApplication.OfficeDocumentProxy.createPreview(repositoryName, version.contentId, version.nameOfVersion, type);
                    String urlproxy = OfficeApplication.OfficeDocumentProxy.WebAddress.ToString();
                    if (!urlproxy.EndsWith("/gtw"))
                    {
                        if (!urlproxy.EndsWith("/"))
                        {
                            urlproxy += "/";
                        }
                        if (!urlproxy.EndsWith("gtw"))
                        {
                            urlproxy += "gtw";
                        }
                    }
                    Uri         url         = new Uri(urlproxy + "?contentId=" + version.contentId + "&versionName=" + version.nameOfVersion + "&repositoryName=" + repositoryName + "&name=" + name + "&type=" + type);
                    String      title       = OfficeApplication.OfficeDocumentProxy.getTitle(repositoryName, version.contentId);
                    FormPreview formPreview = new FormPreview(url, false, title);

                    formPreview.ShowDialog(this);
                }
                finally
                {
                    if (name != null)
                    {
                        OfficeApplication.OfficeDocumentProxy.deletePreview(name);
                    }
                }
            }
        }