Archive | développement RSS for this section

Récupération du serveur SMTP configuré dans sharepoint

Depuis  sharepoint 2010, « SPGlobalAdmin » est à présent obsolète. Afin de récupérer le nom du serveur SMTP, il faut à présent utiliser la classe « SPOutboundMailServiceInstance ».

Lire la Suite…

Publicités

Convertion caractères spéciaux en HTML

Dans la plupart des cas quand on veut convertir une chaine (string) en html il suffit d’utiliser HttpUtility.HtmlEncode. Mais parfois on ne veut pas convertir tous les caractères. Je suis tombé sur un cas où je devais garder les balises HTML mais convertir les caractères spéciaux. J’ai donc fait le code suivant :

 

 

public static string htmlToAccent(string text)

{

string[] spec = new string[]{

"\"","&","€","œ","¡","¢","£","¤","¥","¦","§","¨","©","ª","«","¬","®","¯","°","±","²","³","'","µ","¶","·","¸","¹","º","»","¼","½","¾",

"¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç",

"è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý","þ","ÿ" };

string[] norm = new string[]{

""","&","€","œ","¡","¢","£","¤","&yen","¦","§","¨","©",

"ª","«","¬","®","&masr;","°","±","²","³","´","µ","¶","·","¸","¹","º",

"»","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","&Aelig","Ç","È",

"É","Ê","Ë","Ì","Í","Î","Ï","ð","Ñ","Ò","Ó","Ô","Õ","Ö","×",

"Ø","Ù","Ú","Û","Ü","Ý","þ","ß","à","á","â","ã","ä","å","æ",

"ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó",

"ô","õ","ö","÷","ø","ù","ú","û","ü","ý","þ","ÿ"

};

for (var i = 0; i < spec.Count(); i++)

text = text.Replace(spec[i],norm[i]);

return text;

}

Imprimer un document Word (html …) en PDF avec le service Word Automation livré avec l’installation de SharePoint 2010

Mon besoin était d’envoyer par mail un PDF de la page en cours. Pour ce faire j’ai créé un Template de la page en mht (le format de page web unique de microsoft) avec Word.

Lire la Suite…

Changements entre SharePoint 2010 et SharePoint 2013

Microsoft nous parle des fonctionnalités déconseillées dans SharePoint 2013 « Preview »

Fonctionnalités déconseillées dans SharePoint 2013

Récupération d’un groupe en javascript

Récupération d’un groupe en javascript

Voila un petit script tout simple qui vous permet d’obtenir un Objet Groupe SharePoint avec les utilisateurs qui y sont inscrits.

Lire la Suite…

Convertir une image hébergée dans SharePoint en Base64

Pour convertir une image hébergée dans SharePoint en Base64 afin de l’ajouter dans une page mht par exemple, il suffit de faire :

byte[] imageBytes = web.GetFile(siteUrl + « /Profile/cv/U506619.png »).OpenBinary();

string ImgBase64 = Convert.ToBase64String(imageBytes);

Améliorer les performances de SharePoint

SharePoint : Boîte à trucs

Pour des raisons de performances, préférez utiliser SPList.ItemCount pour les listes importantes

un peu plus d’informations  ici

Un exemple sur une liste de 1142 éléments : s

Et voilà!

View original post