Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Doc Library Events

  Asked By: Robin    Date: Jul 22    Category: Sharepoint    Views: 858

I suspect our most recent requirement will involve custom web parts
that provide a "dashboard" that reflects the status of documents in
a number of document libraries.

As best I've heard it explained, it goes like this:

There's a thousand "reporter" users that can "create" a document in
any number of document libraries. There's a dozen "reviewer" users
that need a "red light" to come on when such a document is created.

They need to be able to click on the red light to open the document.

When they close the document, the red light goes dim.

Since each of the dozen "reviewers" will review these documents
asychronously, therefore, at any given time, each reviewer will see
a unique combination of of red lights\dim lights, each one lighting
up to indicate that there's a document that that particular reviewer
has yet to review.

For example, you and I are reviewers and say there's doc1, doc2 and
doc3, each a doc library.

And say one document is created, new, in each of the three doc

I look at the web part and I see three red lights
labeled "Doc1", "Doc2" and "Doc3" respectively.

I click on "Doc1" and the new document in the Doc1 library opens.

I close it and the "Doc1" light is dimmed but the other two are
still red.

If you were to look at the web part, you would still see all three
lights red.


I'm not great at this but my best guess is that I need a database
tables that store:

Table 1: The reviewer names

Table 2: The Doc Library name and GUID of each document paired with
each reviewer name and a status of Red or Dim.

Then, when the web part opens, for each light, I have to query table
2 for the doc library and current user, check for "status = Red"
and, if I find one, point the graphic object to the red light and
link it to the GUID.

Then when the doc opens, update the table setting status to "dim"
for that GUID\Reviewer combination.

How that sound? Is there something like and XML trick or a web
service I could write to make this work without the database part?



3 Answers Found

Answer #1    Answered By: Michelle White     Answered On: Jul 22

But u got to figure out how are u going to update  the database  when a reviewer opens  a document. Opening document  is a client side javascript, and there is no event for open, only new  or update.

Answer #2    Answered By: Sheena Ray     Answered On: Jul 22

I was hoping to use an InfoPath form that would kick off an event
when the form opened or, at worst, I could make the Infopath form
remember everyone that's seen the form and the update  would trigger
the edit routine of the library  even handler when a user  reviews a
form for the first time.

I was also hoping that the red  light link could both, execute the
database update to indicate a particular document  had been opened
and then, open  the document.

And, then, of course, I was hoping some of you guys would tell me...

Answer #3    Answered By: Gopal Jamakhandi     Answered On: Jul 22

Attached is a low tech solution  using CSS. I just set style sheet
properties for the link in question to have different background images
for visited and non-visited links.

I did this with red-lights for visited and green-lights for non-visited,
but you can easily change the images to what you need for the red/dim

A few caveats:
1) It is machine-specific. So if one  user opens  a document  from their
home computer, it will show a red  light, but when they come in to the
office the next day, it will show green (until they open  that doc).

2) When their browser history is cleared, previously-viewed documents
will show green again.

3) It is user-profile specific. If more than one person is using the
same machine and logging in to that machine with the same Windows
account, whatever the first person has read will show red for the second
person, and vice versa.

But this should work  if you want something low-cost and
easy-to-administer and the requirements are somewhat loose. No hacking
into a database. No custom  web part  code. Just a couple of tweaks to the
XML in your site definition.

Didn't find what you were looking for? Find more on Doc Library Events Or get search suggestion and latest updates.