View Javadoc
1   package org.kuali.ole.describe.inquiry;
2   
3   import org.kuali.ole.OLEConstants;
4   import org.kuali.ole.describe.bo.OleLocationIngestSummaryRecord;
5   import org.kuali.rice.kns.inquiry.KualiInquirableImpl;
6   
7   import java.util.Map;
8   
9   /**
10   * The OleLocationSummaryInquirable class is used to return the failed Url and Filename of the ingest summary record.
11   */
12  public class OleLocationSummaryInquirable extends KualiInquirableImpl {
13      public Object object;
14  
15      /**
16       * This method returns an object based on the parameters passed to it.
17       *
18       * @param parameters
19       * @return object
20       */
21      @Override
22      public Object retrieveDataObject(Map parameters) {
23          object = super.retrieveDataObject(parameters);
24          return object;
25      }
26  
27      /**
28       * This method returns an url string to download an attachment based on the OleLocationSummaryId
29       *
30       * @return url
31       */
32      public String getUrl() {
33          OleLocationIngestSummaryRecord oleLocationIngestSummaryRecord = (OleLocationIngestSummaryRecord) object;
34          String url = OLEConstants.FAILED_LOCATION_ATTACHMENT_DOWNLOAD_URL + oleLocationIngestSummaryRecord.getOleLocationSummaryId();
35          return url;
36      }
37  
38      /**
39       * This method returns an null string or a fileName string from the OleLocationIngestSummaryRecord object
40       *
41       * @return null / fileName string
42       */
43      public String getFileName() {
44          OleLocationIngestSummaryRecord oleLocationIngestSummaryRecord = (OleLocationIngestSummaryRecord) object;
45          if (oleLocationIngestSummaryRecord.getOleLocationFailedCount() != null && oleLocationIngestSummaryRecord.getOleLocationFailedCount() > 0)
46              return oleLocationIngestSummaryRecord.getOleLocationSummaryId() + OLEConstants.FAILED_LOCATION_RECORD_NAME;
47          else
48              return null;
49      }
50  }