Skip to main content

Mark Stokes

Go Search
Home
Blogs
Wiki
Events
Training
Forums
Tools
Jobs
Support
Account
  

Sharepoint Studio > Blogs > Mark Stokes
Dear Mr. Architect
Please design and build a house for me. I am not quite sure of what I need, so you should use your discretion.
 
My house should have between two and forty-five bedrooms. Just make sure the plans are such that the bedrooms can be easily added or deleted. When you bring the blueprints to me, I will make the final decision of what I want. Also, bring me the cost breakdown for each configuration so that I can arbitrarily pick one.
Keep in mind that the house I ultimately choose must cost less than the one I am currently living in. Make sure, however, that you correct all the deficiencies that exist in my current house (the floor of my kitchen vibrates when I walk across it, and the walls don't have nearly enough insulation).
 
As you design, also keep in mind that I want to keep yearly maintenance costs as low as possible. This should mean the incorporation of extra-cost features like aluminum, vinyl, or composite siding. (If you choose not to specify aluminum, be prepared to explain your decision in detail.)
 
 
Please take care that modern design practices and the latest materials are used in construction of the house, as I want it to be a showplace for the most up-to-date ideas and methods. Be alerted, however, that the kitchen should be designed to accommodate, among other things, my 1952 Gibson refrigerator.
 
To insure that you are building the correct house for our entire family, make certain that you contact each of our children, and also our in-laws. My mother-in-law will have very strong feelings about how the house should be designed, since she visits us at least once a year. Make sure that you weigh all of these options carefully and come to the right decision. I, however, retain the right to overrule any choices that you make.
 
Please don't bother me with small details right now. Your job is to develop the overall plans for the house: get the big picture. At this time, for example, it is not appropriate to be choosing the color of the carpet.
 
However, keep in mind that my wife likes blue. Also, do not worry at this time about acquiring the resources to build the house itself. Your first priority is to develop detailed plans and specifications. Once I approve these plans, however, I would expect the house to be under roof within 48 hours.
 
While you are designing this house specifically for me, keep in mind that sooner or later I will have to sell it to someone else. It therefore should appeal to a wide variety of potential buyers. Please make sure before you finalize the plans that there is a consensus of the population in my area that they like the features in this house.
 
I advise you to run up and look at my neighbor's house he constructed last year. We like it a great deal. It has many features that we would also like in our new home, particularly the 75-foot swimming pool. With careful engineering, I believe that you can design this into our new house without impacting the final cost.
 
Please prepare a complete set of blueprints. It is not necessary at this time to do the real design, since they will be used only for construction bids. Be advised, however, that you will be held accountable for any increase of construction costs as a result of later design changes.
 
You must be thrilled to work on such an interesting project as this! To be able to use the latest techniques and materials and to be given such freedom in your designs is something that can't happen very often. Contact me as soon as possible with your complete ideas and plans.
 
PS: My wife has just told me that she disagrees with many of the instructions I've given you in this letter. As architect, it is your responsibility to resolve these differences. I have tried in the past and have been unable to accomplish this. If you can't handle this responsibility, I will have to find another architect.
 
PPS: Perhaps what I need is not a house at all, but a travel trailer. Please advise me as soon as possible if this is the case.
Changing Regional Settings for all sites in a Site Collection

Step 1 – Default Time Zone settings
Note: This step will not effect any sites currently created, but will be used in the creation of new sites.

  • Central administration
  • Application management
  • Web application general settings
  • Default Time Zone
    • Select time zone
      • GMT

Step 2 – Resent current Sites.

  • Navigate to any site in your Site Collection
  • Site Actions -> Site Settings
  • Site Collection Administration
    • Go to top level site settings
  • Site Administration
    • Regional Settings
      • Locale
        • Choose your required locale
    • Subsite Settings
      • All sub-sites inherit these Regional Settings
    • Click Ok

All sites in your Site Collection will now be updated with the required Regional Settings, and any new sites will also be updated.

Start a custom workflow from the context menu dropdown
This is a fantastic article and just what I needed to do!
 
 
 
Setting a SPListItem to expire programmatically
You can set SPListItems to expire at a date of your choosing.  This annot be done through the UI, but can be done programmatically.
 
Before the code below will work you have to set a couple of options on the list or document library.
 
You need to enable Require Content Approval  and Major and minor versions.
 
You need to enable content expiration on the List / Document Library information policy.  This can be done by going to the list settings page and clicking the Information management policy settings link and click the content type you wish to enable content expiry.  You can set a different policy for different content types.
 
When you are editing the policy, enable content expiration, set the retention period to be set programmatically and set the action you want to happen upon content disposition.
 
Now that is set up, we can set the expiry date.
 
I have an approval workflow and within the "Workflow Completed" action I set various properties on the SPListItem.
 
Here is how to do it.....
 
You need to add a reference to:
Microsoft Office Server DLC component
 
Located at:
c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\ISAPI\Microsoft.Office.Policy.dll
 
Then add the following using directive:
using Microsoft.Office.RecordsManagement.PolicyFeatures;
 
The following code snippet achieves this:
SPListItem item = this.workflowProperties.Item;

Expiration
.SetExpirationDateForItem(item, DateTime.Now.AddMonths(6), false);
 
And there you go.
 
More information here:
How to: Customize XSL for the Content Query Web Part

A very useful article on customising the Content Query Web Part look and feel:

http://msdn.microsoft.com/en-us/library/bb447557.aspx
Content Query Webpart won't show Publishing Pages
I have just come across a little bug.
 
I have a SharePoint site with some Publishing Webs and I tried to roll up my Publishing Pages with a Content Query Webpart, however Publishing Pages was not available in the List Type drop down list.
 
Apparently, if the Office SharePoint Server Publishing feature is not activated on the Root Site of the Site Collection then the Content Query Webpart won't let you roll up Publishing Pages.  It obviously checks this location to see if they are available or not, rather than determining if there there are any publishing webs in your site collection.
Can I view Document Library Columns with Content Types?
Question
If I have a Document Library that is set up to store Content Types, can I also make use of additional Columns set on the Document Library? Such as a Status choice column?
 
Answer
After adding the content type to a list, you can click to manage the content type and you can choose to add new columns from the list.
 
These changes to the content type are localised to the specific list.
How to delete a feature that shouldn't exist any more!

This has happened to me a couple of times and I finally came across a method to resolve it.

When creating a new feature in Visual Studio I came across a problem where I changed the Feature ID of a Feature after it had already been deployed.

When I tried to redeploy, the installer process was not able to retract the old feature (as the id's had changed) and so carried on installing the new feature with the new ID.

Unfortunately since the old feature had not uninstalled properly, I ended up with all manner of problems and could not force a delete of the feature as the feature folder didn't exist any more, I didn't know the old Feature ID and there is no enumfeatures command in stsadm.

What you can do however, is look at the HTML source of the manage site features page (/_layouts/ManageFeatures.aspx?Scope=Site) and do a search on the friendly name of the feature. Just under the name you will see a div with the Feature ID and you can then use this in STSADM with the -force parameter to get rid of that little blighter once and for all.

Storing your development projects on a network share

For my development environment I use a Apple MacBook Pro and run my development environments in Virtual Machines under Parallels.

Since I am trying to centralise all my information and projects (I have a LOT of VMs for different projects) I try to store all my data in my Mac Home folders and then just share those user folders with each Virtual Machine This also protects me against a VM going belly up and loosing my code.

When you share your Home folders through parallels, they are mounted as mapped Network Folders, such as \\.psf\.home\.

If you try to open a Visual Studio Project from a network location, you get a very nice error box telling you that the project is not in a trusted location and you have a LOT of problems compiling and debugging.

I found this post that contains a very useful guide on how to enable Full Trust on your network location through the .Net Configuration tools.

I am using Visual Studio .Net 2008 and didn't need to perform step 2, in fact, I don't even see the Security Page, but have left it in, in case other people need to run through it.

STEP #1

Mscorcfg.msc
One simple way to modify the policy affecting a file share is to give a specific file share FullTrust permission using Mscorcfg.msc. You must be an administrator on the computer to make this change.

To give a file share FullTrust permission

  1. Start Mscorcfg.msc. or from the Start Menu, Admin Tools, Microsoft .NET Framework 2.0 Configuration
  2. Expand the Runtime Security Policy node, the Machine node, the Code Groups node, and the All_Code node.
  3. In the right pane, click Add a Child Code Group.
  4. Choose Create a new code group, enter a name (VS Developmenmt)for the code group, and then click Next.
  5. Choose a condition type of URL, and enter the UNC path to the share location of your project, using the format \\servername\sharename\* where \\servername\sharename (\\N5200\*) is the name of the share. Click Next.
  6. Choose Use existing permission set and select FullTrust, and then click Next.
  7. Click Finish.
  8. Select your new code group, right click, and select Properties
  9. Under the General tab, check the two boxes under the "If the membership condition is met" statement, then click Apply
  10. Close Mscorcfg, Reboot Machine
  11. Restart Visual Studio - You will now be able to create a new project without The Project Location is not Trusted Dialog Box. However, you will not be able to Debug until you choose a zone for your partial-trust application

STEP #2

Choose a zone for your partial-trust application

  1. From the Project menu, choose Projectname Properties.
  2. In the Projectname property pages, click the Security page.
  3. Select Enable ClickOnce Security Settings.
  4. Under Zone your application will be installed from, click the drop-down listbox and choose the zone you want to simulate the application being installed from.
    1. The Permissions required by the application grid shows all available permissions. The check mark indicates permissions granted to your application
  5. If the zone you choose was (Custom), select the correct custom settings in the Setting column of the Permissions grid.
  6. Click OK to close the property pages.

That should be it.  Happy coding!

Accessing the Web Parts Maintenance Page

This is an old trick, but still one that people forget.

If you need to access the Web Parts Maintenance Page to close / delete or reset a broken web part, or if you have a redirect web part on the page and need to edit it's URL, then you can get there by simply appending ?Content=1 to the end of your url

1 - 10 Next

 ‭(Hidden)‬ Admin Links