Azkarra eta sinplea: Xedapen SharePoint Object Model erabiliz C web gune bat #

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.

Kode hau berria Wiki gune sortzen:

 SPSite siteCollection;

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

    SPWeb w = siteCollection.OpenWeb();

    w.Webs.Add("xyzzy", "xyzzy Title",
        "xyzzy description", 1033, SPWebTemplate.WebTemplateWIKI, faltsuak, faltsuak);

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

Baduzu bilatu for "Webs.Add()", blog oso erabilgarria da sarrera kopuru bat aurkituko duzu:, MSDN articles and SDK documentation that go into depth on this subject. I definitely recommend gune honetan.

</amaiera>

Nire blog Harpidetu.

Technorati Tags:

Integratzeko SharePoint Designer fluxuak Web Zerbitzuak

Izan dut inguruan jolasten SharePoint Designer ekintza pertsonalizatuak denbora batzuk (ikusi hemen batzuk zehatza gauzak, interesak baduzu).

Nire proiektua uneko, we need to do some fairly heavy lifting and we want to use declarative SPD workflow to manage the associated business process.

Long Narrazio laburren, 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.

Hemen sinadura da:

 publikoak katea Aztergailu(
        GUID WebID, // Duen exekuzio-ingurune gainditu
        GUID SiteID, // Duen exekuzio-ingurune gainditu
        katea ListID, // RTE emandako (ez dakit zergatik hau kate bat da, ez GUID bat)
        int ListItemID, // RTE emandako.
        katea XmlMessage) // SPD gisa deklaratu erabiltzaileak gainditu.

Hau, izan ere, ahal dugun workflow informazio garrantzitsua lortzeko baliatzen, gune bezala, zerrendaren IDa, etc. 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!

Tamalez, hau da, jakina, norabide bakarreko txartel bat behera "Loosey Goosey" anti-eredua lurrak, but it’s better than hitting a brick wall 🙂

Da baduzu, nahiz eta jakin duzu anti-eredua da, anti-eredua da?

I hope to wrap this inside Codeplex in the near future. If you’re interested in me doing so, ematen dit Poke (e-posta edo utzi iruzkin bat) and I’ll be that more enthusiastic about doing it 🙂

</amaiera>

Nire blog Harpidetu.

Technorati Tags: ,

Igandea Funny: “Zure pasahitza bada galdetzen diot nire buruari …”

Duela gutxi erosi dut nire anaia bazkaria egiteko (Ohikoa den bezala) 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.

Bi nire oroitzapenak, nire lagun ona erlazionatzeko, Gabe. He had made the terrible mistake of telling people his freshman year that "I’m a freshman, baina Sophomore zutik daukat" Izan ere, hainbat aurreratu placement klaseak hartu zituen, etc. Many of us were similarly situated but we didn’t talk about it so much. His senior year, hura sartu dugu jendea, 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, jakina, jokatu.

Guk ez dugu ordenagailuz Babesgabe ingeniari bezala hainbeste gure gogoko gauzak egin behar bat litzateke kutxa gainean ziren telnet izan eta exekutatu X-begi 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, iturburua deskargatu nahi izan duzu, 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, berriro eraiki zuten, eta, ondoren, suntsitu Gabe hurrengoan dugu jokatu.

Gabe ere izan zen izeneko TV show bat fan handi bat Blake-en 7. I had never seen it, baina horrek ez zuen eragotzi dit Dr dela azpimarratu tik. Who is the superior show. The arguments would get heated at times 🙂

Egun bat, 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, eskubidea" was his answer. I then logged in, sartu bere erabiltzaile id, aktibatuta zion aurre egiteko, Idatzitako eta esan ozen, "I wonder if it’s B-L-A-K-E-7" ? Touch typing has never paid off as handsomely as it did that day.

Hurrengo astea (edo laster): More computer room antics from college.

Ez edozein partekatu behar duzu? Leave a comment or email me and I’ll publish them here.

</amaiera>

Nire blog Harpidetu.

Technorati Tags:

Minor Herri Iragarpena: Windows Live Segurtasun ezarpen eta Space Jabeak harremanetan

I receive a handful of messages from individuals via the built-in "send a message" funtzioa Microsoft espazio zuzeneko eskaintzen (horrek, gainera, nire blog acoge) hilero.

Ko denbora buruzko hirugarren, those users have secured their live spaces account such that I cannot reply. This is some kind of anti-spam feature I assume.

