Skip to content

Instantly share code, notes, and snippets.

View jjaramillo's full-sized avatar

Jaime Jaramillo jjaramillo

  • Globant
  • Bogotá, Colombia
View GitHub Profile
@jjaramillo
jjaramillo / gist:1497773
Created December 19, 2011 15:59
Powershell commands in order to fully deploy a feature. (This case a job) in sharepoint 2010
Add-SPSolution "c:\Paradigma.GrupoMundial.Innovacion.JobInstall.wsp"
Install-SPSolution -Identity "Paradigma.GrupoMundial.Innovacion.JobInstall.wsp" -GACDeployment
Enable-SPFeature -Identity "Paradigma.GrupoMundial.Innovacion.JobInstall_Feature1" -Url "http://localhost:10963"
@jjaramillo
jjaramillo / sharepointlog.txt
Created December 16, 2011 16:11
Sharepoint's Workflow Engine exception.
RunWorkflow: Microsoft.SharePoint.SPException: <Error><CompilerError Line="0" Column="10" Text="The type or namespace name 'iLoveSharePoint' could not be found (are you missing a using directive or an assembly reference?)" /></Error> at Microsoft.SharePoint.Workflow.SPNoCodeXomlCompiler.LoadXomlAssembly(String assmNameIn, SPWeb web) at Microsoft.SharePoint.Workflow.SPWinOeHostServices.CreateInstance(Guid trackingId, SPWorkflow workflow) at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(Guid trackingId, SPWorkflowHostService host, SPWorkflow workflow, Collection`1 events, TimeSpan timeOut) at Microsoft.SharePoint.Workflow.SPWorkflowManager.RunWorkflowElev(SPWorkflow originalWorkflow, SPWorkflow workflow, Collection`1 events, SPRunWorkflowOptions runOptions)
Microsoft.SharePoint.SPException: <Error><CompilerError Line="0" Column="10" Text="The type or namespace name 'iLoveSharePoint' could not be found (are you missing a using directive or an assembly reference?)" /></Error> at Mic
@jjaramillo
jjaramillo / Cursed error from hell.txt
Created December 15, 2011 15:45
Sharepoint's god damn exception messages
Possible mismatch between the reported error with code = 0x81070504 and message: "There is no Web named "/ServiciosEmpleados/PersonalMencion/Forms/AllItems.aspx"." and the returned error with code 0x80070002.
public partial class Afiliado
{
public Afiliado()
{
this.CategoriasXAfiliado = new HashSet<CategoriaXAfiliado>();
this.Productos = new HashSet<Producto>();
this.Sucursales = new HashSet<Sucursal>();
}
public System.Guid IdAfiliado { get; set; }
@jjaramillo
jjaramillo / jqloader.debug.js
Created November 30, 2011 05:19
A simple jquery "loading" overlay
(function ($) {
$.fn.ajaxloader = function () {
var ajaxloader = $('<div class="Ajax-Loader"><div class="Ajax-Loader-Overlay"></div><div class="Ajax-Loader-Image ui-corner-all"><img src="DesktopModules/DondeCompro/UI/recursos/img/loadinfo.net.gif"/></div></div>');
this.after(ajaxloader);
ajaxloader.css('top', this.position().top).width(this.outerWidth()).height(this.outerHeight());
ajaxloader.find('.Ajax-Loader-Overlay').css('opacity', 0.5).width(this.outerWidth()).height(this.outerHeight());
ajaxloader.find('.Ajax-Loader-Image').css('top', -((ajaxloader.height() / 2) + 36));
ajaxloader.hide();
return ajaxloader;
};
@jjaramillo
jjaramillo / app.config
Created November 29, 2011 19:52
If you ever need to log what a wcf service is doing here's how to. Go to your web.config or app.config file and start adding this
<system.serviceModel>
<!-- ... -->
<diagnostics>
<messageLogging logEntireMessage="true" logMalformedMessages="true"
logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
</diagnostics>
</system.serviceModel>
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Warning, ActivityTracing"
@jjaramillo
jjaramillo / gist:1403566
Created November 29, 2011 05:28
SVC Log output for the serialization exception
The type 'DondeCompro.Data.Afiliado' cannot be serialized to JSON because its IsReference setting is 'True'. The JSON format does not support references because there is no standardized format for representing references. To enable serialization, disable the IsReference setting on the type or an appropriate parent class of the type.
System.Runtime.Serialization.Json.DataContractJsonSerializer.get_RootContract()
System.Runtime.Serialization.Json.DataContractJsonSerializer.InternalWriteObjectContent(XmlWriterDelegator writer, Object graph)
System.Runtime.Serialization.Json.DataContractJsonSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph)
System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
System.Runtime.Serialization.Json.DataContractJsonSerializer.WriteObject(XmlDictionaryWriter writer, Object graph)
System.ServiceModel.Dispatcher.DataContractJsonSerializerOperationFormatter.Seri
@jjaramillo
jjaramillo / CurrentFormData_SetFormData.js
Created September 21, 2011 21:40
"Override" the "callback" function triggered after infopath executes an async call on an infopath browser enabled form
(function () {
var nCurrentFormData_SetFormData = CurrentFormData_SetFormData;
CurrentFormData_SetFormData = function () {
nCurrentFormData_SetFormData.apply(this, arguments);
//Your custom code here
}
})();
@jjaramillo
jjaramillo / Restore-SPUserInfo.ps1
Last active August 29, 2015 14:27
Sometimes someone might screw up you sharepoint user related info by deleting information on the user profile service... This script might help you out restoring the user information integrity on your site...
function Restore-SPUserInfo{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true, HelpMessage='data container url')]
[Alias('webUrl')]
[string]$url,
[Parameter(Mandatory=$true, HelpMessage='library template type id')]
[Alias('libraryTemplateType')]
[int]$templateType,
[Parameter(Mandatory=$false, HelpMessage='parent content type id for the data you want to process')]
@jjaramillo
jjaramillo / everyday.sp2013.ps1
Created June 9, 2015 21:34
Everyday poweshell scripts for sharepoint. Originally found on http://www.vrdmn.com/2012/10/everyday-powershell-scripts-for.html
#add indexes to a field on a list
Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
function IndexField($fieldName, $spList)
{
$spField = $spList.Fields[$fieldName]
$spField.Indexed = $true
$spField.Update()