Shpejtë dhe i thjeshtë: Një dispozitë Web Site përdorur modelin SharePoint objekt në 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.

Ky kod krijon një faqe të re Wiki:

 SPSite siteCollection;

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

    SPWeb w = siteCollection.OpenWeb();

    w.Webs.Add("xyzzy", "xyzzy Title",
        "xyzzy description", 1033, SPWebTemplate.WebTemplateWIKI, i rremë, i rremë);

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

Nëse ju kërkoni for "Webs.Add()", you’ll find a number of very useful blog entries, MSDN articles and SDK documentation that go into depth on this subject. I definitely recommend this site.

</fund>

Abonohen në blogun tim.

Technorati Tags:

Integrimi SharePoint Designer menu me Web Services

Unë kam qenë duke luajtur rreth me veprimet doganore për SharePoint Designer për disa kohë (shikoni këtu for some detailed stuff, në qoftë se ju interesojnë).

Në projektin tim aktual, we need to do some fairly heavy lifting and we want to use declarative SPD workflow to manage the associated business process.

Long histori e shkurtër, this is entirely possible. I extended my Codeplex project to invoke a "helper service" and now we can invoke a web service directly from an SPD workflow.

Here’s the signature:

 publik varg Dispatcher(
        Guid WebID, // Passed by the runtime environment
        Guid SiteID, // Passed by the runtime environment
        varg ListID, // Passed by the RTE (don't know why this is a string, not a GUID)
        int ListItemID, // Passed by the RTE.
        varg XmlMessage) // Passed by the user as declared in SPD.

This leverages the fact that we can get at important workflow information, like the site, list ID, etj. This is well documented in several places for those of you interested in creating your own custom actions. The idea is to extract the XML string as provided by the user to dispatch an appropriate procedure. Fun stuff!

Mjerisht, this is obviously a one-way ticket down to "Loosey Goosey" anti-pattern land, por është më mirë sesa të godasësh një mur me tulla

Is it an anti-pattern if you do it even though you know it’s an anti-pattern?

I hope to wrap this inside Codeplex in the near future. If you’re interested in me doing so, give me poke (Email or leave a comment) dhe unë do të jem aq më entuziast për ta bërë atë

</fund>

Abonohen në blogun tim.

Technorati Tags: ,

E diel Funny: “Pyes veten nëse fjalëkalimi juaj është i …”

Kohët e fundit kam blerë drekë për vëllain tim (si zakonisht) and we ended up talking about funny things that we did at our respective colleges. At my alma mater, Lafayette College, the academic support IT department had a very inclusive way about it. We were given a LOT of rope and I took advantage of that at times.

Two my favorite memories relate to my good friend, Gabe. He had made the terrible mistake of telling people his freshman year that "I’m a freshman, but I have Sophomore standing" due to the various advanced placement classes he had taken, etj. Many of us were similarly situated but we didn’t talk about it so much. His senior year, when we introduced him to people, we’d say "This is Gabe. He’s a Senior, but he has Sophomore standing".

The college had some Sun workstation/servers running X-Window. They had gigantic monitors and the engineers used them for CAD and other boring engineer stuff. We CS people used them to learn programming and, sigurisht, to play games.

We didn’t like the computer-helpless engineers to much so one of our favorite things to do would be to telnet to the box they were on and run X-eye on them. This would pop up a pair of eyes that followed the mouse around on the screen. You could pop up even more and have literally a dozen or more of the X-eye applications running. Mundohuni të mos qeshni me të madhe kur një inxhinier i pafat po përpiqet të mbyllë X-sy pas X-sy dhe duke mërmëritur nën zë për këtë

We also played X-trek on those boxes. Për të bërë që, you had to download the source, get various dependencies wherever you could find them and build it. I wasn’t a sophisticated C programmer, but I could read header files. I was looking through these and found directives like "#DEFINE MAX_TORPEDO_DISTANCE 10". I played around with that increase range and power for phases and torpedoes, re-built it and then destroyed Gabe the next time we played.