</amaiera>

Simple azalpena: “Balioa ez da espero tartean erori.”

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

Noiz gertaera hargailuak eta beste kode batekin lan erreferentziak SharePoint zerrenda bidez objektu ereduaren elementuak, Egin ohi dut akatsak sortzen duten exekuzio at error honetan:

Errorea kargatu eta exekutatzen gertaera hartzailea xyzzy en Conchango.xyzzyEventReceiver, 1.0.0.0 bertsioa =, Kultura = neutrala, 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. Hala eta guztiz ere, one simple explanation is that I’m referencing a field incorrectly. If the name of the field is "Due Date", Bertan azaldu behar dut hau bezalako gertaera hargailu batean:

properties.ListItem["Due Date"]

Noiz edo misspell dut oker gertatzen eremuan erreferentzia, SharePoint generates the above mentioned runtime error. Adibidez, hau ez da zuzena:

properties.ListItem["due Date"]

</amaiera>

Nire blog Harpidetu.

Technorati Tags:

Azken erabiltzailearen azkarra Tip: Ordena Dokumentua Liburutegia Views, Zerrenda, etc.

Dezakegu, behar du, eta, hainbat aldiz sor ez SharePoint zerrendetan (Dokumentu liburutegiak, Ohiko zerrendak, etc). 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 (eta ez nago ziur aski), urrun da tekniko zure amaiera tipikoa erabiltzaile.

Nahi duzu diren ordena SharePoint zerrendatzen eskuragarri aldiz kontrolatu nahi baduzu, besterik gabe, gunearen aurretik zenbaki bat edo gutun ikuspegi izena, bezala:

1 – Material motaren arabera
2 – Dokumentu guztiak
3 – Epemuga

-edo-

A – Material motaren arabera
B – Dokumentu guztiak
C – Epemuga

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

Z_KPI_[deskribapena]

That causes my "KPI" aldiz zerrendaren behealdean agertzen.

</amaiera>

Nire blog Harpidetu.

Igandea Funny: “Noiz Little Boy bat izan dut”

Guraso gisa, somewhere along the line I discovered the "When I was a little boy" trick.

Nire semea, seguruenik, lau edo bost momentuan, zen puxika bat jolasten eta pixka gehienak mutilak duten globoak jolastu atsegin, he popped it. He was very upset. The world had come to an end. I said to him, "when I was little boy, Puxika bat izan nuen, eta, azkenean, idatz ezazu, 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, Prince, had died in a car accident. Oraingo honetan, Bere erantzuna izan zen, "Now I feel bad about two things!" I shied away from using the "when I was a little boy" kontsolamendua teknika ondoren.

Zakur hildako istilurik aurretik, Hala ere,, 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", etc.

Hori ere izan zen, nahiko pixka bat arrakastatsua, but he started to increasingly rebel against the tyranny of my childhood. One event, bereziki, 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, izan zen ergela!".

</amaiera>

Nire blog Harpidetu.

Technorati Tags:

Aldiz Zerrendak eta zutabeak eta Dokumentu Liburutegiak on ezin daiteke segurtatu

UPDATE (02/29/08): Berri honen codeplex proiektua dela dirudi banakako zutabe bermatu metodo bat eskaini nahi da: http://www.codeplex.com/SPListDisplaySetting. If you have any experience working with it, Mesedez, utzi iruzkin bat.

Foroa kartelak maiz eskatu horrelako galdera bat: "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?"

Era berean, maiz eskatu erlazionatutako galdera bat: "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 eta MOSS:

  • SharePoint ematen ez out-of-the-box aldiz bermatu laguntza.
  • SharePoint ematen ez out-of-the-box segurtasun zutabeak laguntza.

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" aldiz. These are easy enough to set up. Hala eta guztiz ere, due to their "personal" izaera, these need to be configured for each user. Use standard security configuration to prevent anyone else from creating a personal view.
  • Erabili ikuspegi datuak web parte AJAXy eta segurtasun-irtenbide trimming mota batzuk ezartzea.
  • Bildu zeure zerrenda pantailako funtzionaltasun eta segurtasun txertatu zutabea mailan trimming.
  • Aldatu datuak sarrera inprimakiak eta JavaScript erabili segurtasun eredu batera zutabe-mailako segurtasun trimming ezartzeko.
  • Use an InfoPath form for data entry. Implement column-level security trimming via web service calls to SharePoint and conditionally hide fields as needed.
  • Bildu zeure datuak ASP.NET sarrera funtzioa zutabe segurtasun maila trimming inplementatzen.

