Results 1 to 4 of 4

Thread: Tips to collect all templates available on WSS and SharePoint Portal

  1. #1
    Join Date
    Nov 2009
    Posts
    117

    Tips to collect all templates available on WSS and SharePoint Portal

    Recently I've had to print, in my case in a ListBox, the list of available templates for Sharepoint Portal and Windows Sharepoint Service, as is the case in the file templatepick.aspx; to do so, the Sharepoint Object Model comes to us by providing the method GetWebTemplates () class SPVirtualServer.

    Code:
      SPGlobalAdmin SPGlobalAdmin admin = new ();
    
      uint lcid = (uint) System.Threading.Thread.CurrentThread.CurrentUICulture.LCID;
    
      SPWebTemplateCollection webTemplates admin.VirtualServers = [0]. GetWebTemplates (lcid);
    
      foreach (t in SPWebTemplate webTemplates)
    
      {
    
      list.Items.Add (new ListItem (t.Title, t.ID.ToString ()));
    
      }
    In my case I chose to print all of the template of the first virtual server, but nothing prevents me from cycling on the templates of all the virtual servers available.

  2. #2
    Join Date
    Nov 2009
    Posts
    117

    Add a link to the Quick Launch bar

    Windows Sharepoint Services 3.0 in the Quick Launch bar present in most of the site definition installed by default, has been enhanced with features that make it become a real navigation bar. Inside it, along with links to get the listings within the site, you can add new groups of elements, for creating a navigation structure. On a site already created, you can then link aggungere of custom, following the path: Actions> Site settings> lanuch bar (in the case of a site wss 3.0) or Actions> Site Settings> Modify All Site Settings> Navigation (in the case of a site with the features of Office SharePoint Server 2007 enabled).

  3. #3
    Join Date
    Nov 2009
    Posts
    117

    Add a link to the Quick Launch bar

    To add contrast, custom links to be added to the site directly to its creation, we insert the definition in the configuration file (Onet.xml) of the site definition that we choose to change or we have created. Simply insert a new element "NavBar" under the "Project / NavBars", to add elements to the site. The NavBar element represents the header of a group of links, each defined by a single element "NavBarLink.

    Code:
    <NavBar Name = "Peppe links" ID = "1028">
    
      <NavBarLink Name = "DotNet.it" url = "http://www.dotnet.it" />
    
      <NavBarLink Name = "Trophy.net" url = "http://www.trophy.net" />
    
      </ NavBar>
    The ID of each new element type NavBar, must be greater than 1027, which is the last value used for items in the quick launch bar present by default.
    In the above example, we created a new set of links, with a header and sub-elements. But nothing prevents us to directly insert a single element that represents NavBar itself a link to another page.

    Code:
      <NavBar Name = "DotNet.it" url = "http://www.dotnet.it" ID = "1029" />
    NB: It 's important to remember that to see these changes applied to a site definition, you need a IISRESET the machine and creating a site from scratch.

  4. #4
    Join Date
    Nov 2009
    Posts
    117

    Assign a task to the user "System Account"

    To use Workflow Foundation Sharepoint 2007 sites in the use of task is fundamental to advancing the workflow on the individual items in a list. Each task can be assigned to a user or group populating the AssignedTo property class SPWorkflowTaskProperties (to assign the task to a group, you only need to write the name of that group). But if we create the task to run automatically, how can we do to assign those tasks the user to SharePoint service, the user "System Account"?
    Here's how:

    Code:
      public SPWorkflowTaskProperties taskProps SPWorkflowTaskProperties = new ();
    
      public Guid taskId = default (Guid);
    
    
      private void CreateTask (object sender, EventArgs e)
    
      {
    
      Guid.NewGuid taskId = ();            
    
      taskProps.Title = "Task Title";
    
      taskProps.AssignedTo = @ "SHAREPOINT \ system";
    
      taskProps.SendEmailNotification = false;
    
      }
    Further customization could then be to assign the task a infopath form to print on screen the word "Autamatic task", so that this task can not be modified graphically, but only from code running from our workflow.

Similar Threads

  1. Tips to Collect Flags and Make Cappers Rage in Tribes: Ascend
    By Computer_Freak in forum Tips & Tweaks
    Replies: 10
    Last Post: 19-04-2012, 07:02 PM
  2. Error: "An error has occurred in the portal site" on Sharepoint
    By Bol-Bacchan in forum Windows Software
    Replies: 4
    Last Post: 07-02-2011, 04:18 AM
  3. Sharepoint Tips for adding items in List
    By Leoniee in forum Tips & Tweaks
    Replies: 2
    Last Post: 01-02-2011, 07:54 AM
  4. Replies: 4
    Last Post: 26-11-2010, 01:42 AM
  5. how sharepoint uses the index on Portal server
    By Saaarc in forum Software Development
    Replies: 3
    Last Post: 04-08-2009, 08:39 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,710,828,922.87553 seconds with 16 queries