OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 149 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 149 Rev 156
1
/*
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
3
 * 
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
5
 * 
5
 * 
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
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
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
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.
9
 * language governing permissions and limitations under the License.
10
 * 
10
 * 
11
 * When distributing the software, include this License Header Notice in each file.
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
12
 */
13
 
13
 
14
 package org.openconcerto.erp.core.edm;
14
 package org.openconcerto.erp.core.edm;
15
 
15
 
16
import java.util.ArrayList;
-
 
17
import java.util.List;
-
 
18
 
-
 
19
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
16
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
20
import org.openconcerto.sql.element.BaseSQLComponent;
17
import org.openconcerto.sql.element.BaseSQLComponent;
21
import org.openconcerto.sql.element.SQLComponent;
18
import org.openconcerto.sql.element.SQLComponent;
22
 
19
 
-
 
20
import java.util.ArrayList;
-
 
21
import java.util.List;
-
 
22
 
23
public class AttachmentSQLElement extends ComptaSQLConfElement {
23
public class AttachmentSQLElement extends ComptaSQLConfElement {
24
 
24
 
25
    public static final String DIRECTORY_PREFS = "EDMdirectory";
25
    public static final String DIRECTORY_PREFS = "EDMdirectory";
26
 
26
 
27
    public AttachmentSQLElement() {
27
    public AttachmentSQLElement() {
28
        super("ATTACHMENT", "un attachement", "attachements");
28
        super("ATTACHMENT", "un attachement", "attachements");
29
    }
29
    }
30
 
30
 
31
    protected List<String> getListFields() {
31
    protected List<String> getListFields() {
32
        final List<String> l = new ArrayList<>(10);
32
        final List<String> l = new ArrayList<>(10);
33
        l.add("SOURCE_TABLE");
33
        l.add("SOURCE_TABLE");
34
        l.add("SOURCE_ID");
34
        l.add("SOURCE_ID");
35
        l.add("NAME");
35
        l.add("NAME");
36
        l.add("MIMETYPE");
36
        l.add("MIMETYPE");
37
        l.add("FILENAME");
37
        l.add("FILENAME");
38
        l.add("STORAGE_PATH");
38
        l.add("STORAGE_PATH");
39
        l.add("THUMBNAIL");
39
        l.add("THUMBNAIL");
40
        l.add("THUMBNAIL_WIDTH");
40
        l.add("THUMBNAIL_WIDTH");
41
        l.add("THUMBNAIL_HEIGHT");
41
        l.add("THUMBNAIL_HEIGHT");
42
        l.add("TAG");
42
        l.add("TAG");
43
        return l;
43
        return l;
44
    }
44
    }
45
 
45
 
46
    @Override
46
    @Override
47
    protected List<String> getComboFields() {
47
    protected List<String> getComboFields() {
48
        final List<String> l = new ArrayList<>(1);
48
        final List<String> l = new ArrayList<>(1);
49
        l.add("NAME");
49
        l.add("NAME");
50
        return l;
50
        return l;
51
    }
51
    }
52
 
52
 
53
    @Override
53
    @Override
54
    protected String getParentFFName() {
54
    protected String getParentFFName() {
55
        return "ID_PARENT";
55
        return "ID_PARENT";
56
    }
56
    }
57
 
57
 
58
    public SQLComponent createComponent() {
58
    public SQLComponent createComponent() {
59
        return new BaseSQLComponent(this) {
59
        return new BaseSQLComponent(this) {
60
            public void addViews() {
60
            public void addViews() {
61
            }
61
            }
62
        };
62
        };
63
    }
63
    }
64
 
64
 
65
    @Override
65
    @Override
66
    protected String createCode() {
66
    protected String createCode() {
67
        return createCodeFromPackage() + ".attachment";
67
        return "edm.attachment";
68
    }
68
    }
69
}
69
}