IntroductionFeatures in Sharepoint is the paradigm set by Microsoft to make passage of solutions developed in Visual Studio, if prentende use and development control to measure the functionality by default. To accomplish our solution used the following solutions: DLLs to support the development can be found where Sharepoint is installed by default in the C: \ Program Files \ Common Files \ Microsoft Shared \ web server extensions \ 12 \ ISAPI "with the names: - Micrsoft.SharePoint.dll
- Micrsoft.SharePoint.Publishing.dll
We created a Solution with the WSP Builder template and select the "Feature with receiver"and created the structure as shown in the image shown below. Feature ExampleFeature.xml Its function define the formant of the solution to add the Sharepoint and has defined a set of methods and files to support our solution. Elements.xml File support Feature.xml where he is set to pass the pages Name: Name of the module where you define the page to copy to the site in Sharepoint mode Ghost *.
URL: Listing the Document Library where the pages will be added and updated.
RootWebOnly: this property has as its limit the copies of the root page of the Site in SharePoint.
Path: Feature Folder where the page to pass the copy to the SharePoint Site. *- GhostTableInLibrary are files that are in the hive and FileSystem "12" which is reflected in the pages of site in Sharepoint support in future updates using Features, any changes made with the Sharepoint Designer UnGhosted the pages are not being updated with possible future upgrades Features of. FeatureCode Exemplo.CS Class Feature Activation of the page where we define "PageBoasVinda.aspx" as the first page access. class Example: SPFeatureReceiver
(
public override void FeatureActivated (SPFeatureReceiverProperties properties)
(
SPSecurity.RunWithElevatedPrivileges (delegate ()
(
if (properties! = null)
(
SPSite site = properties.Feature.Parent the SPSite;
SPWeb web = site.RootWeb;
PublishingWeb pubWeb = PublishingWeb.GetPublishingWeb (web);
if (web.GetFile (String.Concat (pubWeb.PagesList.RootFolder.Url, "/ PageBoasVindas.aspx")). Exists)
(
SPFile homePageFile web.GetFile = (String.Concat (pubWeb.PagesList.RootFolder.Url, "/ PageBoasVindas.aspx"));
pubWeb.DefaultPage = homePageFile;
pubWeb.Update ();
)
)
));
) Installing the WSP solution and Installation of Feature in SharePoint siteStep 1 Step 2 Step 3 After activating the Feature page "PageBoasVindas.aspx" will be copied to the "Document Library Pages"and is defined as the first page to access the area. Whenever they need to make changes in Page, can change its content in Visual Studio and to upgrade the solution through this application a simple way. Note:The last two screen shots are in different language,its just sample only |