View Javadoc

1   package org.gnomekr.potron.service;
2   
3   import java.io.IOException;
4   import java.io.Reader;
5   import java.io.Writer;
6   import java.util.List;
7   
8   import org.gnomekr.potron.data.TranslatedEntry;
9   import org.gnomekr.potron.data.Translation;
10  import org.gnomekr.potron.parser.ParseException;
11  
12  /***
13   * ITranslationManager.java
14   * @author Xavier Cho
15   * @version $Revision 1.1 $ $Date: 2005/09/11 05:49:44 $
16   */
17  public interface ITranslationManager {
18  
19      /***
20       * @param translation
21       * @return
22       */
23      long addTranslation(Translation translation);
24  
25      /***
26       * @param translation
27       * @param reader
28       * @return
29       */
30      long addTranslation(Translation translation, Reader reader)
31              throws ParseException, IOException;
32  
33      /***
34       * Generate a "po" from all translated entries for the given translation. 
35       * 
36       * @param id the translation to export
37       * @param writer the writer object export to
38       * @throws IOException
39       */
40      void exportTranslation(long id, Writer writer) throws IOException;
41  
42      /***
43       * @param id
44       * @return
45       */
46      Translation getTranslation(long id);
47  
48      /***
49       * @param translation
50       */
51      void updateTranslation(Translation translation);
52  
53      /***
54       * @param translation
55       * @param reader
56       * @throws ParseException
57       * @throws IOException
58       */
59      void updateTranslation(Translation translation, Reader reader)
60              throws ParseException, IOException;
61  
62      /***
63       * @param id
64       */
65      void removeTranslation(long id);
66  
67      /***
68       * @param translationId
69       * @return
70       */
71      List<TranslatedEntry> getTranslatedEntries(long translationId);
72  
73      /***
74       * @param translationId
75       * @param includeCheckedOutEntries
76       * @return
77       */
78      List<TranslatedEntry> getUntranslatedEntries(
79              long translationId,
80              boolean includeCheckedOutEntries);
81  
82      /***
83       * @param translationId
84       * @param includeCheckedOutEntries
85       * @return
86       */
87      List<TranslatedEntry> getFuzzyEntries(
88              long translationId,
89              boolean includeCheckedOutEntries);
90  
91      /***
92       * @param id
93       * @return
94       */
95      TranslatedEntry getEntry(long id);
96  
97      /***
98       * @param translationId
99       * @return
100      */
101     List<TranslatedEntry> getCheckedOutEntries(long translationId);
102 
103     /***
104      * @param userName
105      * @return
106      */
107     List<TranslatedEntry> getCheckedOutEntries(String userName);
108 
109     /***
110      * @param entryId
111      * @return
112      * @throws AlreadyCheckedOutException
113      */
114     TranslatedEntry checkOutEntry(long entryId)
115             throws AlreadyCheckedOutException;
116 
117     /***
118      * @param translatedEntryId
119      */
120     void abandonCheckedOutEntry(long translatedEntryId);
121 
122     /***
123      * @param entryId
124      * @param translatedString
125      * @param fuzzy
126      */
127     void checkInEntry(long entryId, String translatedString, boolean fuzzy);
128 
129     /***
130      * @param entryId
131      * @param translatedString
132      * @param pluralStrings
133      * @param fuzzy
134      */
135     void checkInEntry(
136             long entryId,
137             String translatedString,
138             List<String> pluralStrings,
139             boolean fuzzy);
140 }