MOSS 2007 Content Types

Content Types is one of the new features of MOSS 2007, and WSS 3.0, a content type is a logical grouping for a set of informational fields that serve a common and specific purpose, you should decide which content types you need to have for your application, content types should be based on existent content types, and all parent's fields are copied to the new site content type, in other words you can consider the content type as a Class in OOP terminology, and this class is attributed by Must-Inherit, this is a good analogy that makes things easier to grasp, unsurprisingly site content types are built from site columns, so why the site content types are important and why should we start creating site content types and then bind lists or document libraries to them, rather than starting by creating lists or libraries right away by creating required columns, site content types are better to start with for the following reasons:

  • Site content types are reusable, just like OOP classes are.
  • Site content types can be associated with workflows, that are initiated either automatically upong item's creation or manually depending on the workflow type, for example if you associate the content type with "Collect Signatures" workflow, this type of workflow should be started from Microsoft Word application, there is no way to start it from web interface.
  • Site content types can be associated with Information Management Policy, whereby you can impose auditing based on specific selectable events, or you can enable item's expiration by setting a dynamic expiry date " e.g. project's start date + 2 years ", and select the appropriate action to be taken against the expired item, also if the content type is based upon Document content type, you can set document converters for the content type's instances.
  • The above reasons are not everything to justify using content types, however using site columns is so similar to content types, but in a nutshell you use site columsn whenever you want to have a global field/column that will be reusable by more than one list or document library, or basically by a site content type, always think of content type as a class, and site column as a field/property/member variable, these are the available content type's settings:

  • We'll create a site content type called "Projects" to track projects' deadlines, budgets, and resources, then we'll create a custom list that's based upon the Projects content type, to create the Projects content type:
  • Create a new site, give it any name you want, such as Project Management.
  • Select Site Actions -> Site Settings.
  • Galleries -> Site content types, you will get all the categorized site's content types as shown below:


  • Click Create.
  • Enter Name, Description, select Parent Content Type, and enter the Group under which the new content type will be added, enter the values as in this screen shot:


  • Now, you have to add the site columns that will compose the content type, click Add from new site column, add the following set of columns





  • After you're done with creating the site content type, browse to Site Actions -> Create.
  • Select Custom Lists -> Custom List.
  • Enter required data, Name : Projects, then click Create.
  • From Projects list Default view, click Settings -> List Settings.
  • Click General Settings -> Advance Settings.
  • Select Yes for Allow management for content types?, it's No by default.
  • Click OK.
  • You'll get directed to the Project List Settings, and you will find a new section added to the settings called Content Types, and the Project content type is listed with the default item content type, you can delete the default item content type, as we'll not use it for this example.
  • From the sitemap breadcrumb browse to the Projects list.
  • Click New, you will find Project listed, this is because the list is based on the Project content type and it's the default content type, after we deleted the item default content type

  • You will get to the new form, this form is built based upon the Project content type

  • Note that you can select more than one resource to be assigned to the project, and this is quite practical, remember that while adding this site column we've selected it to allow multiple values.
  • After adding this first project, you will get directed to All Items default view for the list, and it's only showing the title and attachment columns, now we'll edit this default view, by clicking All Items -> Modify this View, select Project, Project Client, Project Start Date, Project End Date, Budget, and Resource respectively, by setting the Position from Left.
  • Expand Totals group, for Budget select Sum, and for Project select Count, then click OK.

After modifying the view, you will get all the data you've entered before

  • Note the aggregate/total we've just entered while modifying the default view, under Project you will get the count, and under the budget you will get the subtotal for budgets.

One of the new features of MOSS 2007, Gantt View, that's a very common view/chart for project mangement that depicts the project's duration against time line, so we'll add a new Gantt view to get a bird's eye view about projects' durations, Click the View dropdown for the projects list and then select Create View, Click Gantt View, Provide a name "Gantt", Select Columns to be listed and provide the columns order, expand Gantt columns, and provide the Gantt specific columns, these columns are mandatory for Gantt view, for Title select Project, Start Date : Project Start Date, Due Date: Project End Date, click OK.


