Vinnige en maklike: Voorsiening van 'n webwerf met SharePoint Object Model 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.

Hierdie kode skep 'n nuwe Wiki webwerf:

 SPSite siteCollection;

    siteCollection = nuwe SPSite("Http://conchang-o9l8qi");

    SPWeb W = siteCollection.OpenWeb();

    w.Webs.Add("Xyzzy", "Xyzzy Titel",
        "Xyzzy beskrywing", 1033, SPWebTemplate.WebTemplateWIKI, valse, valse);

My aanvanklike soektogte nie, want ek was op soek na woorde soos "voorsiening 'n webwerf met sharepoint voorwerp model" and the like.

As jy soek "Webs.Add()", vind jy 'n aantal baie nuttige blog inskrywings, MSDN articles and SDK documentation that go into depth on this subject. I definitely recommend hierdie werf.

</einde>

Skryf in op my blog.

Technorati Tags:

Integreer SharePoint Designer Werkstromen Web Services

Ek het rond speel met 'n persoonlike aksies vir SharePoint Designer vir 'n geruime tyd (Kyk hier vir 'n paar gedetailleerde dinge, as wat jou interesseer).

In my huidige projek, we need to do some fairly heavy lifting and we want to use declarative SPD workflow to manage the associated business process.

Lang storie kort, 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.

Hier is die handtekening:

 openbare string Planner(
        Guid WebID, // Wat deur die Runtime Environment
        Guid SiteID, // Wat deur die Runtime Environment
        string ListID, // Geslaag deur die RTE (weet nie waarom hierdie is 'n string, nie 'n GUID)
        int ListItemID, // Geslaag deur die RTE.
        string XmlMessage) // Geslaag deur die gebruiker soos verklaar in SPD.

Dit maak gebruik van die feit dat ons kan kry by 'n belangrike workflow inligting, soos die webwerf, lys ID, ens.. 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!

Ongelukkig, Dit is natuurlik 'n eenrigting-kaartjie af "Loosey Fernandes" anti-patroon land, but it’s better than hitting a brick wall 🙂

Is dit 'n anti-patroon as jy dit doen, selfs al weet jy dit is 'n anti-patroon?

I hope to wrap this inside Codeplex in the near future. If you’re interested in me doing so, gee my poke (e-pos of laat 'n comment) and I’ll be that more enthusiastic about doing it 🙂

</einde>

Skryf in op my blog.

Technorati Tags: ,

Sondag Funny: “Ek wonder of jou wagwoord …”

Ek het onlangs gekoop het middagete vir my broer (soos gewoonlik) 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.

Twee my gunsteling herinneringe aan my goeie vriend, Gabe. He had made the terrible mistake of telling people his freshman year that "I’m a freshman, maar ek het stage staan" as gevolg van die verskillende gevorderde plasing klasse wat hy geneem het, ens.. Many of us were similarly situated but we didn’t talk about it so much. His senior year, wanneer ons hom aan mense, we’d say "This is Gabe. He’s a Senior, Maar hy het 'n stage staan ​​".

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, natuurlik, speletjies te speel.

Ons het nie soos die rekenaar-hulpeloos ingenieurs te veel so een van ons gunsteling dinge om te doen sou wees die telnet aan die boks hulle op en loop X-oog 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. Try not to laugh out loud when a hapless engineer is trying to close X-eye after X-eye and muttering under his breath about it 🙂

We also played X-trek on those boxes. To do that, jy het om die bron te laai, 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, weer gebou en dan vernietig Gabe die volgende keer wat ons gespeel.

Gabe was ook 'n groot fan van 'n TV-show met die naam Blake se 7. I had never seen it, maar dit het nie verhoed dat my uit te dring dat dr.. Who is the superior show. The arguments would get heated at times 🙂

Een dag, 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, "Ek gaan nou om jou wagwoord te raai, Gabe." "Yeah, reg" was his answer. I then logged in, betree sy gebruikers id, draai na hom, getik en hardop gesê, "Ek wonder of dit die B-L-A-K-E-7" ? Touch typing has never paid off as handsomely as it did that day.

Volgende week (of so spoedig moontlik): More computer room antics from college.

Het jy 'n deel? Leave a comment or email me and I’ll publish them here.

</einde>

Skryf in op my blog.

Technorati Tags:

Minor openbare aankondiging: Windows Live security en Ruimte Eienaars Kontak met

Ek kry 'n handvol van die boodskappe van individue via die ingeboude "stuur 'n boodskap" funksie Microsoft bied met lewendige ruimtes (huisves ook my blog) elke maand.

Ongeveer een derde van die tyd, those users have secured their live spaces account such that I cannot reply. This is some kind of anti-spam feature I assume.

</einde>

Eenvoudige verduideliking: “Waarde nie binne die verwagte reeks.”

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

Wanneer jy werk met geleentheid ontvangers en ander kode wat verwysings SharePoint lys items deur middel van die voorwerp model, Ek maak dikwels foute wat hierdie fout tydens looptyd:

Fout met laai en hardloop gebeurtenis ontvanger Conchango.xyzzyEventReceiver in Xyzzy, Weergawe = 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. Egter, one simple explanation is that I’m referencing a field incorrectly. If the name of the field is "Due Date", Ek moet dit verwys soos dit in 'n geval van 'n ontvanger:

properties.ListItem["Vervaldatum"]

Toe ek spelfoute maak of die verkeerde geval wanneer die verwysing na die veld, SharePoint generates the above mentioned runtime error. Byvoorbeeld, Dit is verkeerd:

properties.ListItem["Vervaldatum"]

</einde>

Skryf in op my blog.

Technorati Tags:

End User Vinnige Wenk: Sorteer Views in 'n dokument Biblioteek, Lys, ens..

Ons kan, en die skep van baie sienings in SharePoint lyste (dokument biblioteke, persoonlike lyste, ens.). 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 (en ek is nie seker dat dit kan), dit is baie tegniese vir jou tipiese eindgebruiker.

As jy die volgorde waarin SharePoint n lys van beskikbare menings te beheer, plaas jy eenvoudig 'n nommer of 'n brief aan die oog naam, soos in:

1 – Deur materiaal soort
2 – Alle dokumente
3 – Vervaldatum

-of-

'N – Deur materiaal soort
B – Alle dokumente
C – Vervaldatum

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

Z_KPI_[beskrywing]

Wat veroorsaak dat my "KPI" menings te verskyn aan die onderkant van die lys.

</einde>

Skryf in op my blog.

Technorati Tags: ,

Sondag Funny: “Toe ek 'n klein seuntjie”

As 'n ouer, iewers langs die pad het ek ontdek die "Toe ek 'n klein seuntjie" trick.

My seun, waarskynlik vier of vyf by die tyd, speel 'n ballon en soos die meeste seuntjies wat speel met ballonne, he popped it. He was very upset. The world had come to an end. I said to him, "Toe ek 'n klein seuntjie, Ek het 'n ballon en dit inloer en uiteindelik, 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, Prins, had died in a car accident. Hierdie keer, was sy antwoord, "Nou voel ek sleg oor twee dinge!" I shied away from using the "when I was a little boy" tegniek vir die troos na daardie.

Voor die dooie hond voorval, egter, I had also started to use the technique to convince him to do chores. "Toe ek 'n klein seuntjie was, Ek het om uit te gaan en die koerant te kry. ", "My kamer skoon", "Mamma haar koffie beker", ens..

Dit was ook redelik suksesvol vir 'n rukkie, but he started to increasingly rebel against the tyranny of my childhood. One event, in die besonder, marked the end. I told him to bring the garbage cans from curb back to the garage. He argued and I responded, "Toe ek 'n klein seuntjie was, I had to take the garbage back to the garage." He responded, "O ja! Well when you were a little boy, wat is dom!".

</einde>

Skryf in op my blog.

Technorati Tags:

Views en kolomme op die lys en dokument biblioteke kan nie verseker word

UPDATE (02/29/08): Hierdie nuwe codeplex projek blyk 'n metode om voorsiening te maak vir die beveiliging van individuele kolomme: http://www.codeplex.com/SPListDisplaySetting. If you have any experience working with it, los 'n comment.

Forum plakkate dikwels 'n vraag soos hierdie: "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?"

Hulle het ook dikwels 'n verwante vraag vra: "Ek wil 'n spesifieke metadata kolom te verseker sodat Slegs bestuurders kan wysig dat die kolom terwyl ander kan selfs dit nie sien nie."

These answers apply to both WSS 3.0 en Moss:

  • SharePoint nie out-of-the-box ondersteuning vir die beveiliging van standpunte.
  • SharePoint nie out-of-the-box ondersteuning vir die veiligheid kolomme.

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.
  • Gebruik persoonlike menings vir "bevoorregte" views. These are easy enough to set up. Egter, as gevolg van hul "persoonlike" aard, these need to be configured for each user. Use standard security configuration to prevent anyone else from creating a personal view.
  • Gebruik 'n data vertoning web deel en te implementeer 'n soort van AJAXy sekuriteit snoei oplossing.
  • Rol jou eie lys vertoon funksionaliteit en neem sekuriteit snoei op die kolom.
  • Verander die data inskrywingsvorms en gebruik JavaScript kolom-sekuriteit op te snoei in samewerking met die sekuriteit model te implementeer.
  • Use an InfoPath form for data entry. Implement column-level security trimming via web service calls to SharePoint and conditionally hide fields as needed.
  • Rol jou eie ASP.NET data entry funksie wat implemente kolom vlak sekuriteit snoei.

Nie een van die opsies is werklik so groot, maar daar is ten minste 'n pad om te volg as jy nodig het om te, selfs al is dit moeilik om.

NOTA: As jy enige van hierdie paaie, vergeet nie oor "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" en nederlaag jou zekerheidsstelsel.

As jy ander idees vir of ervarings met die verkryging van kolomme of standpunte, asseblief email my of laat 'n comment en ek sal werk die plasing soos toepaslik.

</einde>

Skryf in op my blog.

Technorati Tags:

Vinnige Wenk: BDC ADF weergawe nommers word jou vriend

As jy hand-kodering die ADF lêers en doen 'n baie kode / invoer / toets siklusse, use the version number to make your life easier.

Ek haat dit om te erken, maar tot hierdie week, 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.

Lêer is onder "dit is duidelik wanneer jy dit sien nie".

Voorbeeld:

<LobSystem
xmlns:XSi="http://www.w3.org/2001/XMLSchema-instance" XSi:schemaLocation="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog BDCMetadata.xsd" Tipe="WebService" Weergawe="1.2.0.0" Naam="xyzzyDocumentReview" xmlns="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog">

Verander dat die weergawe en re-invoer en die bestaande besigheid data kolom gebruik die opgedateerde weergawe outomaties met geen ekstra verstellings vereis.

</einde>

Skryf in op my blog.

Technorati Tags:

Oplossing: BDC Picker toon slegs een kolom van die resultate

In my aan die gang pogings om die verskaffing van 'n meer bruikbare lookup kolom gebruik van BDC, I hit a wall with the BDC picker. If you haven’t see it, die BDC picker is soortgelyk aan 'n volk plukker, behalwe dat dit werk met kolomme van tipe "bedrijfsgegevens".

Jy toegang tot die plukker deur te kliek op die oop boek ikoon van 'n besigheid datakolom soos getoon:

beeld

The above image shows a business data column called "Master Document Id". That column is connected, via BDC, 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" funksie. Users select a "master" dokument en wanneer hulle red, 'n gebeurtenis ontvanger afskrifte meta data velde van die verwysde meester.

By verstek, Die BDC Die plukker lyk soos dit toe ek soek vir 'n dokument wie se ID = "38":

clip_image002

Dit is nuttig, 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 (bijv. Titel) maar dit sal nie toon die werklike lys van titels dit gevind, net hul DocId is soos hier gewys word:

clip_image002[1]

(Die skerm geskiet is nie so groot nie want ek het nie 'n soektog wat enige geldige resultate terugkeer kies, maar jy kan sien dat as dit het 'n paar resultate, dit sal eers getoon het DocId se, nie titels).

I searched high and low for the answer to this and failed. My kollega, die eerbiedwaardige Jonathan Bradshaw, had faced and solved this issue. When I reached out to him for help, hy wys my in die regte rigting.

Stel die plukker verskeie kolomme vertoon word via die "ShowInPicker" eiendom in die ADF:

<Eiendom Naam="ShowInPicker" Tipe="System.Boolean">waar</Eiendom>

In meer besonderhede:

  <!-- Titel -->
  <TypeDescriptor Type Name="System.String" Naam="Titel" >
    <LocalizedDisplayNames>
      <LocalizedDisplayName LCID="1033">Titel</LocalizedDisplayName>
    </LocalizedDisplayNames>
    <Eiendomme>
      <Eiendom Naam="DisplayByDefault" Tipe="System.Boolean">waar</Eiendom>
      <Eiendom Naam="ShowInPicker" Tipe="System.Boolean">waar</Eiendom>
    </Eiendomme>
  </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. In my geval, BDC picker showed DocId by default. Egter, wanneer ek bygevoeg "ShowInPicker" titel, DocId no longer displayed. I solved that by explicitly setting the ShowInPicker property for Doc ID.

Hier is die resultaat:

beeld

(Ek sal verduidelik die vreemd-op soek na "168 – CamlSchema.xsd" construction in a future blog post. In kort, dit is 'n aaneen string wat dit moontlik maak vir 'n effens beter gebruikers ervaring).

Natuurlik, geskryf op hierdie blog inskrywing, Ek het net 'n soektog vir "ShowInPicker" en bevind dat talle treffers, hierdie een ingesluit: http://msdn2.microsoft.com/en-us/library/ms583986.aspx. It explains the meaning of that property along with some other good BDC stuff.

</einde>

Skryf in op my blog!

Technorati Tags: