1 package org.kuali.ole.docstore.engine.factory;
2
3 import org.kuali.ole.docstore.engine.service.storage.rdbms.*;
4 import org.kuali.ole.docstore.model.enums.DocCategory;
5 import org.kuali.ole.docstore.model.enums.DocFormat;
6 import org.kuali.ole.docstore.model.enums.DocType;
7
8 import java.util.HashMap;
9 import java.util.Map;
10
11
12
13
14
15
16
17
18 public class DocumentManagerFactory {
19 private static DocumentManagerFactory documentManagerFactory = new DocumentManagerFactory();
20 private Map<String, DocumentManager> documentManagerMap = new HashMap<String, DocumentManager>();
21
22 public static DocumentManagerFactory getInstance() {
23 return documentManagerFactory;
24 }
25
26 private DocumentManagerFactory() {
27 initDocumentManagerMap();
28 }
29
30 private void initDocumentManagerMap() {
31 String key = DocCategory.WORK.getCode() + DocType.BIB.getCode() + DocFormat.MARC.getCode();
32 documentManagerMap.put(key, RdbmsBibMarcDocumentManager.getInstance());
33
34 key = DocCategory.WORK.getCode() + DocType.BIB.getCode() + DocFormat.DUBLIN_CORE.getCode();
35 documentManagerMap.put(key, RdbmsBibDocumentManager.getInstance());
36
37 key = DocCategory.WORK.getCode() + DocType.BIB.getCode() + DocFormat.DUBLIN_UNQUALIFIED.getCode();
38 documentManagerMap.put(key, RdbmsBibDocumentManager.getInstance());
39
40
41
42
43 key = DocCategory.WORK.getCode() + DocType.ITEM.getCode() + DocFormat.OLEML.getCode();
44 documentManagerMap.put(key, RdbmsItemDocumentManager.getInstance());
45
46 key = DocCategory.WORK.getCode() + DocType.HOLDINGS.getCode() + DocFormat.OLEML.getCode();
47 documentManagerMap.put(key, RdbmsHoldingsDocumentManager.getInstance());
48
49 key = DocCategory.WORK.getCode() + DocType.LICENSE.getCode() + DocFormat.ONIXPL.getCode();
50 documentManagerMap.put(key, RdbmsLicenseOnixplDocumentManager.getInstance());
51 key = DocCategory.WORK.getCode() + DocType.LICENSE.getCode() + DocFormat.PDF.getCode();
52 documentManagerMap.put(key, RdbmsLicenseAttachmentDocumentManager.getInstance());
53 key = DocCategory.WORK.getCode() + DocType.LICENSE.getCode() + DocFormat.XSLT.getCode();
54 documentManagerMap.put(key, RdbmsLicenseAttachmentDocumentManager.getInstance());
55 key = DocCategory.WORK.getCode() + DocType.LICENSE.getCode() + DocFormat.DOC.getCode();
56 documentManagerMap.put(key, RdbmsLicenseAttachmentDocumentManager.getInstance());
57
58
59
60
61
62
63
64 }
65
66 public DocumentManager getDocumentManager(String docCategory, String docType, String docFormat) {
67 return documentManagerMap.get(docCategory + docType + docFormat);
68 }
69
70 }