Page 1 of 1

Protected Project

Posted: Tue Oct 26, 2010 6:12 am
by Romy
when we protect or unprotect a project which variable or file will be updated in the server. Can anyone help me to know the name of the file and the path, so that instead of login to the administrator i can see the value in the file and know the protect or unprotected status of the project.

Posted: Tue Oct 26, 2010 7:20 am
by ray.wurlod
It's not recorded in a file. It's recorded in an entry in a database table in the repository.

Posted: Tue Oct 26, 2010 7:24 am
by Romy
Is there anyway to access it as a dsadmin..

Posted: Tue Oct 26, 2010 7:47 am
by Romy
How to get the value for this flag
DSRProjectProtected ;* flag to indicate if project is protected

I found this line in the DSR_COMM.H

Posted: Tue Oct 26, 2010 2:59 pm
by mhester
That is in a header so I would think you might wrap it with a C/C++ program? but then you would have to understand the API and create an object reference and a bunch of other things - is there some reason you need to know this outside of looking in the administrator client?

Posted: Tue Oct 26, 2010 8:07 pm
by Romy
Ok thanks. I have to manually check whether all the projects are protected in the server. So i thought of writing a UNIX script by fetching this flag value so that it when i trigger the script it will let me know which projects are all protected. Thats the reason i thought of digging but didnt end up in finding a solution to it.

Is there anyother way to workout my idea?

Posted: Wed Oct 27, 2010 11:58 pm
by stuartjvnorton
No offense, but exactly how many projects do you have??
Surely you could check them in the time it took to post?

Not having a go, just curious how many projects some people have.

Posted: Thu Oct 28, 2010 4:28 am
by Romy
More than 40 projects that is split across different servers.

Posted: Thu Oct 28, 2010 4:58 am
by stuartjvnorton
Wow, that is a fair few. I can see why you'd want to automate it now...

As Ray said, it'll be in XMETA somewhere. No idea where though.

Posted: Thu Oct 28, 2010 5:29 am
by ArndW
Once place that the project's status as protected or not is visible is in the UV.ACCOUNTS file, the following query should list all protected projects:

Code: Select all

LIST UV.ACCOUNT ID.SUP @ID WITH EVAL 'FIELD(NAME,"\",4)' = 46256
A BASIC routine to return 0 for unprotected and 1 for protected would be

Routine IsProtectected(ProjectName)

Code: Select all

   Ans = 0 ;** assume unprotected project
   OPEN '','UV.ACCOUNT' TO UvAccountFilePtr ELSE CALL DSLogFatal('Unable to open UV.ACCOUNT file, error is "':STATUS():'".','')
   READ UvAccountRecord FROM UvAccountFilePtr, ProjectName
   THEN
      IF FIELD(UvAccountRecord<7>,'\',4) = 46256 THEN Ans = 1
   END
   ELSE
      CALL DSLogWarn('Project "':ProjectName:'" does not exist.','')
   END
   CLOSE UvAccountFilePtr

Posted: Thu Nov 04, 2010 5:50 am
by Romy
Thanks Arndw, but it didnt work for me .I tried the routine. It is giving the value 0 for all projects, even if that project doesnt exist.

Posted: Thu Nov 04, 2010 6:59 am
by ArndW
Mark at least two projects as protected. Execute

Code: Select all

LIST UV.ACCOUNT ID.SUP @ID EVAL 'FIELD(NAME,"\",4)'
the numeric values should be the same for the two or more protected projects and different for the non-protected ones. Is that the case?

Posted: Thu Nov 04, 2010 7:15 am
by Romy
I am getting different numbers for each project. one thing i observed is, if i am making any changes like protecting or unprotecting it the number gets changed to different one.

Posted: Thu Nov 04, 2010 7:16 am
by Romy
I am getting different numbers for each project. one thing i observed is, if i am making any changes like protecting or unprotecting it the number gets changed to different one.

Posted: Thu Nov 04, 2010 8:31 am
by ArndW
I was afraid of that - I'm currently on Windows and assume that the checksum is computed differently.
Unfortunately, that is the only way I know of getting the project status so the answer to your question is "No, one cannot get the protected/unprotected status"