Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: getting the fullName attribute from a user
Topic Summary: How do I check if the attribute exists?
Created On: 20-Sep-2007 15:48
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by Reik Schroeder, on Tuesday, September 25, 2007 2:09 PM

Answer:
short addon:
I ran the attached script on our database without any error messages?!

So it should be working?!
 20-Sep-2007 15:48
User is offline View Users Profile Print this message


Brian Rohler

Posts: 26
Joined: 20-Jun-2007

right now I'm running the code: User u = find("user") string uName = u.fullName When I run this and there isn't a name it immediately throws a dxl error of "No such attribute exists" To get around this error I was trying: if(!isAttribute(u, "fullName") to check if it exists, but this always comes out false even when there is a full name to be found. My question is how do I find out without throwing a dxl error if the user has a full name listed?
Report this to a Moderator Report this to a Moderator
 20-Sep-2007 16:10
User is offline View Users Profile Print this message


Reik Schroeder

Posts: 361
Joined: 28-Jul-2003

Hi Brian,

could it be that the DXL error message isn't from fullName but from non existing user?

You can check if user exists by using:
bool existsUser(string)
function.

Greetings
Reik

-------------------------
Evosoft GmbH
for Siemens Industry Sector


Berlin, Germany
Report this to a Moderator Report this to a Moderator
 20-Sep-2007 17:26
User is offline View Users Profile Print this message


Brian Rohler

Posts: 26
Joined: 20-Jun-2007

ah sorry I didn't mention that, I verify that the user indeed exists (I do that check, also to reinforce it I use my own user name). Also when I run uName = u.fullName and it's a user that has a name (like my own) it runs fine, but with that same user name I run the: if(!isAttribute(u, "fullName")) and it does not recognize the attribute and returns false. Again is there anyway to check if the user has a full name listed without throwing a dxl error?
Report this to a Moderator Report this to a Moderator
 21-Sep-2007 00:58
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

The 'isAttribute' command only works for user-created 'properties'. fullName is a 'standard' property and so will always return false, unless of course you create a user-created property called 'fullName'.

Its odd you get errors. Try this:
string uName = ""
noError()
uName = u.fullName
if (!null lastError()) uName = "" // ignore errors

- Louie
Report this to a Moderator Report this to a Moderator
 21-Sep-2007 08:34
User is offline View Users Profile Print this message


Reik Schroeder

Posts: 361
Joined: 28-Jul-2003

Hi Brian,

Louie is right by differentiate between user defined and system defined user properties.

I think the fullName system property should not fail at all so it should not create an DXL error.

The fullName property was introduced with Doors 8, so it should be runable for any valid User handle.
If the user's fullname is not set it will return null string.

If you indeed get an DXL error message, please let us know about your configuration:

    server version
    client version
    operating systems on server and clients
    was the user's database migrated somhow from an older version?



Greetings
Reik

-------------------------
Evosoft GmbH
for Siemens Industry Sector


Berlin, Germany
Report this to a Moderator Report this to a Moderator
 21-Sep-2007 08:38
User is offline View Users Profile Print this message


Reik Schroeder

Posts: 361
Joined: 28-Jul-2003

Answer Answer
short addon:
I ran the attached script on our database without any error messages?!

So it should be working?!

-------------------------
Evosoft GmbH
for Siemens Industry Sector


Berlin, Germany
Report this to a Moderator Report this to a Moderator
 25-Sep-2007 14:09
User is offline View Users Profile Print this message


Brian Rohler

Posts: 26
Joined: 20-Jun-2007

Thanks for the help, it seems that if the database isn't setup to have that attribute it will through an error (such as with West Lafayette's server), but on server's with it nothing should happen.
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.