Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            ListViewItem item = listViewBrowse.SelectedItems[0];
            if (item != null)
            {
                ResultSetRowNode node = item.Tag as ResultSetRowNode;
                if (node != null)
                {
                    if (node.type.Contains("folder") == false)
                    {
                        // Create the reference for the node selected
                        Alfresco.AuthoringWebService.Store spacesStore2 = new Alfresco.AuthoringWebService.Store();
                        spacesStore2.scheme = Alfresco.AuthoringWebService.StoreEnum.workspace;
                        spacesStore2.address = "SpacesStore";

                        Alfresco.AuthoringWebService.Reference reference = new Alfresco.AuthoringWebService.Reference();
                        reference.store = spacesStore2;
                        reference.uuid = node.id;

                        // Lets try to check out
                        Alfresco.AuthoringWebService.Predicate predicate = new Alfresco.AuthoringWebService.Predicate();
                        predicate.Items = new Object[] { reference };
                        Alfresco.AuthoringWebService.ParentReference pr = new Alfresco.AuthoringWebService.ParentReference();
                        pr.store = spacesStore2; ;
                        pr.uuid = this.currentReference.uuid;
                        pr.associationType = Constants.ASSOC_CONTAINS;
                        pr.childName = Constants.createQNameString(Constants.NAMESPACE_CONTENT_MODEL, item.Text);
                        this.authoringService.checkout(predicate, pr);
                        int i = 0;

                    }
                    else
                    {

                    }
                }
            }
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            ListViewItem item = listViewBrowse.SelectedItems[0];

            if (item != null)
            {
                ResultSetRowNode node = item.Tag as ResultSetRowNode;
                if (node != null)
                {
                    if (node.type.Contains("folder") == false)
                    {
                        // Create the reference for the node selected
                        Alfresco.AuthoringWebService.Store spacesStore2 = new Alfresco.AuthoringWebService.Store();
                        spacesStore2.scheme  = Alfresco.AuthoringWebService.StoreEnum.workspace;
                        spacesStore2.address = "SpacesStore";

                        Alfresco.AuthoringWebService.Reference reference = new Alfresco.AuthoringWebService.Reference();
                        reference.store = spacesStore2;
                        reference.uuid  = node.id;

                        // Lets try to check out
                        Alfresco.AuthoringWebService.Predicate predicate = new Alfresco.AuthoringWebService.Predicate();
                        predicate.Items = new Object[] { reference };
                        Alfresco.AuthoringWebService.ParentReference pr = new Alfresco.AuthoringWebService.ParentReference();
                        pr.store           = spacesStore2;;
                        pr.uuid            = this.currentReference.uuid;
                        pr.associationType = Constants.ASSOC_CONTAINS;
                        pr.childName       = Constants.createQNameString(Constants.NAMESPACE_CONTENT_MODEL, item.Text);
                        this.authoringService.checkout(predicate, pr);
                        int i = 0;
                    }
                    else
                    {
                    }
                }
            }
        }
