01: package com.xoetrope.carousel.langed;
02:
03: import java.util.Vector;
04:
05: /**
06: * <p>Language Resource Translation Utility</p>
07: * <p> Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
08: * the GNU Public License (GPL), please see license.txt for more details. If
09: * you make commercial use of this software you must purchase a commercial
10: * license from Xoetrope.</p>
11: * <p> $Revision: 1.4 $</p>
12: */
13: public class TranslationObject //extends TableMapping
14: {
15: // public static final int FIELD_ID = TableMapping.FIELD_ID;
16: // public static final int FIELD_REFERENCE = 1;
17: // public static final int FIELD_HINTS = 2;
18: // public static final int FIELD_ENGLISH = 3;
19: // public static int numFields = 0;
20: //
21: // private static final TranslationObject prototype = new TranslationObject();
22: //
23: // public String getName()
24: // {
25: // return getStringFieldValue( FIELD_NAME );
26: // }
27: //
28: // public int getId()
29: // {
30: // return ( int ) getlongFieldValue( FIELD_ID );
31: // }
32: //
33: // public String validate( boolean forInsert )
34: // {
35: // String ret = null;
36: // if ( forInsert && ( getlongFieldValue( FIELD_ID ) != -1 ) )
37: // ret += "The translation ID has already been set !";
38: // else if ( getStringFieldValue( FIELD_NAME ).length() == 0 )
39: // ret += "The translation name cannot be blank!";
40: // return ret;
41: // }
42: //
43: // private void getTranslation( long ID )
44: // {
45: // getObject( ID );
46: // }
47: //
48: // public TranslationObject()
49: // {
50: // }
51: //
52: // public TranslationObject( long _ID )
53: // {
54: // getObject( _ID );
55: // }
56: //
57: // public void configureTable()
58: // {
59: // tableName = ( ( ( prototype == null ) || ( prototype.tableName == null ) ) ? "CS_TRANSLATION" : prototype.tableName );
60: //
61: // configureWithMetaData( prototype == null ? this : prototype );
62: // }
63: //
64: // public static void setTableName( String name )
65: // {
66: // if ( name.compareTo( prototype.tableName ) == 0 )
67: // return;
68: //
69: // prototype.tableName = name;
70: // prototype.fields = new Vector();
71: // prototype.configureWithMetaData( prototype );
72: // }
73: //
74: // public static final TranslationObject getPrototype()
75: // {
76: // return prototype;
77: // }
78: //
79: // public int getNumFields()
80: // {
81: // return numFields = fields.size();
82: // }
83: //
84: // /**
85: // * Add a new language field to the database table
86: // * @param code the ISO code for the language, used as the field name
87: // */
88: // public static void addLanguage( String code )
89: // {
90: // try {
91: // new DataConnection( "default" ).executeUpdate( "ALTER TABLE " + prototype.tableName + " ADD " + code.toUpperCase() + " NATIONAL CHAR VARYING(4000)" );
92: // }
93: // catch ( Exception ex ) {
94: // ex.printStackTrace();
95: // }
96: // }
97: }
|