Changeset 15083 for trunk/Jav_Transform/src/com/scenari/s/co/transform/oo/OoConnectionPoolLoader.java
- Timestamp:
- 03/09/10 10:44:22 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Jav_Transform/src/com/scenari/s/co/transform/oo/OoConnectionPoolLoader.java
r14999 r15083 39 39 package com.scenari.s.co.transform.oo; 40 40 41 import java.io.File; 42 import java.util.regex.Pattern; 43 41 44 import org.xml.sax.Attributes; 42 45 43 46 import com.scenari.s.fw.properties.loaders.xml.HInitAppSaxHandlerBase; 47 48 import eu.scenari.fw.initapp.SystemPropsParser; 44 49 45 50 /** … … 88 93 * pluesieurs serveurs OO sur la machine locale. ATTENTION au format du path : pour Windows ne pas oublier 89 94 * le triple "/" : file:///C:/test/pfOo1. 95 * <li>profileFilePath="{java.io.tmpdir}/ooPf1" : en remplacement de profilePath, permet de spécifier le profile par un path 96 * du file system de l'OS (avec injection de variables système). 97 * Le code s'occupe de s'assurer que le dossier pointé existe (et le crée au besoin) et transforme le 98 * FilePath dans le format conforme pour OO. 90 99 * <li>headless="false" : pour un serveur local en autolaunch="true" - lance OpenOffice avec l'option "-headless" 91 100 * Cet attribut est utile sous *nix et permet de se dispenser d'un serveur serveur X. … … 124 133 public static final String TAG_CONN_ATT_RECHECKINTERVAL = "reCheckInterval"; 125 134 135 /** Profile OO à utiliser sous la forme OO : file:///temp/ooPf1. */ 126 136 public static final String TAG_CONN_ATT_PROFILEPATH = "profilePath"; 137 138 /** 139 * Profile OO à utiliser sous la forme la forme d'un file path classqie de l'OS. 140 * Utilisation possible des varaibles d'environnement systèmes entre {}. 141 */ 142 public static final String TAG_CONN_ATT_PROFILEFILEPATH = "profileFilePath"; 127 143 128 144 public static final String TAG_CONN_ATT_HEADLESS = "headless"; … … 157 173 158 174 String vTempDir = pAttributes.getValue(TAG_POOL_ATT_LOCALTEMPDIR); 159 if (vTempDir != null) fPool.setLocaltempDir( vTempDir);175 if (vTempDir != null) fPool.setLocaltempDir(SystemPropsParser.replaceProps(vTempDir)); 160 176 161 177 String vLocalToDistPathRegex = pAttributes.getValue(TAG_POOL_ATT_LOCALTODISTPATHREGEX); … … 163 179 164 180 String vLocalToDistPathRepl = pAttributes.getValue(TAG_POOL_ATT_LOCALTODISTPATHREPL); 165 if (vLocalToDistPathRepl != null) fPool.setLocalToDistPathRepl( vLocalToDistPathRepl);181 if (vLocalToDistPathRepl != null) fPool.setLocalToDistPathRepl(SystemPropsParser.replaceProps(vLocalToDistPathRepl)); 166 182 } 167 183 … … 194 210 195 211 String vProfilePath = pAttributes.getValue(TAG_CONN_ATT_PROFILEPATH); 196 if (vProfilePath != null) vCon.setProfilePath(vProfilePath); 212 if (vProfilePath != null) { 213 vCon.setProfilePath(vProfilePath); 214 } else { 215 String vProfileFilePath = pAttributes.getValue(TAG_CONN_ATT_PROFILEFILEPATH); 216 if (vProfileFilePath != null) { 217 File vProfile = new File(SystemPropsParser.replaceProps(vProfileFilePath)).getCanonicalFile(); 218 if (!vProfile.isDirectory()) vProfile.mkdirs(); 219 String vOoPath = vProfile.toURI().toURL().toExternalForm(); 220 //Formattage au format OO : file:/// 221 vOoPath = Pattern.compile("^(file:/)").matcher(vOoPath).replaceFirst("file:///"); 222 vCon.setProfilePath(vOoPath); 223 } 224 } 197 225 198 226 String vHeadless = pAttributes.getValue(TAG_CONN_ATT_HEADLESS);
Note: See TracChangeset
for help on using the changeset viewer.