سریع و ساده: تهیه وب سایت با استفاده از مدل شیء شیرپوینت در 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.

این کد را ایجاد ویکی جدید سایت:

 SPSite siteCollection;

    siteCollection = جدید SPSite("http://conchang o9l8qi");

    SPWeb W = siteCollection.OpenWeb();

    w.Webs.Add("xyzzy", "xyzzy Title",
        "xyzzy description", 1033, SPWebTemplate.WebTemplateWIKI, غلط, غلط);

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

اگر شما جستجو for "Webs.Add()", شما یک تعداد نوشته های بلاگ بسیار مفید پیدا کنید, MSDN articles and SDK documentation that go into depth on this subject. I definitely recommend این سایت.

</پایان>

مشترک شدن در وبلاگ من.

برچسب ها:

یکپارچه سازی گردش شیرپوینت طراح با خدمات وب سایت

من بازی در اطراف با اقدامات سفارشی برای طراح شیرپوینت برای برخی از زمان (اینجا را ببینید برای برخی از مسائل مفصل, در صورتی که منافع شما).

در پروژه کنونی من, we need to do some fairly heavy lifting and we want to use declarative SPD workflow to manage the associated business process.

داستان کوتاه مدت, 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.

در اینجا امضا:

 عمومی رشته اعزام کننده(
        GUID WebID, // محیط زمان اجرا به تصویب رسید
        GUID SiteID, // محیط زمان اجرا به تصویب رسید
        رشته ListID, // RTE به تصویب رسید (نمی دانم چرا این رشته است, نه یک GUID)
        اعضای هیات ListItemID, // RTE به تصویب رسید.
        رشته XmlMessage) // توسط کاربر به عنوان در SPD اعلام شده به تصویب رسید.

این اهرم این واقعیت است که ما می توانیم در اطلاعات گردش کار مهم, مثل سایت, لیست ID, غیره. 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!

متاسفانه, این واضح است که یک بلیط یک طرفه به پایین "Loosey Goosey" ضد الگوی زمین, but it’s better than hitting a brick wall 🙂

آیا یک الگوی ضد اگر شما آن را انجام دهد حتی اگر شما می دانید آن را یک الگوی ضد?

I hope to wrap this inside Codeplex in the near future. If you’re interested in me doing so, چیزای من بهم زدن (پست الکترونیک یا ترک یک دیدگاه) and I’ll be that more enthusiastic about doing it 🙂

</پایان>

مشترک شدن در وبلاگ من.

برچسب ها: ,

یکشنبه های خنده دار: “من تعجب می کنم اگر رمز عبور خود را …”

من به تازگی ناهار برای برادر من خریداری (به طور معمول) and we ended up talking about funny things that we did at our respective colleges. At my alma mater, لافایت کالج, 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.

دو خاطره مورد علاقه من مربوط به دوست خوب من, Gabe. He had made the terrible mistake of telling people his freshman year that "I’m a freshman, اما من ایستاده دانشجوی سال دوم" با توجه به طبقات مختلف قرار دادن پیشرفته او گرفته بود, غیره. Many of us were similarly situated but we didn’t talk about it so much. His senior year, هنگامی که ما او را به مردم معرفی, 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, البته, برای استفاده از بازیهای.

ما مانند مهندسان کامپیوتر درمانده به آنجا یکی از چیزهای مورد علاقه خود را به انجام به شبکه راه دور به جعبه می شوند که در آنها بودند و اجرا X-چشم 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. سعی کنید وقتی یک مهندس بدبخت سعی می کند ایکس ایکس را بعد از چشم ایکس ببندد و زیر لب درباره آن غرغر می کند بلند نخندید 🙂

We also played X-trek on those boxes. برای انجام این کار, شما تا به حال برای دانلود منبع, 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, دوباره ساخته شده است و سپس به نابود گیب دفعه بعد ما بازی.

گیب همچنین از طرفداران بزرگ از یک برنامه تلویزیونی به نام بود بلیک 7. I had never seen it, اما که من از اصرار دارد که دکتر جلوگیری نمی کند. Who is the superior show. بحث ها گاهی داغ می شد 🙂

