Resumen
The post describes what it’s like to make an integration between two systems content management, Sharepoint and Joomla!, showing through Joomla! plugin the contents of a public folder Sharepoint.
Pre-requisitos
Los pre-requisitos para poder hacer esta integración es tener activado el acceso anónimo a la biblioteca de docmentos donde tenemos la carpeta pública.
Aquí se puede leer como crear FOLDERS PÚBLICOS, http://technet.microsoft.com/es-es/magazine/2007.07.publicfolders.aspx
Introducción
Para poder hacer la integración tenemos que crear un fichero aspx en el servidor donde tenemos instalado nuestro SharePoint, el cual lo que hace es coger 2 variables HOST (h) y LISTA (l), definidas en el plugin de Joomla!, y recuperar recorriendo la Biblioteca de Documentos la carpeta concreta que le hemos marcado.
La parte alojada en el IIS seria así:
Imports System Imports Microsoft.SharePoint Partial Public Class _Default Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim sHost As String = Request.QueryString("h") Dim sLista As String = Request.QueryString("l") Dim site As SPSite = New SPSite(sHost) Dim web As SPWeb = site.OpenWeb() Dim list As SPList = web.Lists(sLista) Dim sProyecto As String = Request.QueryString("p") Dim f As SPFolder = web.GetFolder(sHost + sLista + "/PUBLICA/" + sProyecto) Dim query As SPQuery = New SPQuery() query.Query = "" query.Folder = f Dim itemCol As SPListItemCollection = list.GetItems(query) Dim listItem As SPListItem Me.lblResultado.Text &= " " For Each listItem In itemCol Me.lblResultado.Text &= "<a>" Me.lblResultado.Text &= listItem.Name Me.lblResultado.Text &= "</a> " Next listItem Me.lblResultado.Text &= "" End Sub End Class
Por otra parte en la parte de Joomla! se ha de crear un plugin, el cual hace la llamada al aspx y recupera los documentos, el plugin tiene el siguiente codigo,
enc-sharepoint.php
<!--p defined( '_JEXEC' ) or die( 'Restricted access' ); class plgContentenc_sharepoint extends JPlugin { //Constructor function plgContentenc_sharepoint( &$subject ) { parent::__construct( $subject ); // load plugin parameters $thi-->_plugin = JPluginHelper::getPlugin( 'content', 'enc_sharepoint' ); $this->_params = new JParameter( $this->_plugin->params ); } function onPrepareContent(&$row, &$params, $limitstart) { // just startup global $mainframe; // root folder $rootfolder = '/images/stories/'; // checking if ( !preg_match("#{proyecto}(.*?){/proyecto}#s", $row->text) ) { return; } $plugin =& JPluginHelper::getPlugin('content', 'enc_sharepoint'); $pluginParams = new JParameter( $plugin->params ); // j!1.5 paths $mosConfig_absolute_path = JPATH_SITE; $mosConfig_live_site = JURI :: base(); if(substr($mosConfig_live_site, -1)=="/") $mosConfig_live_site = substr($mosConfig_live_site, 0, -1); // Parameters $HOST = $pluginParams->get('enc_sharepointHOST', 0); $LISTA = $pluginParams->get('enc_sharepointLISTA', 0); $string = $row->text; $substring = "{proyecto}"; $substring1 = "{/proyecto}"; $proyectoBusqueda = substr ( $string , strpos($string, $substring) + 10 , strpos($string, $substring1) - strpos($string, $substring) - 10 ); $base = $substring . $proyectoBusqueda . $substring1; $inicio= ' '; $final=''; $url = $HOST . "proyecto.aspx?h=" . $HOST . "&l=" . $LISTA . "&p=" . $proyectoBusqueda; $source = @file_get_contents($url)or die('se ha producido un error'); $posicion_inicio = strpos($source, $inicio) + strlen($inicio); $posicion_final = strpos($source, $final) - $posicion_inicio; $found_text = substr($source, $posicion_inicio, $posicion_final); $html= $inicio . $found_text .$final; $cambio = str_replace($base, $html, $row->text); $cambio = str_replace(".doc\">", ".doc\" style=\"padding:0px;margin:0px;background:none;display:inline;color: #426bba;font-size:13px\"><img src="\" alt="" />", $cambio); $cambio = str_replace(".pdf\">", ".pdf\" style=\"padding:0px;margin:0px;background:none;display:inline;color: #426bba;font-size:13px\"><img src="\" alt="" />", $cambio); $cambio = str_replace(".xls\">", ".xls\" style=\"padding:0px;margin:0px;background:none;display:inline;color: #426bba;font-size:13px\"><img src="\" alt="" />", $cambio); $row->text = $cambio; } } ?>
enc-sharepoint.xml
<!--l version="1.0" encoding="utf-8-->
ENC - Sharepoint
Albert Llueca
01/07/2007
allueca@encamina.com
http://www.encamina.com
1.0.0
Conecta Sharepoint con Joomla!
enc_sharepoint.php
enc_sharepoint.xmlPara configurarlo en Joomla! se hace de la siguiente manera:


One Comment add one
Leave a Comment
Previous post: Web 2.0 en la gestión empresarial
Next post: La ola ahogó a Google Wave

Pingback:Twitter Trackbacks for business and IT » Blog Archive » Integración de una Biblioteca de Documentos de SharePoint en Joomla! v1.0 [businessandit.net] on Topsy.com