2
* $Log: MpBizCompanyData.java,v $
3
* Revision 1.1 2004/01/21 17:11:31 m16e
6
* Revision 1.2 2003/07/24 16:49:30 carlos
7
* *** empty log message ***
9
* Revision 1.1.1.1 2003/07/23 00:33:50 carlos
12
* Revision 1.1.1.1 2003/07/22 14:04:37 carlos
15
* Revision 1.1.1.1 2003/07/17 14:56:39 carlos
18
* Revision 1.1.1.1 2003/07/15 17:03:30 carlos
21
* Revision 1.1.1.1 2003/06/19 02:23:17 carlos
22
* restarting point - v1r01
24
* Revision 1.1.1.1 2003/03/31 11:25:29 carlos
25
* Starting point (v. 1.1-pre1)
30
package com.m16e.mpbiz;
38
import com.m16e.free.tools.files.*;
39
import com.m16e.free.tools.xml.*;
41
////////////////////////////////////////////////////////////
42
public class MpBizCompanyData
44
public static final String FILE_NAME = "company-data.xml";
46
public static final String TAG_CAPITAL = "capital";
47
public static final String TAG_COMPANY_DATA = "company-data";
48
public static final String TAG_COMPANY_SHORT_NAME = "company-short-name";
49
public static final String TAG_COMPANY_LONG_NAME = "company-long-name";
50
public static final String TAG_COMPANY_ADDRESS_1 = "company-address-1";
51
public static final String TAG_COMPANY_ADDRESS_2 = "company-address-2";
52
public static final String TAG_FINANTIAL_ID = "finantial-id";
53
public static final String TAG_REGISTO= "registo";
54
public static final String TAG_TELEPHONES = "telephones";
55
public static final String TAG_TELEPHONE = "telephone";
56
public static final String TAG_URL = "url";
57
public static final String TAG_EMAIL = "e-mail";
58
public static final String TAG_LOGO = "logo";
60
public static final String ATTR_NAME = "name";
62
String shortCompanyName = null;
63
String longCompanyName = null;
64
String companyAddress1 = null;
65
String companyAddress2 = null;
66
String finantialId = null;
67
String capitalSocial = null;
68
String registo = null;
70
Object[][] telephones = null;
73
ImageIcon logo = null;
75
////////////////////////////////////////////////////////////
76
public MpBizCompanyData()
79
String companyFile = FileUtils.readFile( FILE_NAME );
80
String elCompanyData =
81
XmlInterpreter.getElement( companyFile, TAG_COMPANY_DATA );
83
XmlInterpreter.getElementValue( elCompanyData, TAG_COMPANY_DATA );
86
XmlInterpreter.getElementValue( companyData, TAG_COMPANY_SHORT_NAME );
88
XmlInterpreter.getElementValue( companyData, TAG_COMPANY_LONG_NAME );
90
XmlInterpreter.getElementValue( companyData, TAG_COMPANY_ADDRESS_1 );
92
XmlInterpreter.getElementValue( companyData, TAG_COMPANY_ADDRESS_2 );
94
XmlInterpreter.getElementValue( companyData, TAG_FINANTIAL_ID );
96
XmlInterpreter.getElementValue( companyData, TAG_CAPITAL );
98
XmlInterpreter.getElementValue( companyData, TAG_REGISTO );
100
XmlInterpreter.getElement( companyData, TAG_TELEPHONES );
102
XmlInterpreter.getElementArray( elTelephones, TAG_TELEPHONE );
105
telephones = new Object[ aux.length ] [ 2 ];
106
for ( int f = 0; f < aux.length; f++ )
109
XmlInterpreter.getAttributeValue( aux[f], ATTR_NAME );
111
XmlInterpreter.getElementValue( aux[f], TAG_TELEPHONE );
115
telephones = new Object[0][];
117
XmlInterpreter.getElementValue( companyData, TAG_URL );
119
XmlInterpreter.getElementValue( companyData, TAG_EMAIL );
121
XmlInterpreter.getElementValue( companyData, TAG_LOGO );
122
if ( aux2.length() > 0 )
123
logo = new ImageIcon( aux2 );
126
////////////////////////////////////////////////////////////
127
public String getShortCompanyName() { return shortCompanyName; }
128
public String getLongCompanyName() { return longCompanyName; }
129
public String getCompanyAddress1() { return companyAddress1; }
130
public String getCompanyAddress2() { return companyAddress2; }
131
public String getFinantialId() { return finantialId; }
132
public String getCapitalSocial() { return capitalSocial; }
133
public String getRegisto() { return registo; }
134
public Object[][] getTelephones() { return telephones; }
136
////////////////////////////////////////////////////////////
137
public String getTelAndFax()
139
return "Tel: " + telephones[0][1] + " - Fax: " + telephones[1][1];
142
////////////////////////////////////////////////////////////
143
public String getUrl() { return url; }
144
public String getEmail() { return email; }
145
public ImageIcon getLogo() { return logo; }
147
////////////////////////////////////////////////////////////