Arquivo da Categoría: Desenvolvemento SharePoint

Calendario Bamboo interactuar co SharePoint causa "Houbo un erro inesperado"

Hoxe, I’ve been working in an environment that uses a Bamboo calendar web part for some improved collaboration. This a standard medium/small farm with two load balanced WFEs, un "servidor de aplicación" para indexación e InfoPath e un back-end en cluster SQL.

The client installed some disaster recovery software onto one of the WFEs and that resulted in a broken WFE for a specific site in the site collection. Whenever load balancing pointed at the affected WFE and that site, users saw a largely blank white screen with the sentence “An unexpected error occurred”. No other info showed, só unha frase que.

They asked me to look at it. I easily reproduced the problem and then added a ?contents=1 to the end of the URL. This is how I learned they were using the Bamboo web part. I went back to the page and now, de súpeto, me mostrou unha mensaxe de erro fermosa e organizada:

image

Eu non sei o que estaba acontecendo ou o que eu fixen para chegar a mensaxe de erro controlado para amosar que non anexando o ?contents=1 bit of the query string.

Este pode ser un caso extremo moi raro, pero se recibe esta mensaxe, "Houbo un erro inesperado" vai adiante e engade ?contents = 1 para a secuencia de consulta e ver onde iso leva.

</final>

Rexístrate para o meu blog.

Siga-me no Twitter http://www.twitter.com/pagalvin

Technorati Tags: ,

Usando Reflector en microsoft.sharepoint.dll

Redgate .NET Reflector Michael Blumenthal puxo-se unha sobre avisos e puntos de vista ("Which views can be used when Creating an Alert ?"), which is interesting on its own merits. Con todo, I was even more interested to see how he methodically walks through the process of using Redgate’s .NET Reflector. Step by step, he shows how to use that tool track down how SharePoint determines whether a view on a list should be "subscribable" por falta dunha palabra mellor (he explains this much better than I do 🙂 ).

Neste punto, na era SharePoint, you’d almost have to be deaf and blind to have not heard or read about using that tool. It’s advanced stuff and my own sense is that it’s in many ways a tool of last resort. Con todo, Se pensas que debe, pero realmente non sei como, Michael do write-up parece ser un excelente tutorial sobre este tema.

</final>

Rexístrate para o meu blog.

Siga-me no Twitter http://www.twitter.com/pagalvin

Clasificando elementos de calendario en modo Calendario

I’m using a calendar to track panel discussions on a given day. I have two sessions: morning and afternoon. I want to create a view that shows morning sessions only listed alphabetically via a session ID. This is a little tricky to accomplish (a non ser que eu perda algo de verdade obvia).

I can easily create a filtered view showing just that day’s events. The calendar will show all those events and if they all take place on the same hour, it lists them side by side in the hour slot. That’s great. The tricky part is that, por defecto, it wants to list them in ID format. Así, se eu engadir "Sesión 02" e despois da sesión "01" para o calendario, mostra-las nesta orde (i.e, Sesión 02 e, a continuación Sesión 01). To list them in Session ID order, Eu penso que tratar isto:

  1. Configure the view using the web user interface. No luck. There are no options to sort items this way.

    Sempre que non funcionou, I am now hoping there’s a CAML query somewhere in there that will allow me to override the sort. CQWP lets me make that kind of change, quizais calendario vai ben?

  2. Editar a parte web, look for an "export" función e … BZZZT! I can’t export its XML. There is no export option.

    I’m still holding out hope that I can find and modify some CAML query. Since I can’t export the web part, que deixa SharePoint Design.

  3. I add the calendar web part to a sandbox site and open that site using SharePoint Designer. I look at the markup for the web part and I find what I’m looking for. It’s encoded madness, pero está aí: "<ListViewXml …. >loucura codificada</ListViewXml>". Especificamente, hai esta xoia:

<Pregunta>
<Onde>
<DateRangesOverlap>
<FieldRef Name = "EVENTDATE" />
<FieldRef Name = "EndDate" />
<FieldRef Name = "RecurrenceID" />
<Tipo value = "datetime">
<Mes />
</Valor>
</DateRangesOverlap>
</Onde>
<OrderBy><FieldRef Name = "Session_x0020_ID" /></OrderBy>
</Pregunta>

