avatar

949

Support uploading auction HTML if the user's account allows for it.

by mrs, 09 Jun, 2009 11:14 AM
940 949  
174174     MQFactory.getConcrete("upload").registerListener(new MessageQueue.Listener() {
175175       public void messageAction(Object deQ) {
176176         if(JConfig.queryConfiguration("my.jbidwatcher.id") != null) {
177           postXML(mSyncQueueURL, EntryCorral.getInstance().takeForRead(deQ.toString()));
177           AuctionEntry ae = EntryCorral.getInstance().takeForRead((String) deQ);
178           postXML(mSyncQueueURL, ae);
179           if(JConfig.queryConfiguration("my.jbidwatcher.uploadhtml", "false").equals("true")) {
180             uploadAuctionHTML(ae, "uploadhtml");
181           }
178182         }
179183       }
180184     });
------
183187       MQFactory.getConcrete("report").registerListener(new MessageQueue.Listener() {
184188         public void messageAction(Object deQ) {
185189           AuctionEntry ae = EntryCorral.getInstance().takeForRead((String)deQ);
186           String s3Result = sendFile(ae.getContentFile(), url(ITEM_UPLOAD_URL), JConfig.queryConfiguration("my.jbidwatcher.id"), ae.getLastStatus());
187           XMLElement root = new XMLElement("report");
188           XMLElement s3Key = new XMLElement("s3");
189           s3Key.setContents(s3Result);
190           root.addChild(ae.toXML());
191           postXML(mReportQueueURL, root);
190           uploadAuctionHTML(ae, "report");
192191         }
193192       });
194193     }
------
207206     });
208207   }
209208 
209   private void uploadAuctionHTML(AuctionEntry ae, String uploadType) {
210     String s3Result = sendFile(ae.getContentFile(), url(ITEM_UPLOAD_URL), JConfig.queryConfiguration("my.jbidwatcher.id"), ae.getLastStatus());
211     XMLElement root = new XMLElement(uploadType);
212     XMLElement s3Key = new XMLElement("s3");
213     s3Key.setContents(s3Result);
214     root.addChild(ae.toXML());
215     postXML(mReportQueueURL, root);
216   }
217 
210218   public boolean getAccountInfo() {
211219     StringBuffer sb = http().get("https://my.jbidwatcher.com/services/account");
212220     if(sb == null) return false;