c# create 2d barcode Exercise 15-2. Improving the Site: Step 1 in Font

Generate Data Matrix in Font Exercise 15-2. Improving the Site: Step 1

Exercise 15-2. Improving the Site: Step 1
DataMatrix Drawer In None
Using Barcode creation for Font Control to generate, create DataMatrix image in Font applications.
www.OnBarcode.com
Data Matrix ECC200 Generator In None
Using Barcode maker for Font Control to generate, create Data Matrix ECC200 image in Font applications.
www.OnBarcode.com
In this exercise, you will add to your site definition and make it easier to implement the EmpireTimes solution. 1. Open the onet file. Inside the Configuration Id="1" element, add a new child element: <ExecuteUrl Url="_layouts/settings.aspx"/> This addition makes sure that when we create a new site, we automatically end up on the Site Settings page of the new site. However, this works only for sites created from an existing site, in other words, from the Create page. If you create a new site collection from the Central Administration web site, you still get sent to the root URL of the new site collection. We can make this a bit better, however. In 6, we looked at the UseRootFolderForNavigation property of the list template element. This property relied on the WelcomePage property of the folder for a list. If that property is set, links to the root of the list in other words, http://lab-s02:10000/lists/News will go to the address stored in WelcomePage instead of the default view for the list. It turns out that we can use this property on the root folder as well. You can test this by setting the WelcomePage property using SharePoint Manager. Look at Figure 15-3. The effect is that going to the root of the site, as in http://lab-s02:10000/, will send the user to the welcome page instead of the normal default.aspx.
PDF417 Drawer In None
Using Barcode drawer for Font Control to generate, create PDF 417 image in Font applications.
www.OnBarcode.com
European Article Number 13 Creation In None
Using Barcode printer for Font Control to generate, create European Article Number 13 image in Font applications.
www.OnBarcode.com
CHAPTER 15 OUR EMPIRE UNITED
Code 3/9 Encoder In None
Using Barcode maker for Font Control to generate, create ANSI/AIM Code 39 image in Font applications.
www.OnBarcode.com
Make Barcode In None
Using Barcode creator for Font Control to generate, create Barcode image in Font applications.
www.OnBarcode.com
Figure 15-3. WelcomePage property of root folder Let s set this property to a custom page as part of our setup. 2. In the FeatureAdded method in your TimesSetup.cs class, add the following piece of code: // Set custom home page SPFolder root = web.RootFolder; root.WelcomePage = "categories.aspx"; root.Update(); It s not perfect, but it s better than nothing. We still need a better way of activating features so we do not have to remember the correct order or risk problems related to missing features. 3. In your EmpireTimes solution, add a new Feature with Receiver item. Make it web scoped, and name it something like TimesSetup. As usual, remove all the throw new Exception lines from the methods in TimesSetup.cs. 4. In the FeatureActivated method of the TimesSetup.cs file, add the following code: SPWeb web = (SPWeb)properties.Feature.Parent; Guid g; g = new Guid("[FEATURE GUID OF TimesArticleCategoriesList]"); web.Features.Add(g);
Encode QR Code In None
Using Barcode maker for Font Control to generate, create QR Code 2d barcode image in Font applications.
www.OnBarcode.com
Paint Intelligent Mail In None
Using Barcode encoder for Font Control to generate, create OneCode image in Font applications.
www.OnBarcode.com
CHAPTER 15 OUR EMPIRE UNITED
Data Matrix Creator In Objective-C
Using Barcode creation for iPhone Control to generate, create Data Matrix image in iPhone applications.
www.OnBarcode.com
Printing Data Matrix ECC200 In None
Using Barcode generator for Font Control to generate, create Data Matrix ECC200 image in Font applications.
www.OnBarcode.com
g = new Guid("[FEATURE GUID web.Site.Features.Add(g); g = new Guid("[FEATURE GUID web.Site.Features.Add(g); g = new Guid("[FEATURE GUID web.Features.Add(g); g = new Guid("[FEATURE GUID web.Features.Add(g);
Code 39 Full ASCII Maker In Java
Using Barcode encoder for Java Control to generate, create Code39 image in Java applications.
www.OnBarcode.com
Printing USS-128 In Java
Using Barcode maker for BIRT reports Control to generate, create EAN / UCC - 13 image in BIRT reports applications.
www.OnBarcode.com
OF TimesSiteColumns]"); OF TimesContentTypes]"); OF TimesLists]"); OF TimesCategoryPage]");
Data Matrix 2d Barcode Printer In None
Using Barcode creation for Software Control to generate, create Data Matrix ECC200 image in Software applications.
www.OnBarcode.com
Drawing Code 3 Of 9 In Objective-C
Using Barcode creator for iPad Control to generate, create Code 39 Extended image in iPad applications.
www.OnBarcode.com
Replace the string in the GUID constructors with the feature ID of the respective features. OK, this at least ensures that we get our features activated in order. Now all we need to do is activate the single TimesSetup feature, and all should be well.
Data Matrix Printer In None
Using Barcode generation for Microsoft Excel Control to generate, create ECC200 image in Excel applications.
www.OnBarcode.com
Barcode Drawer In .NET
Using Barcode encoder for Reporting Service Control to generate, create Barcode image in Reporting Service applications.
www.OnBarcode.com
In the previous exercise, we made a few improvements so that most of our setup is now done semi-automatically. First, we made sure that when a new site is created from within the site collection, we are sent to the Site Settings page to complete the setup of features and other features. Second, we set the WelcomePage property to a custom page. You can, of course, set this to any page, but note that the address is relative to the current site. With a complex feature dependency scheme like the one we have in our solution, the built-in activation dependencies will not work. One important reason why activation dependencies will not help is that one of the site-scoped features, the fields feature, depends on a web-scoped feature, specifically, the Article category list feature. Site-scoped features cannot depend on web-scoped features. And even if activation dependencies did work, you will only be warned that you need to activate other features first. The dependee features will not get activated when a depending feature is activated. We need to either activate manually or write code as we have done here. Still, our solution is not elegant or flexible. If you add new features, you need to build and deploy a new assembly. If you change the order of activation, you need to build and deploy the new assembly. These issues, however, can be overcome, for example, by reading the order of features from a config file. I will leave that as an exercise for you, because we have more pressing matters that require our attention. At this point, we have a site that resembles Figure 15-4 after we have created a new site collection and hit the Activate button on the TimesSetup feature.
EAN 13 Creator In Objective-C
Using Barcode printer for iPhone Control to generate, create EAN13 image in iPhone applications.
www.OnBarcode.com
Barcode Printer In Objective-C
Using Barcode encoder for iPhone Control to generate, create Barcode image in iPhone applications.
www.OnBarcode.com
QR Generator In Java
Using Barcode generation for Java Control to generate, create QR Code ISO/IEC18004 image in Java applications.
www.OnBarcode.com
Barcode Drawer In VB.NET
Using Barcode encoder for .NET framework Control to generate, create Barcode image in .NET applications.
www.OnBarcode.com
Copyright © OnBarcode.com . All rights reserved.