(Eu teño decodificado o &lt;'S e &gt e división los para fóra varias liñas para unha cuestión de claridade).

Engadir o <OrderBy> pouco e agora clasifica por ID de sesión, non o ID do elemento interna lista.

Xigantesca punta o’ o sombreiro para Becky Isserman polo seu comentario ao post do blog Isha Sagi: http://www.sharepoint-tips.com/2008/07/caml-sorting-by-file-name.html. I wouldn’t have put the <OrderBy> no lugar seguro sen o teu comentario.

Espero escribir isto máis claramente con pantallas en breve, pero no caso eu non fago, polo menos eu fixen iso moi.

</final>

SharePoint Features & Solucións de Xestión — Non esqueza da U en CRUD (ou D para que a materia)

Nós colectivamente gastar moito tempo a pensar sobre o SharePoint solucións — como crealos, cal ferramenta utilizar, o que ocorre cando non poden implantar, traballos de timer, alcance, etc. We spend so much time thinking about the up-front bits that it’s easy to forget that we need to retract them as well. Retracting solutions is probably more difficult, desde unha perspectiva de deseño conceptual, than deploying them. Deployment is basically a cookbook affair. Typically, instalar un recurso, quizais un receptor de recurso cargar algúns datos nunha lista, that sort of thing. Con todo, retracción é potencialmente máis complexo.

A solución dada pode crear artefactos como estes:

  • Tipo de contido
  • Definición de lista
  • Definición da web
  • Datos nunha lista
  • Mesmo receptores
  • Os formularios de InfoPath

A lista segue.

Aínda que sexa obviamente importante para proxectar unha solución que instancia os artefactos correctamente, it’s just as important to consider the update and delete cases. If your solution creates a new list and populates that list with data, o que ocorre cando a solución é retraído? In some cases, the list should be deleted. In other cases, it should be left intact for historical purposes. Your business requirements will guide you to the right decision.

Para axudar con iso, create a matrix that lists each artifact your solution deploys to SharePoint. List three columns per artifact, un para crear, actualizar e borrar. For each case, determinar o resultado correcto para que a operación.

This sort of analysis is obviously best done before the solution is ever deployed to a SharePoint farm. Con todo, como o tabaquismo, it’s never too late to start doing things correctly. Create that matrix and develop a plan to address the missing update/delete scenarios. It may be a hard problem to solve, pero polo menos vai ter colocar unha caixa en torno ao problema.

</final>

Rexístrate para o meu blog.

Siga-me no Twitter http://www.twitter.com/pagalvin

Quick Fix: Web Services que interactúan co SharePoint, InvalidOperationException

Un millón de anos, I helped developed a web service that was invoked via a custom action for a SharePoint Designer workflow. Esta semana, o cliente quería mover para produción (finalmente!) así o fixemos.

A acción personalizada funcionou ben, pero o servizo web que invocado non, nos dando ese erro:

System.InvalidOperationException: Esta operación pode ser realizada só nun computador que teña ingresado nun Farm de servidores, usuarios que teñen permisos no SQL Server para ler na base de datos de configuración. Para conectar o servidor para o farm de servidores, utilizar o SharePoint Products e Technologies Asistente de configuración, situado no menú Inicio, en Ferramentas Administrativas.
at Microsoft.SharePoint.Administration.SPWebApplication.Lookup(Uri requestUri)

Turns out that I forgot to add the service to the SharePoint application pool in IIS. Once I did that, funcionou moi ben.

Este foro MSDN mensaxe me deu a información que eu precisaba: http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/2c97c004-7118-4e06-a62c-b2b0ac07ac99

</final>

Rexístrate para o meu blog.

Siga-me no Twitter: http://twitter.com/pagalvin

Technorati Tags:

Fácil e rápida: Obter SPFolder de SPItemList

Eu segue correndo para este problema e Google parece nunca entender o que quero facer, entón eu entender que eu ía escribir isto.

Eu teño feito unha morea de depuración receptor de eventos a última semana ou dúas. The ER is defined against a document library. The individual items in the document library are tightly related to their parent folders. Así, I am always getting the folder of the item for various manipulations. While debugging, Eu precisaba actualizar os metadatos dun cartafol para un elemento específico, cuxa ID sei.

Aquí é unha aplicación de consola pouco (deseñado para rodar en servidores no farm) que recibe dous argumentos: a ID dun elemento e un valor a asignar a un campo, "Approval Status". It hard codes a lot of stuff and has no error checking.

O código é un sitio codificado, gets a hard coded document library and then finds the indicated item. It then finds the parent folder of that item and assigns the status value.

The key lesson here for me is that SPItem doesn’t get you access to the folder. You need to use SPListItem.File.

Se alguén se preocupa en ofrecer unha crítica ou suxerir a mellor maneira de obter o cartafol dun elemento, por favor, deixe un comentario.

<código>
utilización Sistema;
utilización System.Collections.Generic;
utilización System.Text;
utilización Microsoft.SharePoint;
utilización System.Collections;

espazo de nomes Conchango
{
    /// <resumo>
 /// </resumo>
 clase ManualFolderUpdate
    {
        estático invalidar Principal(corda[] args)
        {
            corda MSH = "ManualFolderUpdate (v1.0): "; // msh = "Message Header"

 Consola.WriteLine(MSH + "Starting up.  I foi modificada por última vez en 08/04/08.");

            corda url = http://localhost/xyzzy;

            utilización (SPSite oSPSite = novo SPSite(url))
            {

                utilización (SPWeb oSPWeb = oSPSite.OpenWeb())
                {
                    SPList DocLib = oSPWeb.Lists["Documents"];

                    Consola.WriteLine(MSH + "Got the document library.");

                    Consola.WriteLine(MSH + "Doc lib item count: [" + docLib.ItemCount + "].");

                    int FolderID = 0;
                    corda NewStatus = "Xyzzy";

                    FolderID = System.Converter.ToInt32(args[0].ToString());
                    Consola.WriteLine("Seeking folder for item: [" + FolderID + "].");

                    SPListItem li = docLib.GetItemById(FolderID);

                    SPFolder thisItemFolder = li.File.ParentFolder;

                    Consola.WriteLine(MSH + "Got the parent folder.");

                    NewStatus = args[1].ToString();
                    Consola.WriteLine("Setting status to [" + NewStatus + "].");

                    Consola.WriteLine("Press return to commit the update or CTRL-C to abort.");

                    Consola.ReadLine();

                    thisItemFolder.Item["Approval Status"] = NewStatus;
                    thisItemFolder.Item.Update();

                    Consola.WriteLine(MSH + "Finished updating the folder.  Saír.");

                } // usar SPWeb

            } // usar SPSite

 Consola.WriteLine(MSH + "Finished.");

        } // Principal

    } // clase FolderSync
} // espazo de nomes
</código>

</final>

Rexístrate para o meu blog.

Technorati Tags:

Agochar accións personalizadas no SharePoint

Algúns meses atrás, mentres traballaba nun proxecto para un cliente, I created a feature. Among other things, esa característica definida unha acción personalizada (estas aparecen baixo a configuración da web). The only purpose for this custom action was to demonstrate to me that the feature activation was working as expected. Basicamente, I used it as a crude form of debugging.

Much to my embarrassment, this debugging artifact made its way from dev to UAT and to production before someone got around to asking, "what is this xyzzy link?"

Ata agora, we’re in production and I really don’t want to uninstall the feature, fix elements.xml and then reinstall.

Todd Bleaker pointed out an easy way to handle it. In his words:

"CustomActions are not copied into the database, they are read directly from the Elements.xml file and copied into application state at runtime. Así, you don’t need to deactivate, uninstall, reinstall, and reactivate the Feature to remove the CustomAction. Just remove it from the Elements.xml file and recycle the application pool(s) effected. The next time the Feature is in scope, you won’t see the CustomAction anymore."

I followed his instructions and, claro, they work.

No meu caso, this is a department level installation with just a single WFE. If you find yourself with this problem in future and with multiple WFE’s, I believe you’ll have to make the change in each.

</final>

Rexístrate para o meu blog.

Quick Fix: Acceder web do SharePoint Lanza [HttpException (0x80004005): A solicitude caducou.]

One of my developer colleagues was working on a project this week and ran into a timeout problem while working on building some crazy web part. His web part was fine, pero "de súpeto" un sitio non relacionado tornouse moi lento e moitas veces esgotado con este erro:

[HttpException (0x80004005): A solicitude caducou.]

I logged in and saw that several other sites were just fine. I suspected that there were some hidden web parts on the page and using o fiel ?contido = 1 técnica de depuración, Eu tiña de feito atopar 11 Web Parts na páxina, only two of which were visible. Even better (a partir dun imos-esperanza-I-atopar-algo-Ugly-aquí-que-me-me-fix perspectiva), three of those closed web parts had a name of "Error".

Eu apaguei as partes da web (que se deu un tempo sorprendentemente longo) and that solved the problem. For today 🙂

</final>

Rexístrate para o meu blog.

Technorati Tags:

Invocando Servizos SSRS web de WSS / Moss en Medio Ambiente FBA

Necesitabamos de invocar a CreateSubscription "" method on an SSRS web service that is hosted in an FBA managed MOSS environment from a custom web part. We kept getting variations of:

  • 401: Non autorizado
  • Obxecto Movido

O obxecto "movida" mensaxe era máis interesante porque estaba dicindo que o obxecto "" (noso servizo SSRS) habían "movido" to login.aspx. This clearly meant we had some kind of authentication problem.

Eu finalmente entender que eu tiña marcada unha entrada de blog by Robert Garret that described how to invoke a general purpose WSS/MOSS web service living inside an FBA environment. Note that I can’t link directly to the article (a partir de 06/09/08) because it wants to authenticate. The link I provide brings you to an "all posts" view and you can locate the specific article by searching for "Accessing MOSS Web Services using Forms Based Authentication".

Aquí está o código que funcionou para nós:

ReportingService2006 rs = nulo; 
// Acceder ao sistema Autenticación auth = novo Autenticación(); 
auth.Url = "http://URL / _vti_bin / Authentication.asmx";
auth.CookieContainer =
novo CookieContainer();
Resultado LoginResult = auth.login("userid", "password");
se (result.ErrorCode == LoginErrorCode.NoError) 
{
// Non hai erros, co fin de conseguir as cookies.
Galletas CookieCollection = auth.CookieContainer.GetCookies(novo Uri(auth.Url));
Biscoito authCookie = galletas[result.CookieName];
rs =
novo ReportingService2006();
rs.Url =
"http://server/_vti_bin/ReportServer/ReportService2006.asmx";
rs.CookieContainer =
novo CookieContainer();
rs.CookieContainer.Add(authCookie);
}
intentar
{
  rs.CreateSubscription(denunciar, extSettings, desc, eventType, matchData, parameters1);
}
incorporarse (Exception ex)
{
  Console.WriteLine(ex.Message.ToString());
}

Eu interpreto que as cousas funcionen como esta:

  • Nosa parte web que chamar o servizo de identificación e dicir, "Hey, Tony, son eu!".
  • Mensaxes servizo de autenticación dicindo, "Hey, I know you. How are the kids? Here’s a token."
  • Chamamos o servizo SSRS e dicir, "Tony sent me, aquí está o token."

</final>

Rexístrate para o meu blog.

Rápido e sinxelo: Sitio disposición web usando SharePoint modelo de obxecto en C #

I tried searching for a little snippet code that would show how I can create a new SPWeb in a site collection. I didn’t find it as quickly or easily as I expected so I thought I’d slap together a little entry on the subject.

Este código crea un novo sitio web Wiki:

 SPSite SiteCollection;

    SiteCollection = novo SPSite("Http://conchang-o9l8qi");

    SPWeb w = siteCollection.OpenWeb();

    w.Webs.Add("Xyzzy", "Título xyzzy",
        "Descrición xyzzy", 1033, SPWebTemplate.WebTemplateWIKI, teito, teito);

Miñas pescudas iniciais fallou porque eu estaba a buscar frases como "prestación de un sitio web utilizando o SharePoint modelo de obxecto" and the like.

Se buscar para "Webs.Add()", atoparás unha serie de entradas de blog moi útiles, MSDN articles and SDK documentation that go into depth on this subject. I definitely recommend este sitio.

</final>

Rexístrate para o meu blog.

Technorati Tags: