Category Archives: February 2008

Simplex Explanation: “Praedae pretium non est in parte.”

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

Cum operantes cum eventus receptatores et Codicis references SharePoint album items per obiectum exemplar, Saepe erroribus quod generare hoc error ad runtime:

Error oneratisque et currit eventus susceptor Conchango.xyzzyEventReceiver in xyzzy, Version = 1.0.0.0, Culturae = neutra, 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. Autem, one simple explanation is that I’m referencing a field incorrectly. If the name of the field is "Due Date", Ego oportet respicere quasi hoc in eventus accipientis:

properties.ListItem["Due Date"]

Cum misspell vel uti iniuriam causa cum indiciunt agro, SharePoint generates the above mentioned runtime error. Verbigratia, hoc est iniuriam:

properties.ListItem["Debitum Date"]

</finem>

Scribet ad mea blog.

Technorati Tags:

Finem User Velox Tip: Modi Views in Documentum Bibliotheca, Album, etc.

Potest, debet et creare Multa in SharePoint tabulatum (document bibliothecis, consuetudinem tabulatum, 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 (Non certus sum potest), suus usque ad technicae pro typicam finem user.

Si vis ad moderari ordinem in quod SharePoint enumerat available views, simpliciter prepend a numerus vel litteras ad visum nomen, ut in:

1 – Per materiales Type
2 – Omnes Tabellae
3 – Debitum Date

-aut-

A – Per materiales Type
B – Omnes Tabellae
C – Debitum Date

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

Z_KPI_[description]

Quod facit mea "KPI" numero in extrema sententiae videri.

</finem>

Scribet ad mea blog.

Technorati Tags: ,

Dominica Funny: “Cum ego Puerulus”

Ut a parentis, alicubi in linea inveni "cum essem parvulus" trick.

Mea filius, an quatuor aut quinque dies, ludit a Balloon et sicut maxime pueri quod ludere cum Balloons, he popped it. He was very upset. The world had come to an end. I said to him, "Cum erat puer, Me a Balloon et popped et tandem, 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, Princeps, had died in a car accident. Hoc tempore, responsum erat, "Autem sentio malum de duo!" I shied away from using the "when I was a little boy" artem consolationem post quod.

Ante mortuus canis incidunt, autem, I had also started to use the technique to convince him to do chores. "Cum essem parvulus, Me ire et adepto diurna ", "Mundare mea locus", "Adepto mammam eius capulus calicem", etc.

Hoc erat pulchellus prospere enim a dum, but he started to increasingly rebel against the tyranny of my childhood. One event, in particulari, marked the end. I told him to bring the garbage cans from curb back to the garage. He argued and I responded, "Cum essem parvulus, I had to take the garbage back to the garage." He responded, "O Yeah! Well when you were a little boy, quod erat BRUTUS!".

</finem>

Scribet ad mea blog.

Technorati Tags:

Sententiis et columnas et Lists Document Libraries non potest confici

UPDATE (02/29/08): Hoc novum codeplex videtur promineant providere modus securitate singulis columnis: http://www.codeplex.com/SPListDisplaySetting. If you have any experience working with it, commodo licentia a ineo.

Posters foro frequenter interrogare huiusmodi: "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?"

Related quaestio etiam saepe petivi: "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 et MUSCUS:

  • SharePoint non praebere de-de-in-buxum captandi favorem sententiae.
  • SharePoint non praebere de-de-in-buxum praesidium securitatem columnis.

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. Autem, due to their "personal" natura, these need to be configured for each user. Use standard security configuration to prevent anyone else from creating a personal view.
  • Telam et implement aliqua pars sententiam uti notitia securitatem AJAXy qr solutionem.
  • Volvite tua album propono functionality et incorporamus securitatem qr agmine gradu.
  • Modify notitia introitu usus JavaScript formis et in conjunctione cum securitate exemplar ad peragendam column-gradu salutem qr.
  • Use an InfoPath form for data entry. Implement column-level security trimming via web service calls to SharePoint and conditionally hide fields as needed.
  • Volvite introitu tuo ASP.NET notitia muneris campester quod instrumentum agmen securum qr.

Neminem eorum, qui bene magnam realiter, sed tamen si quid sequatur viam, etiam si suus 'ferreus.

MONUMENTUM: Si quis ex his descendunt semitas, 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" et dissipatum est consilium securitatem.

Si alias ideas aut potiundis experitur cum columnis views, RV email me Licentia a ineo quod puteus 'aut ego hoc update stipes ut conveniens.

</finem>

Scribet ad mea blog.

Technorati Tags:

Vivos Tip: Latin Vulgate Numbers ADF bdc sunt Amici

Si tu manum coding ADF lima facio multus of code / necessarium / test circuitus, use the version number to make your life easier.

Odi illud admittere,, sed usque hoc septimana, 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".

Verbigratia:

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

Vestibulum et Re-version important et existentem negotium notitia agmen utitur updated version automatically cum nulls configuration requisita.

</finem>

Scribet ad mea blog.

Technorati Tags:

Solutio: BDC Picker solum ostendit, unam columnam eventorum

In my on-going attempts at providing a more useful lookup column using 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".

You access the picker by clicking on the open book icon of a business data column as shown:

imaginem

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" munus. Users select a "master" document and when they save, an event receiver copies meta data fields from the referenced master.

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

clip_image002

That’s helpful, 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. Title) but won’t show the actual list of titles it found, just their DocId’s as shown here:

clip_image002[1]

(The screen shot isn’t so great because I didn’t pick a search that returns any valid results, but you can see that if it had found some results, it would only have shown DocId’s, not titles).

I searched high and low for the answer to this and failed. Collega, the venerable Jonathan Bradshaw, had faced and solved this issue. When I reached out to him for help, he pointed me in the right direction.

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

<Proprietas Nomen="ShowInPicker" Typus="System.Boolean">verum</Proprietas>

In more detail:

  <!-- Title -->
  <TypeDescriptor TypeName="System.String" Nomen="Title" >
    <LocalizedDisplayNames>
      <LocalizedDisplayName LCID="1033">Title</LocalizedDisplayName>
    </LocalizedDisplayNames>
    <Proprietates>
      <Proprietas Nomen="DisplayByDefault" Typus="System.Boolean">verum</Proprietas>
      <Proprietas Nomen="ShowInPicker" Typus="System.Boolean">verum</Proprietas>
    </Proprietates>
  </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 meam, BDC picker showed DocId by default. Autem, once I added "ShowInPicker" to Title, DocId no longer displayed. I solved that by explicitly setting the ShowInPicker property for Doc ID.

Here is the result:

imaginem

(I’ll explain the odd-looking "168 – CamlSchema.xsd" construction in a future blog post. In short, it’s a concatenated string that allows for a slightly better user experience).

Utique, having written this blog entry, I just did a search for "ShowInPicker" and found numerous hits, including this one: http://msdn2.microsoft.com/en-us/library/ms583986.aspx. It explains the meaning of that property along with some other good BDC stuff.

</finem>

Scribet ad mea blog!

Technorati Tags:

Velox & Facile: Partum a folder assignare adipiscing elit (Aut, Et Manduca habeant Your KPIs eos nimis)

In order to work around a KPI problem I wrote about here, I did some testing and discovered that KPI’s work against folders with meta data in the same way that they work against documents or list items. I proved it out by creating a new content type based on the folder content type and then added a few fields. I created some indicators and proved to myself that KPIs work as expected. This was welcome news. It’s not perfect, because the drill-down you get from the KPI against the folders is not exactly what you want. This isn’t too much a drawback in my case because 1) the end users don’t know any better and 2) the drill-down goes to a folder. They click the folder name and they are at the item. It’s two clicks instead of one, which isn’t the end of the world.

