View Javadoc
1   package com.acumenvelocity.ath.common;
2   
3   import java.text.DateFormat;
4   import java.text.SimpleDateFormat;
5   import java.util.TimeZone;
6   
7   import org.apache.commons.lang3.math.NumberUtils;
8   
9   import net.sf.okapi.common.Util;
10  import net.sf.okapi.common.filters.IFilter;
11  import net.sf.okapi.common.query.MatchType;
12  
13  /**
14   * Central constants class for the ATH (Acumen Velocity Translation Hub) application.
15   * This class contains all application-wide constants including:
16   * <ul>
17   * <li>Environment variable configurations</li>
18   * <li>Database names and collection names</li>
19   * <li>Default ObjectIds for testing and system operations</li>
20   * <li>Property names and values</li>
21   * <li>Date formatters</li>
22   * <li>Pipeline and MT provider constants</li>
23   * </ul>
24   * 
25   * <p>
26   * All constants are public static final and organized by category for easy navigation.
27   * This class is not meant to be instantiated.
28   * 
29   * @author Acumen Velocity
30   * @version 1.0
31   * @since 1.0
32   */
33  public class Const {
34  
35    // ============================================================================================
36    // ENVIRONMENT VARIABLES
37    // ============================================================================================
38  
39    /**
40     * Port number for the ATH application server.
41     * Defaults to 8080 if ATH_PORT environment variable is not set or invalid.
42     * This value is checked for validity in EnvVarsChecker.
43     */
44    public static final int ATH_PORT = AthUtil.safeToInt(System.getenv("ATH_PORT"), 8080);
45  
46    /**
47     * Storage timeout in minutes for temporary data and cached resources.
48     * Defaults to 15 minutes if ATH_STORAGE_TIMEOUT_MINUTES environment variable is not defined.
49     * This prevents test failures when the environment variable is missing.
50     */
51    public static final long STORAGE_TIMEOUT_MINUTES = Util.isEmpty(
52        System.getenv("ATH_STORAGE_TIMEOUT_MINUTES")) ? 15
53            : Long.valueOf(System.getenv("ATH_STORAGE_TIMEOUT_MINUTES"));
54  
55    /**
56     * Distributed lock timeout in milliseconds for document segment repositioning operations.
57     * Defaults to 30 seconds (30000ms) if ATH_SOLR_DOC_LOCK_TIMEOUT_MS environment variable is not
58     * defined.
59     * This timeout prevents deadlocks when a worker node crashes or becomes unresponsive while
60     * holding a lock. After this duration, the lock is considered expired and can be acquired
61     * by another node.
62     */
63    public static final long SOLR_DOC_LOCK_TIMEOUT_MS = Util.isEmpty(
64        System.getenv("ATH_SOLR_DOC_LOCK_TIMEOUT_MS")) ? 30000
65            : Long.valueOf(System.getenv("ATH_SOLR_DOC_LOCK_TIMEOUT_MS"));
66  
67    /** Google Cloud Storage bucket name */
68    public static final String ATH_GCS_BUCKET = System.getenv("ATH_GCS_BUCKET");
69    
70    // /** Google Cloud Storage bucket name */
71    // public static final String ATH_VERTEX_EVAL_JOB_GCS_BUCKET = System
72    // .getenv("ATH_VERTEX_EVAL_JOB_GCS_BUCKET");
73    //
74    // /** Google Cloud Storage bucket name */
75    // public static final String ATH_VERTEX_EVAL_JOB_GCS_PREFIX = System
76    // .getenv("ATH_VERTEX_EVAL_JOB_GCS_PREFIX");
77  
78    /** Path to Google Cloud Platform service account key file */
79    public static final String ATH_GCP_SECRET_FILE = System.getenv("ATH_GCP_SECRET_FILE");
80  
81    /**
82     * The GCP region
83     */
84    public static final String ATH_GCP_PROJECT_LOCATION = System.getenv("ATH_GCP_PROJECT_LOCATION");
85  
86    /** The Client ID required for authenticating with the Adobe PDF services API. */
87    public static final String ATH_PDF_CLIENT_ID = System.getenv("ATH_PDF_CLIENT_ID");
88  
89    /** The Client Secret for authenticating with the Adobe PDF services API. */
90    public static final String ATH_PDF_CLIENT_SECRET = System.getenv("ATH_PDF_CLIENT_SECRET");
91  
92    /** Apache Solr server URL for search functionality */
93    public static final String ATH_SOLR_URL = System.getenv("ATH_SOLR_URL");
94  
95    /** Logging configuration setting */
96    public static final String ATH_LOGS_CONFIG = System.getenv("ATH_LOGS_CONFIG");
97  
98    /**
99     * Google Translate API key
100    */
101   public static final String ATH_GCT_API_KEY = System.getenv("ATH_GCT_API_KEY");
102 
103   /**
104    * OpenAI API key
105    */
106   public static final String ATH_OPENAI_API_KEY = System.getenv("ATH_OPENAI_API_KEY");
107 
108   /**
109    * OpenAI model
110    */
111 
112   // public static final String OPENAI_MODEL = "gpt-4o-mini";
113   public static final String OPENAI_MODEL = "gpt-5-mini";
114   // public static final String OPENAI_MODEL = "gpt-5";
115   // public static final String OPENAI_MODEL = "gpt-5-nano"; // fills trgCodes only for the 1st one
116   // public static final String OPENAI_MODEL = "gpt-5-chat-latest";
117 
118   /**
119    * Gemini API key
120    */
121   public static final String ATH_GEMINI_API_KEY = System.getenv("ATH_GEMINI_API_KEY");
122 
123   public static final String GEMINI_CODE_REINSERTION_MODEL = "gemini-2.5-flash";
124   // public static final String GEMINI_CODE_REINSERTION_MODEL = "gemini-2.0-flash-exp";
125   // public static final String GEMINI_CODE_REINSERTION_MODEL = "gemini-2.5-pro";
126 
127   // public static final String GEMINI_ALIGNMENT_MODEL = "gemini-2.5-flash";
128   public static final String GEMINI_ALIGNMENT_MODEL = "gemini-2.5-pro";
129 
130   public static final MatchType AL_MATCH_TYPE = MatchType.EXACT_REPAIRED;
131 
132   // ============================================================================================
133   // MACHINE TRANSLATION DEFAULTS
134   // ============================================================================================
135 
136   /** Default machine translation provider name */
137   public static final String DEFAULT_MT_PROVIDER = ProjectProps
138       .getProjectPropValue("default.mt.provider");
139 
140   /** Default machine translation confidence threshold */
141   public static final int DEFAULT_MT_THRESHOLD = ProjectProps
142       .getProjectPropIntValue("default.mt.threshold");
143 
144   // ============================================================================================
145   // MISCELLANEOUS CONFIGURATION
146   // ============================================================================================
147 
148   /** Temporary file prefix */
149   public static final String TEMP_PREFIX = ProjectProps.getProjectPropValue("temp.prefix");
150 
151   /** Atlas Translation Memory index name for search operations */
152   public static final String ATLAS_TM_INDEX_NAME = ProjectProps
153       .getProjectPropValue("atlas.tm.index.name");
154 
155   // ============================================================================================
156   // DATE FORMATTERS
157   // ============================================================================================
158 
159   /**
160    * ISO 8601 date format for TMX files.
161    * Reference: https://www.gala-global.org/tmx-14b#creationdate
162    * Configured with timezone from project properties.
163    */
164   public static final DateFormat TMX_DATE_FORMAT;
165   public static final DateFormat QUARTZ_DATE_FORMAT;
166 
167   // ============================================================================================
168   // PIPELINE TYPES
169   // ============================================================================================
170 
171   /** Import pipeline type identifier */
172   public static final String ATH_PIPELINE_TYPE_IMPORT = ProjectProps
173       .getProjectPropValue("pipeline.type.name.cat.import");
174 
175   /** Export pipeline type identifier */
176   public static final String ATH_PIPELINE_TYPE_EXPORT = ProjectProps
177       .getProjectPropValue("pipeline.type.name.cat.export");
178 
179   // ============================================================================================
180   // SOLR PROPERTY NAMES
181   // ============================================================================================
182 
183   public static final int ATH_SOLR_BATCH_SIZE = NumberUtils
184       .toInt(System.getenv("ATH_SOLR_BATCH_SIZE"), 10_000);
185 
186   // Core entity identifiers
187   /**
188    * Property name for the Solr ID.
189    */
190   public static final String ATH_PROP_SOLR_ID = "id";
191 
192   public static final String ATH_PROP_TM_SEG_ID = "tmSegId";
193 
194   public static final String ATH_PROP_DOC_SEG_ID = "docSegId";
195 
196   /**
197    * Property name for the TM ID.
198    */
199   public static final String ATH_PROP_TM_ID = "tmId";
200 
201   /**
202    * Property name for the TM threshold percentage (byte).
203    */
204   public static final String ATH_PROP_TM_THRESHOLD = "tmThreshold";
205 
206   /**
207    * Property name for the TM name.
208    */
209   public static final String ATH_PROP_TM_FILE_NAME = "tmFileName";
210 
211   /**
212    * Property name for the MT engine ID (string).
213    */
214   public static final String ATH_PROP_MT_ENGINE_ID = "mtEngineId";
215 
216   /**
217    * Property name for the MT-engine-specific parameters (string).
218    */
219   public static final String ATH_PROP_MT_ENGINE_PARAMS = "mtEngineParams";
220 
221   /**
222    * Property name for the MT project location (string).
223    */
224   public static final String ATH_PROP_MT_PROJECT_LOCATION = "mtProjectLocalion";
225 
226   // /**
227   // * Property name for the MT project ID (string).
228   // */
229   // public static final String ATH_PROP_MT_GLOSSARY_PROJECT_ID = "mtGlossaryProjectId";
230   //
231   // /**
232   // * Property name for the MT glossary project ID (string).
233   // */
234   // public static final String ATH_PROP_MT_GLOSSARY_PROJECT_LOCATION = "mtGlossaryProjectLocalion";
235   //
236   // /**
237   // * Property name for the MT glossary ID (string).
238   // */
239   // public static final String ATH_PROP_MT_GLOSSARY_ID = "mtGlossaryId";
240   //
241   // /**
242   // * Property name for the MT model project ID (string).
243   // */
244   // public static final String ATH_PROP_MT_MODEL_PROJECT_ID = "mtModelProjectId";
245   //
246   // /**
247   // * Property name for the MT model project location (string).
248   // */
249   // public static final String ATH_PROP_MT_MODEL_PROJECT_LOCATION = "mtModelProjectLocalion";
250   //
251   // /**
252   // * Property name for the MT model ID (string).
253   // */
254   // public static final String ATH_PROP_MT_MODEL_ID = "mtModelId";
255 
256   /**
257    * Property name for the TM ID.
258    */
259   public static final String ATH_PROP_EXPORT_TM_ID = "exportTmId";
260 
261   /**
262    * Property name for the Solr score.
263    */
264   public static final String ATH_PROP_SOLR_SCORE = "score";
265 
266   /**
267    * Property name for the file ID.
268    */
269   public static final String ATH_PROP_FILE_ID = "fileId";
270 
271   /**
272    * Property name for the file name.
273    */
274   public static final String ATH_PROP_FILE_NAME = "fileName";
275 
276   /** Property name for the document ID (UUID) inside a TM entry. */
277   public static final String ATH_PROP_DOC_ID = "docId";
278 
279   /** Property name for the document file name. */
280   public static final String ATH_PROP_DOC_FILE_NAME = "docFileName";
281 
282   public static final String ATH_PROP_DOC_STORAGE_NAME = "docStorageName";
283 
284   public static final String ATH_PROP_DOC_TRL_STORAGE_NAME = "docTrlStorageName";
285 
286   public static final String ATH_PROP_DOC_OUT_STORAGE_NAME = "docOutStorageName";
287 
288   /** Property name for the document file encoding. */
289   public static final String ATH_PROP_DOC_FILE_ENCODING = "docFileEncoding";
290 
291   /** Property name for the trl (2nd input) document file encoding. */
292   public static final String ATH_PROP_DOC_TRL_FILE_ENCODING = "docTrlFileEncoding";
293 
294   /** Property name for the document output file encoding. */
295   public static final String ATH_PROP_DOC_OUT_FILE_ENCODING = "docOutFileEncoding";
296 
297   /** Property name for the filter ID (string). */
298   public static final String ATH_PROP_FILTER_ID = "filterId";
299 
300   /** Property name for the filter parameters (string). */
301   public static final String ATH_PROP_FILTER_PARAMS = "filterParams";
302 
303   /** Property name for the source segmentation rules (string). */
304   public static final String ATH_PROP_SRC_SRX = "srcSrx";
305 
306   /** Property name for the target segmentation rules (string). */
307   public static final String ATH_PROP_TRG_SRX = "trgSrx";
308 
309   /**
310    * Property name for the source language.
311    */
312   public static final String ATH_PROP_SRC_LANG = "srcLang";
313 
314   /**
315    * Property name for the target language.
316    */
317   public static final String ATH_PROP_TRG_LANG = "trgLang";
318 
319   // General properties
320   /**
321    * Property name for the status.
322    */
323   public static final String ATH_PROP_STATUS = "status";
324 
325   /**
326    * Property name for the error message.
327    */
328   public static final String ATH_PROP_ERROR_MESSAGE = "errorMessage";
329 
330   /**
331    * Property name for the error type.
332    */
333   public static final String ATH_PROP_ERROR_TYPE = "errorType";
334 
335   /**
336    * Property name for the name.
337    */
338   public static final String ATH_PROP_NAME = "name";
339 
340   /**
341    * Property name for the type.
342    */
343   public static final String ATH_PROP_TYPE = "type";
344 
345   /**
346    * Property name for the CAT tool.
347    */
348   public static final String ATH_PROP_CAT_TOOL = "catTool";
349 
350   /**
351    * Property name for the user ID.
352    */
353   public static final String ATH_PROP_USER_ID = "userId";
354 
355   /**
356    * Property name for the user type.
357    */
358   public static final String ATH_PROP_USER_TYPE = "userType";
359 
360   // File and segment properties
361   /**
362    * Property name for the source.
363    */
364   public static final String ATH_PROP_SOURCE = "source";
365 
366   public static final String ATH_PROP_SOURCE_WITH_CODES = "sourceWithCodes";
367 
368   public static final String ATH_PROP_TARGET_WITH_CODES = "targetWithCodes";
369   /**
370    * Property name for the target.
371    */
372   public static final String ATH_PROP_TARGET = "target";
373 
374   // Context properties
375   /**
376    * Property name for the source JSON.
377    */
378   public static final String ATH_PROP_SOURCE_JSON = "sourceJson";
379   /**
380    * Property name for the target JSON.
381    */
382   public static final String ATH_PROP_TARGET_JSON = "targetJson";
383   
384   public static final String ATH_PROP_ALT_TRANS_JSON = "altTransJson";
385   
386   public static final String ATH_PROP_ALT_TRANS_INDEX = "altTransIndex";
387 
388   // ============================================================================================
389   // SEGMENT PROPERTIES
390   // ============================================================================================
391 
392   /** Translation Unit ID */
393   public static final String ATH_PROP_TU_ID = "tuId";
394 
395   /** Segment ID within a translation unit */
396   public static final String ATH_PROP_SEG_ID = "segId";
397 
398   /** Indicates if this segment was merged from multiple segments */
399   public static final String ATH_PROP_MERGED = "merged";
400 
401   /** JSON data about segments this was merged from */
402   public static final String ATH_PROP_MERGED_FROM_SEGMENTS_JSON = "mergedFromSegmentsJson";
403 
404   /** Translator/reviewer notes for the segment */
405   public static final String ATH_PROP_NOTE = "note";
406 
407   /** Indicates if this segment was split from a larger segment */
408   public static final String ATH_PROP_SPLIT = "split";
409 
410   /** JSON data about the segment this was split from */
411   public static final String ATH_PROP_SPLIT_FROM_SEGMENTS_JSON = "splitFromSegmentJson";
412 
413   /** Indicates if the segment is locked for editing */
414   public static final String ATH_PROP_LOCKED = "locked";
415 
416   /** Indicates if the segment has translation memory matches */
417   public static final String ATH_PROP_MATCHED = "matched";
418 
419   /** JSON data about translation memory match information */
420   public static final String ATH_PROP_TM_MATCH_INFO_JSON = "tmMatchInfoJson";
421 
422   /** Position/order of the segment in the document */
423   public static final String ATH_PROP_POSITION = "position";
424 
425   /** Origin/source of the segment (human, MT, TM, etc.) */
426   public static final String ATH_PROP_ORIGIN = "origin";
427   public static final String ATH_PROP_TM_MATCH_SCORE = "tmMatchScore";
428   public static final String ATH_PROP_MT_CONFIDENCE_SCORE = "mtConfidenceScore";
429 
430   // Audit trail properties
431 
432   /**
433    * Property name for created by.
434    */
435   public static final String ATH_PROP_CREATED_BY = "createdBy";
436 
437   /**
438    * Property name for created at.
439    */
440   public static final String ATH_PROP_CREATED_AT = "createdAt";
441 
442   /**
443    * Property name for updated by.
444    */
445   public static final String ATH_PROP_UPDATED_BY = "updatedBy";
446 
447   /**
448    * Property name for updated at.
449    */
450   public static final String ATH_PROP_UPDATED_AT = "updatedAt";
451 
452   /**
453    * Property name for processed by.
454    */
455   public static final String ATH_PROP_PROCESSED_BY = "processedBy";
456 
457   /**
458    * Property name for started at.
459    */
460   public static final String ATH_PROP_STARTED_AT = "startedAt";
461 
462   /**
463    * Property name for finished at.
464    */
465   public static final String ATH_PROP_FINISHED_AT = "finishedAt";
466 
467   // ============================================================================================
468   // MACHINE TRANSLATION PROVIDERS
469   // ============================================================================================
470 
471   /** Google Machine Translation provider identifier */
472   public static final String MT_PROVIDER_GOOGLE_MT = "GoogleMT";
473 
474   /** Google Cloud Translation v3 provider identifier */
475   public static final String MT_PROVIDER_GOOGLE_MT_V3 = "GoogleMTv3";
476   // public static final String PROJECT_ID = "ath-okapi";
477   public static final String US_CENTRAL1_PROJECT_LOCATION = "us-central1";
478 
479   /**
480    * Determines if a machine translation provider requires an API key.
481    * Currently Google MT v2 and v3 require API keys for authentication.
482    * 
483    * @param mtProvider the MT provider name to check
484    * @return true if the provider requires an API key, false otherwise
485    */
486   public static boolean requireApiKey(String mtProvider) {
487     return MT_PROVIDER_GOOGLE_MT.equalsIgnoreCase(mtProvider);
488   }
489 
490   // ============================================================================================
491   // APPLICATION PROPERTY NAMES
492   // ============================================================================================
493 
494   /**
495    * Property name for the CAT name.
496    */
497   public static final String ATH_PROP_CAT_NAME = "cat.name";
498 
499   private static final String ATH_PROP_CAT_SYSTEM_USER_NAME = "cat.system.user.name";
500   private static final String ATH_PROP_CAT_SYSTEM_TEST_USER_NAME = "cat.system.user.name.test";
501   /**
502    * Property name for the CAT version.
503    */
504   public static final String ATH_PROP_CAT_VERSION = "catVersion";
505 
506   /**
507    * Property name for the CAT framework name.
508    */
509   public static final String ATH_PROP_CAT_FRAMEWORK_NAME = "catFrameworkName";
510 
511   /**
512    * Property name for the CAT framework version.
513    */
514   public static final String ATH_PROP_CAT_FRAMEWORK_VERSION = "catFrameworkVersion";
515 
516   /**
517    * Property name for the CAT Solr version.
518    */
519   public static final String ATH_PROP_CAT_SOLR_VERSION = "cat.solr.version";
520 
521   // System properties
522   /**
523    * Property name for the server Java home.
524    */
525   public static final String ATH_PROP_SERVER_JAVA_HOME = "java.home";
526 
527   /**
528    * Property name for the server Java vendor.
529    */
530   public static final String ATH_PROP_SERVER_JAVA_VENDOR = "java.vendor";
531 
532   /**
533    * Property name for the server Java version.
534    */
535   public static final String ATH_PROP_SERVER_JAVA_VERSION = "java.version";
536 
537   /**
538    * Property name for the server Java runtime version.
539    */
540   public static final String ATH_PROP_SERVER_JAVA_RUNTIME_VERSION = "java.runtime.version";
541 
542   /**
543    * Property name for the server OS architecture.
544    */
545   public static final String ATH_PROP_SERVER_OS_ARCHITECTURE = "os.arch";
546 
547   /**
548    * Property name for the server OS name.
549    */
550   public static final String ATH_PROP_SERVER_OS_NAME = "os.name";
551 
552   /**
553    * Property name for the server OS version.
554    */
555   public static final String ATH_PROP_SERVER_OS_VERSION = "os.version";
556 
557   /**
558    * Property name for the server user name.
559    */
560   public static final String ATH_PROP_SERVER_USER_NAME = "user.name";
561 
562   /**
563    * Property name for the server OS user name.
564    */
565   public static final String ATH_PROP_SERVER_OS_USER_NAME = "os.user.name";
566 
567   /**
568    * Property name for the server web name.
569    */
570   public static final String ATH_PROP_SERVER_WEB_NAME = "server.web.name";
571 
572   /**
573    * Property name for the server web version.
574    */
575   public static final String ATH_PROP_SERVER_WEB_VERSION = "server.web.version";
576 
577   /**
578    * Property name for the segment TM score.
579    */
580   public static final String ATH_PROP_SEGMENT_TM_SCORE = "segment.tm.score";
581 
582   // ============================================================================================
583   // RUNTIME PROPERTY VALUES
584   // ============================================================================================
585 
586   // Application identification (loaded from project properties)
587   public static final String CAT_NAME = ProjectProps.getProjectPropValue(ATH_PROP_CAT_NAME);
588 
589   public static final String CAT_SYSTEM_USER_NAME = ProjectProps
590       .getProjectPropValue(ATH_PROP_CAT_SYSTEM_USER_NAME);
591 
592   public static final String CAT_SYSTEM_TEST_USER_NAME = ProjectProps
593       .getProjectPropValue(ATH_PROP_CAT_SYSTEM_TEST_USER_NAME);
594 
595   public static final String CAT_VERSION = ProjectProps.getProjectPropValue("cat.version");
596 
597   public static final String CAT_FRAMEWORK_NAME = ProjectProps
598       .getProjectPropValue("cat.framework.name");
599 
600   public static final String CAT_FRAMEWORK_VERSION = ProjectProps
601       .getProjectPropValue("cat.framework.version");
602 
603   public static final String CAT_SOLR_VERSION = ProjectProps
604       .getProjectPropValue(ATH_PROP_CAT_SOLR_VERSION);
605 
606   // Server environment (loaded from system properties)
607   public static final String SERVER_JAVA_HOME = System.getProperty(ATH_PROP_SERVER_JAVA_HOME);
608   public static final String SERVER_JAVA_VENDOR = System.getProperty(ATH_PROP_SERVER_JAVA_VENDOR);
609   public static final String SERVER_JAVA_VERSION = System.getProperty(ATH_PROP_SERVER_JAVA_VERSION);
610 
611   public static final String SERVER_JAVA_RUNTIME_VERSION = System
612       .getProperty(ATH_PROP_SERVER_JAVA_RUNTIME_VERSION);
613 
614   public static final String SERVER_OS_ARCHITECTURE = System
615       .getProperty(ATH_PROP_SERVER_OS_ARCHITECTURE);
616 
617   public static final String SERVER_OS_NAME = System.getProperty(ATH_PROP_SERVER_OS_NAME);
618   public static final String SERVER_OS_VERSION = System.getProperty(ATH_PROP_SERVER_OS_VERSION);
619   public static final String SERVER_OS_USER_NAME = System.getProperty(ATH_PROP_SERVER_USER_NAME);
620 
621   public static final String SERVER_WEB_NAME = ProjectProps
622       .getProjectPropValue(ATH_PROP_SERVER_WEB_NAME);
623 
624   public static final String SERVER_WEB_VERSION = ProjectProps
625       .getProjectPropValue(ATH_PROP_SERVER_WEB_VERSION);
626 
627   public static final String SEGMENT_TM_SCORE = ProjectProps
628       .getProjectPropValue(ATH_PROP_SEGMENT_TM_SCORE);
629 
630   // ============================================================================================
631   // USER AND SYSTEM VALUES
632   // ============================================================================================
633 
634   /** Default value for unassigned user fields */
635   public static final String USER_UNASSIGNED = "unassigned";
636 
637   /**
638    * Application identifier string combining name, version, framework name and version.
639    * Used in the "createdWith" field to track which version of the application created data.
640    * Dots are replaced with underscores to avoid conflicts in some contexts.
641    */
642   public static final String ATH_CREATED_WITH = Log.format("{}.{}.{}.{}",
643       Const.CAT_NAME.replaceAll(".", "_"), Const.CAT_VERSION.replaceAll(".", "_"),
644       Const.CAT_FRAMEWORK_NAME.replaceAll(".", "_"),
645       Const.CAT_FRAMEWORK_VERSION.replaceAll(".", "_"));
646 
647   // ============================================================================================
648   // STATIC INITIALIZATION
649   // ============================================================================================
650 
651   static {
652     // Initialize TMX date formatter with ISO 8601 format and configured timezone
653     TMX_DATE_FORMAT = new SimpleDateFormat(ProjectProps.getProjectPropValue("date.format.tmx"));
654 
655     TMX_DATE_FORMAT.setTimeZone(
656         TimeZone.getTimeZone(ProjectProps.getProjectPropValue("date.format.tmx.timezone")));
657 
658     QUARTZ_DATE_FORMAT = new SimpleDateFormat(
659         ProjectProps.getProjectPropValue("date.format.quartz"));
660 
661     QUARTZ_DATE_FORMAT.setTimeZone(
662         TimeZone.getTimeZone(ProjectProps.getProjectPropValue("date.format.quartz.timezone")));
663   }
664 
665   // ============================================================================================
666   // FILTER CONFIGURATION BUILDERS
667   // ============================================================================================
668 
669   /**
670    * Builds a default configuration ID for a given filter.
671    * Combines the filter name with a suffix from project properties.
672    * 
673    * @param filter the Okapi filter to build configuration ID for
674    * @return configuration ID string
675    */
676   public static String buildDefConfigId(IFilter filter) {
677     return buildDefConfigId(filter.getName());
678   }
679 
680   /**
681    * Builds a default configuration ID for a given filter name.
682    * 
683    * @param filterName the name of the filter
684    * @return configuration ID string
685    */
686   public static String buildDefConfigId(String filterName) {
687     return filterName + ProjectProps.getProjectPropValue("default.config.id.suffix");
688   }
689 
690   /**
691    * Builds a default configuration name for a given filter.
692    * 
693    * @param filter the Okapi filter (parameter not used, loads from properties)
694    * @return default configuration name from properties
695    */
696   public static String buildDefConfigName(IFilter filter) {
697     return ProjectProps.getProjectPropValue("default.config.name");
698   }
699 
700   /**
701    * Builds a default configuration note/description for a given filter.
702    * Combines the filter's display name with a suffix from project properties.
703    * 
704    * @param filter the Okapi filter to build note for
705    * @return configuration note string
706    */
707   public static String buildDefConfigNote(IFilter filter) {
708     return filter.getDisplayName() + ProjectProps.getProjectPropValue("default.config.note.suffix");
709   }
710 
711   /**
712    * Gets the MIME type for a filter's default configuration.
713    * 
714    * @param filter the Okapi filter
715    * @return the filter's MIME type
716    */
717   public static String buildDefConfigMimeType(IFilter filter) {
718     return filter.getMimeType();
719   }
720 
721   /**
722    * Gets the file extensions for a filter's default configuration.
723    * Currently returns "*" (all extensions) for all filters.
724    * 
725    * @param filter the Okapi filter (parameter not used)
726    * @return "*" indicating all file extensions are supported
727    */
728   public static String buildDefConfigFileExtensions(IFilter filter) {
729     return "*";
730   }
731 
732   // ============================================================================================
733   // MICROSOFT OFFICE DOCUMENT CONSTANTS
734   // ============================================================================================
735 
736   /** Office Open XML core document relationship type */
737   public static final String CORE_DOCUMENT = "http://schemas.openxmlformats.org/officeDocument/2006/"
738       + "relationships/officeDocument";
739 
740   /** Office Open XML styles part relationship type */
741   public static final String STYLE_PART = "http://schemas.openxmlformats.org/officeDocument/2006/"
742       + "relationships/styles";
743 
744   // ============================================================================================
745   // SOLR CORES
746   // ============================================================================================
747   public static final String SOLR_CORE_ATH_DOCS = "ath_docs";
748   public static final String SOLR_CORE_ATH_DOC_SEGMENTS = "ath_doc_segments";
749 
750   public static final String SOLR_CORE_ATH_TMS = "ath_tms";
751   public static final String SOLR_CORE_ATH_TM_SEGMENTS = "ath_tm_segments";
752 }