Kategorija Arhiva: SharePoint razvoj

Bambus Kalendar Interakcija s SharePoint uzrokuje "Pojavila se neočekivana pogreška"

Danas, 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, "aplikacija poslužitelj" za indeksiranje i InfoPath i clustered SQL leđa kraj.

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, samo da je kazna.

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, iznenada, pokazao mi je lijepo uredno poruku o pogrešci:

image

Ne znam što se događa ili što sam učinio da se kontrolirano poruku o pogrešci prikazati osim dodavanjem ?contents=1 bit of the query string.

To je vjerojatno vrlo rijetko rub slučaj, ali ako ste dobili tu poruku, "Pojavila se neočekivana pogreška" ići naprijed i dodati ?Sadržaj = 1 do upita nizu i vidjeti gdje to vodi.

</kraj>

Pretplatite se na moj blog.

Slijedite me na Twitter-u http://www.twitter.com/pagalvin

Technorati Tags: ,

Korištenje reflektorom na Microsoft.SharePoint.dll

Redgate .NET Reflector Michael Blumenthal je postavio Članak o upozorenjima i poglede ("Which views can be used when Creating an Alert ?"), which is interesting on its own merits. Međutim, 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" u nedostatku bolje riječi (he explains this much better than I do 🙂 ).

U ovom trenutku u SharePoint doba, 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. Međutim, if you think you need it but don’t really know how, Michael’s write-up seems like a great tutorial on this subject.

</kraj>

Pretplatite se na moj blog.

Slijedite me na Twitter-u http://www.twitter.com/pagalvin

Sortiranje stavke kalendara u Kalendar View

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 (osim ako sam propustio nešto stvarno očito).

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, po defaultu, it wants to list them in ID format. Tako, if I add "Session 02" and then "Session 01" u kalendar, to im pokazuje u tom redoslijedu (i.e, Sjednica 02 a zatim sjednica 01). To list them in Session ID order, Mislio sam probati ove stvari:

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

    Budući da ne rade, 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, Možda kalendar će, kao i?

  2. Uredi dio web, look for an "export" funkcija i … 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, koji ostavlja SharePoint Designer.

  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, ali to je bilo: "<ListViewXml …. >kodirana ludilo</ListViewXml>". Posebno, tu je ovaj dragulj:

<Pitanje>
<Gdje>
<DateRangesOverlap>
<FieldRef Name="EventDate"/>
<FieldRef Name="EndDate"/>
<FieldRef Name="RecurrenceID"/>
<Value Type="DateTime">
<Mjesec />
</Vrijednost>
</DateRangesOverlap>
</Gdje>
<OrderBy><FieldRef Name="Session_x0020_ID" /></OrderBy>
</Pitanje>

(Ja sam dekodirao &Bilo;Je i &GT-a, te ih podijeliti van više linija za jasnoću miloga).

Dodaj <OrderBy> bitni i sada se sortira po Session ID, Ne unutarnje stavku popisa ID.

Gigantski savjet ili’ kapa do Becky Isserman za njezinu komentaru na Isha Sagi o blogu: http://www.sharepoint-tips.com/2008/07/caml-sorting-by-file-name.html. I wouldn’t have put the <OrderBy> na pravom mjestu bez njezina komentaru.

Nadam se da ću napisati ovo gore jasnije zaslon metak uskoro, ali u slučaju da mi nikada ne, barem sam to učinio mnogo.

</kraj>

SharePoint Značajke & Rješenja za upravljanje — Ne zaboravite uu CRUD (ili D za taj tvar)

Mi kolektivno provode mnogo vremena razmišljajući o SharePoint rješenja — kako ih stvoriti, koji alat koristiti, što se događa kada se oni ne uspiju rasporediti, timer radnih mjesta, opsega, itd.. 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, od idejnog rješenja perspektive, than deploying them. Deployment is basically a cookbook affair. Typically, instalirajte značajku, možda su prijemnik značajka učitati neke podatke u popisu, that sort of thing. Međutim, Uvlačenje je potencijalno složeniji.

Dati rješenje može stvoriti artefakte poput ovih:

  • Vrsta sadržaja
  • Popis Definicija
  • Site Definicija
  • Podaci u popisu
  • Čak prijemnici
  • InfoPath obrasci

Popis ide na.

Iako je očito važno dizajnirati rješenje da instantiates one artefakte ispravno, 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, što se događa kada se povukao rješenje? 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.

Za pomoć s ovim, create a matrix that lists each artifact your solution deploys to SharePoint. List three columns per artifact, jedan za stvaranje, ažuriranje i brisanje. For each case, odrediti točan ishod za tu operaciju.