Gabe was also a huge fan of a TV show called Blake’s 7. I had never seen it, but that didn’t prevent me from insisting that Dr. Who is the superior show. Argumentet nxeheshin herë pas here ...

Një ditë, it occurred to me that I could probably guess his UNIX password. I sat down next to him one day and announced in a loud tone, "I’m going to guess your password right now, Gabe." "Yeah, e drejtë" was his answer. I then logged in, entered his user id, turned to face him, typed and said out loud, "I wonder if it’s B-L-A-K-E-7" ? Touch typing has never paid off as handsomely as it did that day.

Next week (or soon): More computer room antics from college.

Do you have any to share? Leave a comment or email me and I’ll publish them here.

</fund>

Abonohen në blogun tim.

Technorati Tags:

Minor Public Announcement: Windows Live Security Settings and Contacting Space Owners

I receive a handful of messages from individuals via the built-in "send a message" function Microsoft provides with live spaces (which also hosts my blog) every month.

About one third of the time, those users have secured their live spaces account such that I cannot reply. This is some kind of anti-spam feature I assume.

</fund>

Shpjegimi i thjeshtë: “Vlera nuk bie brenda intervalit të pritshme.”

UPDATE: An anonymous poster left a great comment about internal names. Be sure to read it.

Kur punon me marrës ngjarje dhe kodin tjetër që referencat artikuj listë SharePoint nëpërmjet modelit objekt, Unë shpesh bëjnë gabime që gjenerojnë këtë gabim në runtime:

Ngarkimin dhe drejtimin Error ngjarje marrës Conchango.xyzzyEventReceiver në xyzzy, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = 0dc50a750396c3ac. Additional information is below. : Value does not fall within the expected range.

I think this is a fairly generic error that is potentially caused many different ways. Megjithatë, one simple explanation is that I’m referencing a field incorrectly. If the name of the field is "Due Date", I must reference it like this in an event receiver:

properties.ListItem["Due Date"]

When I misspell or use the wrong case when referencing the field, SharePoint generates the above mentioned runtime error. Për shembull, this is wrong:

properties.ListItem["due Date"]

</fund>

Abonohen në blogun tim.

Technorati Tags:

End User Quick Tip: Shikime Rendit në një bibliotekë Document, Listë, etj.

Ne mund të, dhe nuk duhet të krijojnë pikëpamjet shumë në listat e SharePoint (bibliotekat dokument, Listat me porosi, etj). SharePoint always lists available views in alphabetical order. We cannot change this using out of the box functionality. If it can be done via customization (dhe unë nuk jam i sigurt se mund të), it’s far to technical for your typical end user.

If you want to control the order in which SharePoint lists available views, simply prepend a number or letter to the view name, si në:

1 – By Material Type
2 – All Documents
3 – Due Date

-ose-

Një – By Material Type
B – All Documents
C – Due Date

I have also created views whose purpose is strictly to feed a KPI. I have been following this naming convention:

Z_KPI_[përshkrim]

That causes my "KPI" views to appear at the bottom of the list.

</fund>

Abonohen në blogun tim.

Technorati Tags: ,

E diel Funny: “Kur unë isha një djalë i vogël”

Si një prind, somewhere along the line I discovered the "When I was a little boy" trick.

Djali im, ndoshta katër ose pesë në kohën, ishte duke luajtur një tullumbace dhe si djemtë më të vegjël që luajnë me balona, he popped it. He was very upset. The world had come to an end. I said to him, "when I was little boy, Unë kisha një tullumbace dhe ajo popped dhe përfundimisht, I got a new balloon." It seemed to help him cope with his loss and led to a fun talk about what it was like when I was a little boy.

That worked well as a consolation technique and I used it a several times over the next period of time. I did get into trouble once when his Monster Rancher 3 creature died. I talked about how my dog, Princ, had died in a car accident. Këtë herë, Përgjigja e tij ishte, "Now I feel bad about two things!" I shied away from using the "when I was a little boy" Teknika për ngushëllimin, pasi që.