یک روز, 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, راست" was his answer. I then logged in, شناسه کاربری خود را وارد شدند, تبدیل به چهره او, تایپ شده و با صدای بلند گفت:, "I wonder if it’s B-L-A-K-E-7" ? Touch typing has never paid off as handsomely as it did that day.

هفته بعد (و یا به زودی): More computer room antics from college.

آیا شما هر گونه برای به اشتراک گذاشتن? Leave a comment or email me and I’ll publish them here.

</پایان>

مشترک شدن در وبلاگ من.

برچسب ها:

اطلاعیه عمومی جزیی: ویندوز لایو تنظیمات امنیتی و ارتباط با صاحبان فضایی

I receive a handful of messages from individuals via the built-in "send a message" تابع مایکروسافت فراهم می کند با فضای زندگی می کنند (که همچنین میزبان وبلاگ من) هر ماه.

حدود یک سوم از زمان, those users have secured their live spaces account such that I cannot reply. This is some kind of anti-spam feature I assume.

</پایان>

توضیح ساده: “ارزش، در محدوده مورد نظر سقوط نمی کند.”

تکمیلی: An anonymous poster left a great comment about internal names. Be sure to read it.

هنگام کار با گیرنده های رویداد و کد دیگر که مراجع شیرپوینت اقلام لیست از طریق مدل شی, من اغلب مرتکب اشتباه می شوند که تولید این خطا در زمان اجرا:

خطا در بارگذاری و در حال اجرا رویداد Conchango.xyzzyEventReceiver گیرنده در xyzzy, نسخه = 1.0.0.0, فرهنگ = بی طرف, 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. اما, one simple explanation is that I’m referencing a field incorrectly. If the name of the field is "Due Date", من باید آن را مانند این در گیرنده رویداد مرجع:

properties.ListItem["Due Date"]

وقتی که من املای غلط و یا استفاده از مورد اشتباه در هنگام اشاره به زمینه, SharePoint generates the above mentioned runtime error. مثلا, این اشتباه است:

properties.ListItem["due Date"]

</پایان>

مشترک شدن در وبلاگ من.

نکته سریع پایان این کاربر: نمایش ها مرتب سازی بر در یک کتابخانه اسناد, فهرست, غیره.

We can, should and do create many views in SharePoint lists (کتابخانه های اسناد, لیست های سفارشی, غیره). 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 (and I’m not sure it can), 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, همانطور که در:

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

-یا-

A – 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_[شرح]

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

</پایان>

مشترک شدن در وبلاگ من.

یکشنبه های خنده دار: “وقتی که من یک پسر کوچولو بود”

به عنوان یک پدر و مادر, somewhere along the line I discovered the "When I was a little boy" trick.

پسر من, احتمالا چهار یا پنج در آن زمان, بازی بالون و مانند اغلب پسر که با بالن بازی, he popped it. He was very upset. The world had come to an end. I said to him, "when I was little boy, I had a balloon and it popped and eventually, 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. این بار, his response was, "Now I feel bad about two things!" I shied away from using the "when I was a little boy" technique for consolation after that.

Before the dead dog incident, اما, 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", غیره.

This too was pretty successful for a while, but he started to increasingly rebel against the tyranny of my childhood. One event, in particular, 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, that was STUPID!".

</پایان>

مشترک شدن در وبلاگ من.

برچسب ها:

دیدگاه ها و ستون ها در لیست ها و کتابخانه های سند می تواند به امن نیست

تکمیلی (02/29/08): This new codeplex project seems to provide a method for securing individual columns: http://www.codeplex.com/SPListDisplaySetting. If you have any experience working with it, لطفا ترک یک نظر.

Forum posters frequently ask a question like this: "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?"

They also frequently ask a related question: "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 و MOSS:

  • SharePoint does not provide out-of-the-box support for securing views.
  • SharePoint does not provide out-of-the-box support for security columns.

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. اما, due to their "personal" nature, these need to be configured for each user. Use standard security configuration to prevent anyone else from creating a personal view.
  • Use a data view web part and implement some kind of AJAXy security trimming solution.
  • Roll your own list display functionality and incorporate security trimming at the column level.
  • Modify the data entry forms and use JavaScript in conjunction with the security model to implement column-level security trimming.
  • 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 your own ASP.NET data entry function that implements column level security trimming.

None of those options are really that great, but there is at least a path to follow if you need to, even if it’s hard.

