KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > knowgate > hipergate > CategoryLabel


1 /*
2   Copyright (C) 2003 Know Gate S.L. All rights reserved.
3                       C/Oņa, 107 1š2 28050 Madrid (Spain)
4
5   Redistribution and use in source and binary forms, with or without
6   modification, are permitted provided that the following conditions
7   are met:
8
9   1. Redistributions of source code must retain the above copyright
10      notice, this list of conditions and the following disclaimer.
11
12   2. The end-user documentation included with the redistribution,
13      if any, must include the following acknowledgment:
14      "This product includes software parts from hipergate
15      (http://www.hipergate.org/)."
16      Alternately, this acknowledgment may appear in the software itself,
17      if and wherever such third-party acknowledgments normally appear.
18
19   3. The name hipergate must not be used to endorse or promote products
20      derived from this software without prior written permission.
21      Products derived from this software may not be called hipergate,
22      nor may hipergate appear in their name, without prior written
23      permission.
24
25   This library is distributed in the hope that it will be useful,
26   but WITHOUT ANY WARRANTY; without even the implied warranty of
27   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
28
29   You should have received a copy of hipergate License with this code;
30   if not, visit http://www.hipergate.org or mail to info@hipergate.org
31 */

32
33 package com.knowgate.hipergate;
34
35 import com.knowgate.jdc.JDCConnection;
36 import com.knowgate.dataobjs.DB;
37 import com.knowgate.dataobjs.DBPersist;
38
39 import java.sql.SQLException JavaDoc;
40
41 /**
42  * Category Translated Labels
43  * @author Sergio Montoro
44  * @version 1.0
45  */

46 public class CategoryLabel extends DBPersist {
47
48   /**
49    * Create empty label
50    */

51   public CategoryLabel() {
52     super(DB.k_cat_labels, "CategoryLabel");
53   }
54
55   /**
56    * Load label from database
57    * @param sCatId Category GUID
58    * @param sLanguage 2 characters language code (see k_lu_languages table)
59    */

60   public CategoryLabel(String JavaDoc sCatId, String JavaDoc sLanguage) {
61     super(DB.k_cat_labels, "CategoryLabel");
62     put(DB.gu_category, sCatId);
63     put(DB.id_language, sLanguage);
64   }
65
66   // **********************************************************
67
// Static Methods
68

69   /**
70    * Single Step label Create and Store
71    * @param oConn Database Conenction
72    * @param Values An Array with values { (String) gu_category, (String) id_language,
73    * (String) tr_category, (String) url_category }
74    * @throws SQLException
75    */

76   public static void create(JDCConnection oConn, Object JavaDoc[] Values) throws SQLException JavaDoc {
77     CategoryLabel oLbl = new CategoryLabel();
78
79     oLbl.put(DB.gu_category, Values[0]);
80     oLbl.put(DB.id_language, Values[1]);
81     oLbl.put(DB.tr_category, Values[2]);
82     oLbl.put(DB.url_category, Values[3]);
83
84     if (Values.length>4) oLbl.put(DB.de_category, Values[4]);
85
86     oLbl.store(oConn);
87   }
88
89   // **********************************************************
90
// Public Constants
91

92   public static final short ClassId = 11;
93 }
Popular Tags