| By Corey Roth | Article Rating: |
|
| October 9, 2009 11:30 AM EDT | Reads: |
3,025 |
I’ve always liked the power of CAML because it allows me to create so much in SharePoint without ever having to write a line of code. However, there really isn’t enough examples out there, so I like writing posts like these that focus on doing something very specific with a list. @SPKyle would say just write some code to do that, but that’s not my style, so I did some digging through the SDK and some experimentation and I figured out how to do it. Of course there isn’t an attribute called EnableContentApproval. So, the first thing we have to figure out is what CAML calls content approval. It turns out CAML refers to this as moderation. We’ll add this to the SharePoint UI to API translation guide. Looking at the List element, I find two attributes ModeratedList and ModeratedType. The description of the both is quite similar, so I decide to try them out one at a time. I find that setting ModeratedList works but setting ModeratedType does nothing. No idea why there is two attributes. Maybe one is deprecated. Here is what a List element line would like in your schema.xml.
<List xmlns="http://schemas.microsoft.com/sharepoint/" BaseType="0" DisableAttachments="True" EnableContentTypes="True" Name="MyList" OrderedList="False" QuickLaunchUrl="True" Title="My List" Type="10001" VersioningEnabled="False" Url="Lists/MyList" Id="ed65344b-0399-4c34-8265-de0c2d193165" ModeratedList="TRUE">
I then go take a look at the list versioning settings of my newly created list, and everything looks good. Note, if you want to turn on versioning, you can use the VersioningEnabled attribute that you see above.
Again, I set the ModeratedList attribute in the List element of the Schema.xml. Before I set it on the schema.xml file, I noticed that the ListTemplate element that you use in your elements.xml file had an attribute EnableModeration. The SDK states this can be used to turn on moderation as well. However, when using it I find that it does not work. If I set it to true or false it does not work and does not seem to override I set in the schema.xml file. Anyhow, if you ever need to turn on content approval and don’t feel like writing code, I hope this helps.
Read the original blog entry...
Published October 9, 2009 Reads 3,025
Copyright © 2009 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Corey Roth
Corey Roth, a SharePoint Server MVP, is a consultant at Infusion specializing in SharePoint for clients in the energy sector. He has more than ten years of experience delivering solutions in the energy, travel, advertising and consumer electronics verticals.
Corey specializes in delivering ECM and search solutions to clients using SharePoint. Corey has always focused on rapid adoption of new Microsoft technologies including Visual Studio 2010, .NET Framework 4.0, and Silverlight.
He is a member of the .NET Mafia (www.dotnetmafia.com) where he blogs about the latest technology and SharePoint. He is dedicated to the community and speaks regularly at user groups and SharePoint Saturdays.
- Big Data in Telecom: The Need for Analytics
- Patterns for Building High Performance Applications
- What Motivates Open Standards in the Cloud?
- What to Expect in 2012: Cloud Computing and Open Source Software
- Will PaaS Finally Bring Open Source Love to the Enterprise?
- Ten Hot Trends in Cloud Data for 2012
- Cross-Platform Mobile Website Development – a Tool Comparison
- Oracle Disaster Recovery Site Hosted by Amazon Cloud
- Three Buzzwords That Every CIO Hears but One They Should Listen To
- Write Once Run Anywhere or Cross Platform Mobile Development Tools
- Big Data Highlights from McKinsey: Part 2 - Production, Supply, and Logistics
- Microsoft’s New Cloudware Could Cast a Shadow over VMware
- The Future of Cloud Computing: Industry Predictions for 2012
- Gartner Hype Cycle for Emerging Technologies 2011
- Book Excerpt: Introducing HTML5
- Adobe Sends Flex to the Apache Foundation
- Big Data in Telecom: The Need for Analytics
- Book Excerpt: Java Application Profiling Tips and Tricks
- i-Technology in 2012: Five Industry Predictions
- Patterns for Building High Performance Applications
- Microsoft Tries Hadoop on Azure
- The Next Web Architecture
- Cloud Computing: A Comparison of Computing Models
- Amazon to Fix Some Kindle Fire Problems
- The i-Technology Right Stuff
- The Top 150 Players in Cloud Computing
- Who Are The All-Time Heroes of i-Technology?
- Where Are RIA Technologies Headed in 2008?
- Get the Message
- ESB Myth Busters: 10 Enterprise Service Bus Myths Debunked
- i-Technology Viewpoint: Is Web 2.0 the Global SOA?
- i-Technology Viewpoint: Thinking Outside the VC Box
- i-Technology Viewpoint: When to Leave Your First IT Job
- SOA Web Services Edge Conference Coverage on SYS-CON.TV
- SYS-CON.TV's "SOA Web Services" and "Enterprise Open Source" Programs To Air in December
- Five Reasons Why Web 2.0 Matters





