This sort of analysis is obviously best done before the solution is ever deployed to a SharePoint farm. Međutim, kao što su pušenje, 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, ali barem ćete stavili okvir oko problema.

</kraj>

Pretplatite se na moj blog.

Slijedite me na Twitter-u http://www.twitter.com/pagalvin

Technorati Tags:

Quick Fix: Web-usluge koje su u interakciji sa SharePoint, InvalidOperationException

Prije milijun godina, I helped developed a web service that was invoked via a custom action for a SharePoint Designer workflow. Ovaj tjedan, klijent želio da ga se presele u proizvodnji (konačno!) tako mi je.

Običaj akcija izrađen prekid, ali web servis je pozvao nije, dajući nam ovaj problem:

System.InvalidOperationException: Ovaj postupak može se obavljati samo na računalu koje je pridruženo farme poslužitelja od strane korisnika koji imaju dozvole za SQL Server za čitanje iz konfiguracije baze podataka. Za povezivanje ovog poslužitelja na farmi poslužitelja, koristiti SharePoint proizvoda i tehnologija Čarobnjak za konfiguriranje, nalazi se na izborniku Start u Administrativni alati.
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, Internet izrađen prekid.

Ovo MSDN forum objavljivanja mi je dao pojma što je potrebno: http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/2c97c004-7118-4e06-a62c-b2b0ac07ac99

</kraj>

Pretplatite se na moj blog.

Slijedite me na Twitter: http://twitter.com/pagalvin

Technorati Tags:

Brzo i jednostavno: Nabavite SPFolder od SPItemList

Ja i dalje prikazivati ​​u ovaj problem i čini se da Google nikada ne razumiju ono što želim učiniti, tako da sam shvatio bih napisati ovo dolje.

Ive 'bio događaj puno događaja prijemnik za ispravljanje pogrešaka u posljednjem tjednu ili dva. The ER is defined against a document library. The individual items in the document library are tightly related to their parent folders. Tako, I am always getting the folder of the item for various manipulations. While debugging, I needed to update the metadata of a folder for a specific item whose ID I know.

Here’s a little console application (designed to run on server in the farm) that takes two arguments: the ID of an item and a value to assign to a field, "Approval Status". It hard codes a lot of stuff and has no error checking.

The code looks up a hard coded site, 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.

If anyone cares to offer a critique or suggest a better way to get the folder of an item, molimo vas da ostavite komentar.

<code>
pomoću Sustav;
pomoću System.Collections.Generic;
pomoću System.Text;
pomoću Microsoft.SharePoint;
pomoću System.Collections;

namespace Conchango
{
    /// <rezime>
 /// </rezime>
 klasa ManualFolderUpdate
    {
        statički poništiti Glavni(niz[] args)
        {
            niz msh = "ManualFolderUpdate (v1.0): "; // msh = "Message Header"

 Utješiti.WriteLine(msh + "Starting up.  I was last modified on 08/04/08.");

            niz url = http://localhost/xyzzy;

            pomoću (SPSite oSPSite = novi SPSite(url))
            {

                pomoću (SPWeb oSPWeb = oSPSite.OpenWeb())
                {
                    SPList docLib = oSPWeb.Lists["Documents"];

                    Utješiti.WriteLine(msh + "Got the document library.");

                    Utješiti.WriteLine(msh + "Doc lib item count: [" + docLib.ItemCount + "].");

                    int FolderID = 0;
                    niz NewStatus = "xyzzy";

                    FolderID = System.Pretvoriti.ToInt32(args[0].ToString());
                    Utješiti.WriteLine("Seeking folder for item: [" + FolderID + "].");

                    SPListItem li = docLib.GetItemById(FolderID);

                    SPFolder thisItemFolder = li.File.ParentFolder;

                    Utješiti.WriteLine(msh + "Got the parent folder.");

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

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

                    Utješiti.ReadLine();

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

                    Utješiti.WriteLine(msh + "Finished updating the folder.  Exiting.");

                } // using SPWeb

            } // using SPSite

 Utješiti.WriteLine(msh + "Finished.");

        } // Glavni

    } // class foldersync
} // namespace
</code>

</kraj>

Pretplatite se na moj blog.

Technorati Tags:

Skrivanje prilagođene akcije u sustavu SharePoint

Prije nekoliko mjeseci, dok je radio na projektu za klijenta, I created a feature. Among other things, taj lik definirao prilagođenu akciju (to se pod Postavke web-mjesta). The only purpose for this custom action was to demonstrate to me that the feature activation was working as expected. U osnovi, Ja ga koristiti kao sirovom obliku debugging.

