For overview:
For ITs:
For developers :
It's a great one! Can't wait!!
12 years of work within the Sharepoint world : let's talk about technical and functional thoughts around Sharepoint.
I splitted the tool in three part : "Solutions" , "Features" and "Site hierarchy"
The second one "Features"list everything about features :
The third one is the big one :) It gives you, many information about your farm structure (from object ids, to content DBs for web apps, passing by activated feature listing...) and much much more. You can interact with object. For instance, you can set read or write lock mode.
Of course cause, it's a big thing, so far, not everything have been developped, but i work on it. I'll keep you informed.
The codeplex project for this : http://mossadministration.codeplex.com/System.Reflection.Assembly asm = System.Reflection.Assembly.Load(AssemblySrc);
System.Web.UI.WebControls.WebParts.WebPart wpS = (System.Web.UI.WebControls.WebParts.WebPart) asm.CreateInstance(ClassSrc);
public void ReplaceWebpart(SPWeb web)
{
try
{
SPLimitedWebPartManager theMan =
web.Files["Default.aspx"].GetLimitedWebPartManager(System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared);
System.Reflection.Assembly asm = System.Reflection.Assembly.Load(AssemblySrc);
System.Web.UI.WebControls.WebParts.WebPart wpS = (System.Web.UI.WebControls.WebParts.WebPart) asm.CreateInstance(ClassSrc);
System.Reflection.Assembly asmD = System.Reflection.Assembly.Load(AssemblyDest);
for (int i = 0; i < theMan.WebParts.Count; i++)
{
System.Web.UI.WebControls.WebParts.WebPart wp = theMan.WebParts[i];
if (wp.GetType().Equals(wpS.GetType()))
{
System.Web.UI.WebControls.WebParts.WebPart wpD = (System.Web.UI.WebControls.WebParts.WebPart)asmD.CreateInstance(ClassDest);
wpD.Title = wp.Title;
theMan.AddWebPart(wpD, theMan.GetZoneID(wp), wp.ZoneIndex);
theMan.WebParts[wpD.ID].
theMan.DeleteWebPart(wp);
Result++;
i--;
}
}
foreach (SPWeb Sweb in web.Webs)
{
ReplaceWebpart(Sweb);
Sweb.Dispose();
}
}
catch (Exception ex)
{
}
finally
{
}
}
foreach (Object LstItem in PropCollection)
{
try
{
System.Reflection.PropertyInfo prop = wpD.GetType().GetProperty(((KeyValuePair<String, String>)LstItem).Key);
if (prop != null)
{
String[] propValues = new String[1] { ((KeyValuePair<String, String>)LstItem).Value };
if (prop.PropertyType.Equals(String.Empty.GetType()))
{
prop.SetValue(wpD,((KeyValuePair<String, String>)LstItem).Value,null);
}
else
{
Type[] types = new Type[1] { String.Empty.GetType() };
prop.SetValue(wpD, prop.PropertyType.GetMethod("Parse", types, null).Invoke(prop, propValues), null);
}
}
}
catch (Exception exceptionProp)
{}
}
<View List="$Resources:core,lists_Folder;/$Resources:core,announce_Folder;"
BaseViewID="0"
WebPartZoneID="Left">
<RowLimit Paged="TRUE">5</RowLimit>
</View>
Guid ListId = new Guid(this.Page.Request["List"]);2/ Then whenever I reach the page, i check whether the view already exists, if not i create it cloning the default view and adding to it a checbox field. If the clone of the actual defaultview exists i just use it! Easy! In my code below, the listview object is called Select_List
bool creatingView = false;
SPView newView = null;
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite Mysite = new SPSite(siteID))
{
SPWeb MyWeb = Mysite.OpenWeb(webID);
MyWeb.AllowUnsafeUpdates = true;
SPList MyList = MyWeb.Lists[ListId];
foreach (SPView view in MyList.Views)
{
if (view.Title.Equals(MyList.DefaultView.Title+ "_CloneForSelect"))
{
newView = view;
}
}
if (newView == null)
{
if (!MyList.Fields.ContainsField("Select"))
{
MyList.Fields.AddFieldAsXml("<Field Type=\"Computed\" ReadOnly=\"TRUE\" Name=\"ListItemSelection\" DisplayName=\"Select\" Sortable=\"FALSE\" Filterable=\"FALSE\" EnableLookup=\"FALSE\" SourceID=\"http://schemas.microsoft.com/sharepoint/v3\" StaticName=\"ListItemSelection\">" +"<FieldRefs> <FieldRef Name=\"ID\" /> </FieldRefs>" + "<DisplayPattern> <HTML><![CDATA[<input id=\"chk_select]]></HTML><Column Name=\"ID\" HTMLEncode=\"TRUE\" /><HTML><![CDATA[\" name=\"chk_select\" type=\"checkbox\" ]]></HTML>" + "<HTML><![CDATA[LItemId=\"]]></HTML>" + "<Column Name=\"ID\" HTMLEncode=\"TRUE\" />" + "<HTML><![CDATA[\"/> ]]></HTML>" + "</DisplayPattern></Field>");
}
SPFieldComputed fieldComp = (SPFieldComputed)MyList.Fields["Select"];
newView = MyList.DefaultView.Clone(MyList.DefaultView.Title + "_CloneForSelect", 1000, true, false);
newView.Hidden = true;
newView.Scope = SPViewScope.FilesOnly;
newView.ViewFields.Add(fieldComp);
newView.Update();
creatingView = true;
}
MyWeb.Dispose();
}
});
if (!creatingView)
{
Select_List.ViewId = newView.ID.ToString();
}
else
{
Response.Write("");
}
Select_List.ListId = this.Page.Request["List"];
if (!MyList.Fields.ContainsField("Select"))
{
MyList.Fields.AddFieldAsXml("<Field Type=\"Computed\" ReadOnly=\"TRUE\" Name=\"ListItemSelection\" DisplayName=\"Select\" Sortable=\"FALSE\" Filterable=\"FALSE\" EnableLookup=\"FALSE\" SourceID=\"http://schemas.microsoft.com/sharepoint/v3\" StaticName=\"ListItemSelection\">" +"<FieldRefs> <FieldRef Name=\"ID\" /> </FieldRefs>" +
"<DisplayPattern> <HTML><![CDATA[<input id=\"chk_select]]></HTML><Column Name=\"ID\" HTMLEncode=\"TRUE\" /><HTML><![CDATA[\"
name=\"chk_select\" type=\"checkbox\" ]]></HTML>" +
"<HTML><![CDATA[LItemId=\"]]></HTML>" +
"<Column Name=\"ID\" HTMLEncode=\"TRUE\" />" +
"<HTML><![CDATA[\"/> ]]></HTML>" + "</DisplayPattern></Field>");
}
<asp:HiddenField runat="server" id="listSrv_items" />
<asp:HiddenField runat="server" id="checked_ids" />
<asp:Button ID="Btn_valid" OnClientClick="fill_ids();" OnClick="Btn_valid_Click" runat="server"/>
protected override void Render(HtmlTextWriter writer)
{
this.ClientScript.RegisterClientScriptBlock(this.GetType(), "MyScript", @"
<script>
function fill_ids()
{
var items= document.getElementById('" + listSrv_items.ClientID + @"').value;
var checkedIds= document.getElementById('" + checked_ids.ClientID + @"');
checkedIds.value='';
var SParray = items.split(';');
for (ix=0; ix< SParray.length-1; ix++)
{
var item = document.getElementById(""chk_select""+SParray[ix])
if (item!=null && item.checked)
{
checkedIds.value += SParray[ix] + ';';
}
}
if (checkedIds.value.length>0)
checkedIds.value = checkedIds.value.substr(0,checkedIds.value.length-1);
}
</script>");
listSrv_items.Value = "";
foreach (SPListItem item in _rootList.Items)
{
listSrv_items.Value += item.ID + ";";
}
}
public SPList getListFromUrl(string url)
{
try
{
if (!url.EndsWith("/")) url = url + "/";
//match list
Regex listExpReg = new Regex("(?.+)\\/Sites\\/(?.+)\\/Lists\\/(?.+)\\/.*", RegexOptions.IgnoreCase);
if (listExpReg.IsMatch(url))
{
Match siteMatch = listExpReg.Match(url);
String racine = siteMatch.Groups["Racine"].Value;
String siteToFind = siteMatch.Groups["Sites"].Value;
String listeToFind = siteMatch.Groups["LName"].Value;
String[] splitedSiteList = siteToFind.Split('/');
SPSite rootsite = new SPSite(racine + "/Sites/" + splitedSiteList[0]);
if (rootsite != null)
{
using (SPWeb webNavigated = rootsite.RootWeb)
{
foreach (string s in splitedSiteList)
{
if (s != splitedSiteList[0])
{
SPWeb TempWeb = webNavigated.Webs[s];
webNavigated = TempWeb;
TempWeb.Dispose();
}
}
SPList listsearched = webNavigated.GetList(url);
_destinationWeb = webNavigated;
rootsite.Dispose();
}
return listsearched;
}
else
{
return null;
}
}
else
return null;
}
catch (Exception exc)
{
//BUUUUUUUUP
}
}