View Javadoc

1   package org.kuali.ole.location.inquiry;
2   
3   import org.kuali.ole.OLEConstants;
4   import org.kuali.ole.location.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       * @param parameters
18       * @return  object
19       */
20      @Override
21      public Object retrieveDataObject(Map parameters) {
22          object= super.retrieveDataObject(parameters);
23          return object;
24      }
25  
26      /**
27       * This method returns an url string to download an attachment based on the OleLocationSummaryId
28       * @return  url
29       */
30     public String getUrl(){
31         OleLocationIngestSummaryRecord oleLocationIngestSummaryRecord=(OleLocationIngestSummaryRecord)object;
32         String url= OLEConstants.FAILED_LOCATION_ATTACHMENT_DOWNLOAD_URL+oleLocationIngestSummaryRecord.getOleLocationSummaryId();
33         return url;
34      }
35  
36      /**
37       *  This method returns an null string or a fileName string from the OleLocationIngestSummaryRecord object
38       * @return null / fileName string
39       */
40      public String getFileName(){
41          OleLocationIngestSummaryRecord oleLocationIngestSummaryRecord=(OleLocationIngestSummaryRecord)object;
42          if(oleLocationIngestSummaryRecord.getOleLocationFailedCount()!=null && oleLocationIngestSummaryRecord.getOleLocationFailedCount()>0)
43            return oleLocationIngestSummaryRecord.getOleLocationSummaryId()+OLEConstants.FAILED_LOCATION_RECORD_NAME;
44          else
45             return null;
46      }
47  }