Posts

Showing posts from January, 2011

SharePoint | Find Site Template Name and ID

WSS3 stsadm.exe -o enumallwebs -databasename [WSS_Content] WSS_Content is Content Database name, found in C.A., Application Management, Content databases WSS4 In 2010 this can be done with powershell: get-spweb http://contoso | select WebTemplate get-spweb http://contoso | select WebTemplateID

Blog Posts | Post your code nicely

On my way to try this Google SyntaxHighlighter http://code.google.com/p/syntaxhighlighter/wiki/Usage Download latest version http://code.google.com/p/syntaxhighlighter/downloads/list Note: Blogger replaces line feeds by <br> so all your code will appear in line 01, unless you add (before HideAll!): dp.SyntaxHighlighter.BloggerMode(); Here goes all code needed (with javascript, c# and xml code transformations): <link href='http://mywebsiteurl/syntax/SyntaxHighlighter.css' rel='stylesheet' type='text/css'/> <script language='javascript' src='http://mywebsiteurl/syntax/shCore.js'/> <script language='javascript' src='http://mywebsiteurl/syntax/shBrushCSharp.js'/> <script language='javascript' src='http://mywebsiteurl/syntax/shBrushXml.js'/> <script language='javascript' src='http://mywebsiteurl/syntax/shBrushJScript.js'/> <script language='javascript'> w...

SharePoint | Conditionally Aprove List Item When Content Aproval is Enabled

We can programatically aprove an item with item.Aprove("my comment"); the thing is, this will end up in an exception when Content Aproval is not enabled for a list (cheking in is enough to make the item available). I tried using item.ModerationInformation.Status but it turns out this attribute isn't even available for lists without content aproval. so I end up with this: if (myfile.Item.ModerationInformation != null) { myfile.Approve(""); }

MOSS | Failed to extract the cab file in the solution.

Issue: STSADM or SharePoint Solution installer trows "Failed to extract the cab file in the solution." When trying to install wsp package. Solution: Look for duplicate files in manifest.xml or illegal characters (~, ^) in feature.xml. http://geekswithblogs.net/kjones/archive/2010/02/09/137887.aspx

Revert DLL to code with Reflector + FileDisassembler

.NET Reflector enables us to open assemblies and view the existing methods, arguments, system variables, and so on. The FileDisassembler takes an assembly and generates code from it. Useful for retrieving lost source code. http://reflectoraddins.codeplex.com/

Windows Server | Server busy Switch To...

Image
System: Windows Server 2008 R2 (Hyper-V VM) SharePoint Server 2010 Running IE8, FireFox, SharePoint Designer 2010 Error: "This action cannot be completed because the other program is busy. Choose Switch To to activate the busy program and correct the problem." Solution: I haven't totaly figured out what's happenning here. The only thing that solves it is restarting the server. I do think my issue is due to low memory available, and when the IIS is constantly asking for more memory than what is available in the system, eventually I get this error. So while working on the server, regular iisresets keeps this from happening.

SharePoint 2010 | You must specify a value for this required field

After creating my custom master page, every time a edit and saved the page, I got the popup: "You must specify a value for this required field." Turns out it happens when you set the place holder PlaceHolderPageTitleInTitleArea with Visible attribute false . The solution, for Travis Mathison, is to wrap the placeholder in a panel, linked with a css visibility attribute set to false instead of doing it through the place holder attribute. .hiddenpanel{visibility:hidden;} Although Travis saved my life by finding this solution, I worked out my own through his, and now you don't need an external css file, and the white-space occupied by the place holder won't show up. Note: SharePoint 2007 works great either way. My solution in IE for SharePoint 2010 still shows some text on the bottom of the page. Anyway, I decided not to hide this place holder, since it gives some context options for lists and such, and won't be available if the place holder is removed from the pag...

LightUp SharePoint | MS Free Developer Event

"[PT] O LightUp Sharepoint Developer roadshow é um evento gratuito da Microsoft direccionado a gestores de equipas de desenvolvimento, developers ou arquitectos com interesse em soluções avançadas, elegantes e interactivas sobre a plataforma Sharepoint. Ao longo deste dia iremos apresentar-lhe as diferentes opções para desenvolvimento de soluções avançadas Sharepoint nos seus clientes, e como utilizar as diferentes ferramentas e plataformas Microsoft para o efeito, como o Visual Studio 2010 ou o Silverlight. Este evento é a oportunidade ideal para ficar a conhecer a ligação entre o mundo do Sharepoint e a visão global da Microsoft para a área do desenvolvimento, bem como para saber como aproveitar tudo o que esta plataforma tem para oferecer, muito além das funcionalidades out-of-the-box." 9h00: Recepção e Credenciação 9h30: Introduction to SharePoint 2010/BPOS development (45 Min) 10h15: Light Up SharePoint with Silverlight (60 Min) 11h15: Coffee Break 11h30: Professional Sh...

Windows Server RunMRU list

Image
I haven't had my start->run programs list populated for quite some time. Today I decided to look for a way to ativate it and come up with the apparently easy solution: - Right-click the Taskbar and choose Properties - Select the Start Menu tab - Uncheck the following option: - Store and display a list of recently opened programs Source http://www.winhelponline.com/articles/129/1/Clearing-the-Run-MRU-entries-in-Windows-Vista.html

Outlook 2007 | Contact folder not appearing in new mail form

Image
Backing up contacts and emails resulted in contact subfolders not appearing when I selected the "New" email, on the address book list. The solution was to edit the properties of each contact folder and enabling the checkbox "Show this folder as an e-mail Address Book" in "Outlook Address Book" tab.

Orchard | Generate a NuPack Package

To generate a theme package called "MyCustomTheme" for Orchard starting version 0.9.253, we must work a manifest file and pack it using NuGet.exe 1) first we must place all contents in an output folder (Content, Styles, Views, Shapes, Zones) 2) then we must create out manifest file (.nuspec), which may or may not specify the files in the package (seems ouputting the folder adds each file automatically) Contents of manifest file, Orchard.Theme.MyCustomTheme.nuspec: <?xml version="1.0"?> <package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <id>Orchard.Theme.MyCustomTheme</id> <version>0.9.253</version> <authors>Bind</authors> <requireLicenseAcceptance>false</requireLicenseAcceptan...

JavaScript Online Editor

JavaScript language "IDE" Page http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_replace3

PowerShell | Starting running scripts

For first steps, - Install / make sure PS is installed - Run PS command-line with admin privileges - Run "Set-ExecutionPolicy Unrestricted" to enable the system to run scripts "By default, PowerShell has scripting support disabled. If you try and run a PowerShell script, you will be greeted with an error stating that the execution of scripts is disabled on your system." http://www.tech-recipes.com/rx/2513/powershell_enable_script_support/ Update: This is usually needed when running scripts for the first time. System presents us with errors such as: File C:\Common\Scripts\hello.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details. Update: Output of " help set-executionpolicy -detail " command SYNOPSIS     Changes the user preference for the Windows PowerShell execution policy. SYNTAX     Set-ExecutionPolicy [-ExecutionPolicy] {Unrestricted | Remote...