source: vlo/branches/vlo-3.0/vlo-commons/src/main/java/eu/clarin/cmdi/vlo/config/VloConfig.java @ 4584

Last change on this file since 4584 was 4584, checked in by twagoo, 10 years ago

added collectionFacet property to VloConfig? (class+xml)

File size: 23.7 KB
Line 
1package eu.clarin.cmdi.vlo.config;
2
3import java.io.UnsupportedEncodingException;
4import java.net.URLEncoder;
5import java.util.ArrayList;
6import java.util.List;
7import javax.xml.bind.annotation.XmlElement;
8import javax.xml.bind.annotation.XmlElementWrapper;
9import javax.xml.bind.annotation.XmlRootElement;
10
11/**
12 * VLO configuration
13 *
14 * @author keeloo, twagoo
15 */
16@XmlRootElement(name = "VloConfig")
17public class VloConfig {
18
19    /*
20     * VLO application parameter members<br><br>
21     *
22     * Please Initialise the annotated members in a proper way. This will allow
23     * them to be linearised to corresponding elements in an XML file.
24     *
25     * Please refer to the general VLO documentation for a description of the
26     * member parameters.
27     */
28    // page cache related parameters
29    private int pagesInApplicationCache = 0;
30
31    private int sessionCacheSize = 0;
32
33    // data base related parameters
34    private String solrUrl = "";
35
36    // directive for Simple
37    private boolean deleteAllFirst = false;
38
39    private int maxDocsInList = 0;
40
41    private int minDocsInSolrQueue = 0;
42
43    //(required = false)
44    private int solrTimeOut = 0;
45
46    @XmlElementWrapper(name = "dataRoots")
47    @XmlElement(name = "DataRoot")
48    private List<DataRoot> dataRoot;
49
50    private int maxFileSize = 0;
51
52    private int maxDaysInSolr = 0;
53
54    // mapping
55    //(required = false)
56    private String facetConceptsFile = "";
57
58    private String[] languageFilters = {"", "", ""};
59
60    private boolean printMapping = false;
61
62    //(required = false)
63    private String nationalProjectMapping = "";
64
65    private String countryComponentUrl = "";
66
67    private String language2LetterCodeComponentUrl = "";
68
69    private String language3LetterCodeComponentUrl = "";
70
71    private String silToISO639CodesUrl = "";
72
73    // services
74    private String federatedContentSearchUrl = "";
75
76    private boolean useHandleResolver = false;
77
78    @XmlElement
79    private String profileSchemaUrl = "";
80
81    private String componentRegistryRESTURL = "";
82
83    private String handleServerUrl = "";
84
85    @XmlElement
86    private String imdiBrowserUrl = "";
87
88    private String languageLinkPrefix = "";
89
90    // web application user interface
91    private int facetOverviewLength = 0;
92
93    private String homeUrl = "";
94
95    private String helpUrl = "";
96
97    private String feedbackFromUrl = "";
98
99    /**
100     * An array of facetFields<br><br>
101     *
102     * To let JAXB know it has to interpret the facetFields element as an array,
103     * use the XmlElementWrapper directive. Use the directive to let JAXB know
104     * that the elements inside 'facetFields' are named 'facetField'.
105     */
106    @XmlElementWrapper(name = "facetFields")
107    private List<String> facetField = new ArrayList<String>();
108
109    private String collectionFacet;
110
111    // test related parameters
112    //(required = false)
113    private String reverseProxyPrefix = "";
114
115    //(required = false)
116    private String cqlEndpointFilter = "";
117
118    //(required = false)
119    private String cqlEndpointAlternative = "";
120
121    /**
122     * Get and set methods for web application parameter members<br><br>
123     *
124     * By using a get or set method, you can apply an operation to a parameter
125     * here without the need to make changes in different parts of the
126     * application.
127     */
128    /**
129     * Get the value of the pagesInApplicationCache parameter<br><br>
130     *
131     * The parameter represents the number of pages that Wicket will allow to be
132     * stored in the application's cache.
133     *
134     * @return the value
135     */
136    public int getPagesInApplicationCache() {
137        return pagesInApplicationCache;
138    }
139
140    /**
141     * Set the value of the pagesInApplicationCache parameter<br><br>
142     *
143     * The parameter represents the number of pages that Wicket will allow to be
144     * stored in the application's cache.
145     *
146     * @param param the value
147     */
148    public void setPagesInApplicationCache(int param) {
149        pagesInApplicationCache = param;
150    }
151
152    /**
153     * Get the value of the sessionCacheSize parameter<br><br>
154     *
155     * The parameter represents the size in kilobytes of the session page cache.
156     *
157     * @return the value
158     */
159    public int getSessionCacheSize() {
160        return sessionCacheSize;
161    }
162
163    /**
164     * Set the value of the sessionCacheSize parameter<br><br>
165     *
166     * The parameter represents the size in megabytes of the session page cache.
167     *
168     * @param param the value
169     */
170    public void setSessionCacheSize(int param) {
171        sessionCacheSize = param;
172    }
173
174    /**
175     * Get the value of the deleteAllFirst parameter<br><br>
176     *
177     * For a description of the parameter, refer to the general VLO
178     * documentation.
179     *
180     * @return the value
181     */
182    public boolean getDeleteAllFirst() {
183        return deleteAllFirst;
184    }
185
186    /**
187     * Set the value of the deleteAllFirst parameter<br><br>
188     *
189     * For a description of the parameter, refer to the general VLO
190     * documentation.
191     *
192     * @param param the value
193     */
194    public void setDeleteAllFirst(boolean param) {
195        deleteAllFirst = param;
196    }
197
198    /**
199     * Get the value of the maxDocsInList parameter<br><br>
200     *
201     * For a description of the parameter, refer to the general VLO
202     * documentation.
203     *
204     * @return the value
205     */
206    public int getMaxDocsInList() {
207        return maxDocsInList;
208    }
209
210    /**
211     * Set the value of the maxDocsInList parameter<br><br>
212     *
213     * For a description of the parameter, refer to the general VLO
214     * documentation.
215     *
216     * @param param the value
217     */
218    public void setMaxDocsInList(int param) {
219        maxDocsInList = param;
220    }
221
222    /**
223     * Get the value of the minDocsInSolrQueue parameter<br><br>
224     *
225     * For a description of the parameter, refer to the general VLO
226     * documentation.
227     *
228     * @return the value
229     */
230    public int getMinDocsInSolrQueue() {
231        return minDocsInSolrQueue;
232    }
233
234    /**
235     * Set the value of the minDocsInSolrQueue parameter<br><br>
236     *
237     * For a description of the parameter, refer to the general VLO
238     * documentation.
239     *
240     * @param param the value
241     */
242    public void setMinDocsInSolrQueue(int param) {
243        minDocsInSolrQueue = param;
244    }
245
246    /**
247     * Get the value of the solrTimeOut parameter<br><br>
248     *
249     * For a description of the parameter, refer to the general VLO
250     * documentation.
251     *
252     * @return the value
253     */
254    public int getSolrTimeOut() {
255        return solrTimeOut;
256    }
257
258    /**
259     * Set the value of the solrTimeOut parameter<br><br>
260     *
261     * For a description of the parameter, refer to the general VLO
262     * documentation.
263     *
264     * @param param the value
265     */
266    public void setSolrTimeOut(int param) {
267        solrTimeOut = param;
268    }
269
270    /**
271     * Get the value of the maxFileSize parameter<br><br>
272     *
273     * For a description of the parameter, refer to the general VLO
274     * documentation.
275     *
276     * @return the value
277     */
278    public int getMaxFileSize() {
279        return maxFileSize;
280    }
281
282    /**
283     * Set the value of the maxFileSize parameter<br><br>
284     *
285     * For a description of the parameter, refer to the general VLO
286     * documentation.
287     *
288     * @param param the value
289     */
290    public void setMaxFileSize(int param) {
291        maxFileSize = param;
292    }
293
294    /**
295     * Get the value of the maxDaysInSolr parameter<br><br>
296     *
297     * If the parameter is larger than 0, it denotes the maximal number of days
298     * that a document can remain in the database.
299     *
300     * @return the value
301     */
302    public int getMaxDaysInSolr() {
303        return maxDaysInSolr;
304    }
305
306    /**
307     * Set the value of the maxDaysInSolr parameter<br><br>
308     *
309     * If the parameter is larger than 0, it denotes the maximal number of days
310     * that a document can remain in the database.
311     *
312     * @param param the value
313     */
314    public void setMaxDaysInSolr(int param) {
315        maxDaysInSolr = param;
316    }
317
318    /**
319     * Get the value of the useHandleResolver parameter<br><br>
320     *
321     * The parameter can be used to reject meta data files that exceed some
322     * maximum size.
323     *
324     * @return the value
325     */
326    public boolean getUseHandleResolver() {
327        return useHandleResolver;
328    }
329
330    /**
331     * Set the value of the useHandleResolver parameter<br><br>
332     *
333     * For a description of the parameter, refer to the general VLO
334     * documentation.
335     *
336     * @param param the value
337     */
338    public void setUseHandleResolver(boolean param) {
339        useHandleResolver = param;
340    }
341
342    /**
343     * Get the list of dataRoots parameters<br><br>
344     *
345     * For a description of the parameter, refer to the general VLO
346     * documentation.
347     *
348     * @return the value
349     */
350    public List<DataRoot> getDataRoots() {
351        return dataRoot;
352    }
353
354    /**
355     * Set the value of a list of dataRoots parameters<br><br>
356     *
357     * For a description of the parameter, refer to the general VLO
358     * documentation.
359     *
360     * @param param the value
361     */
362    public void setDataRoots(List<DataRoot> param) {
363        dataRoot = param;
364    }
365
366    /**
367     * Get the value of the printMapping parameter<br><br>
368     *
369     * For a description of the parameter, refer to the general VLO
370     * documentation.
371     *
372     * @return the value
373     */
374    public boolean printMapping() {
375        return printMapping;
376    }
377
378    /**
379     * Set the value of the printMapping parameter<br><br>
380     *
381     * For a description of the parameter, refer to the general VLO
382     * documentation.
383     *
384     * @param param the value
385     */
386    public void setPrintMapping(boolean param) {
387        printMapping = param;
388    }
389
390    /**
391     * Get the value of the VloHomeLink parameter<br><br>
392     *
393     * For a description of the parameter, refer to the general VLO
394     * documentation.
395     *
396     * @return the value
397     */
398    public String getHomeUrl() {
399        return homeUrl;
400    }
401
402    /**
403     * Set the value of the VloHomeLink parameter<br><br>
404     *
405     * For a description of the parameter, refer to the general VLO
406     * documentation.
407     *
408     * @param param the value
409     */
410    public void setHomeUrl(String param) {
411        homeUrl = param;
412    }
413
414    /**
415     * Get the value of the helpUrl parameter<br><br>
416     *
417     * For a description of the parameter, refer to the general VLO
418     * documentation.
419     *
420     * @return the value
421     */
422    public String getHelpUrl() {
423        return helpUrl;
424    }
425
426    /**
427     * Set the value of the helpUrl parameter<br><br>
428     *
429     * For a description of the parameter, refer to the general VLO
430     * documentation.
431     *
432     * @param param the value
433     */
434    public void setHelpUrl(String param) {
435        helpUrl = param;
436    }
437
438    /**
439     * Get the value of the SolrUrl parameter<br><br>
440     *
441     * For a description of the parameter, refer to the general VLO
442     * documentation.
443     *
444     * @return the value
445     */
446    public String getSolrUrl() {
447        return solrUrl;
448    }
449
450    /**
451     * Set the value of the SolrUrl parameter<br><br>
452     *
453     * For a description of the parameter, refer to the general VLO
454     * documentation.
455     *
456     * @param param the value
457     */
458    public void setSolrUrl(String param) {
459        solrUrl = param;
460    }
461
462    /**
463     * Get the value of the facetConceptsFile parameter<br><br>
464     *
465     * For a description of the parameter, refer to the general VLO
466     * documentation.
467     *
468     * @return the value
469     */
470    public String getFacetConceptsFile() {
471        return facetConceptsFile;
472    }
473
474    /**
475     * Set the value of the facetConceptsFile parameter<br><br>
476     *
477     * For a description of the parameter, refer to the general VLO
478     * documentation.
479     *
480     * @param param the value
481     */
482    public void setFacetConceptsFile(String param) {
483        facetConceptsFile = param;
484    }
485
486    /**
487     * Get the value of the ProfileSchemaUrl by profileId parameter<br><br>
488     *
489     * For a description of the schema, refer to the general VLO documentation.
490     * Note: the profileId needs to be expanded.
491     *
492     * @return the value
493     */
494    public String getComponentRegistryProfileSchema(String id) {
495        return profileSchemaUrl.replace("{PROFILE_ID}", id);
496    }
497
498    /**
499     * Set the value of the ProfileSchemaUrl parameter<br><br>
500     *
501     * For a description of the schema, refer to the general VLO documentation.
502     * Note: the profileId needs to be expanded.
503     *
504     * @param param the value
505     */
506    public void setComponentRegistryProfileSchema(String param) {
507        profileSchemaUrl = param;
508    }
509
510    /**
511     * Get the value of the ComponentRegisteryRESTURL parameter<br><br>
512     *
513     * For a description of the parameter, refer to the general VLO
514     * documentation.
515     *
516     * @return the value
517     */
518    public String getComponentRegistryRESTURL() {
519        return componentRegistryRESTURL;
520    }
521
522    /**
523     * Set the value of the ComponentRegisteryRESTURL parameter<br><br>
524     *
525     * For a description of the parameter, refer to the general VLO
526     * documentation.
527     *
528     * @param param the value
529     */
530    public void setComponentRegistryRESTURL(String param) {
531        componentRegistryRESTURL = param;
532    }
533
534    /**
535     * Get the value of the HandleServerUrl parameter<br><br>
536     *
537     * For a description of the parameter, refer to the general VLO
538     * documentation.
539     *
540     * @return the value
541     */
542    public String getHandleServerUrl() {
543        return handleServerUrl;
544    }
545
546    /**
547     * Set the value of the HandleServerUrl parameter<br><br>
548     *
549     * For a description of the parameter, refer to the general VLO
550     * documentation.
551     *
552     * @param param the value
553     */
554    public void setHandleServerUrl(String param) {
555        handleServerUrl = param;
556    }
557
558    /**
559     * Get the value of the ProfileSchemaUrl parameter combined with a
560     * handle<br><br>
561     *
562     * For a description of the schema, refer to the general VLO documentation.
563     *
564     * @param handle the handle the URL is based on
565     * @return the value
566     */
567    public String getImdiBrowserUrl(String handle) {
568        String result;
569        try {
570            result = imdiBrowserUrl + URLEncoder.encode(handle, "UTF-8");
571        } catch (UnsupportedEncodingException e) {
572            result = imdiBrowserUrl + handle;
573        }
574        return result;
575    }
576
577    /**
578     * Set the value of the IMDIBrowserUrl parameter<br><br>
579     *
580     * For a description of the parameter, refer to the general VLO
581     * documentation.
582     *
583     * @param param the value
584     */
585    public void setImdiBrowserUrl(String param) {
586        imdiBrowserUrl = param;
587    }
588
589    /**
590     * Get the value of the languageLinkPrefix parameter<br><br>
591     *
592     * For a description of the parameter, refer to the general VLO
593     * documentation.
594     *
595     * @return the value
596     */
597    public String getLanguageLinkPrefix() {
598        return languageLinkPrefix;
599    }
600
601    /**
602     * Set the value of the languageLinkPrefix parameter<br><br>
603     *
604     * For a description of the parameter, refer to the general VLO
605     * documentation.
606     *
607     * @param param the value
608     */
609    public void setLanguageLinkPrefix(String param) {
610        languageLinkPrefix = param;
611    }
612
613    /**
614     * Get the value of the feedbackFromUrl parameter<br><br>
615     *
616     * For a description of the parameter, refer to the general VLO
617     * documentation.
618     *
619     * @return the value
620     */
621    public String getFeedbackFromUrl() {
622        return feedbackFromUrl;
623    }
624
625    /**
626     * Set the value of the feedbackFromUrl parameter<br><br>
627     *
628     * For a description of the parameter, refer to the general VLO
629     * documentation.
630     *
631     * @param param the value
632     */
633    public void setFeedbackFromUrl(String param) {
634        feedbackFromUrl = param;
635    }
636
637    /**
638     * Get the value of the FederatedContentSearchUrl parameter<br><br>
639     *
640     * For a description of the parameter, refer to the general VLO
641     * documentation.
642     *
643     * @return the value
644     */
645    @XmlElement(name = "FederatedContentSearchUrl")
646    public String getFederatedContentSearchUrl() {
647        return federatedContentSearchUrl;
648    }
649
650    /**
651     * Set the value of the FederatedContentSearchUrl parameter<br><br>
652     *
653     * For a description of the parameter, refer to the general VLO
654     * documentation.
655     *
656     * @param param the value
657     */
658    public void setFederatedContentSearchUrl(String param) {
659        federatedContentSearchUrl = param;
660    }
661
662    /**
663     * Get the value of the NationalProjectMapping parameter<br><br>
664     *
665     * For a description of the parameter, refer to the general VLO
666     * documentation.
667     *
668     * @return the value
669     */
670    public String getNationalProjectMapping() {
671        return nationalProjectMapping;
672    }
673
674    /**
675     * Set the value of the NationalProjectMapping parameter<br><br>
676     *
677     * For a description of the parameter, refer to the general VLO
678     * documentation.
679     *
680     * @param nationalProjectMapping the value
681     */
682    public void setNationalProjectMapping(String param) {
683        nationalProjectMapping = param;
684    }
685
686    /**
687     * Get the value of the FacetFields parameter<br><br>
688     *
689     * For a description of the parameter, refer to the general VLO
690     * documentation.
691     *
692     * @return the value
693     */
694    public List<String> getFacetFields() {
695        return facetField;
696    }
697
698    /**
699     * Set the value of the FacetFields parameter<br><br>
700     *
701     * For a description of the parameter, refer to the general VLO
702     * documentation.
703     *
704     * @param param the value, a list of facet fields
705     */
706    public void setFacetFields(List<String> param) {
707        facetField = param;
708    }
709
710    /**
711     *
712     * @return the name of the facet that represents the collection a resource
713     * belongs to
714     */
715    public String getCollectionFacet() {
716        return collectionFacet;
717    }
718
719    /**
720     *
721     * @param collectionFacet the name of the facet that represents the
722     * collection a resource belongs to
723     */
724    public void setCollectionFacet(String collectionFacet) {
725        this.collectionFacet = collectionFacet;
726    }
727
728    /**
729     * Get the value of the languageFields parameter<br><br>
730     *
731     * For a description of the parameter, refer to the general VLO
732     * documentation.
733     *
734     * @return the value
735     */
736    public String[] getLanguageFilters() {
737        return languageFilters;
738    }
739
740    /**
741     * Set the value of the languageFilters parameter<br><br>
742     *
743     * For a description of the parameter, refer to the general VLO
744     * documentation.
745     *
746     * @param param the value, a list of language filters
747     */
748    public void setLanguageFilters(String[] param) {
749        languageFilters = param;
750    }
751
752    /**
753     * Get the value of the getFacetOverviewLength parameter<br><br>
754     *
755     * For a description of the parameter, refer to the general VLO
756     * documentation.
757     *
758     * @return the value
759     */
760    public int getFacetOverviewLength() {
761        return facetOverviewLength;
762    }
763
764    /**
765     * Set the value of the setFacetOverviewLength parameter<br><br>
766     *
767     * For a description of the parameter, refer to the general VLO
768     * documentation.
769     *
770     * @param param the value
771     */
772    public void setFacetOverviewLength(Integer param) {
773        facetOverviewLength = param;
774    }
775
776    /**
777     * Get the value of the CountryComponentUrl parameter<br><br>
778     *
779     * For a description of the parameter, refer to the general VLO
780     * documentation.
781     *
782     * @return the value
783     */
784    public String getCountryComponentUrl() {
785        return countryComponentUrl;
786    }
787
788    /**
789     * Set the value of the CountryComponentUrl parameter<br><br>
790     *
791     * For a description of the parameter, refer to the general VLO
792     * documentation.
793     *
794     * @param param the value
795     */
796    public void setCountryComponentUrl(String param) {
797        countryComponentUrl = param;
798    }
799
800    /**
801     * Get the value of the Language2LetterCodeComponentUrl parameter<br><br>
802     *
803     * For a description of the parameter, refer to the general VLO
804     * documentation.
805     *
806     * @return the value
807     */
808    public String getLanguage2LetterCodeComponentUrl() {
809        return language2LetterCodeComponentUrl;
810    }
811
812    /**
813     * Set the value of the Language2LetterCodeComponentUrl parameter<br><br>
814     *
815     * For a description of the parameter, refer to the general VLO
816     * documentation.
817     *
818     * @param param the value
819     */
820    public void setLanguage2LetterCodeComponentUrl(String param) {
821        language2LetterCodeComponentUrl = param;
822    }
823
824    /**
825     * Get the value of the Language3LetterCodeComponentUrl parameter<br><br>
826     *
827     * For a description of the parameter, refer to the general VLO
828     * documentation.
829     *
830     * @return the value
831     */
832    public String getLanguage3LetterCodeComponentUrl() {
833        return language3LetterCodeComponentUrl;
834    }
835
836    /**
837     * Set the value of the Language3LetterCodeComponentUrl parameter<br><br>
838     *
839     * For a description of the parameter, refer to the general VLO
840     * documentation.
841     *
842     * @param param the value
843     */
844    public void setLanguage3LetterCodeComponentUrl(String param) {
845        language3LetterCodeComponentUrl = param;
846    }
847
848    /**
849     * Get the value of the SilToISO639CodesUrl parameter<br><br>
850     *
851     * For a description of the parameter, refer to the general VLO
852     * documentation.
853     *
854     * @return the value
855     */
856    public String getSilToISO639CodesUrl() {
857        return silToISO639CodesUrl;
858    }
859
860    /**
861     * Set the value of the SilToISO639CodesUrl parameter<br><br>
862     *
863     * For a description of the parameter, refer to the general VLO
864     * documentation.
865     *
866     * @param param the value
867     */
868    public void setSilToISO639CodesUrl(String param) {
869        silToISO639CodesUrl = param;
870    }
871
872    /**
873     * Get the value of the reverseProxyPath parameter<br><br>
874     *
875     * For a description of the parameter, refer to the general VLO
876     * documentation.
877     *
878     * @return the value
879     */
880    public String getReverseProxyPrefix() {
881        return reverseProxyPrefix;
882    }
883
884    /**
885     * Set the value of the reverseProxyPrefix parameter<br><br>
886     *
887     * For a description of the parameter, refer to the general VLO
888     * documentation.
889     *
890     * @param param the value
891     */
892    public void setReverseProxyPrefix(String param) {
893        reverseProxyPrefix = param;
894    }
895
896    /**
897     * Get the value of the cqlEndpointFilter parameter<br><br>
898     *
899     * For a description of the parameter, refer to the general VLO
900     * documentation.
901     *
902     * @return the value
903     */
904    public String getCqlEndpointFilter() {
905        return cqlEndpointFilter;
906    }
907
908    /**
909     * Set the value of the cqlEndpointFilter parameter<br><br>
910     *
911     * For a description of the parameter, refer to the general VLO
912     * documentation.
913     *
914     * @param param the value
915     */
916    public void setCqlEndpointFilter(String param) {
917        cqlEndpointFilter = param;
918    }
919
920    /**
921     * Get the value of the cqlEndpointAlternative parameter<br><br>
922     *
923     * For a description of the parameter, refer to the general VLO
924     * documentation.
925     *
926     * @return the value
927     */
928    public String getCqlEndpointAlternative() {
929        return cqlEndpointAlternative;
930    }
931
932    /**
933     * Set the value of the cqlEndpointAlternative parameter<br><br>
934     *
935     * For a description of the parameter, refer to the general VLO
936     * documentation.
937     *
938     * @param param the value
939     */
940    public void setCqlEndpointAlternative(String param) {
941        cqlEndpointAlternative = param;
942    }
943}
Note: See TracBrowser for help on using the repository browser.