diff --git a/diylc/diylc-core/lib/bancika-http-proxy.jar b/diylc/diylc-core/lib/bancika-http-proxy.jar index 82fb2888..5a2e74aa 100644 Binary files a/diylc/diylc-core/lib/bancika-http-proxy.jar and b/diylc/diylc-core/lib/bancika-http-proxy.jar differ diff --git a/diylc/diylc-core/library/main.jar b/diylc/diylc-core/library/main.jar index b5ab55a2..8104ed84 100644 Binary files a/diylc/diylc-core/library/main.jar and b/diylc/diylc-core/library/main.jar differ diff --git a/diylc/diylc-core/src/org/diylc/plugins/cloud/presenter/CloudPresenter.java b/diylc/diylc-core/src/org/diylc/plugins/cloud/presenter/CloudPresenter.java index 79a09a04..efabd746 100644 --- a/diylc/diylc-core/src/org/diylc/plugins/cloud/presenter/CloudPresenter.java +++ b/diylc/diylc-core/src/org/diylc/plugins/cloud/presenter/CloudPresenter.java @@ -40,23 +40,25 @@ public class CloudPresenter { private boolean loggedIn = false; public CloudPresenter(CloudListener listener) { - serviceUrl = - ConfigurationManager.getInstance().readString(IServiceAPI.URL_KEY, "http://www.diy-fever.com/diylc/api/v1"); - ProxyFactory factory = new ProxyFactory(new PhpFlatProxy()); - service = factory.createProxy(IServiceAPI.class, serviceUrl); - if (service == null) - LOG.warn("Service proxy not created!"); this.listener = listener; } + public IServiceAPI getService() { + if (service == null) { + serviceUrl = + ConfigurationManager.getInstance().readString(IServiceAPI.URL_KEY, "http://www.diy-fever.com/diylc/api/v1"); + ProxyFactory factory = new ProxyFactory(new PhpFlatProxy()); + service = factory.createProxy(IServiceAPI.class, serviceUrl); + } + return service; + } + public boolean logIn(String username, String password) throws CloudException { - if (service == null) - return false; LOG.info("Trying to login to cloud as " + username); String res; try { - res = service.login(username, password, getMachineId()); + res = getService().login(username, password, getMachineId()); } catch (Exception e) { throw new CloudException(e); } @@ -75,9 +77,6 @@ public class CloudPresenter { } public boolean tryLogInWithToken() throws CloudException { - if (service == null) - return false; - String username = ConfigurationManager.getInstance().readString(USERNAME_KEY, null); String token = ConfigurationManager.getInstance().readString(TOKEN_KEY, null); @@ -85,7 +84,7 @@ public class CloudPresenter { LOG.info("Trying to login to cloud using a token as " + username); String res; try { - res = service.loginWithToken(username, token, getMachineId()); + res = getService().loginWithToken(username, token, getMachineId()); } catch (Exception e) { throw new CloudException(e); } @@ -117,7 +116,7 @@ public class CloudPresenter { if (categories == null) { Object res; try { - res = service.getCategories(); + res = getService().getCategories(); if (res != null && res.equals(ERROR)) throw new CloudException("Could not fetch categories from the server."); if (res instanceof List) { @@ -145,7 +144,7 @@ public class CloudPresenter { try { String res = - service.upload(username, token, getMachineId(), projectName, category, description, diylcVersion, keywords, + getService().upload(username, token, getMachineId(), projectName, category, description, diylcVersion, keywords, thumbnail, project); if (!res.equals(SUCCESS)) throw new CloudException(res); @@ -162,7 +161,7 @@ public class CloudPresenter { throw new CloudException("Login failed. Please try to login again."); try { - String res = service.postComment(username, token, getMachineId(), projectId, comment); + String res = getService().postComment(username, token, getMachineId(), projectId, comment); if (!res.equals(SUCCESS)) throw new CloudException(res); } catch (Exception e) { @@ -173,7 +172,7 @@ public class CloudPresenter { public void createUserAccount(String username, String password, String email, String website, String bio) throws CloudException { try { - String res = service.createUser(username, password, email, website, bio); + String res = getService().createUser(username, password, email, website, bio); if (res == null) throw new CloudException("Could not create user account."); if (!SUCCESS.equals(res)) @@ -189,7 +188,7 @@ public class CloudPresenter { Object res; try { - res = service.getUserDetails(username, token, getMachineId()); + res = getService().getUserDetails(username, token, getMachineId()); } catch (Exception e) { throw new CloudException(e); } @@ -209,7 +208,7 @@ public class CloudPresenter { String res; try { - res = service.updatePassword(username, oldPassword, newPassword); + res = getService().updatePassword(username, oldPassword, newPassword); } catch (Exception e) { throw new CloudException(e); } @@ -223,7 +222,7 @@ public class CloudPresenter { String res; try { - res = service.updateUserDetails(username, token, getMachineId(), email, website, bio); + res = getService().updateUserDetails(username, token, getMachineId(), email, website, bio); } catch (Exception e) { throw new CloudException(e); } @@ -235,7 +234,7 @@ public class CloudPresenter { throws CloudException { LOG.info(String.format("search(%1$s,%2$s,%3$s,%4$d,%5$d)", criteria, category, sortOrder, pageNumber, itemsPerPage)); try { - Object res = service.search(criteria, category, pageNumber, itemsPerPage, sortOrder); + Object res = getService().search(criteria, category, pageNumber, itemsPerPage, sortOrder); // Thread.sleep(2000); if (res == null) throw new CloudException("Failed to retreive search results."); @@ -268,7 +267,7 @@ public class CloudPresenter { public String[] getSortings() throws CloudException { try { - return service.getSortings().toArray(new String[0]); + return getService().getSortings().toArray(new String[0]); } catch (Exception e) { throw new CloudException(e); } @@ -276,7 +275,7 @@ public class CloudPresenter { public List getComments(int projectId) throws CloudException { try { - Object res = service.getComments(projectId); + Object res = getService().getComments(projectId); if (res == null) throw new CloudException("Failed to retreive search results."); if (res instanceof String) diff --git a/diylc/diylc-swing/.classpath b/diylc/diylc-swing/.classpath index 77d5bbbb..abec6a25 100644 --- a/diylc/diylc-swing/.classpath +++ b/diylc/diylc-swing/.classpath @@ -1,11 +1,12 @@ + + - diff --git a/diylc/diylc-swing/lib/bancika-http-proxy.jar b/diylc/diylc-swing/lib/bancika-http-proxy.jar index 82fb2888..5a2e74aa 100644 Binary files a/diylc/diylc-swing/lib/bancika-http-proxy.jar and b/diylc/diylc-swing/lib/bancika-http-proxy.jar differ diff --git a/diylc/diylc-swing/lib/commons-compiler-3.0.6.jar b/diylc/diylc-swing/lib/commons-compiler-3.0.6.jar new file mode 100644 index 00000000..b9aaa551 Binary files /dev/null and b/diylc/diylc-swing/lib/commons-compiler-3.0.6.jar differ diff --git a/diylc/diylc-swing/lib/janino-3.0.6.jar b/diylc/diylc-swing/lib/janino-3.0.6.jar new file mode 100644 index 00000000..41ab429d Binary files /dev/null and b/diylc/diylc-swing/lib/janino-3.0.6.jar differ diff --git a/diylc/diylc-swing/lib/poi-3.5-FINAL-20090928.jar b/diylc/diylc-swing/lib/poi-3.5-FINAL-20090928.jar deleted file mode 100644 index 9ff92b02..00000000 Binary files a/diylc/diylc-swing/lib/poi-3.5-FINAL-20090928.jar and /dev/null differ diff --git a/diylc/diylc-swing/update.xml b/diylc/diylc-swing/update.xml index cf4bddd5..a8d1a129 100644 --- a/diylc/diylc-swing/update.xml +++ b/diylc/diylc-swing/update.xml @@ -1341,6 +1341,10 @@ NEW_FEATURE Project Cloud feature introduced with global project sharing functionality + + + NEW_FEATURE + Added Public Announcements feature IMPROVEMENT