Grounding.co.za

Technology information for IT specialists
Welcome to Grounding.co.za Sign in | Join | Help
in Search

Tech Talk with Brett Maytom

  • Certification from an trainer, tech lead and employer perspective

    I thought I will post my views on certification as this discussion comes up often within forums, casual chats and comments I see scattered over the web. I have been in the industry for 21 years and have been in-and-out of the training game since the start. I would hope to think that I understand the IT training game and how learners learn.  As a certified trainer I will promote certification as it continues the learning after the course.

    As an employee looking for a job, my certifications have definitely opened doors for me and got interviews.  I have not landed every job offer as there are brighter people and better suited people than myself.  When I wrote each exam, I studied hard giving me more confidence in the technology. What I found quite interesting in some “technical interviews” the person interviewing me was actually quite weak … and allowed me to have a bit of “fun” by asking them on how they use or plan to use the technology. The interviewer suddenly became the interviewee.

    I have also sat on the side of the employer and have had to hire several technical resources for the company or project. I have had to advertise and do the whole process myself and also have worked through many recruitment agencies.  On a few occasions I have been completely inundated with tons of applicants where I could not actually cope with the response,  one that springs to mind is I had 327 applicants for a C# .NET developer.

    As a employer and tech lead here are some random points on the topic of certification

    • When I come across individuals that have taken certification, it shows the person is a bit more serious about his/her career and willing to go the extra mile. I will also look at how long the person has being doing certifications for and how recent their certification is.
    • A person that has actually studied for an exam has a good broad understanding of a topic and as a tech lead I can work with this base understanding. 
    • I do acknowledge that on any certification there are areas were a person will have more experience and exposure to than other areas.
    • The certification indicates the person has a bit of passion to the technology. 
    • Certified people that have studied and used the technology are normally very confident in their own skill and knowledge base.
    • Having no certification does not mean a person is good, their experience and work history are vital.  I have hired many uncertified geeks over certified people. These individuals however had experience that really stuck out when going through the resumes.
    • Certification does not mean the person is good either, I have come across many individuals that have used brain dumps to pass and have no clue to technology. Looking at when they certified and what they have been doing since the certification gives some indication.
    • I use technical interviews to filter out the brain dumpers who are trying their luck. 
    • As a technical interviewer, it is really easy to pick out good and bad people within the first set of questions.  I start out with some really easy general questions and progress into more technical and specific questions.  Finally I push the boundaries of the person with serious geeky questions to find the persons range of knowledge. 
    • My questions cannot be found from brain dumps as they are adaptive and if I am not sure about the persons skill the more questions I ask.
    • A certification means the person has been exposed to a set level of technologies and features of a product.
    • I will not hire just based on certification, experience and technology exposure also play a huge part.  I always conduct technical interviews with the short listed candidates.
    • Should I be faced with two candidates that are equal in skill, have similar levels of experience and both will fit into the team.  I will pick the certified person over the non certified person.
    • The certification is definitely a foot in the door.  When faced with heaps of resumes the certified applicants do stick out a bit more and make me look twice. 

    For me the certification opens the door and gives you a slightly better edge over other people.  It does not guarantee the position, but it gives you the opportunity to showcase yourself.

    My recommendation … get certified as it does help you.

  • Why not to develop Monolithic applications

    Over the past two decades I have learnt a hell of a lot when it comes to different architectures and designs; also what things work and where things do not.  I have had a heap of failures in varying degrees from “oops, here is the fix”  to “Please don’t axe me”.  One of failures was the development of a Monolithic application and the mother of all ….

    As one progresses in the developer career, ones experience increases and exposure to multiple systems within a organisation grows.  Very quickly commonality, duplication between these systems are uncovered.  The business processes start to look long and lengthy as a lot of duplicate work is done, often with tons of manual effort and bureaucracy.

    As the problem domain is investigated, common grounds between systems look even more simple. There are shared processes, shared data, common workflows. Eventually the appeal to develop a single system for the organisation is made;  the one system to rule all systems.  Teams are formed and the product idea sold through the organisation.

    Benefits

    There are a lot of appeals for a single and central system

    • A single and centralised data store
    • Only one truth of the data
    • No data duplication
    • Single technology stack so it is easy for developers to maintain
    • Inefficient business processes can be reengineered
    • The new system better models the organisation and more accurately
    • Lowered support base as there are fewer systems to support
    • System integration is easier as it is one system with a few external data links
    • Management reporting is easier across systems as there is a single data store to pull data form
    • A single architecture
    • A single developer framework and toolset
    • Central collaboration and user interfaces
    • Easier for users to learn the system
    • A single security system that is easily to maintain
    • Portal facilitated with central user access
    • A consistent look and feel that promotes the company brand.
    • Unified information, data, security, application, system architectures.

    My experience

    Well this happened to me,  I worked for a large international that had 45 small(ish) systems that were all independent.  Each one with a 25-60% functional overlap.  There was a lot of maintenance on each system and each had bug lists that went on for miles.  Users were frustrated with the system to no end.   These systems were just impacting the business too much causing the production support and development teams to run around like headless chickens.  As a lead architect, I spotted the common grounds of all applications; I saw they were all divisions needs and each integrated.  I saw a “big picture” of how they could all fit into a single system.  I was given the go-ahead to explore and prototype the idea with a team of really great guys.  We hashed out some prototypes, designed the architecture across the different architecture domains.  We use the latest technologies and best practices we could find.  Finally external “experts” were brought in to verify the designs and help minimise the risk to the business. This was going to be multi-million dollar project and we needed to get it right.  Everyone gave the green light and “Mother” was born.

    Development and testing went fairly smoothly and we did have our fair share of challenges along the way.  There were several scope changes as business thought through their processes.  The project took 2 years to develop with a team of 30 techs.  We had a successful system and business was happy.

    The first year of the project was bliss and we enhanced the system with new features and stabilised others.   

    The bad

    Building a monolithic application is not easy, and through the eagerness and passion of everyone to make it work we did not see some tell tale signs.

    • When we embarked on the process, the organisations business processes were distorted due to the way the had to do their work.  The complexity was high and no one really understood the real complexity of getting a mature business process model in place.  This lead to a significant amount of scope changes.
    • During the process there was a fair amount of red-tape to cut through as previous processes forced people to protect themselves so they could not be blamed for errors.  Figuring out real process versus “cover your butt” processes was a challenge.
    • There was a fair amount of politics as no one really understood the process, but everyone wanted to control it.
    • The business analysts, architects and designers had a tremendous challenge of fitting in new scope changes or stripping out ineffective ones.  There was a lot of balancing that needed to be done as one change rippled through the system.

    The team did not really notice many of these tell-tale signs and wet ahead regardless; we took many of the issues in our stride and attributed them to “scope change” and refactoring.

    The ugly

    There is a really horrible side of monolithic applications, these things are real enterprise killers.  These “uglies'” only surfaced well after the project was deployed and into our second year live.

    Staff skill

    After the project completed, the contractors had all left and we were left with a handful of staff.  Some of these developers worked on “Mother” and others were pulled into other projects and lost their knowledge of the system.  Then we had some resignations and core staff left for greener pastures, new people came in.  The original vision and designs became vague to some and wrong interpretations were made.  Early after the project I was moved to another area and not actively involved in the maintenance

    Change management

    In the first couple of months after implementing the monolithic the world is ideal, the bugs are ironed out and the world is beautiful. The business starts implementing more and more features into the system and the designs handle these changes.

    Eventually features are added that start changing the data structures and dependencies of information, these changes start affecting other changes which need to be revisited. Changes no longer become quick and simple; and result in a lot of side affects brining down the system. Many change issues were also due to new team members misinterpreting the system and requirement.

    Complexity

    As the system was large and feature rich, newer staff were not aware of all the functionality and thought many new features needed to be developed from scratch, where many where there in the first place but only hidden.  The system grew arms and legs with other weird bits too.  The perfect little system soon became a monster.

    Due to the number of features a change impacts, the sheer manpower needed to implement the change becomes enormous.  A somewhat simple change touched many areas needing refactoring and extensive testing through the change control process.   The team simply was not able to respond fast enough to business demands.

    Users became frustrated as an unrelated new feature, meant they should re-do their User Acceptance Testing for something another team in another area of the system needed, but they were affected.  To this add typical corporate politics and you have a nightmare on your hands.

    In many cases the business areas were affected, it also affected collaboration and reporting making the change huge.

    Business agility

    The biggest downside to a monolithic systems is that all new features need to be integrated with the monolithic system, new smaller systems cannot be procured to fulfil a specific role .. they were not integrated. 

    Changes to the system took long and the team was not able to respond fast enough to business demand.

    Have to code

    Having a home grown system yields a lot of control in the development team and IT management and may have its attractions. Introducing new features will require the team to hand write the feature as not to break the monolithic pattern. A quick fix and procurement of a vendor system breaks the architecture, thus the features have to be internally written.  Resulting in time and money.

    Resistance is futile

    As time progresses, smaller solutions are purchased to fulfil a specific need. Management look at the cost benefit of implementing a new purchased system versus an integrated home grown solution, the pain of change management, In dealing with issues, management need the quickest route to resolve the crisis and a system is introduced.

    The developer team slowly changed and new developers started making their own “interpretations” and “improvements” to the architecture and in some cases areas were re-written.  The monolithic architecture slowly started breaking down and the team was starting to head back to square one.

    This pattern occurs a few times and within a few years the team is back to having many smaller systems, thus defeating the original idea in the first place. It is pretty much what the Borg say in Star Trek ... “Resistance is futile”

    Alternatives

    Investigate your application architecture and adopt multiple smaller systems, of which many can be vendor supplied and others home grown.

    Attempt to create a “plug-and-play’ system architecture, allowing functional systems to be changed with relative ease.

    Independent systems should expose services allowing multiple systems to communicate with each other through some enterprise workflow or orchestration.  Making smaller service exposed systems using a Service Oriented Architecture is far more beneficial.  However the path of SOA is also a tricky minefield to navigate .. I feel a blog topic coming on.

    Focus the development teams energy in building (or procuring) an integration framework that acknowledges the system independence, but supports integration. This will require building interfaces to systems that do not have interfaces.

    As the team and integration framework matures, adding new systems becomes easy. All new systems pose challenges but nothing that can be overcome. A key “buy” decision on any new system is does it have an API, or a service infrastructure to integrate with.

  • I am on Twitter @brettmaytom

    The guys at Readify have finally convinced me to get onto twitter and I have been for the last two weeks.  Fair, I can get the hang of this and I have found benefit in it already.  Catch me @brettmaytom

    Posted Apr 20 2009, 02:24 AM by Brett with no comments
    Filed under: ,
  • Windows 7, Visual Studio and Web Development Error

    Two months ago I decided to upgrade to Windows 7 x64 (Beta build 7000) on my XPS M1730.  Although I have had driver related issues I can report that I am completely satisfied with the change.  There are a few little annoyances that I have come across and this one keeps catching me.

    When developing any web based application in Visual Studio 2008, be it ASP.NET, MVC, WCF, Web Services or Web Applications. I get the following symptoms and errors when debugging the application

    After starting to debug an instance of the browser (IE 8) shows up and freezes then I get an error in the IDE.  “Unable to start program ‘http://localhost:{port}’.” and “Element not found.” as shown below:

    image

    When this happens, you will need to do the following in order (don’t ask me why this baffles me)

    • You have to click ok to remove the error
    • Stop the ASP.NET Development Server
    • Kill the iexplorer.exe in Windows Task manager

    If you do this and debug your application it works fine and you can debug.   However should make changes to your code and debug it again the symptoms reappear.

    Temporary Solution

    Run Visual Studio as Administrator and the problem goes away.

    image

  • SharePoint - Creating a Solution Manifest

    Provisioning a solution to a SharePoint server can be done using several methods, however the only correct methods are to use templates and solution packages.  In my series of posts on provisioning, discussed the relevance of provisioning, if this is your first article you are reading, I would suggest looking at Overview of features, templates, site definitions, solutions in SharePoint and SharePoint - Overview to creating a Solution Package.

    Now, remember WSS is a powerful provisioning engine and is geared up to deploy web sites and components.  These can be deployed to a single or multiple servers in a web farm with ease.  Provisioning is easy once you get to grips with the WSS provisioning engine, the most important thing is follow the rules and you will not have issues deploying to SharePoint.  I strongly urge you to master this deployment mechanism especially solutions and solution packages, it is not conventional deployment as it is geared to SharePoint. 

    After you have created the content of your new SharePoint functionality, that is features, web parts, assemblies, pages, resources etc; you will have to register them into a solution manifest file.  The manifest file is an xml file that follows the CAML schema and has a <Solution...> root element.  When the solution is deployed using a package, SharePoint will open up the .wsp file looking for this solution manifest.  It will then proceed to extract and register everything in the solution manifest.

    The basic schema of a solution manifest

    <Solution
      DeploymentServerType = "ApplicationServer"
      ResetWebServer = "TRUE"
      SolutionId = "GUID">
      <ApplicationResourceFiles />
      <Assemblies />
      <CodeAccessSecurity />
      <DwpFiles />
      <FeatureManifests />
      <Resources />
      <SiteDefinitionManifests />
      <RootFiles />
      <TemplateFiles />
    </Solution>

    The attributes are

    DeploymentServerType
     

    Optional.  Default=WebFrontEnd.  This attribute indicates the target of your solution to either a web front end server (WebFrontEnd) or an application server (ApplicationServer).

    ResetWebServer
      Optional.  Default=FALSE.  Indicates a boolean value whether the web server needs to be reset after the solution is deployed.
    SolutionId
      Required.  A globally unique identifier that should be created for the solution.  Each solution should have its own unique GUID.

    What can be deployed using a solution manifest

    Application Resource Files

    In order to globalise your solution and templates, you will need to create resource files for each localised language.  These resource files should be placed into the 12\Resources directory.  Using a solution, you will be able to deploy these resources files.

    Note that the resorce files are globally available to the entire application across different servers and web applications.

    The basic schema for the  ApplicationResourceFiles element is shown below

    <ApplicationResourceFiles>
      <ApplicationResourceFile Location="Text"/>
      .
      .
    </ApplicationResourceFiles>
    Assemblies
     

    The most useful thing about a solution is that it can deploy your assemblies into either the local bin folder of a site that uses the assembly or it can register the assembly in the Global Assembly Cache (GAC).   Now for the infomercial, "However when you buy into this concept; the provisioning engine will allow you to automatically register these assemblies as SafeControls ... absolutely for free" .   It is simply done by putting a <SafeControl> element in the manifest and it will be done.

    Again this will be deployed onto all servers in a web farm making your assembly available on all servers, and automatically registered in all servers web.config files.

    The basic schema for the  Assemblies element is shown below

    <Assemblies>
      <Assembly
        DeploymentTarget = "GlobalAssemblyCache"
        Location = "Text">
        <SafeControls>
          <SafeControl
            Assembly = "Text"
            Namespace = "Text"
            Safe = "TRUE"
            TypeName = "Text"/>
          ...
        </SafeControls>
        <ClassResources>
          <ClassResource
             FileName = "Text"
             Location = "Text">
          </ClassResource>
          ...
        </ClassResources>
      </Assembly>
      .
      .
    </Assemblies>
    Code Access Security
     

    By default, assemblies deployed into the bin folder are sandboxed with a very restrictive trust level.  You will need to define the appropriate trust level of your assembly especially if you access local resources or play with the WSS object model.  Should you not do this your assembly will fail in a production environment.

    The basic schema for the  CodeAccessSecurity element is shown below

    <CodeAccessSecurity>
      <PolicyItem>
        <PermissionSet ....
          ...
        </PermissionSet>
        <Assemblies>
          <Assembly ...
           ...
        </Assemblies>
      </PolicyItem>
    </CodeAccessSecurity>
    Dwp Files
      There are a number of ways to deploy a web part, however the recommended way is to use a solution package.  You will have to specify the location of the .webpart files in the DwpFile element. also include your assemblies and resource files into the solution.  The best part about a solution is that the assemblies can be deployed to all servers in the farm as well as registered as a safe control.

    The basic schema for the  DwpFiles element is shown below

    <DwpFiles>
      <DwpFile
        Location= "Text">
      </DwpFile>
      ...
    </DwpFiles>
    
    Note that the SharePoint SDK indicates FileName instead of Location which is incorrect.
    Feature Manifests
     

    Typically a solution will contain many different features, all these features can then be activated together to form part of a bigger system or solution you are deploying.  You may have a feature for your site columns and content types, different features for different web parts and then even different features for lists and list templates.

    It is important to not and often I get many questions around this :  A solution can install many features into the 12 hive, however the opposite is not possible.  Remember that a solution is a deployment unit and will copy over all your features,  these features can then be activated either manually or through templates.

    The basic schema for the  Featuremanifests element is shown below

    <FeatureManifests>
      <FeatureManifest
        Location="Text"/>
    </FeatureManifests>
    Resources
     

    Should you wish to localise a feature, you can install a resource file into the features folder.  It is preferable that you localise the file using the <Resource> element instead of using a the <RootFile>.  The resource will be deployed to 12\TEMPLATE\FEATURES\<featurename> folder.

    The basic schema for the  Resources element is shown below

    <Resources>
      <Resource
        Location="Text"/>
      ...
    </Resources>
    Site Definition Manifests
     

    The really cool thing about a solution is deploy all you site definitions and these site definitions will be used by administrators and users to create sites.  Remember that the site definition will then activate needed features, provision pages and menus and place web parts onto site pages.

    The basic schema for the  SiteDefinitionManifests element is shown below

    <SiteDefinitionManifests>
      <SiteDefinitionManifest
        Location="Text">
        <WebTempFile
          Location="Text">
        </SiteDefinitionManifest>
      ...
    </SiteDefinitionManifests>
    
    Root Files
     

    The root file element allows you to copy over any other file, such as images, style sheets, controls.  The root files element will copy files relative to the 12 hive.

    The basic schema for the  RootFiles element is shown below

    <RootFiles>
      <RootFile
        Location = "Text">
      </RootFile>
      ...
    </RootFiles>
    Template Files
     

    The Template Files element is similar to the root element, however it will allow you to target files to the 12\TEMPLATE  folder.

    The basic schema for the  ApplicationResourceFiles element is shown below

    <TemplateFiles>
      <TemplateFile
        Location="Text"/>
      ...
    </TemplateFiles>
    

    Location attribute

    Many of the child elements in the solution package include a Location attribute, this location is the location of the file within the solution package (.wsp) file.  In a future post I will walk you through the steps to create a .wsp file, however it is a standard cabinet file and when you open the cabinet the root directory of the cabinet is displayed. 

    Example

    The RSSView web part is in a folder FEATURE\GroundingRSS in the .wsp file.  You would specify the location of the <DwpFile element as  FEATURES\GroundingRSS\RSSView.webpart

    image

    See also

    Posted Sep 24 2008, 11:56 AM by Brett with no comments
    Filed under: ,
  • SharePoint - Overview to creating a Solution Package

    Deploying your features, sites to should not be done using a file copy as this may be an issue when you have multiple servers in your farm.  The correct way to deploy them is to create a solution package.  A solution package is a single file with an .wsp extension that contains all your resources you wish to deploy to the 12 hive.  Once you have created your solution package, simply deploy it to the farm and it will be copied into the 12 hive of all the servers in the farm.

    Reasons to deploy using a solution package

    Now it is important to highlight issues to the reasons why you should rather use solution packages instead of manually copying them over.

    1. SharePoint tracks usage of the components and will give errors should you try to uninstall the solution package if being used.
    2. Deploying to multiple servers in a farm could be prone to human error and one may forget to deploy to a server.
    3. Should a server be down while deploying, you may forget to to deploy to the server when it comes up again.  However with as solution package it will automatically be deployed to the server when it comes up.
    4. When installing new servers into your farm, you may forget to install your components especially if you have a lot of components that were added over time.  Provisioned solution packages will automatically be deployed to new server that are added to the farm.
    5. Deploying custom DLL's to the Global Assembly Cache to a remote machine may be tricky.
    6. Deploying custom DLL's to every bin folder of each web application that uses your components may be tricky especially on a server where new web applications and site collections are being used.
    7. Modifying the web.config on all servers may be pose problems, using a solution package you can very easily modify the web.config especially your safe controls section.

    WSS is a exceptionally strong provisioning engine which will manage the deployment of your components and resources to multiple servers in a web farm automatically.

    The bottom line here is if you do not use a solution package, you are giving yourself more problems than you need.  These will definitely come back and bite you at a later date, causing you and many other people unnecessary stress.  It is easy to resolve this by creating a solution package.

    How does deployment work with a solution package

    The diagram below indicates what needs to be done to create a solution package.

    image

    Step 1 - Create custom features

    The first thing that a developer has to do is to make the necessary features, templates, assemblies, web parts, pages and other resources that need to be placed into the 12 hive.  The developer will copy and test these features to his/her development machine to make sure it works.

    For more information, see

    Step 2 - Create a solution manifest with CAML

    The next step is create a CAML solution manifest that is called manifest.xml.  This solution manifest will contain all the information about the resources that need to be deployed.  When executing stsadm -o deploysolution, this manifest will be read and executed on all servers on the farm.

    For more information, see

    • SharePoint -  Creating a solution manifest
    • SharePoint - Adding a feature to a solution manifest
    • SharePoint - Adding a webpart to solution manifest
    • SharePoint - Deploying assemblies with a solution manifest
    Step 3 - Build a cab file (.wsp)
    1. The programmer then needs to generate a data description file (ddf) with a text editor that contains a list of files to add to the .wsp (cabinet) file.  This ddf file will contain all the resources file names and the manifest.xml file that need to be deployed to the 12 hive.
    2. Using makecab.exe <ddf filename>, the cabinet file with extension .wsp will be created.

    For more information, see

    • SharePoint - Creating a solution package with makecab.exe
    Step 4 - Deploy the solution package.
    1. The developer gives the single .wsp file to the administrator.
    2. The administrator then uses stsadm -o addsolution -filename pathname\<package.wsp>.  This adds an asynchronous job to load the solution package file into the configuration database. 
      You can force the job to run immediately by executing stsadm -o execadmsvcjobs.  At this point the solution package is copied into the the configuration database.
    3. Finally, the administrator deploys the package to the the farm, this will read the manifest.xml file in the solution package and proceed to extract the contents into the 12 hive.
      This is done by executing stsadm -o deploysolution -name <package.wsp>.  This will execute a job on every server in the farm and whereby the server opens the solution package, reads the solution's manifest.xml file and deploys what is defined in the manifest file.

    Note the following

    • The package is deployed to all servers in the farm, regardless of geography.  The state of what has been deployed to what server is managed in the config database.
    • Should a server be offline when you deploy the solution, when it comes online there will be a job waiting for it to deploy the package. The job will be executed on startup thus ensuring the package is deployed.
    • Should you add a new server to the farm, even months later. A job will be created to deploy all packages to the new server.  Thus when the new server comes online after being added to an existing farm, it will have all the packages deployed.

    See Also

    Posted Sep 19 2008, 06:35 PM by Brett with 2 comment(s)
    Filed under: ,
  • SharePoint - Provisioning a content type with CAML

    Lists and libraries can be defined either to use a set of columns or it can be defined to use a content type which was introduced in WSS 3.0.  The content type defines the columns for a list item or row and a list can be set to use one or several different content types.   This effectively allows a list to contain multiple rows with each row having a different set of columns as defined in different content types.  It is important to note that content types are defined outside of lists and are consumed by a list, thus several lists can implement the same content type.

    Another nice feature of content types is they are defined using an inheritance mechanism, thus a content type can is based on another content type.  In fact, you cannot create a content type from scratch, you always have to inherit from another content type.  When inheriting a content type, all the fields in the base/parent content type will be included in the new child content type you are defining.  There are several content types provided by SharePoint you can inherit from, the core two are either a item type for lists or library types for document libraries.

    A final feature is that a library content type can contain a document template which will be used when creating new items for the library, e.g. you may create a word template for a proposal and a content type for the proposal.  This template document may contain default text, logos and formatting to your companies standards.  When creating a new "proposal" in the library, word will create a new document based on the template that includes all your default content.

    Content types can also be associated with events and workflow's making it a really powerful feature of SharePoint.

    Methods of creating a content type

    There are several ways to create content types, either through the front-end, through code or through a feature.  The best method is to create it using CAML and  a feature.  This method allows you to redeploy and reuse your content type on different farms, sites and site collections.  The feature method of deployment is the preferred method of deploying your content types.

    Provisioning a content type with CAML and a feature

    In order to create a content type you will need to create a feature with an elements manifest file, I have already written several posts on how to do this, see the "See Also" section below if you do not know how to do this.

    A simple content type is easy to provision, however the trick part is to know that content types always must inherit from another content type, thus the get the characteristics of the base content type.  The ID of your new content type must be created and I have written a post SharePoint - Content Type ID's on how to do this, please read this as it is important.

    The next trick is to understand content types can include additional fields, however these fields must be defined as site columns,  you can use the site columns that ship with SharePoint, or you can create your own as described in my post SharePoint - How to provisioning a site column with CAML.  

    The sample elements manifest file below, defines a site column called Customer Account Number and a Content type called Customer which inherits from a contact (0x0106).  The content type customer then also includes the a optional field for the Customer Account Number.

    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <!--Site Columns-->
      <Field
      ID="{63590418-87F5-4fa7-AF50-B371C88F2F56}"
      Name="CustomerAccountNumber"
      DisplayName="Customer Account Number"
      Description="A customer account number used within the company."
      Type="Text"
      MaxLength="10"
      Group="Grounding Site Columns"
        >
      </Field>
      <!--Content Types-->
      <ContentType
        ID="0x0106000BB3F82D2A624B77833C28045F765D7A"
        Group="Grounding Content Types"
        Name="Customer">
        <FieldRefs>
          <FieldRef ID="{63590418-87F5-4fa7-AF50-B371C88F2F56}" />
        </FieldRefs>
      </ContentType>
    </Elements>

    Verifying the content type

    Once you have created the feature, installed and activate the feature.  Navigate to the Site Content Type Gallery in your site settings:

    image

    Notice the following when viewing your content type:

    • The parent indicates it is a contact
    • The columns defined in contact are in your contact.
    • The new site column "Customer Account Number" is also in the content type.

    See Also

    Posted Sep 10 2008, 09:26 AM by Brett with no comments
    Filed under: ,
  • SharePoint - Content Type ID's

    Content types are little gems within SharePoint with many useful characteristics.  The one characteristic is that content types support inheritance.  For the non programmers; inheritance is when you define a content type it must be based on an existing content type.  The new type called the child type will get all the features, i.e. fields, settings of the parent type.  The child type can then have additional types.

    To illustrate this, let us say we have a business that has customers and suppliers and we need to store customers and suppliers.  We could easily create a content type for a Customer that inherits from Contact, however a customer has an additional Account number field and Account Manager field.  The Supplier is also a contact and thus inherits from contact, however it has a Customer Number field.

    At this point it is important to note that content types inherit from other content types and build a tree as shown in the diagram below:

    image

    You can create your own content types that inherit from other content types in CAML by understanding the ID field. Each content type must have a unique id, however unlike many other ID's that are Globally unique identifiers, a content type ID is a mixture of the parent ID, shown in the table below an a unique GUID.  Also the GUID is contains no braces or dashes like other GUIDS.

    Content Type

    ID Start

    System

    0x

    Item

    0x01

    Library Content Types

     

    Document

    0x0101

    Form

    0x010101

    Picture

    0x010102

    WikiDocument

    0x010108

    BasicPage

    0x010109

    WebPartPage

    0x01010901

    List Content Type

     

    Event

    0x0102

    Issue

    0x0103

    Announcemnt

    0x0104

    Link

    0x0105

    Contact

    0x0106

    Message

    0x0107

    Task

    0x0108

    BlogPost

    0x0110

    BlogComment

    0x0111

    Folder Content Types

     

    Folder

    0x0120

    RootOfList

    0x012001

    Discussion

    0x012002

    Where to set the ID

    When you define your content type in the Elements manifest file, there is a mandatory ID field which needs to be the content type.  A snipit of a content type is shown below:

    <?xml version="1.0" encoding="utf-8"?>
    <
    Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <
    ContentType
       ID="0x0106000BB3F82D2A624B77833C28045F765D7A"
        >

      </
    ContentType>
    </
    Elements>

    The syntax is :

    Parent ID + 00 + GUID

    Examples

    1. To create a content type with GUID {0BB3F82D-2A62-4b77-833C-28045F765D7A} that is based on contact (0x0106), you would se the ID to
      0x0106000BB3F82D2A624B77833C28045F765D7A
    2. To create a content type with GUID {0E3E8F35-3A21-4ed7-8151-816C48E2D64F} that is a based on document (0x0101), you would set the ID to
      0x0101000E3E8F353A214ED78151816C48E2D64F
    3. To create your own item with GUID {A6C62A39-E374-4d8d-9EFE-90DD65B659F9} that is based on item (0x01), you would set the ID to
      0x0100A6C62A39E3744D8D9EFE90DD65B659F9

    See also

    Posted Sep 09 2008, 12:16 PM by Brett with 3 comment(s)
    Filed under: ,
  • SharePoint - Defining a choice site column with CAML

    In my previous post SharePoint - How to provisioning a site column with CAML I showed you how to provision a general site column using CAML.  In this post I will show you how to provision a site column with choices choices.

    The basics steps are to create a feature.xml manifest that loads a elements manifest that has a <Field ... /> element for your site column.  The manifest looks something like the XML below.  In this example, I have created a colour picker with choices of colours from the rainbow.  I have also set the default colour to green.

    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <Field
        ID="{D03DFA8E-3A4E-4bc7-9D1F-E653C1D69B13}"
        Name="Colour"
        DisplayName="Colour"
        Description="A colour of the rainbow."
        Type="Choice" 
        Group="Grounding Site Columns"
        >
        <CHOICES>
          <CHOICE>Red</CHOICE>
          <CHOICE>Orange</CHOICE>
          <CHOICE>Yellow</CHOICE>
          <CHOICE>Green</CHOICE>
          <CHOICE>Blue</CHOICE>
          <CHOICE>Indigo</CHOICE>
          <CHOICE>Violet</CHOICE>
        </CHOICES>
        <Default>Green</Default>
      </Field>
    </Elements>

    Creating the field element

    1. Create a field in an elements manifest, see my post SharePoint - How to provisioning a site column with CAML on how to do this.
    2. Give your field a Name and DisplayName.
    3. Set the type to Choice

    Creating the choices

    1. In the Field element, create a child element called <CHOICES>
    2. Add a <CHOICE>Item</CHOICE> element for each item that you want to appear in the list, e.g.  <CHOICE>Red</CHOICE>

    Setting the default

    1. Add a <Default>Item</Default> element for the default as a child element of Field.

    Testing

    You will need to install and activate your feature, once done you will need to create a list and add your new site column.  Notice the site column appears under the list of Available site columns

    image

    Finally, when you add a new item to the list and you will notice that it shows the choices in a drop down list.

    image

    Related Posts

    Posted Sep 08 2008, 08:39 AM by Brett with no comments
    Filed under: ,
  • SharePoint - How to provisioning a site column with CAML

    A SharePoint list can be thought of as a data table with columns describing the fields and rows for each record.  The columns (or fields) are defined within the list and are only defined in a single list instance.  The are many business cases where your data contains the same column in many different lists and each time you will need recreate this column in each list, an example may be a Customer Account Number which is in many lists.

    In WSS 3.0 there is a site column, which simply is a reusable field definition.  The site column allows you to define the field with all it's settings, once done you simply can add it to many different lists.  This becomes really handy when you have complex fields and want reusability.

    Now there are three ways to create your site columns:

    1. Manually create it using the web front-end. 
      The problem with this approach is that you will have to recreate this on different web applications and server farms, e.g. dev, test and production.  This could be prone to error
    2. You can write code to create the site column.
      This is the long and hard way as you will need to test your code well and will require a programmer to do this.  You most probably will land up provisioning your code through features and site definitions anyway and I feel this is just too much effort.
    3. Create the column using CAML.
      This is most probably the best way when it comes to reusability as you will create an element manifest and include this manifest in a feature.  Then you can simply deploy the feature and activate it where needed.

    In this post, I will only focus on the last step as this is the best way to do provision a site column.

    Summary of steps

    This post will walk you through the steps below in order to create a site column,  the most important step is Step 3 which

    1. Create a feature project
    2. Create a feature manifest
    3. Create a site column elements manifest file
    4. Deploy the feature
    5. Provision and Activate the feature
    6. Verify the columns exist

    Creating a feature to provision a site column

    Download the code

    Step 1 - Create a feature project

    In creating a project for SharePoint, I somewhat follow the project structure as defined in the Microsoft Press Book: Inside Microsoft Windows SharePoint Services 3.0 by Ted Pattison and Daniel Larson. 

    1. Create a Library project in visual studio, in this example I have called it Grounding.Demo.SiteColumn
      In this project we will not be deploying the actual DLL, so I will skip the steps of creating a strong named assembly
    2. Create a directory structure to mimic the feature folder in the 12 hive where we are going to deploy the feature to. 
       image
    3. Edit the build events to deploy your SharePoint solution onto your development box.
      Please note that you should be provisioning your solution using a site definition, however I did not want to complicate this post.
      image 

      For this demo, the post-build event command line is:
      XCOPY "$(ProjectDir)TEMPLATE" "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\" /s

    Step 2 - Create a feature manifest

    In this step, we need to create a SharePoint feature for our content types in order to set up a proper deployment environment for our content types.  Once completed the feature will be used to deploy to other server environments, i.e. test and production.

    1. Create a feature.xml file in the TEMPLATE\FEATURES\Grounding.Demo.SiteColumns folder.
    2. Add the following xml to the file.

      <?xml version="1.0" encoding="utf-8" ?>
      <Feature xmlns="http://schemas.microsoft.com/sharepoint/"
               Id="{1EED8F45-4FF6-473d-9B8F-99CB6599D50C}"
               Title="Grounding Demo - Provision Site Column"
               Description="This demonstration teaches you how to provision a site column using CAML"
               Version="1.0.0.0"
               Hidden="FALSE"
               Scope="Site">
        <ElementManifests>
          <ElementManifest Location="SiteColumns.xml" />
        </ElementManifests>
      </Feature></PRE< P>

       

    Important points to note
    • The site columns are provisioned to the "Site" scope i.e. the site collection
    • The feature has a unique GUID, which you can generate from Visual Studio menu, Tools\Create GUID (Use the registry format).
    • The ElementManifest points to a file (created in the next step) that includes the site columns.

    Step 3 - Creating a site column

    Creating a CAML site is done by placing a field element into an element manifest file which is explained in the steps below.  For demonstration purposes I have created a simple customer account number field.

    1. The first thing to do is create a element manifest file using an XML editor.
      In this case the it was called SiteColumns.xml (see the ElementManifest in the feature above).
    2. Add the following XML to the file

      <?xml version="1.0" encoding="utf-8" ?>
      <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
        <Field
          ID="{63590418-87F5-4fa7-AF50-B371C88F2F56}"
          Name="CustomerAccountNumber"
          DisplayName="Customer Account Number"
          Description="A customer account number used within the company."
          Type="Text"
          MaxLength="10"
          Group="Grounding Site Columns"
          >
        </Field>
      </Elements> 

    Important points to note

    • The ID must be a unique GUID which you can create using visual studio, Tools\Create GUID.  Use the registry format.
    • Type and Title are mandatory.
    • You can provision several fields in a single element manifest file, just create as many <Field .... /> elements as you need.
    • Grouping your fields makes them easier to find and use from the front-end

    Some field attributes

    ID The ID is a globally unique identifier (GUID) which you should generate for each field. This ID will be used in lists when referencing the site column
    Type

    The type indicates the data type of the column and can be of the any following:

    AllDayEvent The all day event flag is used in calendar lists.
    Attachments The URL of an attachment.
    Boolean A boolean indicator with Yes/No.
    Calculated Indicates that the column is a calculated column based on a expression.
    Choice Indicates that the column is choice from a list of items
    Computed Indicates the field's value is dependant on another field's value.
    ContentTypeId A Content Type ID value.
    Counter An internal unique ID's / counter for each item.
    Currency A currency value (its format depends on the locale).
    DateTime A Date and Time field.
    File A file object when used in document libraries.
    GridChoice A rating scale as used in surveys
    Guid A globally unique identifier.
    Integer An integer number field.
    Lookup The field is a lookup which is a choice, however the choice is from another list.
    LookupMulti A lookup field, however multiple selections are allowed.
    ModStat An approval status.
    MultiChoice A choice field, however multiple selections are allowed
    Note Multiple lines of text which can be plain or formatted.
    Number A numerical field which allows decimal places.
    PageSeparator A page separator field, for surveys.
    Recurrence An indicator that identifies the field as a reoccurring calendar event.
    Text A single line of text
    ThreadIndex The ID of a discussion thread.
    Threading Indicates the field supports threading (in discussions).
    URL A Unified Resource Locator (URL) is stored.
    User A person or group.
    UserMulti A person or group, however multiple people or groups can be selected.
    WorkflowEventType Contains the type of workflow history event (used in workflow history list).
    WorkflowStatus The status of a workflow is stored.
    Title The name of the field as displayed in the user interface.  This title may be set using a resource file.
    Name (optional) The name of the field which should be guaranteed to never change.  The default is the Title with spaces and invalid characters removed.
    StaticName (optional) The logical name of the field which is similar to Name, however this can be programmatically changed.
    DisplayName (optional) See title.
    Description (optional) A description of the field which will be displayed in front ends.  The description can be placed into a resource file.
    Required (optional) Indicates whether or not the field is mandatory. The default is FALSE.
    MaxLength (optional) The maximum number of characters allowed.
    Hidden (optional) Indicates that the field should be hidden from the interface. If TRUE, this field will not be shown on views or forms. The default is FALSE.
    ReadOnly (optional) The field should be read-only and can be displayed and not edited.  The default is FALSE.
    ShowInDisplayForm (optional) Indicates whether the field should be shown on a display form. The default is TRUE.
    ShowInEditForm (optional) Indicates whether the field should be shown on an edit form. The default is TRUE.
    ShowInListSettings (optional) Indicates whether the field should be shown in the list settings screen. The default is TRUE.
    ShowInNewForm (optional) Indicates whether the field should be shown on a New form. The default is TRUE.
    ShowInVersionHistory (optional) Indicates whether the field should be shown in the version history of an item. The default is TRUE.
    ShowInViewForms (optional) Indicates whether the field should be shown on a view form. The default is TRUE.
    Group (optional) A group name allowing you to group fields together.

    Step 4 - Deploy the feature

    In my sample, I have inserted a post build event into the project properties which copies the feature to the 12 hive.  This is simply for demonstration purposes and you should provision your features correctly using a site definition.

    image

    Step 5 - Provision and Activate the feature

    The next step is to actually deploy the feature and then activate the feature on a site

    1. Open the command console. Start, Run, cmd.exe\
    2. (OPTIONAL)Create an environment variable to the STSADM.EXE by typing
      SET STSADM=C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\STSADM.EXE
    3. Install the feature by typing the following command:
      STSADM -o installfeature -filename Grounding.Demo.SiteColumn\feature.xml -force
      image
    4. Open your web site
    5. Click Site Actions
    6. Click Site Settings.
    7. Click  Site collection features under Site Collection Administration.
      image
    8. Activate the Grounding Demo - Provision Site Column feature
      image

    Note you could have activated the feature using stsadm -o activatefeature

    Step 6 - Verify the site columns exist

    Now the feature is activated, verify the column exists

    1. Open your web site (should still be open).
    2. Click Site Actions
    3. Click Site Settings.
    4. Click Site columns under Galleries
      Scroll down to find the column
      image

     

    Related Posts

    Posted Sep 08 2008, 01:21 AM by Brett with 1 comment(s)
    Filed under: ,
  • SharePoint - The role of a Web Part vs using application pages

    In the past few weeks I have been doing some consulting and giving advice to development teams starting SharePoint development. In this process I have found it a common problem that several developers misunderstand what are site pages, applications pages and web parts are used for and when to use it.  At least a dozen e-mails, MSN chats and meetings in the past few weeks has prompted me to write this post.

    As a developer we have many options available to us and it is difficult at first to really understand where to use what and when to use it.  Hopefully through my trials and errors I will be able to share with you what I have found works best. 

    SharePoint opportunities as a developer

    SharePoint, WSS 3.0 leverages on top of the .NET 2.0 and 3.0 frameworks using many ASP.NET features to deliver a powerful portal engine.  As an ASP.NET developer there are many different approaches to develop a web site and how to go about it.  The trick with SharePoint development is to know when to use what.  What makes it a bit more confusing is that many ASP.NET developers are introduced features of the .NET framework that they never new existed and the combination of the two new technologies becomes quite confusing.  There is however one thing in common, however or whatever approach you take, you will be generating HTML, CSS and client side scripts.

    Web Parts

    Web Parts are really nice server side controls that give the user the following benefits

    • Personalisation
      • a user can move the control to different zones on the page.
      • a user can customise settings of a web part allowing data to be filtered, selected or rendered by parameters
      • a user can choose to put a web part on a page or not.
    • Reusability
      • Web parts are intended to be reused on many different site pages
    • Communication
      • Web Parts can communicate with other web parts on the same page, sharing information between the controls providing a master / detail set of controls
    • Summaries and information sharing

    Web parts are intended to be used to display summarised and management information to users in a dashboard type page.  This page should have web parts that show results, graphs, KPI's and keep with the spirit of a SharePoint site ... that is to share and make information visible and easily accessible. The primary goal is to. 

    The idea of a web part has been confusing to many, and often web parts are created for the wrong reasons, these include

    • data capture and entry
    • one-of-a-kind web part that will be placed on a site page by an administrator and will only be used once.
    • front-end controls for line of business applications.

    After all, a user is not going to want to choose the location on the screen to where to capture the new account details for a new customer, nor will they choose to optionally display or hide this from their screen.

    Site Pages

    Site pages are aspx pages that have web part zones in them, allowing a user \ administrator to choose a web part and drop it into a zone.  A site page should not need to have code behind the page and most definitely should not be hard wired to interact with a specific web part.  In essence it as a template for a page that contains zones.  These zones will be filled with web parts.  Please do not put code into your site pages or hard wire the site pages.

    Application Pages

    Application pages are for all intense purposes the same as a traditional .aspx page where you can do what ever on the page you wish.  Application pages are ideal for your line of business pages and data capture pages.  Your application page can also contain as much code and complexity as you like.  You can choose to interact with SharePoint or do your own thing.

    Application pages should be used for

    • Data capture pages
    • Line of business or system pages
    • Configuration pages
    • Pages that are a one-of-a kind page
    • Pages that should not be customised by users
    • Requires code behind the page

    Now, another small mistake that many developers make is that they place complex logic into the .aspx page, instead get used to putting your logic into an .asxc page and then dropping this onto your page.

    Conclusion

    Create application pages for you line of business systems and implement these into your solution.  Threat these application pages as you would a traditional ASP.NET web site, however you need to play by a few Windows SharePoint Services rules.  Don't use web parts for this as it is pointless and far too much work (and pain).  Create links from the navigation system of SharePoint, other pages and web parts to your application pages.

    Web Parts should be created to enhance the users SharePoint experience.  Create web parts that summarise information from your line of business applications.  The idea here is to allow users to create dashboards to quickly get the big picture of what is going on and where they should focus their attention to.  Web Parts should not be created for data capture, rather create an application page.

    Site Pages should be created should you not find a suitable standard SharePoint layout for your dashboard page with all the needed zones.  In this situation create your own site page.

  • Happy 1st Birthday Grounding.co.za

    I can remember last year when I decided to get my act together and create the grounding site.  I went through a whole process of looking at blogging engines and finally chose Community Server as it had the features I needed to host a community site.  I had a inactive site hosted at WebHost4Life which I took down and replaced the contents with the shell for grounding.   I had previously registered the domain name and thought it appropriate to use the name grounding.co.za as to give all the readers a solid grounding on the technology. 

    I started adding content a few weeks before, with a huge amount of posts on course outlines and some news around the time and some posts I had done previously.  On 16 June 2007, I brought the site online and now a year has flown by.

    What has happened in the year

    I did not expect the site to do as well as it has, and all credit goes to you, our readers, students and friends.  Soon after I launched, I approached Trevor and Neil to join me blogging and I sold them the idea, with some nagging they started blogging too, since then we now have 9 talented people blogging with different areas of specialities.

    • Neil
    • Trevor
    • Pieter
    • Gail
    • Nico
    • Barend
    • Romiko
    • Cara
    • Brett

    The content of the site has grown tremendously with 981 posts made.  The list below is an extraction of the Tag Cloud on the blog site indicating the topics posted on.

    .NET Architecture ASP.NET BizTalk  C# CES Courses CPS  Delphi  Design Patterns Dynamics CRM Exchange Grade 12  OCS Office 2007 OOP Opinionated Posts SharePoint SharePoint Designer SQL Server SSIS Training Virtual PC Vista Visual Studio 

    Statistics

    The following statistics are from AWStats

    image

    Our membership has grown over the period and has shown, interestingly this does correspond to training courses presented and over the past few months there has been a dip as we all have not trained that much.

    image

    The total number of visitors is growing exponentially as the site is becoming more established on the Internet and ranked higher in many of the search engines such as Google and Live.

    image

    The number of "pages" has also shown a steep increase as the user visits has increased.  Not bad for a 1 year old web site from our little corner of Africa!

    Personal lessons learnt

    For me personally, blogging has become quite addictive an very enjoyable.  I have personally grown in my knowledge due to my blogging, forcing me to dig deeper into a subject matter than I would have done in the past.  The blog site has also helped me tremendously with my career and has opened a few doors me.  The biggest rush is to chat to someone or read a comment on the site where someone has managed to get value out of something I have posted.  The satisfaction of being able to help someone with a problem, point them in the right direction or help with improving their skill is most rewarding.

    Silent Sponsors

    As the site grew we approached Teligent, the company that creates and markets Community Server to get a better price.  They generously gave our community a free licence to the corporate edition of community server, again a big thank you for a great product.

    Also, a big thank all the community blogger's for their contributions to the site with a big special thanks to my friends Neil and Trevor for all their help getting the site up and running to where it is today.  This site, its content is truly a community effort and collectivity our efforts have shown good results.

    Related Posts

    Last words

    The site is nothing without you and I would like to thank you for reading and supporting grounding.  Please keep visiting, referring your friends and co-workers; making comments and guiding us in what we should write on. 

    Thank you!

    Posted Jun 16 2008, 10:35 AM by Brett with 1 comment(s)
    Filed under:
  • SharePoint - Register an assembly as a safe control in the Web.config file

    In order for you to use your own custom assembly with your web parts and other little bits, you will need to add your safe control to the web.config file.  However, you need to think "WEB FARM" with many servers hosting the web application so I will show you a couple ways to do this.

    The entry in the web.config

    You need to place a SaveControl element entry into the web.config file of the web application.  The entry looks like the following:

       1: <configuration>
       2:   <SharePoint>
       3:     <SafeControls>
       4:       <SafeControl Assembly="[Assembly Name]" Namespace="[Namespace]" TypeName="*" Safe="True" />
       5:     </SafeControls>
       6:   </SharePoint>
       7: </configuration>
    Assembly The name of your assembly needs to added to this section. Although you can simply type the name of the DLL hosting the control into the Assembly element, it is important to not that this is not the recommended practice.  Rather, use a full four part name; i.e. [assembly], version=[version], culture=[culture], publickeytoken=[publickeytoken]Namespace The namespace that your web controls are in.  If you have your controls in multiple namespaces, you will need to add one <SafeContol ...> element for each control.TypeName The name of the web control which is allowed to be executed with the SharePoint web application.  Should your namespace have multiple web controls, you do not need to register each control.  You can simply use * (asterisk) to indicate the dll.Safe A boolean flag, indicating whether the control is treated as safe (true) or unsafe (false). AllowRemoteDesignerA boolean flag, indicating whether the control can be loaded by a remote designer, such as SharePoint Designer.

    Sample

       1: <SafeControl Assembly="Brett.DemoParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f03e5f7a44d50a3a" 
       2:              Namespace="Brett.SharePoint.WebParts" 
       3:              TypeName="*" 
       4:              Safe="True" 
       5:              AllowRemoteDesigner="True" />

    Methods of updating the web.config file

    There are three ways you can update the web.config file,

    • Manually adding the SafeControl to the web.config
    • Adding the SafeControl to the web.config with code
    • Deploy the assembly using a solution package

    Manually editing the web.config (bad)

    This approach may sound the easiest and quickest way as you simply open up your favourite xml editor, find the <SafeControls> element and add your own control into it.

    WARNING!
    If you do it this way, you are looking for trouble in a farm as you will need to remember to change the web.config modification for all your servers in the farm as well as all the web applications on the farm that use the custom control.  So should you have a really awsome web part that is used within 5 web applications hosted on your farm of 3 servers, you will need to make the modification to 15 web.config's .. have fun.

    Also should you add a new server to your farm, please remember to add the entry the web.config.

    Bottom line, this is the worst possible way you can do it  and stay away from doing it this way

    Adding the SafeControl to the web.config with code (good)

    SharePoint provides a class called SPWebConfigModification which has a set of modification commands in a collection.  These modification commands are applied to the default web.config of the Web Application.  These configuration modification commands will also be added and applied to all servers in a farm.   Finally, should a new server be added to the farm, these modifications will also be applied.

    The following code could be added to the FeatureActivated override method in your feature that deploys the web part.

       1: public override void FeatureActivated(SPFeatureReceiverProperties properties) 
       2: {
       3:     // A reference to the features Site Collection
       4:     SPSite site = null;
       5:  
       6:     // Get a reference to the Site Collection of the feature
       7:     if (properties.Feature is SPWeb)
       8:     { site = ((SPWeb)properties.Feature.Parent).Site; }
       9:     else if (properties.Feature.Parent is SPSite)
      10:     { site = properties.Feature.Parent as SPSite; }
      11:  
      12:     if (site != null)
      13:     {
      14:         SPWebApplication webApp = site.WebApplication;
      15:  
      16:         // Create a modification
      17:         SPWebConfigModification mod = new SPWebConfigModification(
      18:             "SafeControl[@Assembly=\"MyAssembly\"][@Namespace=\"My.Namespace\"]"
      19:                 + "[@TypeName=\"*\"][@Safe=\"True\"][@AllowRemoteDesigner=\"True\"]"
      20:             , "/configuration/SharePoint/SafeControls"
      21:             );
      22:  
      23:         // Add the modification to the collection of modifications
      24:         webApp.WebConfigModifications.Add(mod);
      25:  
      26:         // Apply the modification
      27:         webApp.Farm.Services.GetValue<SPWebService>().ApplyWebConfigModifications();
      28:     }
      29: }

    Deploy the assembly using a solution package (best)

    The preferred way to provision your features, web parts and assemblies is by creating a Solution Package (.wsp file).  You will add add your assembly, the manifest.xml file and all your other components and resources into the cabinet.

    You will need to add the following entry into the manifest.xml

       1: <Solution SolutionId="{1E0FDA58-6611-423a-92EC-8E7355810CEE}"
       2:           xmlns="http://schemas.microsoft.com/sharepoint/">
       3:   <FeatureManifests  />
       4:   <ApplicationResourceFiles />
       5:   <CodeAccessSecurity />
       6:   <DwpFiles />
       7:   <Resources />
       8:   <RootFiles />
       9:   <SiteDefinitionManifests />
      10:   <TemplateFiles />
      11:   
      12:    <Assemblies>
      13:       <Assembly DeploymentTarget="WebApplication" Location="Brett.DemoParts.dll">
      14:          <SafeControls>
      15:             <SafeControl Assembly="Brett.DemoParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f03e5f7a44d50a3a"
      16:                          Namespace="LitwareWebParts" 
      17:                          TypeName="*" 
      18:                          Safe="True"                         
      19:                          />
      20:          </SafeControls>
      21:       </Assembly>
      22:    </Assemblies>
      23: </Solution>
      24:  

    Key highlights

    DeploymentTarget The depoloyment target is location where the assembly will be copied to and can ether be the bin folder of the WebApplication or it could be the GlobalAssemblyCache (GAC)Location The location of the assembly within the cabinet file. SafeControl A SafeControl element entry as described at the beginning of the post.   

    Using this method, your assembly will be correctly deployed the servers in the farm as well as added to the safe controls of the web application.  Again any new server added to the farm will automatically get all the solution packages deployed.

    See

    References

    Posted May 23 2008, 08:30 PM by Brett with 6 comment(s)
    Filed under:
  • Hiding a user name from the Vista welcome screen

    This post is not in line with the technologies and products I normally blog on, however this has been a pet little irritation I have had for some time since I installed Vista. So, my apologies to the mirrors and and RSS feed readers that are not interested in this type of topic and feel it is "off topic".

    On my Vista installation I have installed a several services such as SQL and BizTalk and few other products. Now as a good puppy, I installed these products I have always created specific service accounts for each service and applied security, my reason for this is I want to make sure that I take security into account in my development cycle.  The irritation is that after you boot, the welcome screen comes up showing all the accounts including the service accounts.  Now, I never wanted these to user accounts and images to appear here as I never manually logon with the account.

    For several months, now I have struggled to find out how to remove them from the welcome page and only leaving the account I logon with on the screen.  With some digging and bouncing off many sites I finally found out how it is done.

    1. Open up your registry editor, regedit.exe
    2. Navigate to the [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
    3. Create a key SpecialAccounts under Winlogon
    4. Create a key UserList under SpecialAccounts
    5. Add a DWORD Value and set the Value to the User Name.
    6. Set the value to 0 to hide the username and icon from the welcome screen, or 1 to show the username and icon.

    image

    End result was a happy Brett :>>

    Reference

    1. Configure the login and Welcome Screen in Vista 
    Posted May 20 2008, 09:27 AM by Brett with 3 comment(s)
    Filed under:
  • SharePoint : Application Pool accounts and the IIS_WPG Group

    In Internet Information Server 6.0 there is a new user group IIS_WPG which basically gives a minimum set of permissions required to start and run worker processes on a web server.  By default, the group contains the following user accounts

    • Network Service
    • Local Service
    • LocalSystem
    • IWAM_ComputerName

    Before you assign your own service account as a worker process identity for a Web site, make the user a account a member of the IIS_WPG group.  This will make your life easier as you will not have to manually assign permissions and privileges. 

    SharePoint Important If your application pool account is not assigned as a member to this group and you have not manually granted permissions to the account, you should get an error "Service Unavailable".  Rectify this by adding the account to IIS_WPG as well as the SPS_WPG and STS_WPG accounts.  Also, ensure this account is correctly set up on all servers in your farm.

    Default permissions to the account

    On NTFS

    Location Permission

    %windir%\help\iishelp\common

    Read, Execute
    %windir%\IIS Temporary Compressed Files Full control

    %windir%\system32\inetsrv\ASP compiled templates

    Full control

    Inetpub\wwwroot (or content directories)

    Read, Execute

    In the Registry

    Location Permission

    HKLM\System\CurrentControlSet\Services\ASP

    Read
    HKLM\System\CurrentControlSet\Services\HTTP Read
    HKLM\System\CurrentControlSet\Services\IISAdmin Read
    HKLM\System\CurrentControlSet\Services\w3svc Read

    Windows policy rights

    Policy

    Bypass traverse checking

    Impersonate a client after authentication
    Log on as a batch job

    Tips

    1. Remove the IIS_WPG account from the ACL list in the folder with the site content and rather add only the application pool identity to the ACL.
    2. Remember any changes you make should be done on all servers in your farm and some careful thought given to how you will do this.

    References

    Related certifications

    The information in this post is important for the following certification exams

    Posted May 09 2008, 09:09 AM by Brett with no comments
    Filed under: ,
  • Preparing for exam 70-541: TS: Microsoft Windows SharePoint Services 3.0 – Application Development

    Exam news

    The Technology Specialist (TS) exam, Exam 70-541: TS: Microsoft Windows SharePoint Services 3.0 – Application Development, was released in March 2007. This exam is available in English, Chinese [Simplified], French, Japanese, and Spanish.

    Exam topics covered

    The following list includes the topic areas covered on this exam. The percentage indicates the portion of the exam that addresses a particular skill.

    Deploying Windows SharePoint Services and Custom Components (14 percent) Creating Site and Feature Provisioning Components (20 percent) Creating Metadata and Workflow Provisioning Components (15 percent) Developing Windows SharePoint Services Components by Using the .NET Framework (17 percent) Manipulating Site Content by Using the API (20 percent) Manipulating Site Configuration by Using the API (14 percent)

    Audience profile

    This exam is intended for consultants who provide Windows SharePoint Services development or corporate developers who build systems using the Windows SharePoint Services platform. The qualified candidate for this exam typically has:

    • Two to three years of experience working with ASP.NET
    • One to two years of experience developing ASP.NET Web Parts
    • Experience working with Master pages
    • One to two years of experience working with XML documents
    • Two to three years of experience developing and consuming Web services
    • Working knowledge of Windows WorkFlow Foundation

    Credit toward certification

    When you pass this exam, you earn credit toward the following certifications:

    MCTS: Microsoft Windows SharePoint Services 3.0: Application Development

    Code languages

    When the exam begins, you can choose the programming language in which the code segments will appear. The available code languages for this exam are:

    • Microsoft Visual Basic 2005
    • Microsoft Visual C# 2005

    Skills measured

    This certification exam measures your ability to build enterprise portals using Windows SharePoint Services 3.0.

    Before you take the exam, you should be proficient in the job skills listed in the following table. The table lists Official Microsoft Learning Products that can help you reach competency in the skills being tested in the exam.

    Deploying Windows SharePoint Services and Custom Components

    Configure a target computer for Windows SharePoint Services development.

    • Create Windows SharePoint Services service accounts.
    • Configure database rights for Windows SharePoint Services service accounts.
    • DbCreator
    • SecurityAdministrator
    • Configure machine rights.
    • IIS_WPG (learn more)
    • STS_WPG
    • Enable forms authentication on the IIS virtual server.

    Deploy a Web Part to the Windows SharePoint Services server.

    • Register an assembly as a safe control in the Web.config file.  (learn more)
    • Configure Web Part permissions.
    • Enable a Web Part to access resources by creating a custom security policy.

    Create and deploy a Windows SharePoint Services solution package.

    Deploy a site definition to a Windows SharePoint Services front-end Web server.

    • Deploy a site definition manually by copying appropriate files and folders to the server and resetting IIS.

    Deploy a feature to a Windows SharePoint Services front-end Web server

    • Deploy a feature manually by copying appropriate files and folders to the server and resetting IIS
    • Install and activate a feature by using STSADM.

    Deploy a Web service to a Windows SharePoint Services front-end Web server.

    • Deploy a Web service so that it is available within the context of any Windows SharePoint Services site.
    • Deploy a Web service external to the Windows SharePoint Services context.

    Deploy user controls to a Windows SharePoint Services front-end Web server.

    • Deploy a user control so that it can be used by any Windows SharePoint Services component.

    Creating Site and Feature Provisioning Components

    Create a feature definition

    • Specify a feature that depends on another feature to activate
    • Specify an Event Receiver to handle events for a feature
    • Localize a feature using a resource file
    • Create an action to add an option to the site settings menu
    • Add a new master page when a feature is activated
    • Cache the master page in a document library

    Create a site definition

    • Define the top and side navigation areas for a site
    • Specify a list definition to use in a site
    • Hide a list definition from the Create Page

    Specify a Document Template in a site definition

    • Specify a file for use in a Document Template

    Create a site definition module

    • Specify a file to be cached in memory on the front-end server
    • Add a UI element to the beginning of the top navigation area in a module
    • Force a Feature to install when a site is created by using the site definition

    Specify the configurations of lists and modules in a site definition

    • Create multiple configurations for a single site definition
    • Specify that the site created will only exist as the root Web site in a collection

    Create pages and layouts for a site

    • Create a custom Page Layout that has multiple Web part zones
    • Customize the fields that are displayed on the mobile view of a Windows SharePoint Services page
    • Modify the page layout for a site using master pages

    Creating Metadata and Workflow Provisioning Components

    Create a site column

    • Specify a site column in a site definition in a Feature
    • Add a column to a Provisioned Site by using the API

    Create a list definition

    • Prevent a list from being created on a site by hiding it on the list Create Page
    • Add a new view to a list definition
    • Specify a view that shows all files and all subfolders of all folders

    Create a Custom Field Type

    • Define the Custom Field Type to be displayed for inclusion in lists and document libraries
    • Display the Custom Field Type differently for a new item form and an edit form

    Create a Workflow definition

    • Attach a workflow to a list on creation
    • Collect default values for a workflow
    • Package a workflow in a feature

    Create a Content Type

    • Add multiple Content Types to a single list
    • Apply a Content Type to multiple file types
    • Inherit properties from one Content Type to another
    • Update an existing content type

    Developing Windows SharePoint Services Components by Using the .NET Framework

    Implement a business process by using a workflow.

    • Create a basic workflow by using the SharePoint Designer.
    • Call custom services from workflow by using Visual Studio 2005

    Handle Windows SharePoint Services events by developing an event receiver.

    • Handle a list event.
    • Cancel an operation.
    • Handle a feature event.

    Develop a Web Part.

    • Upgrade a Web Part from Windows SharePoint Services-version 2 to version 3.
    • Handle postback data by using the control life cycle.
    • Troubleshoot a Web Part failure.
    • Handle exceptions within a Web Part.
    • Convert a user control into a Web Part.
    • Implement caching by using the Windows SharePoint Services cache.
    • Create a personalized Web Part property.
    • Create a shared Web Part property.
    • Create a Web Part that uses Windows SharePoint Services cascading style sheet (CSS) styles.
    • Enhance the Web Part configuration UI by using a custom tool part.

    Share data between Web Parts.

    • Create a Web Part that is a data provider.
    • Create a Web Part that is a data consumer.
    • Filter information from one Web Part to another.

    Elevate application permissions by using impersonation.

    Enable a custom Windows SharePoint Services administration page to access the Windows SharePoint Services object model.

    Schedule tasks by using the SharePoint Timer service.

    • Create a job by using the SPJobDefinition class.
    • Submit a job to the SharePoint Timer service.

    Manipulating Site Content by using the API

    Manage an alert.

    • Create an alert for a user.
    • Remove an alert from a user.
    • Change the frequency of alerts.

    Enhance the Windows SharePoint Services search service.

    • Create a custom SPQuery object.
    • Perform a cross-site search.

    Customize user access and permissions.

    • Add a user to a site group.
    • Remove a user from a site group.
    • Change a user's permissions to edit a list.

    Manipulate items in lists.

    • Create a list item.
    • Update a list item.
    • Delete a list item.
    • Enumerate list items.
    • Add a photo to a picture library.
    • Add a recurring event to a calendar.
    • Delete a thread in a discussion board.

    Manipulate documents in lists.

    • Upload a document.
    • Copy a document between document libraries.
    • Attach a document to a list item.
    • Move a document across sites.

    Manage records by using the records repository.

    • Enable the records repository for the Send to menu.
    • Submit a file to the records repository.
    • Manipulate source data by using record properties.
    • Retrieve a series on a file from the records repository.

    Manage document versions.

    • Check out a document.
    • Check in a document.
    • Rollback a document version.
    • Display all versions of a document.

    Manipulating Site Configuration by Using the API

    Manipulate a list structure.

    • Dynamically add a custom action to a list.
    • Create a list object and add a column to the list object.
    • Create a custom view for a list.
    • Create a dynamic column type on a list.
    • Create a document template and assign it to a document library.

    Customize Web Part behaviour based on feature availability.

    Dynamically handle events.

    • Dynamically register an event receiver for a site event.
    • Dynamically register an event receiver for a list event.
    • Dynamically register an event receiver for a feature event.

    Manage site hierarchy.

    • List the IIS virtual servers on a Windows SharePoint Services server farm.
    • List the sites available to the current user.
    • Create a site.

    Customize navigation in a Windows SharePoint Services site.

    • Add an item to the QuickLaunch menu.
    • Modify an item on the top navigation menu.

    Manage groups and group membership.

    • Create a custom site group and set permissions for the group.
    • Add a cross-site group to a site group on different site.
    Posted May 08 2008, 10:54 PM by Brett with 7 comment(s)
    Filed under:
  • Preparing for exam 70-536: TS: Microsoft .NET Framework 2.0—Application Development Foundation

    About the exam

    The Technology Specialist (TS) exam 70-536: TS: Microsoft .NET Framework 2.0—Application Development Foundation is one of the core exams for all the .NET Framework 2.0 certifications.

    This exam tests your knowledge of Microsoft .NET Framework 2.0 and the implied knowledge of the Common Language Runtime and basic functionality it provides.

    Once you have mastered this contents of the exam you will truly have a good understanding of the framework and will be able to tackle a large variety of systems.  The content of the exam is intended for developers with experience in developing .NET based applications and is geared to assist them in mastering the framework.

    My personal feeling is any senior developer worth his salt should know this content well and be able to mentor junior programmers and coders through this exam if you are a senior programmer.   For the junior coders and programmers, here is your chance to take a leap to the next level .. just do it!

    This post and acknowledgements

    I have copied information from http://www.microsoft.com/learning/exams/70-536.mspx and have added my three cents worth through the subject matter.  My intent is over time to blog on all the topics making this site a conclusive guide to the .NET Framework and developer skill.

    Ambitious .. I know .. Want to help  Send me a PM and lets do it together.  If not I hope you enjoy the journey learning as I have will enjoy doing this for you.

    Exam objectives

    The following list includes the topic areas covered on this exam. The percentage indicates the portion of the exam that addresses a particular skill.

    Objective 1 - Developing applications that use system types and collections (15 percent)

    This objective is to test your knowledge of data types and how they work within the framework.  That is classes, structures, arrays, collections and generics.  There is a big drive in this section on the various types of collections, know them and all the associated standard interfaces.

    Many core features such as garbage collection, using delegates and events are also covered.

    Objective 2 - Implementing service processes, threading, and application domains in a .NET Framework application (11 percent)

    Now that the basics are over lets get into windows and how processes are loaded, working with threads and creating services. Forget about a simple Windows Forms application, we are talking real applications here.

    Objective 3 - Embedding configuration, diagnostic, management, and installation features into a .NET Framework application (14 percent)

    This section takes configuration to the next level and instead of simply using it, lets program around the configuration model. Part of this section includes understanding custom windows installers and how to develop one. The focus then changes to running your application, managing the processes running, adding diagnostics, implementing tracing and debugging and auditing events .. i.e. application management

    Objective 4 - Implementing serialization and input/output functionality in a .NET Framework application (18 percent)

    Up to know you should have already played with serialisation, streams and general IO. This objective expects you now to master it and know the different types of streams, and the ins and outs of IO management.

    Objective 5 - Improving the security of the .NET Framework applications by using the .NET Framework 2.0 security features (20 percent)

    Now this is were we say goodbye to the want-to-be's and for the rest let really implement security how the .NET Framework expects us to do it. Forget about rolling your own security, learn this and I am sure you will gain a new respect for the MS team and the .NET framework. Security in the framework is powerful when you know what it can do, where to find it and how to use it.

    Objective 6 - Implementing interoperability, reflection, and mailing functionality in a .NET Framework application (11 percent)

    If you have not worked with reflection up to now, you do not know what you are missing ... here is your chance.

    Objective 7 - Implementing globalisation, drawing, and text manipulation functionality in a .NET Framework application (11 percent)

    This is the "Catch All Else" objective with some very useful and good to know topics.

    Audience profile

    Candidates for this exam work on a team in a medium or large development environment that uses Microsoft Visual Studio 2005.

    Candidates learning the materials should have at least two to three years of experience developing Web-based, Microsoft Windows-based, or distributed applications by using the .NET Framework 1.0, the .NET Framework 1.1, and the .NET Framework 2.0. Candidates should have a working knowledge of Visual Studio 2005.

    Credit toward certification

    When you pass Exam 70-536: TS: Microsoft .NET Framework 2.0—Application Development Foundation, you earn credit toward the following certifications:

    • Microsoft Certified Technology Specialist: .NET Framework 2.0 Web Applications
    • Microsoft Certified Technology Specialist: .NET Framework 2.0 Windows Applications
    • Microsoft Certified Technology Specialist: .NET Framework 2.0 Distributed Applications

    Code languages

    When the exam begins, you can choose the programming language in which the code segments will appear. The available code languages for this exam are:

    • Microsoft Visual Basic 2005
    • Microsoft Visual C# 2005
    • Microsoft Visual C++ 2005

    Preparation tools and resources

    To help you prepare for this exam, Microsoft Learning recommends that you have hands-on experience with the product and that you use the following training resources. These training resources do not necessarily cover all of the topics listed in the "Skills measured" section.

    Skills measured

    This certification exam measures your knowledge of the fundamentals of the .NET Framework 2.0. Before taking the exam, you should be proficient in the job skills that are listed in the following table. The table lists Official Microsoft Learning Products that may help you reach competency in the skills being tested in the exam.

    Manage data in a .NET Framework application by using the .NET Framework 2.0 system types. (Refer System namespace)

    • Value types
    • Nullable type
    • Reference types
    • Attributes
    • Generic types
    • Exception classes
    • Boxing and UnBoxing
    • TypeForwardedToAttribute Class

    Manage a group of associated data in a .NET Framework application by using collections. (Refer System.Collections namespace)

    • ArrayList class
    • Collection interfaces
    • ICollection interface and IList interface
    • IComparer interface and IEqualityComparer interface
    • IDictionary interface and IDictionaryEnumerator interface
    • IEnumerable interface and IEnumerator interface
    • Iterators
    • Hashtable class
    • CollectionBase class and ReadOnlyCollectionBase class
    • DictionaryBase class and DictionaryEntry class
    • Comparer class
    • Queue class
    • SortedList class
    • BitArray class
    • Stack class

    Improve type safety and application performance in a .NET Framework application by using generic collections. (Refer System.Collections.Generic namespace)

    • Collection.Generic interfaces
    • Generic IComparable interface (Refer System Namespace)
    • Generic ICollection interface and Generic IList interface
    • Generic IComparer interface and Generic IEqualityComparer interface
    • Generic IDictionary interface
    • Generic IEnumerable interface and Generic IEnumerator interface IHashCodeProvider interface
    • Generic Dictionary
    • Generic Dictionary class and Generic Dictionary.Enumerator structure
    • Generic Dictionary.KeyCollection class and Dictionary.KeyCollection.Enumerator structure
    • Generic Dictionary.ValueCollection class and Dictionary.ValueCollection.Enumerator structure
    • Generic Comparer class and Generic EqualityComparer class
    • Generic KeyValuePair structure
    • Generic List class, Generic List.Enumerator structure, and Generic SortedList class
    • Generic Queue class and Generic Queue.Enumerator structure
    • Generic SortedDictionary class
    • Generic LinkedList
    • Generic LinkedList class
    • Generic LinkedList.Enumerator structure
    • Generic LinkedListNode class
    • Generic Stack class and Generic Stack.Enumerator structure

    Manage data in a .NET Framework application by using specialized collections. (Refer System.Collections.Specialized namespace)

    • Specialized String classes
    • StringCollection class
    • StringDictionary class
    • StringEnumerator class
    • Specialized Dictionary
    • HybridDictionary class
    • IOrderedDictionary interface and OrderedDictionary class
    • ListDictionary class
    • Named collections
    • NameObjectCollectionBase class
    • NameObjectCollectionBase.KeysCollection class
    • NameValueCollection class
    • CollectionsUtil
    • BitVector32 structure and BitVector32.Section structure

    Implement .NET Framework interfaces to cause components to comply with standard contracts. (Refer System namespace)

    • IComparable interface
    • IDisposable interface
    • IConvertible interface
    • ICloneable interface
    • IEquatable interface
    • IFormattable interface

    Control interactions between .NET Framework application components by using events and delegates. (Refer System namespace)

    • Delegate class
    • EventArgs class
    • EventHandler delegates

    Implementing service processes, threading, and application domains in a .NET Framework application Practice questions

    Implement, install, and control a service. (Refer System.ServiceProcess namespace)

    • Inherit from ServiceBase class
    • ServiceController class and ServiceControllerPermission class
    • ServiceInstaller and ServiceProcessInstaller class
    • SessionChangeDescription structure and SessionChangeReason enumeration

    Develop multithreaded .NET Framework applications. (Refer System.Threading namespace)

    • Thread class
    • ThreadPool class
    • ThreadStart delegate and ParameterizedThreadStart delegate
    • Timeout class, Timer class, TimerCallback delegate, WaitCallback delegate, WaitHandle class, and WaitOrTimerCallback delegate
    • ThreadState enumeration and ThreadPriority enumeration
    • ReaderWriterLock class
    • AutoResetEvent class and ManualResetEvent class
    • IAsyncResult interface (Refer System namespace)
    • EventWaitHandle class, RegisterWaitHandle class, SendOrPostCallback delegate, and IOCompletionCallback delegate
    • Interlocked class
    • ExecutionContext class, HostExecutionContext class, HostExecutionContext Manager class, and ContextCallback delegate
    • LockCookie structure, Monitor class, Mutex class, and Semaphore class

    Create a unit of isolation for common language runtime in a .NET Framework application by using application domains. (Refer System namespace)

    • Create an application domain.
    • Unload an application domain.
    • Configure an application domain.
    • Retrieve setup information from an application domain.
    • Load assemblies into an application domain.

    Embedding configuration, diagnostic, management, and installation features into a .NET Framework application Practice questions

    Embed configuration management functionality into a .NET Framework application. (Refer System.Configuration namespace)

    • Configuration class and ConfigurationManager class
    • ConfigurationElement class, ConfigurationElementCollection class, and ConfigurationElementProperty class
    • ConfigurationSection class, ConfigurationSectionCollection class, ConfigurationSectionGroup class, and ConfigurationSectionGroupCollection class
    • Implement ISettingsProviderService interface
    • Implement IApplicationSettingsProvider interface
    • ConfigurationValidatorBase class

    Create a custom Microsoft Windows Installer for the .NET Framework components by using the System.Configuration.Install namespace, and configure the .NET Framework applications by using configuration files, environment variables, and the .NET Framework Configuration tool (Mscorcfg.msc).

    • Installer class
    • Configure which runtime version a .NET Framework application should use.
    • Configure where the runtime should search for an assembly.
    • Configure the location of an assembly and which version of the assembly to use.
    • Direct the runtime to use the DEVPATH environment variable when you search for assemblies.
    • AssemblyInstaller class
    • ComponentInstaller class
    • Configure a .NET Framework application by using the .NET Framework Configuration tool (Mscorcfg.msc).
    • ManagedInstallerClass class
    • InstallContext class
    • InstallerCollection class
    • InstallEventHandler delegate
    • Configure concurrent garbage collection.
    • Register remote objects by using configuration files.

    Manage an event log by using the System.Diagnostics namespace.

    • Write to an event log.
    • Read from an event log.
    • Create a new event log.

    Manage system processes and monitor the performance of a .NET Framework application by using the diagnostics functionality of the .NET Framework 2.0. (Refer System.Diagnostics namespace)

    • Get a list of all running processes.
    • Retrieve information about the current process.
    • Get a list of all modules that are loaded by a process.
    • PerformanceCounter class, PerformanceCounterCategory, and CounterCreationData class
    • Start a process both by using and by not using command-line arguments.
    • StackTrace class
    • StackFrame class

    Debug and trace a .NET Framework application by using the System.Diagnostics namespace.

    • Debug class and Debugger class
    • Trace class, CorrelationManager class, TraceListener class, TraceSource class, TraceSwitch class, XmlWriterTraceListener class, DelimitedListTraceListener class, and EventlogTraceListener class
    • Debugger attributes
    • DebuggerBrowsableAttribute class
    • DebuggerDisplayAttribute class
    • DebuggerHiddenAttribute class
    • DebuggerNonUserCodeAttribute class
    • DebuggerStepperBoundaryAttribute class
    • DebuggerStepThroughAttribute class
    • DebuggerTypeProxyAttribute class
    • DebuggerVisualizerAttribute class

    Embed management information and events into a .NET Framework application. (Refer System.Management namespace)

    • Retrieve a collection of Management objects by using the ManagementObjectSearcher class and its derived classes.
    • Enumerate all disk drivers, network adapters, and processes on a computer.
    • Retrieve information about all network connections.
    • Retrieve information about all services that are paused.
    • ManagementQuery class
    • EventQuery class
    • ObjectQuery class
    • Subscribe to management events by using the ManagementEventWatcher class.

    Implementing serialization and input/output functionality in a .NET Framework application Practice questions

    Serialize or deserialize an object or an object graph by using runtime serialization techniques. (Refer System.Runtime.Serialization namespace)

    • Serialization interfaces
    • IDeserializationCallback interface
    • IFormatter interface and IFormatterConverter interface
    • ISerializable interface
    • Serilization attributes
    • OnDeserializedAttribute class and OnDeserializingAttribute class
    • OnSerializedAttribute class and OnSerializingAttribute class
    • OptionalFieldAttribute class
    • SerializationEntry structure and SerializationInfo class
    • ObjectManager class
    • Formatter class, FormatterConverter class, and FormatterServices class
    • StreamingContext structure

    Control the serialization of an object into XML format by using the System.Xml.Serialization namespace.

    • Serialize and deserialize objects into XML format by using the XmlSerializer class.
    • Control serialization by using serialization attributes.
    • Implement XML Serialization interfaces to provide custom formatting for XML serialization.
    • Delegates and event handlers are provided by the System.Xml.Serialization namespace

    Implement custom serialization formatting by using the Serialization Formatter classes.

    • SoapFormatter class (Refer System.Runtime.Serialization.Formatters.Soap namespace)
    • BinaryFormatter class (Refer System.Runtime.Serialization.Formatters.Binary namespace)

    Access files and folders by using the File System classes. (Refer System.IO namespace)

    • File class and FileInfo class
    • Directory class and DirectoryInfo class
    • DriveInfo class and DriveType enumeration
    • FileSystemInfo class and FileSystemWatcher class
    • Path class
    • ErrorEventArgs class and ErrorEventHandler delegate
    • RenamedEventArgs class and RenamedEventHandler delegate

    Manage byte streams by using Stream classes. (Refer System.IO namespace)

    • FileStream class
    • Stream class
    • MemoryStream class
    • BufferedStream class

    Manage the .NET Framework application data by using Reader and Writer classes. (Refer System.IO namespace)

    • StringReader class and StringWriter class
    • TextReader class and TextWriter class
    • StreamReader class and StreamWriter class
    • BinaryReader class and BinaryWriter class

    Compress or decompress stream information in a .NET Framework application (refer System.IO.Compression namespace), and improve the security of application data by using isolated storage. (Refer System.IO.IsolatedStorage namespace)

    • IsolatedStorageFile class
    • IsolatedStorageFileStream class
    • DeflateStream class
    • GZipStream class

    Improving the security of the .NET Framework applications by using the .NET Framework 2.0 security features Practice questions

    Implement code access security to improve the security of a .NET Framework application. (Refer System.Security namespace)

    • SecurityManager class
    • CodeAccessPermission class
    • Modify the Code Access security policy at the computer, user, and enterprise policy level by using the Code Access Security Policy tool (Caspol.exe).
    • PermissionSet class and NamedPermissionSet class
    • Standard Security interfaces
    • IEvidenceFactory interface
    • IPermission interface

    Implement access control by using the System.Security.AccessControl classes.

    • DirectorySecurity class, FileSecurity class, FileSystemSecurity class, and RegistrySecurity class
    • AccessRule class
    • AuthorizationRule class and AuthorizationRuleCollection class
    • CommonAce class, CommonAcl class, CompoundAce class, GenericAce class, and GenericAcl class
    • AuditRule class
    • MutexSecurity class, ObjectSecurity class, and SemaphoreSecurity class

    Implement a custom authentication scheme by using the System.Security.Authentication classes. (Refer System.Security.Authentication namespace)

    Encrypt, decrypt, and hash data by using the System.Security.Cryptography classes. (Refer System.Security.Cryptography namespace)

    • DES class and DESCryptoServiceProvider class
    • HashAlgorithm class
    • DSA class and DSACryptoServiceProvider class
    • SHA1 class and SHA1CryptoServiceProvider class
    • TripleDES and TripleDESCryptoServiceProvider class
    • MD5 class and MD5CryptoServiceProvider class
    • RSA class and RSACryptoServiceProvider class
    • RandomNumberGenerator class
    • CryptoStream class
    • CryptoConfig class
    • RC2 class and RC2CryptoServiceProvider class
    • AssymetricAlgorithm class
    • ProtectedData class and ProtectedMemory class
    • RijndaelManaged class and RijndaelManagedTransform class
    • CspParameters class
    • CryptoAPITransform class
    • Hash-based Message Authentication Code (HMAC)
    • HMACMD5 class
    • HMACRIPEMD160 class
    • HMACSHA1 class
    • HMACSHA256 class
    • HMACSHA384 class
    • HMACSHA512 class

    Control permissions for resources by using the System.Security.Permission classes. (Refer System.Security.Permission namespace)

    • SecurityPermission class
    • PrincipalPermission class
    • FileIOPermission class
    • StrongNameIdentityPermission class
    • UIPermission class
    • UrlIdentityPermission class
    • PublisherIdentityPermission class
    • GacIdentityPermission class
    • FileDialogPermission class
    • DataProtectionPermission class
    • EnvironmentPermission class
    • IUnrestrictedPermission interface
    • RegistryPermission class
    • IsolatedStorageFilePermission class
    • KeyContainerPermission class
    • ReflectionPermission class
    • StorePermission class
    • SiteIdentityPermission class
    • ZoneIdentityPermission class

    Control code privileges by using System.Security.Policy classes. (Refer System.Security.Policy namespace)

    • ApplicationSecurityInfo class and ApplicationSecurityManager class
    • ApplicationTrust class and ApplicationTrustCollection class
    • Evidence class and PermissionRequestEvidence class
    • CodeGroup class, FileCodeGroup class, FirstMatchCodeGroup class, NetCodeGroup class, and UnionCodeGroup class
    • Condition classes
    • AllMembershipCondition class
    • ApplicationDirectory class and ApplicationDirectoryMembershipCondition class
    • GacInstalled class and GacMembershipCondition class
    • Hash class and HashMembershipCondition class
    • Publisher class and PublisherMembershipCondition class
    • Site class and SiteMembershipCondition class
    • StrongName class and StrongNameMembershipCondition class
    • Url class and UrlMembershipConditon class
    • Zone class and ZoneMembershipCondition class
    • PolicyLevel class and PolicyStatement class
    • IApplicationTrustManager interface, IMembershipCondition interface, and IIdentityPermissionFactory interface

    Access and modify identity information by using the System.Security.Principal classes. (Refer System.Security.Principal namespace)

    • GenericIdentity class and GenericPrincipal class
    • WindowsIdentity class and WindowsPrincipal class
    • NTAccount class and SecurityIdentifier class
    • IIdentity interface and IPrincipal interface
    • WindowsImpersonationContext class
    • IdentityReference class and IdentityReferenceCollection class

    Implementing interoperability, reflection, and mailing functionality in a .NET Framework application Practice questions

    Expose COM components to the .NET Framework and the .NET Framework components to COM. (Refer System.Runtime.InteropServices namespace)

    • Import a type library as an assembly.
    • Add references to type libraries.
    • Type Library Importer (Tlbimp.exe)
    • Generate interop assemblies from type libraries.
    • Imported Library Conversion
    • Imported Module Conversion
    • Imported Type Conversion
    • Imported Member Conversion
    • Imported Parameter Conversion
    • TypeConverter class
    • Create COM types in managed code.
    • Compile an interop project.
    • Deploy an interop application.
    • Qualify the .NET Framework types for interoperation.
    • Apply Interop attributes, such as the ComVisibleAttribute class.
    • Package an assembly for COM.
    • Deploy an application for COM access.

    Call unmanaged DLL functions in a .NET Framework application, and control the marshaling of data in a .NET Framework application. (Refer System.Runtime.InteropServices namespace)

    • Platform Invoke
    • Create a class to hold DLL functions.
    • Create prototypes in managed code.
    • DllImportAttribute class
    • Call a DLL function.
    • Call a DLL function in special cases, such as passing structures and implementing callback functions.
    • Create a new Exception class and map it to an HRESULT.
    • Default marshaling behavior
    • Marshal data with Platform Invoke
    • Marshal data with COM Interop
    • MarshalAsAttribute class and Marshal class

    Implement reflection functionality in a .NET Framework application (refer System.Reflection namespace), and create metadata, Microsoft intermediate language (MSIL), and a PE file by using the System.Reflection.Emit namespace.

    • Assembly class
    • Assembly attributes
    • AssemblyAlgorithmIdAttribute class
    • AssemblyCompanyAttribute class
    • AssemblyConfigurationAttribute class
    • AssemblyCopyrightAttribute class
    • AssemblyCultureAttribute class
    • AssemblyDefaultAliasAttribute class
    • AssemblyDelaySignAttribute class
    • AssemblyDescriptionAttribute class
    • AssemblyFileVersionAttribute class
    • AssemblyFlagsAttribute class
    • AssemblyInformationalVersionAttribute class
    • AssemblyKeyFileAttribute class
    • AssemblyTitleAttribute class
    • AssemblyTrademarkAttribute class
    • AssemblyVersionAttribute class
    • Info classes
    • ConstructorInfo class
    • MethodInfo class
    • MemberInfo class
    • PropertyInfo class
    • FieldInfo class
    • EventInfo class
    • LocalVariableInfo class
    • Binder class and BindingFlags
    • MethodBase class and MethodBody class
    • Builder classes
    • AssemblyBuilder class
    • ConstructorBuilder class
    • EnumBuilder class
    • EventBuilder class
    • FieldBuilder class
    • LocalBuilder class
    • MethodBuilder class
    • ModuleBuilder class
    • ParameterBuilder class
    • PropertyBuilder class
    • TypeBuilder class

    Send electronic mail to a Simple Mail Transfer Protocol (SMTP) server for delivery from a .NET Framework application. (Refer System.Net.Mail namespace)

    • MailMessage class
    • MailAddress class and MailAddressCollection class
    • SmtpClient class, SmtpPermission class, and SmtpPermissionAttribute class
    • Attachment class, AttachmentBase class, and AttachmentCollection class
    • SmtpException class and SmtpFailedReceipientException class
    • SendCompletedEventHandler delegate
    • LinkedResource class and LinkedResourceCollection class
    • AlternateView class and AlternateViewCollection class

    Implementing globalization, drawing, and text manipulation functionality in a .NET Framework application Practice questions

    Format data based on culture information. (Refer System.Globalization namespace)

    • Access culture and region information in a .NET Framework application.
    • CultureInfo class
    • CultureTypes enumeration
    • RegionInfo class
    • Format date and time values based on the culture.
    • DateTimeFormatInfo class
    • Format number values based on the culture.
    • NumberFormatInfo class
    • NumberStyles enumeration
    • Perform culture-sensitive string comparison.
    • CompareInfo class
    • CompareOptions enumeration
    • Build a custom culture class based on existing culture and region classes.
    • CultureAndRegionInfoBuilder class
    • CultureAndRegionModifier enumeration

    Enhance the user interface of a .NET Framework application by using the System.Drawing namespace.

    • Enhance the user interface of a .NET Framework application by using brushes, pens, colors, and fonts.
    • Brush class
    • Brushes class
    • SystemBrushes class
    • TextureBrush class
    • Pen class
    • Pens class
    • SystemPens class
    • SolidBrush class
    • Color structure
    • ColorConverter class
    • ColorTranslator class
    • SystemColors class
    • StringFormat class
    • Font class
    • FontConverter class
    • FontFamily class
    • SystemFonts class
    • Enhance the user interface of a .NET Framework application by using graphics, images, bitmaps, and icons.
    • Graphics class
    • BufferedGraphics class
    • BufferedGraphicsManager class
    • Image class
    • ImageConverter class
    • ImageAnimator class
    • Bitmap class
    • Icon class
    • IconConverter class
    • SystemIcons class
    • Enhance the user interface of a .NET Framework application by using shapes and sizes.
    • Point Structure
    • PointConverter class
    • Rectangle Structure
    • RectangleConverter class
    • Size Structure
    • SizeConverter class
    • Region class

    Enhance the text handling capabilities of a .NET Framework application (refer System.Text namespace), and search, modify, and control text in a .NET Framework application by using regular expressions. (Refer System.RegularExpressions namespace)

    • StringBuilder class
    • Regex class
    • Match class and MatchCollection class
    • Group class and GroupCollection class
    • Encode text by using Encoding classes
    • Encoding class
    • EncodingInfo class
    • ASCIIEncoding class
    • UnicodeEncoding class
    • UTF8Encoding class
    • Encoding Fallback classes
    • Decode text by using Decoding classes.
    • Decoder class
    • Decoder Fallback classes
    • Capture class and CaptureCollection class

    Where to next

    Well keep coming back to this post as I will keep editing links in it as time goes on to content to the topics.

  • Microsoft Visual Studio 2008 certifications heads up

    Microsoft Learning has introduced the new Visual Studio 2008 certifications, although these exams are still in beta or about to go into beta this is the roadmap ahead of you.  Some of the exams are still in beta for the next few weeks if you are game to do them.

    In a nutshell:

    • There are 6 MCTS exams on different framework aspects of the .NET framework
      • MCTS: .NET Framework 3.5, Windows Presentation Foundation Applications
      • MCTS: .NET Framework 3.5, Windows Communication Foundation Applications
      • MCTS: .NET Framework 3.5, Windows Workflow Foundation Applications
      • MCTS: .NET Framework 3.5, Windows Forms Applications
      • MCTS: .NET Framework 3.5, ADO.NET Applications
      • MCTS: .NET Framework 3.5, ASP.NET Applications
    • You still need to write the core exam 70-536: TS: Microsoft .NET Framework 2.0 – Application Development Foundation
    • MCPD still have the same three categories (again you need to do the MCTS exams in each area first)
      • MCPD: Windows Developer 3.5
      • MCPD: ASP.NET Developer 3.5
      • MCPD: Enterprise Application Developer 3.5

    I will keep you posted as more exam details come out.

    References

    1. http://www.microsoft.com/learning/mcp/vstudio/2008/default.mspx
    2. http://blogs.msdn.com/trika/archive/2008/04/18/net-framework-3-5-certifications.aspx
  • System.Object Equals Method

    The Equals method is used to determine equality of two objects, however the way it does this differs from reference an value type objects.  For value type objects (structures)  the actual values of the structure is compared, i.e. its state is compared. For reference type objects, equality is determined whether the two objects are pointing to the same object in memory, thus the actual state is not compared. 

    For the purposes of demonstration, the following co-ordinate class has been created with an X and Y co-ordinate

    image 

       1: /// <summary>
       2: /// The point class represents a X and Y coordinate
       3: /// </summary>
       4: public class Point
       5: {
       6:     #region // Fields
       7:  
       8:     private int _x;
       9:     private int _y;
      10:  
      11:     #endregion
      12:  
      13:     #region // Properties
      14:  
      15:     /// <summary>
      16:     /// The x coordinate.
      17:     /// </summary>
      18:     public int X { get { return _x; } set { _x = value; } }
      19:  
      20:     /// <summary>
      21:     /// The y coordinate.
      22:     /// </summary>
      23:     public int Y { get { return _y; } set { _y = value; } }
      24:  
      25:     #endregion
      26:  
      27:     #region // Constructor
      28:  
      29:     #region // -  ctor(int, int)
      30:  
      31:     /// <summary>
      32:     /// Initialises the point to the values of x and y.
      33:     /// </summary>
      34:     /// <param name="x">The initial value of the x coordinate.</param>
      35:     /// <param name="y">The initial value of the y coordinate.</param>
      36:     public Point(int x, int y)
      37:     {
      38:         _x = x;
      39:         _y = y;
      40:     }
      41:  
      42:     #endregion
      43:  
      44:     #endregion
      45:  
      46:     #region // System.Object overrides
      47:  
      48:     #region // -  ToString
      49:  
      50:     /// <summary>
      51:     /// This method converts the point to a string.
      52:     /// </summary>
      53:     /// <returns>Returns a string representation of the x and y cordinates</returns>
      54:     public override string ToString()
      55:     {
      56:         return string.Format("(x={0},y={1})", _x, _y);
      57:     }
      58:     
      59:     #endregion
      60:  
      61:     #endregion
      62: }

    The problem

    Create the following test program

       1: /// <summary>
       2: /// The demonstration console application
       3: /// </summary>
       4: class Program
       5: {
       6:     static void Main(string[] args)
       7:     {
       8:         // Create a Point reference varialble to point new object on the heap for point 3,5
       9:         Point A = new Point(3, 5);
      10:         // Create a Point reference varialble to point new object on the heap for point 8,6 
      11:         Point B = new Point(8, 6);
      12:         // Create a Point reference variable and point it to the same heap object as A
      13:         Point C = A;
      14:         // Create a Point reference varialble to point new object on the heap for point 3,5
      15:         Point D = new Point(3, 5);
      16:  
      17:         Console.WriteLine("A {1} == B {2} : {0}", (A==B),A,B);
      18:         Console.WriteLine("A {1} == C {2} : {0}", (A == C),A,C);
      19:         Console.WriteLine("A {1} == D {2} : {0}", (A == D),A,D);
      20:     }
      21: }

    Run the program an you get the following result

    image

    Note that A and C are equal as they point to the same object on the heap.  However, A and D are not equal even though the values are the same, the reason for this is they are different objects on the heap!  Remember that when comparing reference types, the reference to the heap is compared and NOT the values.

    image

    This is a problem if you actually want to compare the values, well in .NET you can, read the solution below.

    The solution

    If you want to compare different objects on the heap and equality is important for you, you are going to have to override the Equals method. Overriding this is not good enough as most programmers do not type code like if( a.Equals(b) ), and would rather type if( a == b ).  Thus you will land up creating an the operator==, however the bad news is you will also need to create the operator !=.

    Thus when comparing objects you will have to create three methods, these are listed below:

    Override the Equals Method

    The first step is to override the Equals method of system object.  This method should compare the current object with the passed object to determine whether the fields are the same.  In my example I will check this.X == obj.X a and this.Y ==  obj.Y, when both are the same I will return true otherwise I will also return false. 

    You will also not that the Equals operator passes an object, so the first thing to do is determine whether we are comparing a Point with a Point.   The nice little trick here is obj is Point will return false if obj == null, thus we are ensuring the object is not null and is a point.

       1: #region // -  Equals
       2:  
       3: /// <summary>
       4: /// This method compares the equality of two objects
       5: /// </summary>
       6: /// <param name="obj"></param>
       7: /// <returns></returns>
       8: public override bool Equals(object obj)
       9: {
      10:     if (obj is Point)
      11:     {
      12:         Point rhs = (Point)obj;
      13:         return (this._x == rhs._x && this._y == rhs._y);
      14:     }
      15:  
      16:     return false;
      17: }
      18:  
      19: #endregion

    Create the operator==

    This is nice however the == operator still will not return what we expected, thus we have to create the == operator.  Create the operator by adding the following code to the project

       1: #region // -  operator==
       2:  
       3: /// <summary>
       4: /// The equals operator compares two points and uses the Equals method
       5: /// </summary>
       6: /// <param name="lhs">The object on the left-hand-side of the operator.</param>
       7: /// <param name="rhs">The object on the right-hand-side of the operator.</param>
       8: /// <returns>Returns true if the x,y coordinates are the same.</returns>
       9: public static bool operator ==(Point lhs, Point rhs)
      10: {
      11:     if (null == (object)lhs)
      12:         return false;
      13:     return lhs.Equals(rhs);
      14: }
      15:  
      16: #endregion

     

    There is a bit of ugly code here that you need to be aware of, that is on line 11.  This is to make sure that the lhs argument is not null and to prevent lhs.Equals(rhs) throwing an NullReferenceException if it is null.  The ugly comes in the fact that if you had typed if (null == rhs), you would get recursive method execution method and a StackOverflowException, hence the cast (object)lhs, causing the objects operator== to execute.

    Create the operator!=

    When you create the operator==, you have to also code the operator!=, so you will have to add this code

     
       1: #region // -  operator!=
       2:  
       3: /// <summary>
       4: /// The not equals operator compares that inequality of two operators
       5: /// </summary>
       6: /// <param name="lhs">The object on the left-hand-side of the operator.</param>
       7: /// <param name="rhs">The object on the right-hand-side of the operator.</param>
       8: /// <returns>Returns true if the x,y coordinates are not the same.</returns>
       9: public static bool operator !=(Point lhs, Point rhs)
      10: {
      11:     if (null == (object)lhs) 
      12:         return false;
      13:     return !lhs.Equals(rhs);
      14:     
      15: }
      16:  
      17: #endregion

    As with the operator==, we need to make sure that lhs is an object and prevent a recursive call.

    The test

    Compile and run your test application, this time you will notice that A == D is also true.

    image 

    Summary

    In summary if you are wanting to compare two different objects on the heap, i.e. reference type objects that contain the same data, you will have to override the Equals method of System.Object, then also create operator== and operator!=.   You will still be able to check whether the objects are physically the same object in memory by using object.ReferenceEquals.

    Posted Apr 12 2008, 01:14 PM by Brett with no comments
    Filed under: ,
  • SharePoint - The TEMPLATE folder in the 12 Hive

    As a developer learning how to provision your custom solutions to SharePoint, you will come across the TEMPLATE directory within the 12 hive.  It is exceptionally important that you master what is in the directory and where to put your own resources.  This blog post will attempt to help you master what is in the TEMPLATE directory structure.

    Spend a bit of time exploring this on your own machine and having a look at the contents as this will certainly be time well spent.

    TEMPLATE\LCID

    SharePoint is an international product and supports globalisation.  You are able to localise your site to any supported language.  The LCID is the local identifier for a language and is commonly used through windows programming.  Refer to my post SharePoint Locale ID (LCIDS) Table.

    TEMPLATE\LCID\STS

    The directory contains a set of default template documents for various packages such as word, excel, one note and many others.  These templates are automatically used when creating a new document within a document library.

    TEMPLATE\LCID\Workflow

    The directory contains manifest files for workflow templates.

    TEMPLATE\LCID\XML

    The directory contains several XML files with language specific text for default e-mails, regional settings.  The global configuration file for the global template resides in this folder.

    TEMPLATE\Admin

    The Admin folder contains the application pages for the Central Administration site.

    TEMPLATE\ControlTemplates

    This directory contains a set of common composite server side controls (ascx) files that are used in pages as well on the master pages.

    TEMPLATE\DocumentTemplates

    This folder contains template pages used when provisioning templates.  The only page is in WSS the template aspx for a wiki page.

    TEMPLATE\Features

    This vital directory is where all the various sharepoint features will be deployed to, including your own.  Each feature is deployed into its own folder, I would suggest that you create your feature in a directory[company].[Feature name] as to eliminate naming conflicts.

    TEMPLATE\Features\[feature]

    Each feature directory will contain the feature manifest file, typically this would be feature.xml.

    TEMPLATE\Global

    This directory contains the global master page (also mobile pages), all the fields definitions that are global to all sites and the global site definitions.

    TEMPLATE\Images

    Contains images shared by all pages on the server, addressed by the virtual directory /_layouts/images.

    TEMPLATE\Layouts

    This directory structure is contains application pages, application master pages, cascading style sheets, java scripts. Th directory is exposted as a virtual directory /_layouts on all web applications, this directory contains language subdirectories that contain the forms for creating lists, site administration pages, and so on. These directories are shared by all sites.

    TEMPLATE\Layouts\LCID

    Contains forms for creating lists, site administration pages, and so on, for a specific language.

    TEMPLATE\Layouts\LCID\Images

    This folder contains regional specific images used by the style sheets as well as images used on application pages.

    TEMPLATE\Layouts\LCID\Styles

    This folder contains regional specific cascading style sheets used by templates within the site.  The important style sheet to note is the core.css file.

    TEMPLATE\Layouts\Mobile

    The directory contains application pages specific to mobile devices.

    TEMPLATE\Layouts\Style

    The directory contains style sheets used by pages that are not local specific.

    TEMPLATE\Pages

    The directory contains several site page files.

    TEMPLATE\SiteTemplates

    The directory contains a set of directories for different templates deployed into sharepoint.  Each template is in a subdirectory

    TEMPLATE\SiteTemplates\[template]

    Each template is installed in its own  sub directory with possible supporting files.

    TEMPLATE\SiteTemplates\[template]\xml

    Each template has an xml sub directory with the important ONET.xml file.  This manifest describes the template and the different configurations within the template.

    TEMPLATE\SQL

    The SQL folder contains a set of T-SQL files used to create the necessary database schemas for the various SharePoint databases.

    TEMPLATE\Themes

    This directory contains the list of themes which allows you to change the basic colour scheme and branding of the site.  However, these themes are strongly coupled to the default.master and other master pages as well as the core.css file.  Each directory will also contain graphic resources 

    XML

    Contains various xml schema files that define Collaborative Application Markup Language. These files are particularly useful to copy to the xml editors such as Visual Studio, thus allowing validation and intelli-sense.

    See

    See Also

    Posted Apr 09 2008, 10:28 PM by Brett with 2 comment(s)
    Filed under:
  • SharePoint Locale ID (LCID) Table

    Windows uses a Locale Identifier (LCID) to determine the language and culture to use when displaying information to a user.  The users LCID is picked up from his/her regional settings within windows or from the language settings for the browser.  The application then displays resources, number and date formatting according to the the local.  This post lists a table of LCID's, the short name and full name of each locale.

    All products, such as SharePoint, SQL, .NET all use this to assist with formatting.  As this post is focusing on LCIDS in SharePoint, there are several folders within the 12 hive that allow you to globalise and localise your application.

    \BIN\LCID
    SharePoint deploys local specific dll's for custom messages used within the SharePoint framework.  You will typically not be updating this folder with your own DLL's.
    \HCCab\LCID
    You are able to create and deploy your own help files that integrate into the SharePoint help system.  Doing this is not the simplest of tasks and does require a very specific way to deploy your help files.
    \Help\LCID  
      This folder contains a compiled help file (.chm) that is used when installing SharePoint.  There is no need for you to change this folder.
    \TEMPLATE\LCID  
    SharePoint is an international product and supports globalisation.  You are able to localise your site to any supported language.  The LCID is the local identifier for a language and is commonly used through windows programming.
    \TEMPLATE\LAYOUTS\LCID  
    The layouts folder contains application pages and there is a LCID folder for each language.  This LCID folder contains localised java scripts, cascading style sheets and images used in the application page. 
    \TEMPLATE\SQL\LCID  
    Localised default script and data used when the SharePoint provisioning engine creates a database.
    \ISAPI\HELP\LCID  
    Help content for the SharePoint web services.

    Table of locals

    Locale Description

     

     

     

     

    Short String

     

     

     

     

    Decimal Value

     

     

     

     

    Afrikaans

     

     

     

    af

     

     

     

    1078

     

     

     

    Albanian

     

     

     

    sq

     

     

     

    1052

     

     

     

    Arabic - United Arab Emirates

     

     

     

    ar-ae

     

     

     

    14337

     

     

     

    Arabic - Bahrain

     

     

     

    ar-bh

     

     

     

    15361

     

     

     

    Arabic - Algeria

     

     

     

    ar-dz

     

     

     

    5121

     

     

     

    Arabic - Egypt

     

     

     

    ar-eg

     

     

     

    3073

     

     

     

    Arabic - Iraq

     

     

     

    ar-iq

     

     

     

    2049

     

     

     

    Arabic - Jordan

     

     

     

    ar-jo

     

     

     

    11265

     

     

     

    Arabic - Kuwait

     

     

     

    ar-kw

     

     

     

    13313

     

     

     

    Arabic - Lebanon

     

     

     

    ar-lb

     

     

     

    12289

     

     

     

    Arabic - Libya

     

     

     

    ar-ly

     

     

     

    4097

     

     

     

    Arabic - Morocco

     

     

     

    ar-ma

     

     

     

    6145

     

     

     

    Arabic - Oman

     

     

     

    ar-om

     

     

     

    8193

     

     

     

    Arabic - Qatar

     

     

     

    ar-qa

     

     

     

    16385

     

     

     

    Arabic - Saudi Arabia

     

     

     

    ar-sa

     

     

     

    1025

     

     

     

    Arabic - Syria

     

     

     

    ar-sy

     

     

     

    10241

     

     

     

    Arabic - Tunisia

     

     

     

    ar-tn

     

     

     

    7169

     

     

     

    Arabic - Yemen

     

     

     

    ar-ye

     

     

     

    9217

     

     

     

    Armenian

     

     

     

    hy

     

     

     

    1067

     

     

     

    Azeri - Latin

     

     

     

    az-az

     

     

     

    1068

     

     

     

    Azeri - Cyrillic

     

     

     

    az-az

     

     

     

    2092

     

     

     

    Basque

     

     

     

    eu

     

     

     

    1069

     

     

     

    Belarusian

     

     

     

    be

     

     

     

    1059

     

     

     

    Bulgarian

     

     

     

    bg

     

     

     

    1026

     

     

     

    Catalan

     

     

     

    ca

     

     

     

    1027

     

     

     

    Chinese - China

     

     

     

    zh-cn

     

     

     

    2052

     

     

     

    Chinese - Hong Kong SAR

     

     

     

    zh-hk

     

     

     

    3076

     

     

     

    Chinese - Macau SAR

     

     

     

    zh-mo

     

     

     

    5124

     

     

     

    Chinese - Singapore

     

     

     

    zh-sg

     

     

     

    4100

     

     

     

    Chinese - Taiwan

     

     

     

    zh-tw

     

     

     

    1028

     

     

     

    Croatian

     

     

     

    hr

     

     

     

    1050

     

     

     

    Czech

     

     

     

    cs

     

     

     

    1029

     

     

     

    Danish

     

     

     

    da

     

     

     

    1030

     

     

     

    Dutch - The Netherlands

     

     

     

    nl-nl

     

     

     

    1043

     

     

     

    Dutch - Belgium

     

     

     

    nl-be

     

     

     

    2067

     

     

     

    English - Australia

     

     

     

    en-au

     

     

     

    3081

     

     

     

    English - Belize

     

     

     

    en-bz

     

     

     

    10249

     

     

     

    English - Canada

     

     

     

    en-ca

     

     

     

    4105

     

     

     

    English - Caribbean

     

     

     

    en-cb

     

     

     

    9225

     

     

     

    English - Ireland

     

     

     

    en-ie

     

     

     

    6153

     

     

     

    English - Jamaica

     

     

     

    en-jm

     

     

     

    8201

     

     

     

    English - New Zealand

     

     

     

    en-nz

     

     

     

    5129

     

     

     

    English - Phillippines

     

     

     

    en-ph

     

     

     

    13321

     

     

     

    English - South Africa

     

     

     

    en-za

     

     

     

    7177

     

     

     

    English - Trinidad

     

     

     

    en-tt

     

     

     

    11273

     

     

     

    English - United Kingdom

     

     

     

    en-gb

     

     

     

    2057

     

     

     

    English - United States

     

     

     

    en-us

     

     

     

    1033

     

     

     

    Estonian

     

     

     

    et

     

     

     

    1061

     

     

     

    Farsi

     

     

     

    fa

     

     

     

    1065

     

     

     

    Finnish

     

     

     

    fi

     

     

     

    1035

     

     

     

    Faroese

     

     

     

    fo

     

     

     

    1080

     

     

     

    French - France

     

     

     

    fr-fr

     

     

     

    1036

     

     

     

    French - Belgium

     

     

     

    fr-be

     

     

     

    2060

     

     

     

    French - Canada

     

     

     

    fr-ca

     

     

     

    3084

     

     

     

    French - Luxembourg

     

     

     

    fr-lu

     

     

     

    5132

     

     

     

    French - Switzerland

     

     

     

    fr-ch

     

     

     

    4108

     

     

     

    Gaelic - Ireland

     

     

     

    gd-ie

     

     

     

    2108

     

     

     

    Gaelic - Scotland

     

     

     

    gd

     

     

     

    1084

     

     

     

    German - Germany

     

     

     

    de-de

     

     

     

    1031

     

     

     

    German - Austria

     

     

     

    de-at

     

     

     

    3079

     

     

     

    German - Liechtenstein

     

     

     

    de-li

     

     

     

    5127

     

     

     

    German - Luxembourg

     

     

     

    de-lu

     

     

     

    4103

     

     

     

    German - Switzerland

     

     

     

    de-ch

     

     

     

    2055

     

     

     

    Greek

     

     

     

    el

     

     

     

    1032

     

     

     

    Hebrew

     

     

     

    he

     

     

     

    1037

     

     

     

    Hindi

     

     

     

    hi

     

     

     

    1081

     

     

     

    Hungarian

     

     

     

    hu

     

     

     

    1038

     

     

     

    Icelandic

     

     

     

    is

     

     

     

    1039

     

     

     

    Indonesian

     

     

     

    id

     

     

     

    1057

     

     

     

    Italian - Italy

     

     

     

    it-it

     

     

     

    1040

     

     

     

    Italian - Switzerland

     

     

     

    it-ch

     

     

     

    2064

     

     

     

    Japanese

     

     

     

    ja

     

     

     

    1041

     

     

     

    Korean

     

     

     

    ko

     

     

     

    1042

     

     

     

    Latvian

     

     

     

    lv

     

     

     

    1062

     

     

     

    Lithuanian

     

     

     

    lt

     

     

     

    1063

     

     

     

    FYRO Macedonian

     

     

     

    mk

     

     

     

    1071

     

     

     

    Malay - Malaysia

     

     

     

    ms-my

     

     

     

    1086

     

     

     

    Malay – Brunei

     

     

     

    ms-bn

     

     

     

    2110

     

     

     

    Maltese

     

     

     

    mt

     

     

     

    1082

     

     

     

    Marathi

     

     

     

    mr

     

     

     

    1102

     

     

     

    Norwegian - Bokmål

     

     

     

    no-no

     

     

     

    1044

     

     

     

    Norwegian - Nynorsk

     

     

     

    no-no

     

     

     

    2068

     

     

     

    Polish

     

     

     

    pl

     

     

     

    1045

     

     

     

    Portuguese - Portugal

     

     

     

    pt-pt

     

     

     

    2070

     

     

     

    Portuguese - Brazil

     

     

     

    pt-br

     

     

     

    1046

     

     

     

    Raeto-Romance

     

     

     

    rm

     

     

     

    1047

     

     

     

    Romanian - Romania

     

     

     

    ro

     

     

     

    1048

     

     

     

    Romanian - Republic of Moldova

     

     

     

    ro-mo

     

     

     

    2072

     

     

     

    Russian

     

     

     

    ru

     

     

     

    1049

     

     

     

    Russian - Republic of Moldova

     

     

     

    ru-mo

     

     

     

    2073

     

     

     

    Sanskrit

     

     

     

    sa

     

     

     

    1103

     

     

     

    Serbian - Cyrillic

     

     

     

    sr-sp

     

     

     

    3098

     

     

     

    Serbian - Latin

     

     

     

    sr-sp

     

     

     

    2074

     

     

     

    Setsuana

     

     

     

    tn

     

     

     

    1074

     

     

     

    Slovenian

     

     

     

    sl

     

     

     

    1060

     

     

     

    Slovak

     

     

     

    sk

     

     

     

    1051

     

     

     

    Sorbian

     

     

     

    sb

     

     

     

    1070

     

     

     

    Spanish - Spain

     

     

     

    es-es

     

     

     

    1034

     

     

     

    Spanish - Argentina

     

     

     

    es-ar

     

     

     

    11274

     

     

     

    Spanish - Bolivia

     

     

     

    es-bo

     

     

     

    16394

     

     

     

    Spanish - Chile

     

     

     

    es-cl

     

     

     

    13322

     

     

     

    Spanish - Colombia

     

     

     

    es-co

     

     

     

    9226

     

     

     

    Spanish - Costa Rica

     

     

     

    es-cr

     

     

     

    5130

     

     

     

    Spanish - Dominican Republic

     

     

     

    es-do

     

     

     

    7178

     

     

     

    Spanish - Ecuador

     

     

     

    es-ec

     

     

     

    12298

     

     

     

    Spanish - Guatemala

     

     

     

    es-gt

     

     

     

    4106

     

     

     

    Spanish - Honduras

     

     

     

    es-hn

     

     

     

    18442

     

     

     

    Spanish - Mexico

     

     

     

    es-mx

     

     

     

    2058

     

     

     

    Spanish - Nicaragua

     

     

     

    es-ni

     

     

     

    19466

     

     

     

    Spanish - Panama

     

     

     

    es-pa

     

     

     

    6154

     

     

     

    Spanish - Peru

     

     

     

    es-pe

     

     

     

    10250

     

     

     

    Spanish - Puerto Rico

     

     

     

    es-pr

     

     

     

    20490

     

     

     

    Spanish - Paraguay

     

     

     

    es-py

     

     

     

    15370

     

     

     

    Spanish - El Salvador

     

     

     

    es-sv

     

     

     

    17418

     

     

     

    Spanish - Uruguay

     

     

     

    es-uy

     

     

     

    14346

     

     

     

    Spanish - Venezuela

     

     

     

    es-ve

     

     

     

    8202

     

     

     

    Sutu

     

     

     

    sx

     

     

     

    1072

     

     

     

    Swahili

     

     

     

    sw

     

     

     

    1089

     

     

     

    Swedish - Sweden

     

     

     

    sv-se

     

     

     

    1053

     

     

     

    Swedish - Finland

     

     

     

    sv-fi

     

     

     

    2077

     

     

     

    Tamil

     

     

     

    ta

     

     

     

    1097

     

     

     

    Tatar

     

     

     

    tt

     

     

     

    1092

     

     

     

    Thai

     

     

     

    th

     

     

     

    1054

     

     

     

    Turkish

     

     

     

    tr

     

     

     

    1055

     

     

     

    Tsonga

     

     

     

    ts

     

     

     

    1073

     

     

     

    Ukrainian

     

     

     

    uk

     

     

     

    1058

     

     

     

    Urdu

     

     

     

    ur

     

     

     

    1056

     

     

     

    Uzbek - Cyrillic

     

     

     

    uz-uz

     

     

     

    2115

     

     

     

    Uzbek – Latin

     

     

     

    uz-uz

     

     

     

    1091

     

     

     

    Vietnamese

     

     

     

    vi

     

     

     

    1066

     

     

     

    Xhosa

     

     

     

    xh

     

     

     

    1076

     

     

     

    Yiddish

     

     

     

    yi

     

     

     

    1085

     

     

     

    Zulu

     

     

     

    zu

     

     

     

    1077

     

     

     

    See

    Posted Apr 09 2008, 11:02 AM by Brett with no comments
    Filed under:
  • System.Object

    Learning your language for .NET programming is a challenge in its own right, learning to use and exploit the .NET framework to its fullest is even harder due the mere fact of the size of the framework.  However, there is one class in the framework you should master and that is the System.Object class.  

    System.Object defines the basic behaviour of all managed data types and thus all managed data types within the framework, be it a value or reference types.  Every managed type inherits from System.Object, either directly or indirectly.  A reference type (class) may inherit from another explicit class, however ultimately they all will inherit from System.Object.

    Reference Types and System.Object

    Take the following set of classes:

    class Animal
    { }

    class Mammal : Animal
    { }

    class Dog : Mammal
    { }

    image

    Dog inherits from Mammal, thus dog gains all characteristics of a Mammal and its own members.  Mammal however inherits from animal, thus both Dog and Mammal get all the characteristics of the Animal.  In this example, Animal does not inherit from anything explicitly.  Don't be fooled by this as in reality Animal does inherit from system object.  You may have written the class

    class Animal: System.Object
    { }

    In C#, the keyword object is an alias for System.Object, thus the code below is the same as above.

    class Animal : object
    { }

    Value Types and System.Object

    Value types (struct) on the other hand do not support inheritance directly, let us take the following value type as an example:

    struct Point
    { }

    This struct automatically inherits from System.ValueType (a class) which in turn inherits from System.Object.  Thus one could theoretically say that a structure is a class, however it has a different memory model to a class. 

    image

    System.Object Members

    Now we all know the rules, and it is not necessary for you to explicitly inherit from object.  It is automatically implied and all .NET programmers should know this.  This section now describes the member methods of the System.Object class and answers the begging question of what you can do with it.

    Constructor
    public Object();

     

    The default constructor of System.Object is called every time an instance of an object is created.  The System.Object only has a default constructor (no parameters).   Equals
    public virtual bool Equals(object obj)
    public static bool Equals(object objA, object objB)

     

    The Equals method is used to compare whether two objects are in fact the identical.  However, there is a twist to their tail.  For reference type objects, the objects identity is actually checked, i.e. Are they the same physical object in memory?.  Value Types are different as a compare will check the state, i.e. The actual values are compared.  It is common practice to override the Equals method to perform proper equality checking.   Finalize
    public override void Finalize()

    This method is called on every instance of objects in memory when the garbage collector is in the process of freeing the memory.  This method will then be used to free up unmanaged resources used by the object.  In C#, you will not be able to override this directly as other methods as Finalize is implemented as a destructor ~Class().  When you compile your project and view the MSIL you will notice that ~Class() will be converted into a Finalize method.

    GetHashCode
    public virtual int GetHashCode()

     

    A hash code is normally created to uniquely identify the object.  A default hash code is automatically generated when an object is created, this has code may have some interesting issues.  Firstly hash codes are not evenly distributed, that is they are not sequential and completely random.  Secondly the default hash code is not guaranteed to be unique.  These has codes are often used in collections to uniquely define a key or whether an object exists.   In reality the likelihood of two hash codes being the same is slim,  You will be able to override and generate your own hash code that uniquely identifies the object. GetType
    public Type GetType()

    This method returns at System.Type reference to the object. This nifty little method allows you to then inspect the data type and programmatically work with the data type.  It thus returns the metadata of your object. I.e.  You will write code to interrogate the data type and adjust accordingly, welcome to the start of Reflection.

    MemberWiseClone
    protected object MemberwiseClone()

     

    MemberwiseClone is used to create a new copy of the object.  It is a protected method and thus can only be accessed from child classes.  It cannot be overridden.  MemberwiseClone creates what we call a shallow copy, it will copy the data from the object to the clone.  Value type member fields will have their data copied, however, reference type member objects will only have their object references copied.  I.e.  Should you clone a object that has a member which is a reference type, both the original and the clone will point to the same member of Reference type.   ReferenceEquals
    public static bool ReferenceEquals(object objA, object objB)

     

    This method compares whether two object reside at the same memory location, their values or state are not compared.   ToString
    public virtual string ToString()

    The ToString() method is used to return a string representation of the current instance.  The default behaviour of this method is to return the fully qualified name of the Type.  Override this method to implement a better representation of data of your method.

    Posted Apr 04 2008, 10:37 PM by Brett with no comments
    Filed under: ,
  • SharePoint - Get to know the directory structure in the 12 Hive

    The 12 hive is where everything in SharePoint happens and is where all the binaries, configuration, web pages, web controls, help files and other resources reside.  As a developer writing your own features for SharePoint, it is vital that you learn where things go and where you should be targeting your resources.  Without having an understanding of this, you have lost the battle before you have even started.

    This article forms part on the "Series of posts on the art of provisioning in SharePoint".

    A while back I posted an article SharePoint - The 12 Hive which pointed you to the location of the 12 hive, however the article was for general users and not aimed at administrators or developers.  This article however is aimed at an administrator and developer with a basic overview of what you can find where.   I will follow up on this post with a post on the TEMPLATE folder as this is the heart of the site and developers should really get familiar with the Template folder.

    image

    Below is a list of core folders in the 12 hive.

    \ADMISAPI

    The directory contain the web service used used by the SharePoint Central Administration and appears as a virtual directory.

    \BIN

    The directory contains all the core binary files, utilities that are used by Windows SharePoint Services.  Your command line tools such as STSADM.EXE reside in this folder

    \BIN\LCIDD

    A directory will be created for each language will be created that contains language specific binary files.

    \CONFIG

    This directory contains a set of configuration, binary and resource files used by SharePoint.  Some files are the default values which will be copied to web site instances.

    \Data

    SharePoint uses this directory structure for the indexing services where content will be indexed.

    \HCCab\LCID

    This directory has a set of cab files containing manifest and content information used by the SharePoint help sytem

    \Help

    The folder contains a compiled html help file (.chm) used by the configuration wizard.

    \ISAPI

    This directory contains all the standard Web Services for SharePoint and some additional DLL's, resources and configuration files that the web services use.  Every web application provisioned in SharePoint will have a virtual directory strong>/_vti/_bin that points to this directory, thus giving each web application it's own set of web services.

    \ISAPI\HELP

    This directory contains all the help files used by SharePoint.  The folder also contains LCID sub directories for each language installed thus globalising the help system.

    \LOGS

    This is the directory that you will visiting frequently whilst doing development and administration as it contains the log files of what SharePoint did and what errors occurred.

    \Resources

    This directory contains the core.resx file used for creating language packs for SharePoint.  If you are going to be localising your SharePoint sites with different languages and cultures, this is the folder to do it in.

    \TEMPLATE

    This directory structure contains the core web site functionality in SharePoint, that is the features, templates, configurations, resources of a web site.  What is important to note about this directory structure is that the Virtual Path Provider hides and masks this directory structure, thus it appears under each web site, list in a completely different structure.

    This directory structure rather large and it fully warrants a complete post by itself.  As a SharePoint developer you should completely familiarise yourself with this folder structure.

    Tips and suggestions

    • Open up the 12 Hive on your computer and spend the next five minutes looking through the directory structure.
    • If you plan to be administrate or be a SharePoint development guru. Look at the content.
    • On your server add the \bin directory to PATH environment variable, as it will search this folder when you are at a command prompt.
    • As a developer you will be updating this directory structure with your own content, and it is important that you do it through the correct mechanisms.
    • DO NOT CHANGE ANY FILE DIRECTLY in the 12 Hive, unless like pain, wasting time resolving bugs and having to reinstall SharePoint.
    • Learn how to provision properly.
    Posted Mar 24 2008, 01:17 PM by Brett with 1 comment(s)
    Filed under:
  • What is BizTalk Server?

    Microsoft BizTalk Server is a server side product that is aimed to provide integration between system as well as business process automation.  The product is used in many organisations to integrate system ranging from internal systems to partner, vendor and customer system. It also allows you to implement a workflow (called an orchestration) to manage, automate the flow of data throughout the organisation.

    The business challenges BizTalk addresses

    Companies and their systems have evolved over the past decade and the solutions that these systems need to deliver are complex.  These systems have also introduced a whole new set of challenges that professional need to look at, these are

    System isolation

    Using an integration tool such as BizTalk allows you to keep your systems independent and disparate.  This allows you to focus on the functionality of a single system and not on trying to make a single ERP solution that does everything.  Large systems which I term as a "Mother" systems, try to do everything, changes normally are complex and require long development runs to implement simple changes.

    Business reengineering also becomes a nightmare as the impact of a business change may cripple the organisation due to  the fact the development may take too long and cost a far too much.  The reasons I call them mother systems, is they are normally the "mother of all stuff-ups".

    System integration

    Through BizTalk, you are able to isolate and then integrate systems by sharing data between systems.  BizTalk will be responsible for getting the data from system A, then passing it through an orchestration allowing you to process, route, apply business rules and finally deliver it to one or many systems.  This does require the organisation to adopt a Service Oriented Architecture (SOA) over a period of time.

    Supply chain management

    Integrating with many customers, suppliers and trading partners can be really tough, however one will typically find that the Business to business data transmitted between these companies is very similar, however normally in different formats and over different technologies.  To implement this end-to-end supply chain for each business partner takes a lot of development time, thus incurring large expenses especially if there are many partners.  Using BizTalk you will be able to reduce this time drastically and improve the time-to-market to the partner.

    Data integrity across systems

    Through routing of information between systems one is able to keep data synchronised where changes made will be reflected in all other systems.  Not only does this improve the quality of the organisations data, it assists the Business Intelligence and the relevant information workers to get a reporting across the organisation.

    Business Processes

    Many companies are exceptionally week in managing critical business procedures and typically work in on different steps of a procedure on different system.  This poses many business challenges to users especially with communication, timing and managing the process.  Using BizTalk one can route information across the organisation, thus assisting business adopt formalised process management for critical processes.

    This assists the business in formalising their business process and in doing so weaknesses will be identified and hopefully rectified.  This will enter the company into a new age of process management.

    Tracking

    With business processes spanning many departments across the organisation, information is hard to track.  Using BizTalk one is able to track the movement of data in a real time manner as well as report on the information and where it is within a process.

    Change management

    The only constant in the information technology industry is change, and this change is complicated by both changes in technology as well as within the business.   As an IT team, we need to be able to quickly adopt to these changes by implementing new systems and processes.  Using BizTalk one can achieve this through the use of adapters, maps, business rules and orchestrations.

    History of BizTalk

    BizTalk is definitely not a new product and it has gone through multiple releases, and as with all Microsoft products it has matured and stabilised over the past few years. Below is a short overview to the history of BizTalk.

    image

    2000 - BizTalk Server 2000

    Microsoft released BizTalk late 2000.  The BizTalk editor had a Mapper for translating data, a management desk for tracking data.  Orchestrations were introduced to manage business processes. The product hade protocols for EDI, HTTP, HTTPS, MSMQ, SMTP, File transfer.  An enterprise and standard version was released.

    2002 - BizTalk Server 2002

    Several new features were introduced such as the integration with Visual Studio .NET.  SEED was introduced assist configuring with trading partners.  BizTalk integration with Microsoft Operations Manager (MOM).  There was a big drive was on web services.  Changes were made to orchestrations with transaction support.  The mappers were changed to support mixed XML.  Developers could create functiods.  There were also changes to many adapters with a few new adapters.

    2004 - BizTalk Server 2004

    Changes were made to how messaging and orchestrations integrated.  The orchestration designer was significantly changed.  Human Workflow Services, Business Activity Services added.  A welcome content-based routing mechanism introduced.  Security changed and SSO introduced.  The rules engine and integration of rules into orchestrations.  Pipeline designer for assembling and disassembling messages.  Better support for industry standards. Used Microsoft .NET 1.0

    2006 - BizTalk Server 2006

    Used Microsoft .NET 2.0.  The deployment model changed with a more modular approach.  Easier to configure.  Business Activity Monitoring was introduced.  Health and Activity Tracking introduced with improvements to monitor.  Development support in Visual Studio 2005  The processing of XML changed with some welcome changes should there be failures in messages.  Recoverable interchange processing.  Developers could create flat-file schemas with a wizard.  Changes to the orchestration designer.   BizTalk application introduced to allow solutions to be separated.  Monitoring was radically changed.  Many improvements were made to adapters with an introduction of new adapters.  BAM improved and enhanced, the BAM portal, alerts, notifications, Web Portals and BAM interceptors added.

    2007 - BizTalk Server 2006 R2

    Runs on Microsoft .NET 2.0 with Microsoft .NET 3.0 using Windows Communication Foundation and Windows Workflow Foundation.  RFID functionality added to BizTalk  EDI Adapters changed.  The BizTalk Adapter Pack introduced allowing adapters to be created and consumed with .NET Framework applications.  BAM Interceptors for WF and WCF introduced.  SSO 4.0 adopted.

    Tools and Services

    There are many tools, engines and services offered by BizTalk and I will breifly discuss each one as to give you a basic understanding to what the product entails.

    Messaging engine

    image

    BizTalk processes data in the form of messages and communication between systems is based on the exchange of messages.  Thus the messages engine is essential to BizTalk Services.  The BizTalk messaging engine performs the following

    • Uses adapters to physically send and receive data in the form of messages to and from different systems.
    • Pass the messages through pipelines to encrypt\decrypt, compress\decompress the message
    • Format the external data into XML for processing
    • Map the data from one data structure to an internally understood data structure
    • Extract key data from the messages that will be used for routing the messages.
    • Track documents
    • Deliver the message to the MessageBox.
    • Route data to the necessary orchestrations for processing and finally to send adapters to be delivered to destination systems.

    Adapters

    BizTalk's prime objective is to route data between different systems which is controlled by a business process, this data is represented in the form of messages.  However these systems that need to be integrated run on different technologies, written by different vendors with different development tools and are transported with various different protocols. 

    BizTalk has an extensive library of adapters that allow communication between systems over well defined and common industry protocols, these include SMTP, POP3, FTP, Web Services, MSMQ, MQ-Series.  There are also product specific adapters such as Siebel, SAP, SQL Server which have been written to interact with specific software.  There are also adapter such as the EDI and SWIFT adapters allowing connectivity to the SWIFT and EDI networks. 

    This list of adapters is by no means extensive and is only for you to get an idea of what they are, there are many, many different adapters; some come with BizTalk others you need to pay additional licence fees to use and then there is a whole bunch of commercially available adapters.  Developers can then also write their own adapters.

    Mapping

    When dealing with data from different systems, there is always the need to translate data from one the source data structure to the destination data structure.  The mapping engine does exactly this, however it includes an extensive functoid library that allows you to do data manipulation, aggregation and transformation.  This too is customisable and developers are able to fully code against this mapping engine.

    Internally BizTalk uses data in an XML format and translation is done through mapping; basically this is BizTalk's way of doing XSLT.  External systems may not unnecessarily use XML and this is where the Pipelines and adapters come in.

    Orchestration services

    The BizTalk orchestration services are used to define, manage and execute business process.  These processes included looking at the data and making decisions on the data.  Typically the orchestration will engage in a process of getting data related from others systems, correlating the data, making decisions on the data and based on the outcomes of these decisions send messages to destination systems.

    A single BizTalk orchestration may engage with obtaining or updating data from many different systems.  Transactional integrity of this data can then be maintained by BizTalk across many different system. These orchestrations are also not time bound and may run for hours, weeks, months and even years. 

    Pipelines

    Pipelines are typically used to encrypt\decrypt messages, compress\decompress message and mime encode the messages.  Additional conversion may be done in the pipeline to get the data into a format the mappers understand for receive pipelines or to a format the adapters understand in a send pipeline.

    MessageBox Database

    The MessageBox is a SQL server database that BizTalk uses to store, route, pass to orchestrations and finally to send ports.  The MessageBox is thus used to track the entire life of the message over time.  The MessageBox also stores versions of the message as data may change through the orchestration.  This then allows information workers and administrators to troubleshoot data.

    Application development tools

    BizTalk development is development is done within the Visual Studio environment and when BizTalk is installed onto the developer's box a few project templates are added to Visual Studio.

    The first thing to do is to create a BizTalk project and then add the following items to your project

    • Schema.  The BizTalk Editor allows you define XSL schemas which are used to describe your data.
    • Map.  The BizTalk Mapper allows you to define transformations from one schema to another schema.  The conversion allows you to add functoids to the map to perform data manipulation, conversion and aggregation.
    • Pipeline.  The Pipeline designer allows you to define the process for incoming and outgoing messages.
    • Orchestrations.  The Orchestration designer allows you to model your message flow according to a business process.
    • SDK.  An advanced developer can use the BizTalk SDK to define custom pipelines, orchestrations and adapters for BizTalk.

    Business Rule Engine

    The Business Rule Engine allows developers to define basic rules that can be implemented within orchestrations.  These rules can be used to define calculations, decision structures thus affecting the branching of an orchestration based on the rule conditions.  Rules are exposed to users through the Business Rule Composer, allowing non-developers to change and adjust the rules using non-technical terminology.  These rules then are applied and orchestrations are immediately adjusted.

    Business rules are ideal for giving users a way to control the execution and outcomes of orchestrations without having to engage a developer to change the orchestration.

    Message activity and tracking

    Health and Activity Tracking (HAT) allows administrators to monitor, track and resolve problems with business processes.  HAT provides a valuable and indispensable tool for administrators to manage and troubleshoot the BizTalk Serves.

    HAT includes the following benefits

    • Tracking to see start, end times of messages as well as the current status
    • Health allows you to view the current state of a process
    • Monitoring live data allows you to see what is happening on the server, thus identifying issues
    • Analysing live and archived data and tracking the complete message flow, changes to messages and the route the message whet through and orchestration.
    • Orchestration debugging
    • Business rule activity tracking

    Business Activity Monitoring (BAM)

    BAM provides information workers the ability to view running process and draw reports on process statistics and key information.  This information is near real and can be configured with alerts and notifications, the information worker then can react to different situations based on the activity.  In 2006 R2, developers can write their own components that can publish information to BAM.  The BAM information can be extracted and manipulated within excel or through the BAM portal running on SharePoint.

    BAM gives you the ability to

    • Access views of data to understand what is happening
    • Search for activities and query key data
    • Summarise and aggregate data to draw statistics
    • Drill down from summarised data to detailed data.
    • Configure alerts and notifications to notify users when certain thresholds have been exceeded.
    • Escalate issues to administrators from the BAM portal

    Business Activity Services (BAS)

    BizTalk provides a mechanism to manage relationships between trading partners.  Through trading partner management (TPM) and using the Business Activity Service, our are able to define the partners, define the protocols and formats of messages used in the relationship.  Developers use this information in orchestrations to define dynamic ports where information can be routed to and from the partners in different formats.  Through an easy interface, information workers can easily add, edit and manage partners.  BizTalk will apply these changes, thus preventing development and changes.

    RFID

    BizTalk RFID is an RFID device-level management set of components introduced BizTalk Server 2006 R2. Using RFID, you can eliminate many existing challenges faced with RFID devices as it allows a uniform way to discover, communicate and manage these devices. BizTalk RFID includes a SDK that developers need to build vertical applications that are reliant on RFID tag information -- everything from track-and-trace to asset tracking and inventory control.  Although independent of BizTalk Server, the RFID tag information can then be sent to BizTalk and then passed through orchestrations.

    Posted Mar 23 2008, 12:52 PM by Brett with 2 comment(s)
    Filed under:
  • Overview of features, templates, site definitions, solutions in SharePoint

    This article forms part on the "Series of posts on the art of provisioning in SharePoint".  In this post I will discuss the different ways you as a developer or administrator can package and deploy your content to SharePoint.

    When learning SharePoint, it is important that you understand the difference between features, templates, definitions, solutions and configurations.  If you are new to the product and doing customisation of sites, this may be tremendously confusing and I will try to demystify this in the post.

    Feature

    image

    A feature provide a a developer to solve a business need by adding SharePoint content, such as page templates, lists, content types, web parts, work-flows and events into a self contained unit.  Typically a developer will create a feature to solve a common set business requirement.  In fact the default installation of WSS or MOSS installs many base features, such as the Team Site, My Site, Wiki and blog.

    Features can be installed and then activated within a site, when the feature is activated the lists, content types will be created on the site and the functionality provisioned.  Features can also be deactivated thus removing the functionality from the site.

    After a feature has been created, it is typically packaged into a solution file.  This solution file is then copied into the SharePoint configuration database and deployed to all servers in the farm.  Features are deployed to the 12 Hive\TEMPLATES\FEATURES folder.

    The benefit of developing features is that you do not have to build a huge and complex site in a site definition, rather create many smaller self contained features that are then activated by the site definition.  Not only does this break down the complexity of a site, it also facilitates reusability of features in other sites.

    Tips and points

    • Create your custom functionality in a feature.
    • Create many small features.
    • Think reusability.
    • Deploy your features in a solution package.
    Site Template

     

    image

    A site template allows you to create a template for a web site, once the template has been created it is easy for site administrators to create new web sites based on the template.  The template can contain many SharePoint contents, such as lists, pages, menus, enabled features.  The template is easy to create and can be done in the web front-end, through tool such as SharePoint designer or it can be developed by a programmer.

    There are many templates available and these can easily be downloaded off the web.  Most templates provide a starting point of a site allowing you to further customise it for your business needs.

    Tips and points

    • Easy to create and copy a site from front-end.
    • Can only use existing installed features.
    • Site Templates are deployed to the configuration database.
    • Cannot create application pages or site pages with code.
    • As a developer, slap together a site, export the site and then open the cab and copy content into your own site definition.
    Templates

    image

    A template is exactly the same as a site template, however you are able to create templates at a more granular level.  That is you can create a template just for a list or library. This too can easily bee created from the web front-end.   Once created these templates can be imported into a new site.

    Tips and points

    • Easy to create and copy lists, content types and libraries from the front end
    • As a developer, export a list, content type or library to a template and then open the cab file and copy the content to your site definition.
    Site Definition

     

    image

    Site definitions, sometimes referred to as admin templates, enable developers to create functionality using features, web parts and custom DLL's as well as SharePoint elements and lists.  The site definition is packaged into a .wsp file and installed by the administrator.  The site definition can then be deployed to all servers within the farm using a solution package.

    Site definitions for are identical to Site Templates, however they are created by a developer and not generated from the front-end.  The site definition can include custom Web Parts, Workflow's, DLLs, application pages as well as custom server side controls.

    Tips and points

    • A site definition is a site template with more flexibility for custom development.
    • Site definitions are deployed to the 12 hive.
    • Can create multiple configurations of the site definition, thus giving reusability
    • Can create application pages with code.
    • Activates your custom features when deployed.
    • Use site definitions, features to create your Line-of-business (LOB) applications.
    • Deployed using a solution package.
    Solution Package

    image

    A solution is a deployment mechanism introduced to Windows SharePoint Services 3.0.  All features, web parts, extra DLL's, ASP.NET pages and controls, resources and finally SharePoint elements defined in CAML are added to a CAB file.  The cab file also has a deployment manifest (manifest.xml) that defines what needs to be deployed to front-end servers.

    The power of packaging your custom components into a solution is that it is easily deployed to web servers in a farm.  This is done by an administrator who will add the solution to the configuration database.  The administrator will then deploy the solution to all web servers in the farm,  the powerful provisioning engine will then extract the contents of the solution on all web servers.

    Tips and points

    • Always package your custom development into a solution package.
    • Solution packages are copied to configuration database and then deployed to all web servers in the farm.
    • Do NOT copy directly into the 12 hive, use a solution package to do it for you.
    • Always thing server farm.
    Configuration

    image

    A solution package may contain many different types SharePoint content which you may want to activate and reuse on different sites.  You are able to create a site template that is used to create a new site, however template within the site template definition, many different configuration can be created.  Each configuration can install and activate different features, pages and web parts.

    Using configurations you are able to create different variations of a  site template, with each configuration using different features and content.  The configurations thus give you the ability to create multiple templates using a common set of features, list definitions and other SharePoint content.

    For example you could create a template for IT project and in this template you would define lists, web parts and features.  Then you could create a "New development project", a "Maintenance project" and even a "Software deployment project".  When a site is created, the site administrator can create a new site based on one of the three "templates"

    Tips and points

    • Think reusability.
    • Create variations of your site definitions.
    Posted Mar 15 2008, 10:20 AM by Brett with 4 comment(s)
    Filed under:
More Posts Next page »
Add to Technorati Favorites
Powered by Community Server (Commercial Edition), by Telligent Systems
Afrigator