Need to get the username for an off-line web client

Hi,

I have a problem whereby I need to restrict access to a subset of documents for DOLS off-line web clients.

I was using a subset of @Username in the View, which matched up to a field in the docs. Despite four years Domino dev experience i’ve never come across the fact that @Username doesn’t work too well in Views!!!

So now, I can’t find a way to get the current user details for my offline clients. A typical example would be a user called “Liverpool .07656365” (the number is a unique number for that user, which is actually a retail store). When they login they use just “Liverpool” and their docs all contain the word “Liverpool”. However, if I have “Liverpool” in the Authors field it doesn’t work, presumably because the user’s full name is “Liverpool .07656365”.

Any ideas guys? I’m sure i’m being a bit thick…

Subject: Need to get the username for an off-line web client…

As far as I remember the author and reader field are matching the first value on the field Username in the person doc in the NAB.

Which means if the first value (i.e first line) in the “Liverpool .07656365” person document in the NAB is “Liverpool” and not “Liverpool .07656365” than your reader and author field won’t work.

Check the content of your author (or reader) field and compare it with the username field in the NAB.

But I never used DOLS so maybe it has also something to do with DOLS !

Hope this helps

Renaud

Subject: RE: Need to get the username for an off-line web client…

Thanks Renaud.

Unfortunately the Username field in the Person doc is the full…“Liverpool .07656365”.

Specifically, Liverpool is the First Name and is also in the Short Name field.

Subject: RE: Need to get the username for an off-line web client…

I’ll have to check to be sure of what I said, but I remember we had a problem with reader fields after someone changed something in the persons document.

Can you tell me in the meantime, what are all the values in the following fields ?

In the person doc in the NAB :

First Name

middle name

Last name

Username

Shortname

In your DB doc :

The author field

Then I’ll compare that to what we implemented for our customer.

Renaud

Subject: RE: Need to get the username for an off-line web client…

The Username is :"Liverpool .000"The First Name is :“Liverpool”

The Middle Name is blank.

The Last Name is “.000”

The Short Name is “Liverpool”.

The value in the Authors field is “Liverpool”.

Obviously these aren’t real values, which is why i’ve simplified it a bit.

Subject: RE: Need to get the username for an off-line web client…

Did you considered to use a role, let’s name it "[Liverpool]"then put all that “Liverpool .XXXXX” users in a group and assign that roule for this group in ACL ?

after that put that role in Authors field

Subject: RE: Need to get the username for an off-line web client…

The problem with that is, that each user has access to a separate subset of documents, so if all users had a particular Role, they’d all see the same documents.

Subject: RE: Need to get the username for an off-line web client…

OK, then how you distinguish users if them all have the same login “Liverpool” ?

When they login they use just “Liverpool”

Subject: RE: Need to get the username for an off-line web client…

To clarify, all my users do not login as “Liverpool”. I just gave that as an example of an individual username.

They all follow the same structure of “name”+" ."+“numeric value”.

i.e. Manchester .474563

  Liverpool .735614

  London .123456

Each user has a set of documents which contain a field called “StoreName”. In this field is the First Name from their username (i.e. “Liverpool” or “Manchester”).

I need to selectively show those documents based on whoever is logged in at the time.

Subject: RE: Need to get the username for an off-line web client…

still not clear.,sorry:All users with Liverpool first name should view all docs with “Liverpool” text in some field or every user should see only his own documents?

anyway you have this possibilities

  1. SPOFU views which can handle @UserName in selection formula (not secure)

2.CN (or Full hierarchial name) or Roles in the field Readers/Authors

  1. Selective replication (not secure)

Subject: RE: Need to get the username for an off-line web client…

Hi Andrey,

Thanks for sticking with me on this one!

You are along the right lines. The CN of each user basically matches the “StoreName” field on the documents.

So “Liverpool” user has a set of documents with “Liverpool” in the StoreName field. Some have “Manchester” in the StoreName field, and I want them to be viewed by the user “Manchester” etc.

I was thinking of SPOFU views, but then i’d obviously have problems changing the views later.

The best option would be Readers fields as you say, with the value of StoreName automatically added to the Readers field - this will then match the user’s CN when they log in. Can’t get this to work for some reason…

I’ve added a Readers field to the Form, called it “Readers”, and set it as CFD. It has the right values in it, but for some reason it doesn’t hide anything…

Again I really appreciate your help with this so far!

Subject: RE: Need to get the username for an off-line web client…

CFD fields are not stored in the documentCreate CWC field with formula @Name([CN;@UserName)

do not forget to add hidden computed authors field with “[admin]” role in this field - just to not loose this document.

Subject: Need to get the username for an off-line web client…

This post is really to summarise how I got 'round this issue, in case it’s helpful to anyone else in the future.

I tried Readers fields, but it seems that I needed the full username, and that the Canonical Name isn’t enough. As the documents only hold the CN name in the “StoreName” field I couldn’t obtain the full Username.

Instead, I have a Page in the middle of my frameset which links to various views. I created some Computed Text in my link, as follows…

“\TS?OpenView&count=100&”

My Computed Text consisted of the following:

user:=@Left(@Name([CN];@Username);" .";

“RestrictToCategory=”+user

I also of course categorised my View by the “StoreName” field.

This may seem obvious but i’ve had many suggestions about how to obtain the documents relevant to a particular user, and it’s taken me the best part of 2 days to end up with this, simpler than expected answer.

Thanks for all the advice guys!