SharePoint: Create Custom Workflow Activities Using VS 2008
SharePoint: Create Custom Workflow Activities Using VS 2008
http://www.endusersharepoint.com/2010/01/06/outing-sharepoint-workflows-%E2%80%93-linking-to-workflows-in-list-views-and-item-displays/
Interview
http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=1335831
no connection could be made because the target machine actively refused it
mailbox unavailable the server response was 5.7.1 unable to relay for
MOSS to Word Content Controls
how to bind Microsoft Office SharePoint Server (MOSS) content type fields to Word content controls. This technique allows you to surface document data automatically in MOSS without placing an additional burden on end-users.
Read document meta data in sharepoint.
Fill document with meta data entry.
http://msdn.microsoft.com/en-us/office/bb629437.aspx
Introducing SharePoint Designer 2010
Introducing SharePoint Designer 2010
sharepoint calendar
http://e-junkie-chronicles.blogspot.com/2009/07/year-to-view-with-sharepoint-calendar.html
http://e-junkie-chronicles.blogspot.com/2010/10/calendar-year-view-web-part-code.html
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Drawing;
using System.ComponentModel;
using System.Diagnostics;
using Microsoft.SharePoint;
using Microsoft.SharePoint;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
namespace CalendarYearToView
{
public class YearToViewWebPart : WebPart
{
private string _calendarName;
private int _year;
private GridView grid;
private DataTable table;
private Label errMsg;
[Browsable(true), Personalizable(PersonalizationScope.Shared), Description(“The name of the Calendar to generate the view”), Category(“Options”), DefaultValue(“”), WebBrowsable(true), WebDisplayName(“Calendar Name”)]
public string calendarName
{
get
{
return this._calendarName;
}
set
{
this._calendarName = value;
}
}
[Browsable(true), Personalizable(PersonalizationScope.Shared), Description(“The year from which to generate the view”), Category(“Options”), DefaultValue(“”), WebBrowsable(true), WebDisplayName(“Year”)]
public int year
{
get
{
return this._year;
}
set
{
this._year = value;
}
}
public YearToViewWebPart()
{
}
protected override void CreateChildControls()
{
base.CreateChildControls();
if (!hasControlBeenConfigured())
return;
this.grid = new GridView();
this.errMsg = new Label();
// Base Formatting
this.grid.AutoGenerateColumns = true;
this.grid.AllowSorting = false;
this.grid.HeaderStyle.Font.Bold = true;
this.grid.Visible = true;
this.grid.ShowHeader = true;
this.grid.ShowFooter = false;
this.grid.ForeColor = Color.Black;
this.grid.HeaderStyle.BackColor = Color.DarkGray;
if (!BuildTable())
{
errMsg.Text += ”
Problem Building Table”;
this.Controls.Add(errMsg);
return;
}
table.DefaultView.Sort = table.Columns[0] + ” ASC”;
this.grid.RowDataBound += new GridViewRowEventHandler(grid_RowDataBound);
this.grid.DataSource = table;
this.grid.DataBind();
this.grid.Width = Unit.Percentage(100);
this.Controls.Add(grid);
}
void grid_RowDataBound(object sender, GridViewRowEventArgs e)
{
// Bail if it’s the header.
if (e.Row.RowType == DataControlRowType.Header)
return;
if (e.Row.RowType == DataControlRowType.DataRow)
{
// Render HTML for URLS
foreach (TableCell cell in e.Row.Cells)
{
cell.Text = Context.Server.HtmlDecode(cell.Text);
}
if (e.Row.Cells[0].Text.ToLower().Contains(“tentative”))
{
foreach (TableCell cell in e.Row.Cells)
{
if (cell.Text.Length > 1)
{
cell.BorderColor = Color.Red;
cell.BorderWidth = Unit.Pixel(2);
}
}
}
}
}
protected override void RenderContents(HtmlTextWriter writer)
{
if (!hasControlBeenConfigured())
{
writer.Write(“Please complete the options for this Web Part.”);
return;
}
this.grid.RenderControl(writer);
this.errMsg.RenderControl(writer);
}
private bool hasControlBeenConfigured()
{
if (this._calendarName == null)
return false;
return true;
}
private bool BuildTable()
{
// First, try to load the List and bail if it can’t find it.
SPList calList;
SPWeb oWeb = SPContext.Current.Web;
calList = oWeb.GetList(oWeb.Url + “/Lists/” + this._calendarName);
if (year == 0) year = DateTime.Now.Year;
// Make sure the list in question has a “Title” and a “Start Date” field.
// .. to do 😉
// Buid the table.
this.table = new DataTable();
table.Columns.Add(new DataColumn(“Event”));
table.Columns.Add(new DataColumn(“Jan”));
table.Columns.Add(new DataColumn(“Feb”));
table.Columns.Add(new DataColumn(“Mar”));
table.Columns.Add(new DataColumn(“Apr”));
table.Columns.Add(new DataColumn(“May”));
table.Columns.Add(new DataColumn(“Jun”));
table.Columns.Add(new DataColumn(“Jul”));
table.Columns.Add(new DataColumn(“Aug”));
table.Columns.Add(new DataColumn(“Sep”));
table.Columns.Add(new DataColumn(“Oct”));
table.Columns.Add(new DataColumn(“Nov”));
table.Columns.Add(new DataColumn(“Dec”));
SPQuery query = new SPQuery() { Query = “”; }
foreach (SPListItem item in calList.GetItems(query))
{
// Extract the Day, Month and Year from the start Date field
DateTime eventDate = (DateTime)item[“Start Time”];
DateTime endDate = (DateTime)item[“End Time”];
if (eventDate.Year != year)
continue;
DataRow row = table.NewRow();
string eventURL = ““;
eventURL += “Details“;
row[0] = item.Title + ” (” + eventURL + “)”;
// Does this event span 2 months?
if (eventDate.Month == endDate.Month)
{
if (eventDate.Day.ToString().Equals(endDate.Day.ToString()))
{
row[eventDate.Month] = eventDate.Day.ToString();
}
else
{
row[eventDate.Month] = eventDate.Day.ToString() + ” – ” + endDate.Day.ToString();
}
}
else
{
row[eventDate.Month] = eventDate.Day.ToString();
row[endDate.Month] = endDate.Day.ToString();
}
table.Rows.Add(row);
}
return true;
}
}
}