OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 73 | Rev 91 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 73 Rev 83
Line 118... Line 118...
118
            System.out.println("Warning: no default directory stored for PFD output");
118
            System.out.println("Warning: no default directory stored for PFD output");
119
            propertyDefaultPDFDirectory = propertyDefaultDirectory;
119
            propertyDefaultPDFDirectory = propertyDefaultDirectory;
120
        }
120
        }
121
 
121
 
122
        storage.setPDFDefaultDirectory(new File(propertyDefaultPDFDirectory));
122
        storage.setPDFDefaultDirectory(new File(propertyDefaultPDFDirectory));
-
 
123
 
-
 
124
 
123
        register(DevisXmlSheet.TEMPLATE_ID, DevisXmlSheet.TEMPLATE_PROPERTY_NAME, AbstractGenerationDocumentPreferencePanel.getLabelFromTable("DEVIS"));
125
            register(DevisXmlSheet.TEMPLATE_ID, DevisXmlSheet.TEMPLATE_PROPERTY_NAME, AbstractGenerationDocumentPreferencePanel.getLabelFromTable("DEVIS"));
124
        register(VenteFactureXmlSheet.TEMPLATE_ID, VenteFactureXmlSheet.TEMPLATE_PROPERTY_NAME, AbstractGenerationDocumentPreferencePanel.getLabelFromTable("SAISIE_VENTE_FACTURE"));
126
            register(VenteFactureXmlSheet.TEMPLATE_ID, VenteFactureXmlSheet.TEMPLATE_PROPERTY_NAME, AbstractGenerationDocumentPreferencePanel.getLabelFromTable("SAISIE_VENTE_FACTURE"));
125
        register(CommandeClientXmlSheet.TEMPLATE_ID, CommandeClientXmlSheet.TEMPLATE_PROPERTY_NAME, AbstractGenerationDocumentPreferencePanel.getLabelFromTable("COMMANDE_CLIENT"));
127
            register(CommandeClientXmlSheet.TEMPLATE_ID, CommandeClientXmlSheet.TEMPLATE_PROPERTY_NAME, AbstractGenerationDocumentPreferencePanel.getLabelFromTable("COMMANDE_CLIENT"));
126
        register(BonLivraisonXmlSheet.TEMPLATE_ID, BonLivraisonXmlSheet.TEMPLATE_PROPERTY_NAME, AbstractGenerationDocumentPreferencePanel.getLabelFromTable("BON_DE_LIVRAISON"));
128
            register(BonLivraisonXmlSheet.TEMPLATE_ID, BonLivraisonXmlSheet.TEMPLATE_PROPERTY_NAME, AbstractGenerationDocumentPreferencePanel.getLabelFromTable("BON_DE_LIVRAISON"));
127
        register(AvoirClientXmlSheet.TEMPLATE_ID, AvoirClientXmlSheet.TEMPLATE_PROPERTY_NAME, AbstractGenerationDocumentPreferencePanel.getLabelFromTable("AVOIR_CLIENT"));
129
            register(AvoirClientXmlSheet.TEMPLATE_ID, AvoirClientXmlSheet.TEMPLATE_PROPERTY_NAME, AbstractGenerationDocumentPreferencePanel.getLabelFromTable("AVOIR_CLIENT"));
Line 145... Line 147...
145
        register(ReleveChequeEmisSheet.TEMPLATE_ID, ReleveChequeEmisSheet.TEMPLATE_PROPERTY_NAME, null);
147
            register(ReleveChequeEmisSheet.TEMPLATE_ID, ReleveChequeEmisSheet.TEMPLATE_PROPERTY_NAME, null);
146
        storage.dump();
148
        storage.dump();
147
 
149
 
148
    }
150
    }
149
 
151
 
-
 
152
    public void preventecRegister(String path, String templateId, String defaultSubFolder) {
-
 
153
        if (templateId == null) {
-
 
154
            throw new IllegalArgumentException("null template id");
-
 
155
        }
-
 
156
 
-
 
157
        if (TemplateManager.getInstance().isKnwonTemplate(templateId)) {
-
 
158
            System.err.println("Warning: registering known template id : " + templateId);
-
 
159
        }
-
 
160
        final DocumentLocalStorageManager storage = DocumentLocalStorageManager.getInstance();
-
 
161
        if (defaultSubFolder != null) {
-
 
162
            storage.addDocumentDirectory(templateId, new File(path, defaultSubFolder));
-
 
163
            storage.addPDFDirectory(templateId, new File(path, defaultSubFolder));
-
 
164
        } else {
-
 
165
            storage.addDocumentDirectory(templateId, new File(path));
-
 
166
            storage.addPDFDirectory(templateId, new File(path));
-
 
167
        }
-
 
168
    }
-
 
169
 
150
    public void register(String templateId, String propertyBaseName, String defaultSubFolder) {
170
    public void register(String templateId, String propertyBaseName, String defaultSubFolder) {
151
        if (templateId == null) {
171
        if (templateId == null) {
152
            throw new IllegalArgumentException("null template id");
172
            throw new IllegalArgumentException("null template id");
153
        }
173
        }
154
        if (propertyBaseName == null) {
174
        if (propertyBaseName == null) {
Line 191... Line 211...
191
 
211
 
192
        final ComptaPropsConfiguration configuration = (ComptaPropsConfiguration) ComptaPropsConfiguration.getInstance();
212
        final ComptaPropsConfiguration configuration = (ComptaPropsConfiguration) ComptaPropsConfiguration.getInstance();
193
        if (!configuration.isOnCloud()) {
213
        if (!configuration.isOnCloud()) {
194
            provider = new DefaultLocalTemplateProvider();
214
            provider = new DefaultLocalTemplateProvider();
195
            if (property != null) {
215
            if (property != null) {
-
 
216
                File storage = new File(property);
196
                ((DefaultLocalTemplateProvider) provider).setBaseDirectory(new File(property));
217
                ((DefaultLocalTemplateProvider) provider).setBaseDirectory(storage);
197
            }
218
            }
198
        } else {
219
        } else {
199
            provider = new DefaultCloudTemplateProvider(configuration.getSocieteID());
220
            provider = new DefaultCloudTemplateProvider(configuration.getSocieteID());
200
        }
221
        }
201
 
222