توجه: If you go down any of these paths, 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" and defeat your security scheme.

If you have other ideas for or experiences with securing columns or views, please ایمیل من or leave a comment and I’ll update this posting as appropriate.

</پایان>

مشترک شدن در وبلاگ من.

برچسب ها:

نکته سریع: تعداد نسخه ADF BDC دوست شما

اگر شما برنامه نویسی فایل ADF و انجام تعداد زیادی از کد / واردات / تست چرخه, use the version number to make your life easier.

من نفرت را به آن اعتراف, اما تا این هفته, 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".

مثال:

<LobSystem
xmlns:XSI="HTTP://www.w3.org/2001/XMLSchema-instance" XSI:schemaLocation="HTTP://schemas.microsoft.com/office/2006/03/BusinessDataCatalog BDCMetadata.xsd" نوع="WebService" نسخه="1.2.0.0" نام="xyzzyDocumentReview" xmlns="HTTP://schemas.microsoft.com/office/2006/03/BusinessDataCatalog">

تغییر آن نسخه و واردات مجدد و کسب و کار موجود در ستون داده ها با استفاده از نسخه به روز شده به طور خودکار با هیچ تنظیمات اضافی مورد نیاز.

</پایان>

مشترک شدن در وبلاگ من.

برچسب ها:

راه حل: ارسال ها BDC فقط یک ستون از نتایج را نشان می دهد

در من تلاش در حال ارائه ستون مراجعه مفید تر با استفاده از BDC, 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".

به جمع دسترسی داشته باشید شما با کلیک کردن بر روی آیکون کتاب باز از یک ستون اطلاعات کسب و کار به عنوان نشان داده شده است:

تصویر

The above image shows a business data column called "Master Document Id". That column is connected, از طریق 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" تابع. Users select a "master" سند و هنگامی که آنها را ذخیره کنید, یک رویداد گیرنده کپی زمینه های متا داده ها از استاد اشاره.

به طور پیش فرض, the BDC picker looks like this when I search for a document whose ID = "38":

clip_image002

مفید, 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. عنوان) اما لیستی واقعی از عناوین آن را نشان نمی دهد, فقط DocId خود را همانطور که در اینجا نشان داده شده است:

clip_image002[1]

(ضربه روی صفحه نمایش خیلی بزرگ نیست چرا که من جستجو که هیچ نتایج معتبر می گرداند انتخاب نشده, اما شما می توانید ببینید که اگر آن را برخی از نتایج پیدا کرده بود, آن را فقط نشان داده DocId, نه عناوین).

I searched high and low for the answer to this and failed. My colleague, ارجمند جاناتان بنوا, had faced and solved this issue. When I reached out to him for help, او به من در مسیر درست اشاره کرد.

Configure the picker to show multiple columns via the "ShowInPicker" ملک در ADF:

<ویژگی نام="ShowInPicker" نوع="System.Boolean">درست</ویژگی>

در جزئیات بیشتر:

  <!-- عنوان -->
  <TypeDescriptor TypeName="System.String" نام="عنوان" >
    <LocalizedDisplayNames>
      <LocalizedDisplayName LCID="1033">عنوان</LocalizedDisplayName>
    </LocalizedDisplayNames>
    <خواص>
      <ویژگی نام="DisplayByDefault" نوع="System.Boolean">درست</ویژگی>
      <ویژگی نام="ShowInPicker" نوع="System.Boolean">درست</ویژگی>
    </خواص>
  </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. در مورد من, BDC picker showed DocId by default. اما, once I added "ShowInPicker" به عنوان, DocId no longer displayed. I solved that by explicitly setting the ShowInPicker property for Doc ID.

در اینجا نتیجه است:

تصویر

(I’ll explain the odd-looking "168 – CamlSchema.xsd" construction in a future blog post. In short, این یک رشته متنی است که اجازه می دهد تا برای یک تجربه کمی بهتر کاربر).

البته, به نوشته این وبلاگ است, I just did a search for "ShowInPicker" و بازدید های متعدد, از جمله این یکی: http://msdn2.microsoft.com/en-us/library/ms583986.aspx. It explains the meaning of that property along with some other good BDC stuff.

</پایان>

مشترک شدن در وبلاگ من!

برچسب ها: