VSGUID of component

  • Thread starter Thread starter Mikhail Mintchenkov
  • Start date Start date
M

Mikhail Mintchenkov

Hi,

Should I change Version Specific GUID of component while increasing its
revision number ?

M.M.
 
Also, some body knows how often VSGUID of repository should be changed?
M.M.

Thnk you in Advance!
 
KM,

I've the problem again
The script placed below should update the component (update files in DB and
increment revision).
But it doesnt.
It is nessasary to change the VSGUID of the Repository, because it is used
as a folder name in repositiry
Changing og the VSGUID *by hands* leads to problems.

;Opening database
DBOPEN 'my server'

;create object to generate GUID
DIM TypeLib
TypeLib = CreateObject("Scriptlet.TypeLib")

;Loadin the SLD file
LOAD sld micker_test.sld
DUMP sld

sld.Components.Item(1).Released = false

;Incrementing revision
DIM fc ' first component in SLD
fc = sld.Components.Item(1)

DIM rev ' components revision
rev = fc.Revision
sld.Components.Item(1).Revision = 1 + rev

Wscript.Echo "sld.Repositories.Item(1).VSGUID: " &
sld.Repositories.Item(1).VSGUID

;Change VSGUID
DIM ng
ng = TypeLib.Guid
Wscript.Echo "ng : " & ng
sld.Repositories.Item(1).VSGUID = ng ' here comes an error: unable
to set read-only attribute

sld.Components.Item(1).Released = true
Wscript.Echo "sld.Repositories.Item(1).VSGUID: " &
sld.Repositories.Item(1).VSGUID

SAVE sld micker_test_n.sld

DBIMPORT micker_test_n.sld 'path to repository'
DBCLOSE


Are any information how to change VSGUID before importing component into DB?

Thanks in advance!

M.M.
 
Mikhail,

Well.. I think you cannot easily change VSGUID of a Repository object (or any other object, in fact). It can be set only once, I
think.
The reason is obvious - you can have some references to the object by its VSGUID in database. This is especially true when you
assign a component by a repository.

So, the only way I see to implement what you want is to create another repository in the SLD file with new GUID. Replace the current
component reference to the old repository by the new one.
Then, of course, you can clean up the old Repository object from database.

Keep in mind that repository objects are supposed to change rarely. Rather their contents may change quite often.
If you are trying to implement an automatic Repository update through a script, you will suffer from the XPE object model not being
designed (no convenient way) for such functionality.

--
Regards,
KM, BSquare Corp.

PS. When you post scripts, please make sure to have comments as you do in original RSP file (use ";" only and have the comments on
separate lines only). Otherwise the script will fail and it is hard sometimes understand why it does not work.

PPS. Instead of "DBOPEN 'my server'" command you can use "DBOPEN setup" which will work on any machine with XPe Toolkit installed.

PPPS. I reserve a right to say I am wrong in my statement above that VSGUID is one-time-set property. We do not have documentation
for CMI so we are guessing here. :-)
 
Back
Top