Uniface on GitHub
Product (releases and patches)
Fixes and Updates
one of my Uniface project is including some external files, either text and binary files; I have included them into a project deployment archive to be distributed. This functionality is already available into current deployment archive functionality:- Binary files are saved into deployment archive within "fil" subdir- Text files are saved into deployment archive within "txt" subdirNow I have found one issues:All these files are configuration files related to this project and are organized in a subtree starting from base project directory. This project was initially setup 2 years ago and it was positioned on a machine in a certain position into file system.Now the same project was restored to be reviewed into another machine in another position of the files system; all references to external files into UARCHITEM are broken!
The reason is UDE is saving for these files their FULL PATH NAME into table UARCHITEM, I feel because being its primary key. As of today in U9.7.05.024 I did not find any way to save a relative filename: there is a checkbox available (Qualify source name) but also unchecking it always the full path file name is saved because the filename cannot be manually edited.
My question:Shouldn't UDE require to developer to define UNIQUE original filenames either full path names or path names relative to current directory?
And finally there is a proposal for a "all uniface" solution in 9.6.04
x_workdir = $ldir()
end ; do_fill_x_workdir
U_OBJNAME = $concat(X_WORKDIR,"·*")
end ; do_retrieve
$1 = ""
while ($dbocc > 0)
putlistitems/occ $2 ,"UARCHITEM"
while ($1 != "")
getitem $2, $1, 1
delitem $1, 1
getlistitems/occ $2, "UARCHITEM"
U_OBJNAME = $replace(U_OBJNAME,1,X_WORKDIR,"")
end ; do_transform
end ; do_save
; NOTE: to break the readonly UARCHITEM put a WRITE/DELETE in the triggers
The benefit of U9 is that GOLD chars have this "central dot" prefix so you should be able to just copy&paste
YES, also this your second solution is really valid...because could be embedded into UDE.So, the previous one is a workaround, this is a solution.
I've asked for THE solution fully integrated into UDE defining wish #58.
The SQL magic is more difficult as it needs proprietary statements depending on your database.
But it works similar to editing the export file with the following steps:
This way we are database dependend, but do not need to export/delete/import.
190822: Just to complete the suggestion with an example
For a SOLID database, the statements you can use with the SQL Workbench (GOLD-W) are for $IDF:
update UARCHITEM set U_OBJNAME = replace(U_OBJNAME,'C:\drive_g\!drive_!m4l\umeFASTory\umeFASTory_TDD-9604\work\','') where u_objname like 'C:\drive_g\!drive_!m4l\umeFASTory\umeFASTory_TDD-9604\work\%'
or you can write a tiny form using $ldir to get the working directory, but I would use the "all uniface" implementation because it should work on all databases.
Have you had a look at the mklink command in Dos?
Thanks for your suggestion.
I consider the export/edit/delete/import session Uli suggested the simpler solution.
To REPAIR this situation without artistic SQL tricks we edit the export file:
This should be able to handle even the subtrees Gianni has mentioned as we cut only the leading part of the full path which is a constant to all PKs
Its a fast and easy way to transform from fullpath to relative path while benefit from all the support of IDE.
PLUS you can maintain the archive using the standard way which is the fastest one and finally apply the transformation routine again which works on the new records only.
It works! Workaround accepted.
I just had a little experiment with 9604 with Select Files Form:
uncheck Qualify Source file namescheck Qualify target file namesbut leave target folder (which is editable) empty
"Define Development Archive" shows only the pure filename as ObjectName
The generated UAR looks OK for me because under the root we find "txt and "uar" subdirectory
so it may take only a little SQL magic to change the PKs for the existing Archives
I've checked the usage you proposed but unfortunately it does NOT work for me because my files are hosted in a directory tree including 4 different configurations, having more files with same basic name in different directories...I am receiving DUPKEY errors!
I am going to check later this evening the hand made solution you've called "a little SQL magic"...
Thanks for your efforts.
what about adding just the relative part of the directory tree manually as "destination folder" ??
This should solve the duplicate key problem,
P.S. the export solution should work on the subtrees as well in just one go
good try but unfortunately(again) the destination folder is in use for those files...because I need to duplicate to uar:configs\config1\config.xmlconfigs\config1\[aFirstWholeSubtree]...configs\config4\config.xmlconfigs\config4\[aFourthWholeSubtree]and those subtrees contains many files with same name in different directories.
I'll probably go for the XML editing session instead of SQL...
© 2019 Uniface Privacy & Cookies | Privacy Statement | Legal