Aukera horiek ez dira benetan handia duten, baina, gutxienez bide bat behar izanez gero jarraitu behar da, bada ere, zaila da.

OHARRA: Behera joan behar bada, bide hauetako edozein, 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" eta garaitzeko zure segurtasun eskema.

Duzu, beste ideia edo esperientziak bada zutabe bermatu edo ikusia, mesedez email me edo utzi iruzkin bat, eta eguneratu egokiak posting dut.

</amaiera>

Nire blog Harpidetu.

Technorati Tags:

Quick Tip: BDC ADF bertsio zenbakiak Zure lagunaren zaude

Zuk ADF fitxategiak eskuz kodetu eta kode asko / import / test zikloak egiten, use the version number to make your life easier.

Aitortzen gorroto dut, baina aste honetan arte, 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".

Adibidea:

<LobSystem
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog BDCMetadata.xsd" Mota="WebService" Bertsioa="1.2.0.0" Izena="xyzzyDocumentReview" xmlns="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog">

Aldatu bertsio hori eta re-inportazio eta dauden negozio datuak zutabe eguneratzen bertsioa erabiltzen du automatikoki osagarriak konfigurazio ez behar dituzten.

</amaiera>

Nire blog Harpidetu.

Technorati Tags:

Irtenbidea: BDC Picker Only One emaitzen zutabea erakusten

Nire on-going bat emateko saiakera batean gehiago erabilgarria bilaketa zutabe BDC erabiliz, 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".

Hautatzailea sartzeko duzun negozio datuak zutabea liburu irekia ikonoa erakusten klik eginez:

image

The above image shows a business data column called "Master Document Id". That column is connected, BDC bidez, 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" funtzioa. Users select a "master" dokumentu eta noiz gorde, bat gertaera hartzailea kopiak meta datuak erreferentziatutako maisua eremuak.

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

clip_image002

Hori lagungarria izan, 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. Izenburua) baina ez dira agertuko izenburuak aurkitu zerrenda benetako, beren DocId bezala hemen:

clip_image002[1]

(Pantaila jaurtiketa ez da hain handia izan nuen, ez duelako jaso bilaketa bat itzultzen baliozko edozein emaitza, baina ikusi ahal izango duzu izan da aurkitu bada zenbait emaitza hori, litzateke soilik erakutsi dute DocId en, ez izenburuak).

I searched high and low for the answer to this and failed. Nire lankide, agurgarri du Jonathan Bradshaw, had faced and solved this issue. When I reached out to him for help, me adierazi zuen du eskuinetik egin-norabidea in.

Configure the picker to show multiple columns via the "ShowInPicker" ADF the in, jabetza:

<De la Propiedad Izena="ShowInPicker" Mota="System.Boolean">Egia</De la Propiedad>

Zehatz-mehatz more In:

  <!-- Izenburua -->
  <TypeDescriptor TYPENAME="System.String" Izena="Izenburua" >
    <LocalizedDisplayNames>
      <LocalizedDisplayName LCID="1033">Izenburua</LocalizedDisplayName>
    </LocalizedDisplayNames>
    <Propietateak>
      <De la Propiedad Izena="DisplayByDefault" Mota="System.Boolean">Egia</De la Propiedad>
      <De la Propiedad Izena="ShowInPicker" Mota="System.Boolean">Egia</De la Propiedad>
    </Propietateak>
  </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. Nire kasuan, BDC picker showed DocId by default. Hala eta guztiz ere, once I added "ShowInPicker" to Izenburua, DocId no longer displayed. I solved that by explicitly setting the ShowInPicker property for Doc ID.

Here emaitza da,:

image

(I’ll explain the odd-looking "168 – CamlSchema.xsd" construction in a future blog post. Laburbilduz, bat concatenated string duten bat user, apur bat-esperientzia hobea for aukera ematen dio da it).

Jakina, habiendo idatzizko blog zabaldubildudel.icio.us Istorio hau, I just did a search for "ShowInPicker" , eta aurkitu da hainbat eta hainbat Klik-kopurua, hau ko barne,: http://msdn2.microsoft.com/en-us/library/ms583986.aspx. It explains the meaning of that property along with some other good BDC stuff.

</amaiera>

Nire blog Harpidetu!

Technorati Tags: