142 |
ilm |
1 |
/*
|
|
|
2 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
|
|
3 |
*
|
|
|
4 |
* Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
|
|
|
5 |
*
|
|
|
6 |
* The contents of this file are subject to the terms of the GNU General Public License Version 3
|
|
|
7 |
* only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
|
|
|
8 |
* copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
|
|
|
9 |
* language governing permissions and limitations under the License.
|
|
|
10 |
*
|
|
|
11 |
* When distributing the software, include this License Header Notice in each file.
|
|
|
12 |
*/
|
|
|
13 |
|
|
|
14 |
package org.openconcerto.erp.core.edm;
|
|
|
15 |
|
|
|
16 |
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
|
|
|
17 |
import org.openconcerto.sql.element.BaseSQLComponent;
|
|
|
18 |
import org.openconcerto.sql.element.SQLComponent;
|
|
|
19 |
|
156 |
ilm |
20 |
import java.util.ArrayList;
|
|
|
21 |
import java.util.List;
|
|
|
22 |
|
142 |
ilm |
23 |
public class AttachmentSQLElement extends ComptaSQLConfElement {
|
|
|
24 |
|
180 |
ilm |
25 |
public static final String EDM_KEY_METADATA = "EDM_KEY";
|
|
|
26 |
|
149 |
ilm |
27 |
public static final String DIRECTORY_PREFS = "EDMdirectory";
|
142 |
ilm |
28 |
|
180 |
ilm |
29 |
public static final String ITEM_SOURCE_TABLE = "source.table";
|
|
|
30 |
public static final String ITEM_SOURCE_ID = "source.id";
|
|
|
31 |
public static final String ITEM_NAME = "name";
|
|
|
32 |
public static final String ITEM_MIMETYPE = "mimetype";
|
|
|
33 |
public static final String ITEM_FILENAME = "filename";
|
|
|
34 |
public static final String ITEM_STORAGE_PATH = "storage.path";
|
|
|
35 |
public static final String ITEM_THUMBNAIL = "thumbnail";
|
|
|
36 |
public static final String ITEM_THUMBNAIL_WIDTH = "thumbnail.width";
|
|
|
37 |
public static final String ITEM_THUMBNAIL_HEIGHT = "thumbnail.height";
|
|
|
38 |
public static final String ITEM_TAG = "tag";
|
|
|
39 |
public static final String ITEM_PARENT = "parent.id";
|
|
|
40 |
|
142 |
ilm |
41 |
public AttachmentSQLElement() {
|
|
|
42 |
super("ATTACHMENT", "un attachement", "attachements");
|
|
|
43 |
}
|
|
|
44 |
|
|
|
45 |
protected List<String> getListFields() {
|
149 |
ilm |
46 |
final List<String> l = new ArrayList<>(10);
|
142 |
ilm |
47 |
l.add("SOURCE_TABLE");
|
|
|
48 |
l.add("SOURCE_ID");
|
|
|
49 |
l.add("NAME");
|
|
|
50 |
l.add("MIMETYPE");
|
|
|
51 |
l.add("FILENAME");
|
|
|
52 |
l.add("STORAGE_PATH");
|
|
|
53 |
l.add("THUMBNAIL");
|
|
|
54 |
l.add("THUMBNAIL_WIDTH");
|
|
|
55 |
l.add("THUMBNAIL_HEIGHT");
|
|
|
56 |
l.add("TAG");
|
|
|
57 |
return l;
|
|
|
58 |
}
|
|
|
59 |
|
149 |
ilm |
60 |
@Override
|
142 |
ilm |
61 |
protected List<String> getComboFields() {
|
149 |
ilm |
62 |
final List<String> l = new ArrayList<>(1);
|
142 |
ilm |
63 |
l.add("NAME");
|
|
|
64 |
return l;
|
|
|
65 |
}
|
|
|
66 |
|
149 |
ilm |
67 |
@Override
|
|
|
68 |
protected String getParentFFName() {
|
|
|
69 |
return "ID_PARENT";
|
|
|
70 |
}
|
|
|
71 |
|
142 |
ilm |
72 |
public SQLComponent createComponent() {
|
|
|
73 |
return new BaseSQLComponent(this) {
|
|
|
74 |
public void addViews() {
|
|
|
75 |
}
|
|
|
76 |
};
|
|
|
77 |
}
|
|
|
78 |
|
|
|
79 |
@Override
|
|
|
80 |
protected String createCode() {
|
156 |
ilm |
81 |
return "edm.attachment";
|
142 |
ilm |
82 |
}
|
|
|
83 |
}
|