Para incidentit vdekur qen, megjithatë, I had also started to use the technique to convince him to do chores. "When I was a little boy, I had to go out and get the newspaper", "clean my room", "get Mommy her coffee cup", etj.

Kjo shumë ishte goxha i suksesshëm për një kohë, but he started to increasingly rebel against the tyranny of my childhood. One event, veçanërisht, marked the end. I told him to bring the garbage cans from curb back to the garage. He argued and I responded, "When I was a little boy, I had to take the garbage back to the garage." He responded, "Oh yeah! Well when you were a little boy, se ishte STUPID!".

</fund>

Abonohen në blogun tim.

Technorati Tags:

Views dhe kolona në Listat dhe Bibliotekat dokument nuk mund të sigurohen

UPDATE (02/29/08): Ky projekt i ri CodePlex duket të sigurojë një metodë për sigurimin kolona individuale: http://www.codeplex.com/SPListDisplaySetting. If you have any experience working with it, ju lutemi të lënë një koment.

Posterat Forum shpesh pyes një pyetje si kjo: "I have a manager view and and a staff view of a list. How do I secure the manager view so that staff can not use it?"

Ata gjithashtu shpesh pyes një pyetje lidhur me: "I want to secure a specific metadata column so that only managers may edit that column while others may not even see it."

These answers apply to both WSS 3.0 dhe Moss:

  • SharePoint nuk japin jashtë-of-the-box mbështetje për sigurimin shikime.
  • SharePoint nuk japin jashtë-of-the-box mbështetje për shtylla të sigurisë.

There are several techniques one can follow to meet these kinds of security requirements. Here’s what I can think of:

  • Use out-of-the-box item level security. Views always honor item level security configuration. Event receivers and/or workflow can automate security assignment.
  • Use personal views for "privileged" views. These are easy enough to set up. Megjithatë, due to their "personal" natyrë, these need to be configured for each user. Use standard security configuration to prevent anyone else from creating a personal view.
  • Përdorni një web dhënave pjesë të parë dhe të zbatojë disa lloj zgjidhje AJAXy sigurisë zvogëlimin.
  • Roll tuaj ekranit funksionalitetin lista dhe përfshijnë zvogëlimin e sigurisë në nivel kolonën.
  • Ndrysho formularët e regjistrimit të të dhënave dhe të përdorin JavaScript në lidhje me modelin e sigurisë për të zbatuar kolona të nivelit të sigurisë zvogëlimin.
  • Use an InfoPath form for data entry. Implement column-level security trimming via web service calls to SharePoint and conditionally hide fields as needed.
  • Roll funksionin tuaj ASP.NET futja e të dhënave që zbaton nivelit të sigurisë kolonë zvogëlimin.

Asnjë prej këtyre opsioneve që janë me të vërtetë e madhe, por ka të paktën një rrugë për të ndjekur në qoftë se keni nevojë për të, edhe në qoftë se është e vështirë.

SHËNIM: Nëse ju shkoni poshtë ndonjë prej këtyre rrugëve, don’t forget about "Actions -> Open with Windows Explorer". You want to be sure that you test with that feature to make sure that it doesn’t work as a "back door" dhe humbjen skemën tuaj të sigurisë.

Nëse ju keni ide të tjera për ose përvojat me kolona sigurimit apo pikëpamjet, ju lutem email mua apo të lënë një koment dhe unë do update këtë postimit si të përshtatshme.

</fund>

Abonohen në blogun tim.

Technorati Tags:

Tip i shpejtë: QZHB Version Numrat FSHZH janë të mikut tuaj

Nëse ju jeni dora-kodim fotografi FSHZH dhe duke bërë një shumë të kodit / import / Testi cikle, use the version number to make your life easier.

Unë e urrej të pranoj atë, por deri në këtë javë, I was always deleting the ADF and re-importing it. This would break my business data columns and make me re-wire them. All unnecessary.

File this under "it’s obvious once you see it".

Shembull:

