1 package org.kuali.ole.select.maintenance;
2
3 import org.kuali.ole.docstore.common.client.DocstoreClientLocator;
4 import org.kuali.ole.docstore.common.document.License;
5 import org.kuali.ole.select.bo.OleLicenseRequestBo;
6 import org.kuali.ole.sys.context.SpringContext;
7 import org.kuali.rice.core.api.config.property.ConfigContext;
8 import org.kuali.rice.kew.api.KewApiConstants;
9 import org.kuali.rice.krad.maintenance.MaintainableImpl;
10
11
12
13
14
15
16
17
18 public class OleLicenseRequestMaintenanceImpl extends MaintainableImpl {
19
20 private DocstoreClientLocator docstoreClientLocator;
21 public DocstoreClientLocator getDocstoreClientLocator() {
22 if (null == docstoreClientLocator) {
23 return SpringContext.getBean(DocstoreClientLocator.class);
24 }
25 return docstoreClientLocator;
26 }
27
28
29
30
31
32
33 public String getUrl(OleLicenseRequestBo oleLicenseRequestBo) {
34 String oleurl = ConfigContext.getCurrentContextConfig().getProperty("ole.url");
35
36
37 String redirectUrl = "";
38 String eResourceDocNumber = "";
39 if (oleLicenseRequestBo != null) {
40 eResourceDocNumber = oleLicenseRequestBo.geteResourceDocNumber();
41 redirectUrl = oleurl + "/" + KewApiConstants.Namespaces.MODULE_NAME + "/" +
42 KewApiConstants.DOC_HANDLER_REDIRECT_PAGE + "?" + KewApiConstants.COMMAND_PARAMETER + "=" +
43 KewApiConstants.DOCSEARCH_COMMAND + "&" + KewApiConstants.DOCUMENT_ID_PARAMETER + "="
44 + eResourceDocNumber;
45 }
46 return redirectUrl;
47 }
48
49
50
51
52
53 public String viewAgreement(OleLicenseRequestBo oleLicenseRequestBo) {
54 String url = ConfigContext.getCurrentContextConfig().getProperty("ole.docstore.Documentrest.url");
55 String redirectUrl = "";
56 if (oleLicenseRequestBo != null && oleLicenseRequestBo.getAgreementId() != null) {
57
58 redirectUrl = url + "license/" + oleLicenseRequestBo.getAgreementId();
59 }
60 return redirectUrl;
61 }
62
63
64
65
66
67 public String getDocNum(OleLicenseRequestBo oleLicenseRequestBo) {
68 String oleurl = ConfigContext.getCurrentContextConfig().getProperty("ole.url");
69 String eResourceDocNumber = "";
70 if (oleLicenseRequestBo != null) {
71 eResourceDocNumber = oleLicenseRequestBo.geteResourceDocNumber();
72 }
73 return eResourceDocNumber;
74 }
75
76 }