Na moje sramote, to debugging predmet je napravio svoj put iz dev da UAT i proizvodnju prije nego što netko dobio oko na molba, "Što je to veza xyzzy?"

Do sada, smo u proizvodnji, a ja stvarno ne želite deinstalirati značajku, fix elements.xml and then reinstall.

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

"CustomActions ne kopira u bazu podataka, se čitati izravno sa Elements.xml datoteke i kopirati u stanju aplikacija tijekom izvršavanja. Tako, ne treba isključiti, deinstalirati, ponovno, i aktivirati značajku za uklanjanje CustomAction. Samo ga izvadite iz Elements.xml datoteku i recikliranje zahtjeva bazen(s) izvršiti. Sljedeći put značajka je u djelokrugu, nećete vidjeti CustomAction više."

Pratio sam njegove upute i, naravno, oni rade.

U mom slučaju, 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, Vjerujem da ćete morati napraviti promjene u svakom.

</kraj>

Pretplatite se na moj blog.

Technorati Tags: ,

Quick Fix: Pristup SharePoint web-mjesta bacanja [HttpException (0x80004005): Zahtjev je isteklo.]

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, ali "iznenada" nevezano stranica je postala vrlo sporo i često je isteklo s tom pogreškom:

[HttpException (0x80004005): Zahtjev je isteklo.]

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 vjerodostojna ?contents=1 debug technique, I did in fact find 11 web parts on the page, only two of which were visible. Even better (from a let’s-hope-I-find-something-ugly-here-that-I-can-fix perspective), three of those closed web parts had a name of "Error".

I deleted those web parts (which itself took a surprisingly long time) and that solved the problem. For today 🙂

</kraj>

Pretplatite se na moj blog.

Technorati Tags:

Ulazak SSRS Web usluge iz WSS / Mahovina u FBA okoliša

Mi je potrebno da se pozove na "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: Nije ovlaštena
  • Objekt Moved

"Objekt preselio" Poruka je najzanimljivije jer je rekao da "objekt" (naš SSRS usluga) je "preselio" to login.aspx. This clearly meant we had some kind of authentication problem.

Na kraju sam shvatila da sam imala označili blogu 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 (od 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".

Evo kod koji je radio za nas:

ReportingService2006 rs = nula; 
// Dokazati Provjera auth = novi Ovjera(); 
auth.Url = "http://URL / _vti_bin / Authentication.asmx";
auth.CookieContainer =
novi CookieContainer();
LoginResult rezultat = auth.Login("userid", "password");
ako (result.ErrorCode == LoginErrorCode.NoError) 
{
// Bez pogreške, tako dobiti kolačiće.
CookieCollection kolačiće = auth.CookieContainer.GetCookies(novi Uri(auth.Url));
Cookie authCookie = kolačići[result.CookieName];
rs =
novi ReportingService2006();
rs.Url =
"http://server/_vti_bin/ReportServer/ReportService2006.asmx";
rs.CookieContainer =
novi CookieContainer();
rs.CookieContainer.Add(authCookie);
}
pokušati
{
  rs.CreateSubscription(izvijestiti, extSettings, Opis, eventType, matchData, parameters1);
}
ulov (Iznimka ex)
{
  Console.WriteLine(ex.Message.ToString());
}

Ja interpretirati stvari raditi kao što je to:

  • Naša web-dio treba dial-up uslugu provjere autentičnosti i reći, "Hey, Tony, to sam ja!".
  • Autentifikacije usluga odgovora rekavši, "Hey, I know you. How are the kids? Here’s a token."
  • Zovemo se SSR uslugu i reći, "Tony sent me, evo token."

</kraj>

Pretplatite se na moj blog.

Technorati Tags: , ,

Brzo i jednostavno: Pružanje Web Site Korištenje SharePoint Object Model u 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.

Ovaj kod stvara novi Wiki stranice:

 SPSite siteCollection;

    siteCollection = novi SPSite("http://conchang-o9l8qi");

    SPWeb w = siteCollection.OpenWeb();

    w.Webs.Add("xyzzy", "xyzzy Title",
        "xyzzy description", 1033, SPWebTemplate.WebTemplateWIKI, lažan, lažan);

My initial searches failed because I was looking for phrases like "provision a web site using sharepoint object model" and the like.

Ako Usporedite for "Webs.Add()", naći ćete niz vrlo korisnih blogova, MSDN articles and SDK documentation that go into depth on this subject. I definitely recommend ovaj site.

</kraj>

Pretplatite se na moj blog.

Technorati Tags: