I dont think double or single quote is required...
Pat,try this:iwextattr -u -s "TeamSite/Metadata/ea_name=hello there" //localhost/default/main/WORKAREA/wa_name/test.txtNote the location of the first double-quote.
I dont think double or single quote is required. Also, have you given full path for $iwhome/bin/iwextattr in your code?
Hi,I have an issue running iwextattr commands from a servlet on Solaris 9 (TeamSite 6.7.1 SP1).If i execute the following command:iwextattr -u -s TeamSite/Metadata/ea_name="hello there" //localhost/default/main/WORKAREA/wa_name/test.txtThis command returns "ERROR locating: there". As soon as i have spaces within the value, It splits the ea value into several parameters?!?!? If there is no spaces within the value it works fine.If i execute this command from the command line directly, it works fine.If i move the servlet to a Windows box, it also works fine.any ideas? Does the iwui user who execute java code (like servlets) needs to be setup with a specific shell? or need any specific configuration on Solaris?Thanks,Pat
If using a servlet, a better design would be to use CSSDK classes to set Metadata or EA's using the CSExtendedAttribute class.
Process p;p = Runtime.getRuntime().exec("/apps/iw-home/bin/iwextattr -u -s \"TeamSite/Metadata/ea_name=hello there\" //localhost/default/main/WORKAREA/wa_name/test.txt");
What does it mean, "better"? Better for what? By what metric?For couple EAs it won't even be that much faster. Development efforts though are probably order of magnitude higher than for a single command, perhaps more if you count required configurational changes.This efforts may pay off if you have massive EAs setting, multiple EAs per each File in a branch, stuff like that.Commands' shell forking overhead accumulates really fast so dedicated CSSDK Servlet *may* provide serious performance gain.
"Better" - coz' using Runtime.exec craps out by default implementation if the stdin & stdout exceeds 255 bytes. You need supporting classes to handle the buffered i/o operations. Again, using runtime.exec fires off child process thread & the exception handling is not possible for the command "iwextattr" itself.