USEFUL PORTAL CUSTOMIZATIONS in .NET framework

Printing Data Matrix in .NET framework USEFUL PORTAL CUSTOMIZATIONS

USEFUL PORTAL CUSTOMIZATIONS
Data Matrix ECC200 Drawer In .NET Framework
Using Barcode printer for ASP.NET Control to generate, create Data Matrix ECC200 image in ASP.NET applications.
www.OnBarcode.com
Painting Barcode In .NET Framework
Using Barcode drawer for ASP.NET Control to generate, create Barcode image in ASP.NET applications.
www.OnBarcode.com
Listing 8.4 shows the code within our custom personalization provider which ensures that the personalization data is saved correctly, regardless of whether the user is editing or approving content updates.
Making Denso QR Bar Code In Visual Studio .NET
Using Barcode creation for ASP.NET Control to generate, create QR Code JIS X 0510 image in ASP.NET applications.
www.OnBarcode.com
Barcode Creation In .NET Framework
Using Barcode creation for ASP.NET Control to generate, create Barcode image in ASP.NET applications.
www.OnBarcode.com
Listing 8.4 Customizing the saving logic within our personalization provider allows us to route data to the correct path based upon the action that is being committed.
PDF 417 Drawer In .NET Framework
Using Barcode encoder for ASP.NET Control to generate, create PDF 417 image in ASP.NET applications.
www.OnBarcode.com
Printing Code128 In Visual Studio .NET
Using Barcode creator for ASP.NET Control to generate, create USS Code 128 image in ASP.NET applications.
www.OnBarcode.com
protected override void SavePersonalizationBlob( WebPartManager wpm, string path, string userName, byte[] dataBlob) { bool isRevisionPage = ((PortalWebPartManager)wpm).IsRevisionPage; if (((PortalWebPartManager)wpm).CommittingChanges) { base.SavePersonalizationBlob( wpm, path, userName, dataBlob); ResetPersonalizationBlob( wpm, path + "|revision", null); } else if (isRevisionPage) { base.SavePersonalizationBlob( wpm, path + "|revision", userName, dataBlob); } else { base.SavePersonalizationBlob( wpm, path, userName, dataBlob); } }
Data Matrix ECC200 Drawer In VS .NET
Using Barcode creator for ASP.NET Control to generate, create Data Matrix ECC200 image in ASP.NET applications.
www.OnBarcode.com
Making UPC E In .NET
Using Barcode generation for ASP.NET Control to generate, create Universal Product Code version E image in ASP.NET applications.
www.OnBarcode.com
Check to see whether the user is committing changes
DataMatrix Recognizer In .NET Framework
Using Barcode recognizer for .NET Control to read, scan read, scan image in VS .NET applications.
www.OnBarcode.com
Paint Data Matrix In Objective-C
Using Barcode drawer for iPad Control to generate, create Data Matrix image in iPad applications.
www.OnBarcode.com
Reset the second version of the content Otherwise, simply decide whether this is a revision copy
Paint Barcode In None
Using Barcode creator for Online Control to generate, create Barcode image in Online applications.
www.OnBarcode.com
Creating Barcode In None
Using Barcode printer for Software Control to generate, create Barcode image in Software applications.
www.OnBarcode.com
Notice there are three logic branches in the save method. The first branch checks the custom CommittingChanges property of our PortalWebPartManager to see if the user is committing changes; and if so, the content is saved against the public version of personalization data and the revision copy is cleared out. If the user is not committing changes, we check to see whether we are currently on the revision page or not to determine against which path the data is saved.
EAN / UCC - 14 Creation In Java
Using Barcode generator for Java Control to generate, create EAN 128 image in Java applications.
www.OnBarcode.com
Reading GTIN - 13 In Java
Using Barcode reader for Java Control to read, scan read, scan image in Java applications.
www.OnBarcode.com
VERSIONED PERSONALIZATION DATA
EAN 13 Encoder In None
Using Barcode creation for Office Excel Control to generate, create EAN-13 Supplement 5 image in Microsoft Excel applications.
www.OnBarcode.com
Create Barcode In Objective-C
Using Barcode creator for iPad Control to generate, create Barcode image in iPad applications.
www.OnBarcode.com
Allowing a user to commit changes You ve now seen all the code required to save and fetch revisions of personalization data. So now all we need to do is to create some user interface elements to allow users to kick off versioning operations. The Common Tasks area we created earlier in this chapter will be the ideal place to surface these operations. Since it s likely that users will be performing these versioning tasks regularly, we want to have this functionality clearly displayed. Figures 8.5 and 8.6 show the new items on the menu bar for managing content revisions. In figure 8.5 a Revise Content button has been added that the user can click to enter into a state where he may create new versions of the content. When the user clicks on the Revise Content button the view= edit querystring parameter is added to the URL of the page; this is how we determine that the page is in revision mode. When the page is in revision mode, the toolbar changes to the one shown in figure 8.6 and the text of the Revise Content button changes to End Revising Content. In addition, an Approve Content Changes button is visible so that the user can accept version changes made to the page. Because the appearance of the buttons we are adding to the Common Tasks menu changes based on the state of the page, we must add some code to the PreRender event just as we did in listing 8.1 when we changed the display of certain buttons based on specific criteria. The following snippet shows the code that must be added to the PreRender event to manage the state of the Revise Content buttons:
Encoding Barcode In Java
Using Barcode creator for Eclipse BIRT Control to generate, create Barcode image in BIRT applications.
www.OnBarcode.com
Barcode Maker In Visual Basic .NET
Using Barcode creation for .NET framework Control to generate, create Barcode image in .NET framework applications.
www.OnBarcode.com
this.lnkCreateRevision.Text = _wpm.IsRevisionPage "End Revising Content" : "Revise Content"; this.pnlApprove.Visible = _wpm.HasUnapprovedChanges && _wpm.IsRevisionPage;
Encoding GTIN - 128 In Java
Using Barcode generator for Java Control to generate, create EAN 128 image in Java applications.
www.OnBarcode.com
EAN / UCC - 13 Maker In Java
Using Barcode generator for Android Control to generate, create European Article Number 13 image in Android applications.
www.OnBarcode.com
Here we see how the text of the revision button is toggled between Revise Content and End Revising Content, based on whether the page is currently being viewed in its revised state. The second part of the code snippet responsible for setting the visibility of the Approve Content Changes button simply checks the two custom properties we
Figure 8.5 Actions displayed in Common Tasks area when the page is in its normal mode.
USEFUL PORTAL CUSTOMIZATIONS
Figure 8.6 Actions displayed in Common Tasks area when the page is in revision mode.
added to the WebPartManager to see whether the page has changes, and whether we are on the revision version of the page before displaying the Approve Content Changes button. The code which handles the click events of those buttons is also quite simple, as we see in listing 8.5.
Listing 8.5 The code for performing revision tasks is quite simple at the page level.
protected void lnkCreateRevision_Click(object sender, EventArgs e) { string url = Page.Request.Path; if (!_wpm.IsRevisionPage) { url += " view=edit"; } Response.Redirect(url); } protected void lnkApproveChanges_Click(object sender, EventArgs e) { _wpm.CommitChanges(); }
Clicking on the Create Revision button simply toggles the page between edit and normal views by either appending or removing the querystring parameter, which is what we can see in the first method shown in listing 8.5. The code for approving the convent revision is even more straightforward as we simply call through to our custom CommitChanges method on the WebPartManager, and the remainder of the work will be handled by the saving logic that we wrote in our personalization provider in listing 8.3. Before our solution is complete, we must add code to the load method of the page. This will set the display mode of the page to catalog mode if the user is viewing the revision page; and is similar to code that we ve written many times before, as seen in the following snippet:
if (_wpm.IsRevisionPage) { _wpm.DisplayMode = WebPartManager.CatalogDisplayMode; }
Copyright © OnBarcode.com . All rights reserved.