Support uploading auction HTML if the user's account allows for it.
| 940 | 949 | |
|---|---|---|
| 174 | 174 | MQFactory.getConcrete("upload").registerListener(new MessageQueue.Listener() { |
| 175 | 175 | public void messageAction(Object deQ) { |
| 176 | 176 | 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 | } | |
| 178 | 182 | } |
| 179 | 183 | } |
| 180 | 184 | }); |
| --- | --- | |
| 183 | 187 | MQFactory.getConcrete("report").registerListener(new MessageQueue.Listener() { |
| 184 | 188 | public void messageAction(Object deQ) { |
| 185 | 189 | 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"); | |
| 192 | 191 | } |
| 193 | 192 | }); |
| 194 | 193 | } |
| --- | --- | |
| 207 | 206 | }); |
| 208 | 207 | } |
| 209 | 208 | |
| 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 | ||
| 210 | 218 | public boolean getAccountInfo() { |
| 211 | 219 | StringBuffer sb = http().get("https://my.jbidwatcher.com/services/account"); |
| 212 | 220 | if(sb == null) return false; |