<LobSystem
xmlns:XSi="http://www.w3.org/2001/XMLSchema-instance" XSi:schemaLocation="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog BDCMetadata.xsd" Lloj="Webservice" Version="1.2.0.0" Emër="xyzzyDocumentReview" xmlns="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog">

Ndryshimi se versioni dhe ri-importojë dhe të dhënave ekzistuese të biznesit kolona përdor variantin e përditësuar automatikisht me asnjë konfigurim shtesë të kërkuara.

</fund>

Abonohen në blogun tim.

Technorati Tags:

Zgjidhje: Mbledhës QZHB tregon vetëm për kolonë të rezultateve

Në përpjekjet në vazhdim e mi në sigurimin e një Kolona më e dobishme lookup duke përdorur QZHB, I hit a wall with the BDC picker. If you haven’t see it, the BDC picker is similar to a people picker except that it works with columns of type "business data".

Ju hyni në picker duke klikuar mbi ikonën librin e hapur të një kolonë e të dhënave të biznesit, siç tregohet:

imazh

The above image shows a business data column called "Master Document Id". That column is connected, nëpërmjet QZHB, to a web service. The web service returns two columns of information: Document ID and Title. The business purpose here is to provide a "this document is based on" funksion. Users select a "master" dokument dhe kur ata të shpëtuar, një marrës ngjarje kopjet fushat e meta të dhënave nga mjeshtri referuar.

By default, the BDC picker looks like this when I search for a document whose ID = "38":

clip_image002

Kjo është e dobishme, but not good enough. People don’t think in terms of IDs, they think in terms of titles and/or other meta data. The picker allows you to search on other columns (e.g. Titull) por nuk do të tregojë listën aktuale të titujve të gjetura, vetëm DocId të tyre siç tregohet këtu:

clip_image002[1]

(Shtënë ekran nuk është aq e madhe, sepse unë nuk e marr një kërkim që kthen ndonjë rezultate të vlefshme, por ju mund të shihni se në qoftë se ajo kishte gjetur disa rezultate, ajo vetëm do të kanë treguar së DocId, jo tituj).

I searched high and low for the answer to this and failed. Kolegu im, nderuar Jonathan Bradshaw, had faced and solved this issue. When I reached out to him for help, ai vuri mua në drejtimin e duhur.

Configure the picker to show multiple columns via the "ShowInPicker" prona në FSHZH:

<Pronë Emër="ShowInPicker" Lloj="System.Boolean">i vërtetë</Pronë>

Në më shumë detaje:

  <!-- Titull -->
  <TypeDescriptor TypeName="System.String" Emër="Titull" >
    <LocalizedDisplayNames>
      <LocalizedDisplayName LCID="1033">Titull</LocalizedDisplayName>
    </LocalizedDisplayNames>
    <Prona të paluajtshme>
      <Pronë Emër="DisplayByDefault" Lloj="System.Boolean">i vërtetë</Pronë>
      <Pronë Emër="ShowInPicker" Lloj="System.Boolean">i vërtetë</Pronë>
    </Prona të paluajtshme>
  </TypeDescriptor>

Setting this property does introduce a minor problem. As soon as you set it once, you need to set it for every column you want to show. Në rastin tim, BDC picker showed DocId by default. Megjithatë, once I added "ShowInPicker" për Titull, DocId no longer displayed. I solved that by explicitly setting the ShowInPicker property for Doc ID.

Këtu është rezultat:

imazh

(I’ll explain the odd-looking "168 – CamlSchema.xsd" construction in a future blog post. In short, kjo është një varg concatenated që lejon për një përvojë përdorues paksa më të mirë).

Sigurisht, ka shkruar këtë blog entry, I just did a search for "ShowInPicker" dhe gjeti hite të shumta, duke përfshirë edhe këtë: http://msdn2.microsoft.com/en-us/library/ms583986.aspx. It explains the meaning of that property along with some other good BDC stuff.

</fund>

Abonohen në blogun tim!

Technorati Tags: