Archivos de diciembre,2009

Log Files de Sharepoint

diciembre 05, 2009
Cuando implementamos soluciones en SharePoint muchas veces no encontramos el detalle de un error en la aplicación; en esos casos, se puede ingresar a los log files de sharepoint a ver el detalle de la ejecuciòn del portal.

La ubicación por defecto es:

"C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS"

En el servidor web.


Espero que sea de ayuda

Carga de Archivo (Upload File) desde infopath forms services

diciembre 05, 2009
En una entrada anterior publiqué un método para cargar archivos desde cualquier aplicación web; en este caso publico la misma funcionalidad desde el control upload de infopath forms services.

Deben utilizar un botón adicional al cual le añaden el siguiente codigo .net:

public void btnCargarDocumento_Clicked(object sender, ClickedEventArgs e)
{
XPathNavigator DOM = this.MainDataSource.CreateNavigator();
XPathNavigator fileDocumento = DOM.SelectSingleNode("/my:misCampos/my:att_documento", NamespaceManager);
byte[] attachmentNodeBytes = Convert.FromBase64String(fileDocumento.Value.ToString());
int fnLength = attachmentNodeBytes[20] * 2;
byte[] fnBytes = new byte[fnLength];

for (int i = 0; i < fnBytes.Length; i++)
{
fnBytes[i] = attachmentNodeBytes[24 + i];
}

char[] charFileName = System.Text.UnicodeEncoding.Unicode.GetChars(fnBytes);
string fileName = new string(charFileName);

fileName = txtIdActividad.Value + "-" + fileName.Substring(0, fileName.Length - 1);
byte[] fileContents = new byte[attachmentNodeBytes.Length - (24 + fnLength)];

for (int i = 0; i < fileContents.Length; ++i)
{
fileContents[i] = attachmentNodeBytes[24 + fnLength + i];
}

string LibreriaDestino = "http://SERVIDOR:8001/sitio/sitiodocs/documentosA/";
string Destino = LibreriaDestino + fileName;
System.Net.WebClient objWebClient = new System.Net.WebClient();
objWebClient.Credentials = System.Net.CredentialCache.DefaultCredentials;
objWebClient.UploadData(Destino, "PUT", fileContents);
//limpiar el control upload
if (!fileDocumento.MoveToAttribute("nil",
fileDocumento.LookupNamespace("xsi")))
{
fileDocumento.SetValue("");
}

}


Espero que sea de ayuda