This flowed nicely with the work I was doing. I am creating a folder for every document that gets uploaded. This is done via an event receiver. Ut ex, it’s a piece of cake to keep the parent folder’s meta data in sync with the KPI-driven meta data from the file itself since the plumbing is already in place. Hoc mihi concedit KPI meum in ea, et comedent et 🙂

I modified the event receiver to add the folder and then set this new folder’s content type to my custom KPI-friendly content type. This bit of code did the trick:

 SPFolderCollection srcFolders = targetWeb.GetFolder("Documents").SubFolders;
  SPFolder addedFolder = srcFolders.Add(properties.ListItem.ID.ToString());
  SPContentTypeId kpiCT = novum SPContentTypeId("0x0120002A666CAA9176DC4AA8CBAA9DC6B4039F");
  addedFolder.Item["Content Type ID"] = kpiCT;
  addedFolder.Item.Update();

To locate the actual Content Type ID, I accessed that content type via site settings and copy/pasted it from the URL as shown:

imaginem

</finem>

Scribet ad mea blog!

Technorati Tags: ,

Vivos et Securus: Adepto de SPFolder SPListItem in eventum Receptor

Odi illud admittere,, but I struggled with this one all day. My event receiver needs to update a field of its parent folder. This little bit shows how to do it:

privatis Irrita UpdateParentFolder(SPItemEventProperties Proprietates)
{

SPFolder thisItemFolder = properties.ListItem.File.ParentFolder;
thisItemFolder.Item["ZZ Approval Status"] = "Good news, omnes!";
thisItemFolder.Item.Update();


} // UpdateParentFolder

In hoc, Ego sum operantes cum a tabellae bibliothecam proprietates veniunt ab eventu ItemAdded.

Dolum est, ut non directe item Lorem ipsum SPFolder (i.e. properties.ListItem.Folder nulla sit). Pro, item in album scriptor ire et adepto coniuncta File lima folder est scriptor.

</finem>

Scribet ad mea blog!

Technorati Tags:

Aliud Vicis Receptor debug Dolum

I’m sure I’m not the first person to come up with this. Autem, I haven’t noticed anyone publish a trick like this since I started paying close attention to the community last July. Ita, Ego stipes hoc mallem de facili debug apicem.

I’m working on an event receiver that started to generate this error in the 12 alveare:

Error oneratisque et currit eventus susceptor Conchango.xyzzyEventReceiver in xyzzy, Version = 1.0.0.0, Culturae = neutra, PublicKeyToken=blahbalhbalh. Additional information is below. : Non objectum secundum posuit ad instantiam objectum.

I didn’t know where I had introduced this bug because I had done too many things in one of my code/deploy/test cycles.

I tried this solution to get my pdb in there with hopes that SharePoint’s 12 hive would show the stack trace, sed non fortuna. I don’t know if it’s possible and if someone does, placet me cognoscere 🙂

I know it’s possible to write your own log messages to the 12 alveare. Frankly, I wanted something a little less scary and quicker to implement.

It occurred to me that I could at least get some basic trace information by catching and re-throwing generic exceptions like this:

  experiri {
    UpdateEditionDate(Proprietates);
  }
  capiendos (Exceptio e)
  {
    mittent novum Exceptio("Dispatcher, UpdateEditionDate(): Exceptio: [" + e.ToString() + "].");
  }

This showed up in the 12 hive thusly:

Error oneratisque et currit eventus susceptor Conchango.xyzzyEventReceiver in xyzzy, Version = 1.0.0.0, Culturae = neutra, PublicKeyToken=blahblahblah. Additional information is below. : Dispatcher, UpdateEditionDate(): Exceptio: [System.NullReferenceException: Non objectum secundum posuit ad instantiam objectum. at Conchango.xyzzyManagementEventReceiver.UpdateEditionDate(SPItemEventProperties proprietatum) at Conchango.xyzzyManagementEventReceiver.Dispatcher(SPItemEventProperties proprietatum, String eventDescription)].

That gave me all the detail I needed to track down that particular problem and I expect to use it a lot going forward.

</finem>

Scribet ad mea blog!