View Javadoc

1   package org.kuali.ole.patron.inquiry;
2   
3   import org.kuali.ole.OLEConstants;
4   import org.kuali.ole.patron.bo.OlePatronIngestSummaryRecord;
5   import org.kuali.rice.kns.inquiry.KualiInquirableImpl;
6   import java.util.Map;
7   
8   /**
9    * OlePatronSummaryInquirable provides URL to download the failed patron attachment and filename.
10   */
11  public class OlePatronSummaryInquirable extends KualiInquirableImpl {
12      public Object object;
13  
14      /**
15       * This method will retrieve the data object using the parameters
16       * @param parameters
17       * @return object
18       */
19      @Override
20      public Object retrieveDataObject(Map parameters) {
21          object= super.retrieveDataObject(parameters);
22          return object;
23      }
24  
25      /**
26       * This method will create the url by appending the olePatronSummaryId to call the download method in the controller
27       * @return url
28       */
29     public String getUrl(){
30         OlePatronIngestSummaryRecord olePatronIngestSummaryRecord=(OlePatronIngestSummaryRecord)object;
31         String url= OLEConstants.FAILED_PATRON_ATTACHMENT_DOWNLOAD_URL+olePatronIngestSummaryRecord.getOlePatronSummaryId();
32         return url;
33      }
34  
35      /**
36       * This will return the file name of the error xml otherwise it will return null
37       * @return fileName
38       */
39      public String getFileName(){
40          OlePatronIngestSummaryRecord olePatronIngestSummaryRecord=(OlePatronIngestSummaryRecord)object;
41          if(olePatronIngestSummaryRecord.getPatronFailedCount()!=null && olePatronIngestSummaryRecord.getPatronFailedCount()>0)
42            return olePatronIngestSummaryRecord.getOlePatronSummaryId()+OLEConstants.FAILED_PATRON_RECORD_NAME;
43          else
44             return null;
45      }
46  }