Esempio n. 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            Alfresco.RepositoryWebService.Store[] stores = this.repoService.getStores();

            Alfresco.RepositoryWebService.Store vStore = stores[3];

            ListViewItem item = listViewBrowse.SelectedItems[0];

            if (item != null)
            {
                ResultSetRowNode node = item.Tag as ResultSetRowNode;
                if (node != null)
                {
                    if (node.type.Contains("folder") == false)
                    {
                        // Create the reference for the node selected
                        Alfresco.AuthoringWebService.Store spacesStore2 = new Alfresco.AuthoringWebService.Store();
                        spacesStore2.scheme  = Alfresco.AuthoringWebService.StoreEnum.workspace;
                        spacesStore2.address = "SpacesStore";

                        Alfresco.AuthoringWebService.Reference reference = new Alfresco.AuthoringWebService.Reference();
                        reference.store = spacesStore2;
                        reference.uuid  = node.id;

                        VersionHistory VH = this.authoringService.getVersionHistory(reference);

                        int    i    = 0;
                        char[] temp = new char[1];
                        temp[0] = '0';
                        string versions = new string(temp);
                        Alfresco.AuthoringWebService.Version first;
                        foreach (Alfresco.AuthoringWebService.Version version in VH.versions)
                        {
                            if (i == 0)
                            {
                                first = version;
                            }
                            versions += version.label + (";") + version.id.uuid + (";");
                        }

                        {
                            // Create the reference for the node selected
                            Alfresco.ContentWebService.Store spacesStore3 = new Alfresco.ContentWebService.Store();
                            spacesStore3.scheme  = Alfresco.ContentWebService.StoreEnum.versionStore;
                            spacesStore3.address = vStore.address;

                            Alfresco.ContentWebService.Reference reference1 = new Alfresco.ContentWebService.Reference();
                            reference1.store = spacesStore3;
                            reference1.uuid  = VH.versions[VH.versions.GetUpperBound(0)].id.uuid;

                            // Lets try and get the content
                            Alfresco.ContentWebService.Predicate predicate = new Alfresco.ContentWebService.Predicate();
                            predicate.Items = new Object[] { reference1 };
                            Content[] contents = this.contentService.read(predicate, "{http://www.alfresco.org/model/content/1.0}content");
                            Content   content  = contents[0];
                            if (content.url != null && content.url.Length != 0)
                            {
                                string url = content.url + "?ticket=" + AuthenticationUtils.Ticket;
                                webBrowser.Url = new Uri(url);
                            }
                        }
                    }
                    else
                    {
                    }
                }
            }
        }
Esempio n. 4
0
        private void button2_Click(object sender, EventArgs e)
        {
            Alfresco.RepositoryWebService.Store[] stores = this.repoService.getStores();

            Alfresco.RepositoryWebService.Store vStore = stores[3];

            ListViewItem item = listViewBrowse.SelectedItems[0];
            if (item != null)
            {
                ResultSetRowNode node = item.Tag as ResultSetRowNode;
                if (node != null)
                {
                    if (node.type.Contains("folder") == false)
                    {
                        // Create the reference for the node selected
                        Alfresco.AuthoringWebService.Store spacesStore2 = new Alfresco.AuthoringWebService.Store();
                        spacesStore2.scheme = Alfresco.AuthoringWebService.StoreEnum.workspace;
                        spacesStore2.address = "SpacesStore";

                        Alfresco.AuthoringWebService.Reference reference = new Alfresco.AuthoringWebService.Reference();
                        reference.store = spacesStore2;
                        reference.uuid = node.id;

                        VersionHistory VH = this.authoringService.getVersionHistory(reference);

                        int i = 0;
                        char[] temp = new char[1];
                        temp[0] = '0';
                        string versions = new string(temp);
                        Alfresco.AuthoringWebService.Version first;
                        foreach (Alfresco.AuthoringWebService.Version version in VH.versions)
                        {
                            if (i == 0)
                                first = version;
                            versions += version.label + (";") + version.id.uuid + (";");
                        }

                        {
                            // Create the reference for the node selected
                            Alfresco.ContentWebService.Store spacesStore3 = new Alfresco.ContentWebService.Store();
                            spacesStore3.scheme = Alfresco.ContentWebService.StoreEnum.versionStore;
                            spacesStore3.address = vStore.address;

                            Alfresco.ContentWebService.Reference reference1 = new Alfresco.ContentWebService.Reference();
                            reference1.store = spacesStore3;
                            reference1.uuid = VH.versions[VH.versions.GetUpperBound(0)].id.uuid;

                            // Lets try and get the content
                            Alfresco.ContentWebService.Predicate predicate = new Alfresco.ContentWebService.Predicate();
                            predicate.Items = new Object[] { reference1 };
                            Content[] contents = this.contentService.read(predicate, "{http://www.alfresco.org/model/content/1.0}content");
                            Content content = contents[0];
                            if (content.url != null && content.url.Length != 0)
                            {
                                string url = content.url + "?ticket=" + AuthenticationUtils.Ticket;
                                webBrowser.Url = new Uri(url);
                            }

                        }

                    }
                    else
                    {

                    }
                }
            }
        }