Select Gantt view from the views dropdown, you will get the Gantt view for the entered data, and you can edit projects' items from this view.

In this post, we've examined site content types and site columns, also we've gone through the new Gantt view.

Labels:

InfoPath Forms Services Compatibility

InfoPath Forms Services is a new addition to both InfoPath 2007 and MOOS 2007, InfoPath 2003 served a great purpose to design forms, based on XML, that can collect users' input in easy steps, designing forms in InfoPath is a real fun, you can build very complex forms in a few minutes, InfoPath forms can interact with SQL Server, XML files, WebServices, and SharePoint List as a data source, however it's worth mentioning that one InfoPath form could have more than on data source, also InfoPath offers to embed the data inside the form itself, InfoPath 2003 offered a brilliant way to let users fill data in forms and post dta back to MOOS 2003, the biggest limitation was that the user who's filing the form should have InfoPath 2003 installed, otherwise no other way to open the form, this gave birth to InfoPath Forms Services , it's a core feature that's shipped with Enterprise License for MOSS 2007, whereby you can design your InfoPath forms and publish to MOSS 2007, then using InfoPath Forms Services, MOSS is rendering InfoPath forms to users using browsers, so no need to have InfoPath installed anymore, however there are some limitations for the designed forms, you'll be limited by using some set of controls, these ones are renderable inside browsers, other controls are not supported by InfoPath Services, so you have to keep this in mind while desigining your forms, also you can use the design compatablity checker from InfoPath 2007, this checker checks compatablity of the designed form against InfoPath Forms Services and InfoPath 2003, you can launch it by clicking Tools -> Design Checker, but before launching it you have to set the compatablity options by clicking Tools -> Form Options, select from Category Compatibility, you will get this dialog box:



If you plan to publish your form to MOSS 2007 InfoPath Forms Services Server, check Design a form template that can be opened in a browser or InfoPath. then click OK, then launch the design checker you will get any probable errors or warnings, resolve them and then you can publish your form, I have tried one InfoPath form and got this list of errors:

If you check the above list you will find that the combobox is not compatible, actually there is a subtle difference between the dropdown list and combobox, in InfoPath terms, the combobox allows the user to enter items into it, if the item is not listed in the combobox items.



For the full list of controls compatibility in InfoPath Forms Services you can check it here


One of the cool features I like about InfoPath 2007, it can impose working in Forms Services compatibility mode, Launch InfoPath 2007, click Design a Form Template, check Enable browser-compatible features only, select the template type you want to design, from the task pane, click Controls, you will find that the toolbox is only populated with compatible controls, and all the other ones are not listed, such as Combobox, this is one of the good practices to design a browser compatible InfoPath form.



Once you click OK, and get the default template's view, view the Controls from task pane if it's not visible, you will find that all unsupported controls have been hidden and one note is written below the controls toolbox saying "Some controls have been hidden based on the current compatibility settings."



if you click this yellow note, you will get a messagebox that's listing all the controls that have been hidden to build compatible forms

Note: Template parts are not compatible with InfoPath Forms Services, in compatibility mode all the custom controls in controls toolbox are hidden, as the template parts are not supported.

Labels:

RSS.NET

RSS.NET is an open source class library for writing and reading RSS feeds, it almost supports all RSS versions, the good thing about RSS.NET it's well documented in MSDN style documentation, and it's been used by so many websites to use RSS out of the box, consuming the library is quite easy and straightforward, you can check some examples here , on the other hand one other project is kicked off at SourceForge, to manage Atom feeds ( Atom is the next generation for websites content syndication. ), both libraries are great and saves you thousands of lines to be written to handle RSS and Atom.

Note: To get more information about RSS and Atom standards you can refer to my articles published at CodeProject:

Labels: