Share Point

588 views

Published on

SetFocus SharePoint portfolio

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
588
On SlideShare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Share Point

  1. 1. SharePoint Portfolio Jim Bello [email_address] 610-954-0443
  2. 2. Table of Contents <ul><li>Introduction </li></ul><ul><li>Project Specification Overview </li></ul><ul><li>Projects Tasks - SP Admin - SP Development - SP Business Processes - SP Portals </li></ul>
  3. 3. Introduction <ul><li>This project is for a fictitious towing services company called ACME, Inc. </li></ul><ul><li>The project will design and establish a SharePoint application to support the company’s towing providers. </li></ul>
  4. 4. Project Specification Overview <ul><li>ACME Inc. is a large towing services company. </li></ul><ul><li>On their intranet they would like the ability to share sales decks amongst their sales personnel where a sales person may modify a sales presentation based off existing content. </li></ul><ul><li>They would also like to establish a shared calendar on their intranet site that would integrate into Outlook. </li></ul><ul><li>They would like to establish an area to publish a monthly news letter. A newsletter should be readable by anyone in the organization; it’s contributed by authors and reviewed/published by editors. </li></ul><ul><li>Lastly ACME would like to establish a shared area for contacts. Establish a contacts list utilizing a custom list and utilizing the Microsoft Application template for contact management. </li></ul>
  5. 5. Project Goals <ul><li>Create an intranet solution based on SharePoint Server 2007. </li></ul><ul><li>Branded with a unique design. </li></ul><ul><li>Shared calendar with integration into Outlook. </li></ul><ul><li>Shared are for contacts list utilizing Microsoft Application template for contact management. </li></ul><ul><li>Share sales decks amongst their sales people where a sales person may customize a presentation based off of existing content. </li></ul><ul><li>Monthly Newsletter CMS site implementing out of box workflow for approval process </li></ul><ul><li>A dashboard to display the total dollar amount of un-invoiced Purchase orders, Total dollar amount of unpaid invoices, Total PO amount that have been submitted. </li></ul><ul><li>Extend the solution to the Internet with sub-site creation for each provider. </li></ul>
  6. 6. SP Admin <ul><li>Objectives </li></ul><ul><li>Create a new Site Collection for Acme Inc. Solution Portal </li></ul><ul><li>A Solution Site Template </li></ul><ul><li>A Developer Knowledge Base </li></ul><ul><li>Enable SharePoint features to provide additional functionality to a site collection </li></ul><ul><li>Content Deployment </li></ul><ul><li>Configure SharePoint Services </li></ul><ul><li>Configure user groups and permissions </li></ul>
  7. 7. SP Development <ul><li>Objectives </li></ul><ul><li>Create custom metadata to track information about a solution </li></ul><ul><li>Setup the development environment to create and deploy solutions to the farm </li></ul><ul><li>Change the look and feel of the solution site </li></ul><ul><li>Create a content query Web Part to view all Solution list items </li></ul><ul><li>Create a custom Web Part to allow managers to create new SharePoint solution sites </li></ul><ul><li>Create a custom web part to view all Solution sites using SharePoint’s versions of GridView and DataSource controls </li></ul><ul><li>Create a Search Center </li></ul><ul><li>Modify the Advanced Search page to search by SiteTemplate column. </li></ul><ul><li>Use Search Web Parts to display helpful information on Solutions elsewhere in the Solution Portal </li></ul>
  8. 8. SP Business Processes <ul><li>Objectives </li></ul><ul><li>Create custom workflows using Visual Studio 2008 and SharePoint Designer </li></ul>
  9. 9. SP Portals <ul><li>Objective </li></ul><ul><li>Create a form and list that managers can use to submit Change Management requests for a solution. </li></ul><ul><li>Manage portals using Document and Record Centers </li></ul><ul><li>Control the layout of the portal using publishing features </li></ul>
  10. 10. Additional Project Content <ul><li>Created custom content including master pages, page layouts and custom search </li></ul><ul><li>Worked with the Business Data Catalog, used Excel Services and Forms Services </li></ul><ul><li>Worked with the Reporting Center, Information Management Policies and Dashboard with KPIs </li></ul>
  11. 11. Acme Branding Feature
  12. 12. ACME Home Page
  13. 13. Purchase Orders List
  14. 14. ACME Purchase Order InfoPath Form <ul><li>Custom form features </li></ul><ul><ul><li>Required fields enforced </li></ul></ul><ul><ul><li>Document name based on Ref Number + date + Last Name </li></ul></ul><ul><ul><li>States pulled from db </li></ul></ul><ul><ul><li>Venders info pulled from Vender list </li></ul></ul><ul><ul><li>Charge field value calculated from distance and Vender towing rate </li></ul></ul>
  15. 15. Invoice Forms List
  16. 16. ACME Invoice InfoPath Form <ul><li>Acme Invoice Form </li></ul><ul><ul><li>Required fields enforced </li></ul></ul><ul><ul><li>Document name based on Invoice Number + Invoice Date </li></ul></ul><ul><ul><li>Venders info pulled from Vender list </li></ul></ul>
  17. 17. Create Vender Webpart <ul><li>Create Vender Webpart </li></ul><ul><ul><li>Creates a new vender site using a custom site template </li></ul></ul><ul><ul><li>Creates an entry in the Vender list including a hyperlink to the site </li></ul></ul><ul><ul><li>Creates a table and controls through code behind </li></ul></ul>
  18. 18. Create Vender Webpart <ul><li>private HtmlTable CreateFormTable() </li></ul><ul><li>{ </li></ul><ul><li>HtmlTable table = new HtmlTable(); </li></ul><ul><li>table.Width = &quot;100%&quot;; // width set on page through webpart </li></ul><ul><li>#region Site Name Row </li></ul><ul><li>HtmlTableCell SiteNameCell = new HtmlTableCell(); </li></ul><ul><li>Literal SitetNameLiteral = new Literal(); </li></ul><ul><li>SitetNameLiteral.ID = &quot;SitetNameLiteral&quot;; </li></ul><ul><li>SiteNameCell.Width = &quot;30%&quot;; </li></ul><ul><li>SiteNameCell.Align = &quot;right&quot;; </li></ul><ul><li>SitetNameLiteral.Text = &quot;Site Name: &quot;; </li></ul><ul><li>SiteNameCell.Controls.Add(SitetNameLiteral); </li></ul><ul><li>HtmlTableCell SiteNameTextBoxCell = new HtmlTableCell(); </li></ul><ul><li>SiteNameTextBoxCell.Controls.Add(SitetNameTextBox); </li></ul><ul><li>HtmlTableRow SitetNameRow = new HtmlTableRow(); </li></ul><ul><li>SitetNameRow.Cells.Add(SiteNameCell); </li></ul><ul><li>SitetNameRow.Cells.Add(SiteNameTextBoxCell); </li></ul><ul><li>table.Rows.Add(SitetNameRow); </li></ul><ul><li>#endregion </li></ul><ul><li>#region Vender Description row </li></ul><ul><li>HtmlTableCell VenderDescriptionCell = new HtmlTableCell(); </li></ul><ul><li>Literal VenderDescriptionLiteral = new Literal(); </li></ul><ul><li>VenderDescriptionLiteral.ID = &quot;SiteDescriptionLiteral&quot;; </li></ul><ul><li>VenderDescriptionLiteral.Text = &quot;Descrtiption: &quot;; </li></ul><ul><li>VenderDescriptionCell.Align = &quot;right&quot;; </li></ul><ul><li>VenderDescriptionCell.Controls.Add(VenderDescriptionLiteral); </li></ul><ul><li>HtmlTableCell VenderDescriptionTextBoxCell = new HtmlTableCell(); </li></ul><ul><li>VenderDescriptionTextBoxCell.Controls.Add(SiteDescriptionTextBox); </li></ul><ul><li>HtmlTableRow SiteDescriptionRow = new HtmlTableRow(); </li></ul><ul><li>SiteDescriptionRow.Cells.Add(VenderDescriptionCell); </li></ul><ul><li>SiteDescriptionRow.Cells.Add(VenderDescriptionTextBoxCell); </li></ul><ul><li>table.Rows.Add(SiteDescriptionRow); </li></ul><ul><li>#endregion </li></ul><ul><li>#region Url Row </li></ul><ul><li>HtmlTableCell UrlCell = new HtmlTableCell(); </li></ul><ul><li>Literal UrlLiteral = new Literal(); </li></ul><ul><li>UrlLiteral.ID = &quot;UrlLiteral&quot;; </li></ul><ul><li>UrlLiteral.Text = &quot;Url: &quot;; </li></ul><ul><li>UrlCell.Align = &quot;right&quot;; </li></ul><ul><li>UrlCell.Controls.Add(UrlLiteral); </li></ul><ul><li>HtmlTableCell UrlTextBoxCell = new HtmlTableCell(); </li></ul><ul><li>UrlTextBoxCell.Controls.Add(UrlTextBox); </li></ul><ul><li>HtmlTableRow UrlRow = new HtmlTableRow(); </li></ul><ul><li>UrlRow.Cells.Add(UrlCell); </li></ul>
  19. 19. Create Vender Webpart (continued) <ul><li>#region Rate Row </li></ul><ul><li>HtmlTableCell RateCell = new HtmlTableCell(); </li></ul><ul><li>Literal RateLiteral = new Literal(); </li></ul><ul><li>RateLiteral.ID = &quot;RateLiteral&quot;; </li></ul><ul><li>RateLiteral.Text = &quot;Rate: &quot;; </li></ul><ul><li>RateCell.Align = &quot;right&quot;; </li></ul><ul><li>RateCell.Controls.Add(RateLiteral); </li></ul><ul><li>HtmlTableCell RateTextBoxCell = new HtmlTableCell(); </li></ul><ul><li>RateTextBoxCell.Controls.Add(RateTextBox); </li></ul><ul><li>HtmlTableRow RateRow = new HtmlTableRow(); </li></ul><ul><li>RateRow.Cells.Add(RateCell); </li></ul><ul><li>RateRow.Cells.Add(RateTextBoxCell); </li></ul><ul><li>table.Rows.Add(RateRow); </li></ul><ul><li>#endregion </li></ul><ul><li>#region Blank row </li></ul><ul><li>HtmlTableCell BlankCell1 = new HtmlTableCell(); </li></ul><ul><li>BlankCell1.ColSpan = 2; </li></ul><ul><li>Literal BlankLiteral = new Literal(); </li></ul><ul><li>BlankLiteral.ID = &quot;BlankLiteral&quot;; </li></ul><ul><li>BlankLiteral.Text = &quot; &quot;; </li></ul><ul><li>BlankCell1.Controls.Add(BlankLiteral); </li></ul><ul><li>HtmlTableRow BlankRow = new HtmlTableRow(); </li></ul><ul><li>BlankRow.Cells.Add(BlankCell1); </li></ul><ul><li>table.Rows.Add(BlankRow); </li></ul><ul><li>#endregion </li></ul><ul><li>#region Create Button </li></ul><ul><li>HtmlTableCell BlankCell2 = new HtmlTableCell(); </li></ul><ul><li>Literal BlankLiteral2 = new Literal(); </li></ul><ul><li>BlankLiteral2.ID = &quot;BlankLiteral2&quot;; </li></ul><ul><li>BlankLiteral2.Text = &quot; &quot;; </li></ul><ul><li>BlankCell2.Controls.Add(BlankLiteral2); </li></ul><ul><li>HtmlTableCell CreateSiteButtonCell = new HtmlTableCell(); </li></ul><ul><li>CreateSiteButtonCell.Controls.Add(CreateSiteButton); </li></ul><ul><li>HtmlTableRow CreateSiteButtonRow = new HtmlTableRow(); </li></ul><ul><li>CreateSiteButtonRow.Cells.Add(BlankCell2); </li></ul><ul><li>CreateSiteButtonRow.Cells.Add(CreateSiteButtonCell); </li></ul><ul><li>table.Rows.Add(CreateSiteButtonRow); </li></ul><ul><li>#endregion </li></ul><ul><li>return table; </li></ul><ul><li>} </li></ul>
  20. 20. Create Vender Webpart (continued) <ul><li>protected void CreateSiteButton_Click(object sender, EventArgs e) </li></ul><ul><li>{ </li></ul><ul><li>//// find our controls so we can work with them </li></ul><ul><li>TextBox SiteNameTextBox = (TextBox)FindControl(&quot;SiteNameTextBox&quot;); </li></ul><ul><li>TextBox SiteDescriptionTextBox = (TextBox)FindControl(&quot;SiteDescriptionTextBox&quot;); </li></ul><ul><li>TextBox UrlTextBox = (TextBox)FindControl(&quot;UrlTextBox&quot;); </li></ul><ul><li>DropDownList SiteTemplatesList = (DropDownList)FindControl(&quot;SiteTemplatesListBox&quot;); </li></ul><ul><li>CheckBox AllowUniquePermissionsCB = (CheckBox)FindControl(&quot;AllowUniquePermissionsCBBox&quot;); </li></ul><ul><li>Button CreateSiteButton = (Button)FindControl(&quot;CreateSiteButton&quot;); </li></ul><ul><li>if (SiteNameTextBox.Text == &quot;&quot;) </li></ul><ul><li>return; </li></ul><ul><li>// finally add the new site </li></ul><ul><li>SPWeb web = SPContext.Current.Web; </li></ul><ul><li>SPSite site = SPContext.Current.Site; </li></ul><ul><li>SPSecurity.CatchAccessDeniedException = false; </li></ul><ul><li>///* runs with admin privileges */ </li></ul><ul><li>//1033 is For English Locale </li></ul><ul><li>try </li></ul><ul><li>{ </li></ul><ul><li>// see what permissions a user has, normally we would check but we are running with </li></ul><ul><li>// an elevated permission set </li></ul><ul><li>// turn this off to test code below </li></ul><ul><li>SPWeb webInUserContext = SPContext.Current.Web; </li></ul><ul><li>SPSite SiteInUserContext = SPContext.Current.Site; </li></ul><ul><li>Guid webGuid = webInUserContext.ID; </li></ul><ul><li>Guid siteGuid = SiteInUserContext.ID; </li></ul><ul><li>SPWebTemplateCollection templates = </li></ul><ul><li> SiteInUserContext.GetCustomWebTemplates(1033); </li></ul><ul><li>SPWebTemplate template = </li></ul><ul><li>templates[&quot;vendersitetemplate.stp&quot;]; </li></ul><ul><li>SPSecurity.RunWithElevatedPrivileges(delegate() </li></ul><ul><li>{ </li></ul><ul><li>// get the site in impersonated context </li></ul><ul><li>using (SPSite siteElevated = new SPSite(siteGuid)) </li></ul><ul><li>{ </li></ul><ul><li>siteElevated.AllowUnsafeUpdates = true; </li></ul><ul><li>// get the web in the impersonated context </li></ul><ul><li>SPWeb webElevated = </li></ul><ul><li>siteElevated.OpenWeb(webGuid); </li></ul>
  21. 21. Create Vender Webpart (continued) <ul><li>SPWebCollection spSiteCol = webElevated.Webs; </li></ul><ul><li>webElevated.AllowUnsafeUpdates = true; </li></ul><ul><li>SPWeb newWeb = spSiteCol.Add(&quot;SiteDirectory/&quot; + </li></ul><ul><li> UrlTextBox.Text, SiteNameTextBox.Text, SiteDescriptionTextBox.Text, ((System.UInt32)(SPContext.Current.RegionalSettings.LocaleId)), &quot;vendersitetemplate.stp&quot;, false, false); </li></ul><ul><li>webElevated.Dispose(); </li></ul><ul><li>} </li></ul><ul><li>}); </li></ul><ul><li>SPList list = web.Lists[&quot;Vender List&quot;]; </li></ul><ul><li>SPFieldUrlValue url = new SPFieldUrlValue(); </li></ul><ul><li>url.Description = UrlTextBox.Text; </li></ul><ul><li>url.Url = SPContext.Current.Site + &quot;/SiteDirectory/&quot; + UrlTextBox.Text; </li></ul><ul><li>SPListItem item = list.Items.Add(); </li></ul><ul><li>item[&quot;Title&quot;] = SiteNameTextBox.Text; </li></ul><ul><li>item[&quot;Vender Name&quot;] = SiteNameTextBox.Text; </li></ul><ul><li>item[&quot;Vender Site&quot;] = &quot;http://dell2003srv/SiteDirectory/&quot; + UrlTextBox.Text + &quot;, &quot; + UrlTextBox.Text; </li></ul><ul><li>item[&quot;Towing Rate&quot;] = RateTextBox.Text; </li></ul><ul><li> item[&quot;Vender Description&quot;] = </li></ul><ul><li> SiteDescriptionTextBox.Text; </li></ul><ul><li>item.Update(); </li></ul><ul><li>SiteCreationResult = &quot;Success!&quot;; </li></ul><ul><li>} </li></ul><ul><li>catch (Exception ex) </li></ul><ul><li>{ </li></ul><ul><li>SiteCreationResult = ex.Message; </li></ul><ul><li>} </li></ul><ul><li>finally </li></ul><ul><li>{ </li></ul><ul><li>SPSecurity.CatchAccessDeniedException = true; </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  22. 22. Vender List
  23. 23. Purchase Order Workflow <ul><li>Simple Sequential Workflow </li></ul><ul><li>Visual Studio 2008 workflow </li></ul><ul><li>Copies the new PO to the PO list in the vender site PO list when form is submitted </li></ul>
  24. 24. Workflow Code <ul><li>public Guid workflowId = default(System.Guid); </li></ul><ul><li>public string errorMessage = string.Empty; </li></ul><ul><li>public SPWorkflowActivationProperties workflowProperties = new SPWorkflowActivationProperties(); </li></ul><ul><li>private void codeCopyDocToLib_ExecuteCode(object sender, EventArgs e) </li></ul><ul><li>{ </li></ul><ul><li>// Get the item the workflow is running on </li></ul><ul><li>SPListItem item = workflowProperties.Item; </li></ul><ul><li>string siteUrl = string.Empty; </li></ul><ul><li>try </li></ul><ul><li>{ </li></ul><ul><li>//Get the field that contains the vender name. </li></ul><ul><li>string name = item[&quot;Vender&quot;].ToString(); </li></ul><ul><li>// Set the name of the document library and site </li></ul><ul><li>// where to copy the document to </li></ul><ul><li>SPSite sourceSite = workflowProperties.Site; </li></ul><ul><li>SPWeb sourceWeb = sourceSite.OpenWeb(); </li></ul><ul><li>string[] urlArray = null; </li></ul><ul><li> SPList list = sourceWeb.Lists[&quot;Vender List&quot;]; </li></ul><ul><li>for (int i = 0; i < list.Items.Count; i++) </li></ul><ul><li>{ </li></ul><ul><li>SPListItem venderItem = list.Items[i]; </li></ul><ul><li>if (venderItem[&quot;Vender Name&quot;].ToString().Equals(name)) </li></ul><ul><li>{ </li></ul><ul><li>siteUrl = (String)venderItem[&quot;VenderRateURL&quot;]; </li></ul><ul><li>urlArray = siteUrl.Split(','); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>//string siteUrl = &quot;http://vm187:100/solutions/Test&quot;; </li></ul><ul><li>string libName = &quot;Purchase Orders&quot;; </li></ul><ul><li>if (siteUrl != null) </li></ul><ul><li>{ </li></ul><ul><li> siteUrl = urlArray[1]; // Open the site </li></ul><ul><li>using (SPSite site = new SPSite(siteUrl)) </li></ul><ul><li>{ </li></ul><ul><li>using (SPWeb web = site.OpenWeb()) </li></ul><ul><li>{ </li></ul><ul><li>if (item.File != null) </li></ul><ul><li>{ </li></ul><ul><li>// Copy the document to the library </li></ul><ul><li>SPFolder library = web.Folders[libName]; </li></ul><ul><li>library.Files.Add( </li></ul><ul><li>item.Name, item.File.OpenBinary()); </li></ul><ul><li>library.Update(); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>catch (Exception ex) </li></ul><ul><li>{ </li></ul><ul><li>errorMessage = ex.Message; </li></ul><ul><li>} </li></ul>

×