/// <remarks/>
 public void checkInAsync(authentication authentication, identifier identifier, string comments)
 {
     this.checkInAsync(authentication, identifier, comments, null);
 }
 /// <remarks/>
 public void checkOutAsync(authentication authentication, identifier identifier)
 {
     this.checkOutAsync(authentication, identifier, null);
 }
 public operationResult checkIn(authentication authentication, identifier identifier, string comments)
 {
     object[] results = this.Invoke("checkIn", new object[] {
                 authentication,
                 identifier,
                 comments});
     return ((operationResult)(results[0]));
 }
 /// <remarks/>
 public void readWorkflowInformationAsync(authentication authentication, identifier identifier)
 {
     this.readWorkflowInformationAsync(authentication, identifier, null);
 }
        protected void Page_Load(object sender, EventArgs e)
        {   
            System.Web.UI.WebControls.Label label = new Label();
            
            // enclosing in try/catch for easier debugging, primarily
            try
            {
                // get a handle to the asset operation service
                proxy = new AssetOperationHandlerService();

                // contruct a path object referencing the 'about' page from the example.com site
                // note:  change this path to a page that actually exists in your cms instance, if necessary
                pagePath = new path();
                // set the relative path (from the Base Folder) to the asset
                pagePath.path1 = "/about";
                // set the site name of the path object (note: set siteName to 'Global' if the asset is not in a Site)
                pagePath.siteName = "example.com";
               
                // contruct asset identifier used for read() operation
                id = new identifier();
                // set the asset type
                id.type = entityTypeString.page;
                // set asset path (may use either path or id, but never both)
                id.path = pagePath;

                // contruct authentication element to be used in all operations
                auth = new authentication();
                // change username / password as necessary
                auth.username = "******";
                auth.password = "******";

                // attempt to read the asset
                result = proxy.read(auth, id);

                // print asset contents to page label
                label.Text = CascadeWSUtils.printAssetContents(result.asset);

                // edit the asset
                // create an empty asset for use with edit() operation
                // (note: this is assuming the authentication user has bypass workflow abilities --
                // if not, you will also need to supply workflowConfig information)
                asset editAsset = new asset();
                editAsset.page = result.asset.page;
                // add some content to the exiting page xhtml
                editAsset.page.xhtml += "<h1>Added via .NET</h1>";
                // must call this method to avoid sending both id and path values in 
                // component references in the asset -- will generate SOAP errors otherwise
                CascadeWSUtils.nullPageValues(editAsset.page);

                // attempt to edit
                operationResult editResult = proxy.edit(auth, editAsset);
                // check results
                label.Text += "<br/><br/>edit success? " + editResult.success + "<br/>message = " + editResult.message;


                // create new asset (using read asset as a model)
                asset newAsset = new asset();
                page newPage = result.asset.page;

                // must call this method to avoid sending both id and path values in 
                // component references in the asset -- will generate SOAP errors otherwise
                CascadeWSUtils.nullPageValues(newPage);

                // since this will be a new asset, change its name
                newPage.name = "new-page-created-via-dot-net";
                // remove id from read asset
                newPage.id = null;
                // remove other system properties brought over from read asset
                newPage.lastModifiedBy = null;
                newPage.lastModifiedDate = null;
                newPage.lastModifiedDateSpecified = false;
                newPage.lastPublishedBy = null;
                newPage.lastPublishedDate = null;
                newPage.lastPublishedDateSpecified = false;
                newPage.pageConfigurations = null;

                newAsset.page = newPage;

                // attempt to create
                createResult createResults = proxy.create(auth, newAsset);
                
                // check create results
                label.Text = label.Text + "<br/><br/>create success? " + createResults.success + "<br/>message = " + createResults.message;

                // debugging -- writes the serialzed XML of the asset element sent in create request to a file
                /*
                // Serializing the returned object
                System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(newAsset.GetType());

                System.IO.MemoryStream ms = new System.IO.MemoryStream();

                x.Serialize(ms, newAsset);

                ms.Position = 0;

                // Outputting to client

                byte[] byteArray = ms.ToArray();

                Response.Clear();
                Response.AddHeader("Content-Disposition", "attachment; filename=results.xml");

                Response.AddHeader("Content-Length", byteArray.Length.ToString());

                Response.ContentType = "text/xml";

                Response.BinaryWrite(byteArray);
                Response.End();
                 * */
            }
            catch (Exception booboo) { label.Text = "Exception thrown:<br>" + booboo.GetBaseException() + "<br/><br/>STACK TRACE:<br/>" + booboo.StackTrace; }

            WSContent.Controls.Add(label);
        }
 public operationResult move(authentication authentication, identifier identifier, moveParameters moveParameters, workflowconfiguration workflowConfiguration)
 {
     object[] results = this.Invoke("move", new object[] {
                 authentication,
                 identifier,
                 moveParameters,
                 workflowConfiguration});
     return ((operationResult)(results[0]));
 }
 /// <remarks/>
 public void moveAsync(authentication authentication, identifier identifier, moveParameters moveParameters, workflowconfiguration workflowConfiguration, object userState)
 {
     if ((this.moveOperationCompleted == null))
     {
         this.moveOperationCompleted = new System.Threading.SendOrPostCallback(this.OnmoveOperationCompleted);
     }
     this.InvokeAsync("move", new object[] {
                 authentication,
                 identifier,
                 moveParameters,
                 workflowConfiguration}, this.moveOperationCompleted, userState);
 }
 /// <remarks/>
 public void markMessageAsync(authentication authentication, identifier identifier, messagemarktype markType)
 {
     this.markMessageAsync(authentication, identifier, markType, null);
 }
 /// <remarks/>
 public void markMessageAsync(authentication authentication, identifier identifier, messagemarktype markType, object userState)
 {
     if ((this.markMessageOperationCompleted == null))
     {
         this.markMessageOperationCompleted = new System.Threading.SendOrPostCallback(this.OnmarkMessageOperationCompleted);
     }
     this.InvokeAsync("markMessage", new object[] {
                 authentication,
                 identifier,
                 markType}, this.markMessageOperationCompleted, userState);
 }
 /// <remarks/>
 public void readAccessRightsAsync(authentication authentication, identifier identifier)
 {
     this.readAccessRightsAsync(authentication, identifier, null);
 }
 public operationResult markMessage(authentication authentication, identifier identifier, messagemarktype markType)
 {
     object[] results = this.Invoke("markMessage", new object[] {
                 authentication,
                 identifier,
                 markType});
     return ((operationResult)(results[0]));
 }
 public readAccessRightsResult readAccessRights(authentication authentication, identifier identifier)
 {
     object[] results = this.Invoke("readAccessRights", new object[] {
                 authentication,
                 identifier});
     return ((readAccessRightsResult)(results[0]));
 }
 /// <remarks/>
 public void publishAsync(authentication authentication, identifier identifier)
 {
     this.publishAsync(authentication, identifier, null);
 }
 public operationResult publish(authentication authentication, identifier identifier)
 {
     object[] results = this.Invoke("publish", new object[] {
                 authentication,
                 identifier});
     return ((operationResult)(results[0]));
 }
 /// <remarks/>
 public void checkInAsync(authentication authentication, identifier identifier, string comments, object userState)
 {
     if ((this.checkInOperationCompleted == null))
     {
         this.checkInOperationCompleted = new System.Threading.SendOrPostCallback(this.OncheckInOperationCompleted);
     }
     this.InvokeAsync("checkIn", new object[] {
                 authentication,
                 identifier,
                 comments}, this.checkInOperationCompleted, userState);
 }
 public operationResult deleteMessage(authentication authentication, identifier identifier)
 {
     object[] results = this.Invoke("deleteMessage", new object[] {
                 authentication,
                 identifier});
     return ((operationResult)(results[0]));
 }
 /// <remarks/>
 public void copyAsync(authentication authentication, identifier identifier, copyParameters copyParameters, workflowconfiguration workflowConfiguration)
 {
     this.copyAsync(authentication, identifier, copyParameters, workflowConfiguration, null);
 }
 /// <remarks/>
 public void deleteMessageAsync(authentication authentication, identifier identifier)
 {
     this.deleteMessageAsync(authentication, identifier, null);
 }
 /// <remarks/>
 public void moveAsync(authentication authentication, identifier identifier, moveParameters moveParameters, workflowconfiguration workflowConfiguration)
 {
     this.moveAsync(authentication, identifier, moveParameters, workflowConfiguration, null);
 }
 /// <remarks/>
 public void deleteMessageAsync(authentication authentication, identifier identifier, object userState)
 {
     if ((this.deleteMessageOperationCompleted == null))
     {
         this.deleteMessageOperationCompleted = new System.Threading.SendOrPostCallback(this.OndeleteMessageOperationCompleted);
     }
     this.InvokeAsync("deleteMessage", new object[] {
                 authentication,
                 identifier}, this.deleteMessageOperationCompleted, userState);
 }
 public readWorkflowInformationResult readWorkflowInformation(authentication authentication, identifier identifier)
 {
     object[] results = this.Invoke("readWorkflowInformation", new object[] {
                 authentication,
                 identifier});
     return ((readWorkflowInformationResult)(results[0]));
 }
 public checkOutResult checkOut(authentication authentication, identifier identifier)
 {
     object[] results = this.Invoke("checkOut", new object[] {
                 authentication,
                 identifier});
     return ((checkOutResult)(results[0]));
 }
 /// <remarks/>
 public void readWorkflowInformationAsync(authentication authentication, identifier identifier, object userState)
 {
     if ((this.readWorkflowInformationOperationCompleted == null))
     {
         this.readWorkflowInformationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnreadWorkflowInformationOperationCompleted);
     }
     this.InvokeAsync("readWorkflowInformation", new object[] {
                 authentication,
                 identifier}, this.readWorkflowInformationOperationCompleted, userState);
 }
 /**
     * Nulls out unneeded values from an Identifier
     * 
     * @param i
     */
 private static void nullIdentifierValues(identifier i)
 {
     if (i.id != null && i.id != "")
         i.path = null;
 }