List of usage examples for com.liferay.portal.kernel.json JSONArray toString
@Override
public String toString();
From source file:at.graz.meduni.liferay.api.service.http.rdconnectServiceSoap.java
License:Open Source License
public static java.lang.String regbbs() throws RemoteException { try {/* ww w.j ava 2 s . co m*/ com.liferay.portal.kernel.json.JSONArray returnValue = rdconnectServiceUtil.regbbs(); return returnValue.toString(); } catch (Exception e) { _log.error(e, e); throw new RemoteException(e.getMessage()); } }
From source file:at.graz.meduni.liferay.api.service.http.rdconnectServiceSoap.java
License:Open Source License
/** * @return//from www . j a v a 2s . co m */ public static java.lang.String regs() throws RemoteException { try { com.liferay.portal.kernel.json.JSONArray returnValue = rdconnectServiceUtil.regs(); return returnValue.toString(); } catch (Exception e) { _log.error(e, e); throw new RemoteException(e.getMessage()); } }
From source file:at.graz.meduni.liferay.api.service.http.rdconnectServiceSoap.java
License:Open Source License
/** * @return// w w w . ja v a 2 s. c om */ public static java.lang.String bbs() throws RemoteException { try { com.liferay.portal.kernel.json.JSONArray returnValue = rdconnectServiceUtil.bbs(); return returnValue.toString(); } catch (Exception e) { _log.error(e, e); throw new RemoteException(e.getMessage()); } }
From source file:at.graz.meduni.liferay.portlet.bibbox.service.service.http.LogapiServiceSoap.java
License:Open Source License
/** * @return/* ww w . j ava 2s . co m*/ */ public static java.lang.String regbbs(java.lang.String data) throws RemoteException { try { com.liferay.portal.kernel.json.JSONArray returnValue = LogapiServiceUtil.regbbs(data); return returnValue.toString(); } catch (Exception e) { _log.error(e, e); throw new RemoteException(e.getMessage()); } }
From source file:at.graz.meduni.liferay.portlet.bibbox.service.service.http.LogapiServiceSoap.java
License:Open Source License
/** * @return//from w w w . ja v a 2s .co m */ public static java.lang.String regbbs() throws RemoteException { try { com.liferay.portal.kernel.json.JSONArray returnValue = LogapiServiceUtil.regbbs(); return returnValue.toString(); } catch (Exception e) { _log.error(e, e); throw new RemoteException(e.getMessage()); } }
From source file:at.graz.meduni.liferay.portlet.bibbox.service.service.http.LogapiServiceSoap.java
License:Open Source License
public static java.lang.String findorganizationbyname(java.lang.String organizationname) throws RemoteException { try {/* w w w. j av a 2 s .co m*/ com.liferay.portal.kernel.json.JSONArray returnValue = LogapiServiceUtil .findorganizationbyname(organizationname); return returnValue.toString(); } catch (Exception e) { _log.error(e, e); throw new RemoteException(e.getMessage()); } }
From source file:at.graz.meduni.liferay.portlet.bibbox.service.service.http.LogapiServiceSoap.java
License:Open Source License
/** * @return/*from w w w.jav a 2 s . c om*/ */ public static java.lang.String regs() throws RemoteException { try { com.liferay.portal.kernel.json.JSONArray returnValue = LogapiServiceUtil.regs(); return returnValue.toString(); } catch (Exception e) { _log.error(e, e); throw new RemoteException(e.getMessage()); } }
From source file:at.graz.meduni.liferay.portlet.bibbox.service.service.http.LogapiServiceSoap.java
License:Open Source License
/** * @return// w ww . j a v a2 s .c o m */ public static java.lang.String bbs() throws RemoteException { try { com.liferay.portal.kernel.json.JSONArray returnValue = LogapiServiceUtil.bbs(); return returnValue.toString(); } catch (Exception e) { _log.error(e, e); throw new RemoteException(e.getMessage()); } }
From source file:com.beorn.onlinepayment.messaging.messageprocessor.GetPaymentMethodsMessageProcessorTest.java
License:Open Source License
/** * Verifies that the GetPaymentMethodsMessageProcessor sends an answer * containing available payment methods that corresponds to the * transactionId parameter/*from w w w . j av a2 s . c o m*/ * * @throws Exception */ @Test public void testProcessMessage() throws Exception { // Data String applicationId = "appID"; long transactionId = 123; String countryCode = "FR"; List<PaymentMethod> paymentMethods = new ArrayList<PaymentMethod>(); String jsonStringPaymentMethods = "jsonStringPaymentMethods"; // Mocks mockStatic(TransactionLocalServiceUtil.class); mockStatic(PaymentMethodLocalServiceUtil.class); mockStatic(JSONUtil.class); Message message = mock(Message.class); Message response = mock(Message.class); MessageContext messageContext = mock(MessageContext.class); Transaction transaction = mock(Transaction.class); JSONArray jsonPaymentMethods = mock(JSONArray.class); when(message.getStringProperty(Mockito.eq("applicationId"))).thenReturn(applicationId); when(message.getLongProperty(Mockito.eq("transactionId"))).thenReturn(transactionId); when(message.getStringProperty(Mockito.eq("countryCode"))).thenReturn(countryCode); when(TransactionLocalServiceUtil.getTransaction(Mockito.eq(transactionId))).thenReturn(transaction); when(PaymentMethodLocalServiceUtil.getTransactionAvailablePaymentMethods(Mockito.eq(transaction), Mockito.eq(countryCode))).thenReturn(paymentMethods); when(messageContext.createResponse(Mockito.eq(message))).thenReturn(response); when(JSONUtil.paymentMethodsToJSON(Mockito.eq(paymentMethods))).thenReturn(jsonPaymentMethods); when(jsonPaymentMethods.toString()).thenReturn(jsonStringPaymentMethods); // Test GetPaymentMethodsMessageProcessor getPaymentMethodsMessageProcessor = new GetPaymentMethodsMessageProcessor(); getPaymentMethodsMessageProcessor.processMessage(message, messageContext); Mockito.verify(response).setStringProperty(Mockito.eq("methods"), Mockito.eq(jsonStringPaymentMethods)); Mockito.verify(messageContext).sendResponse(Mockito.eq(message), Mockito.eq(response)); }
From source file:com.evozon.evoportal.my_account.wrapper.UserExpandoWrapper.java
public void addNewStatusLog(int status, long createdDate, long statusChangeDate) { try {/*from w w w .ja v a 2 s . c o m*/ JSONArray statusArray = getStatusArrayLog(); if (statusArray == null) { statusArray = JSONFactoryUtil.createJSONArray(); } JSONObject newStatus = JSONFactoryUtil.createJSONObject(); newStatus.put("status", status); newStatus.put("createdDate", createdDate); newStatus.put("statusChangeDate", statusChangeDate); statusArray.put(newStatus); user.getExpandoBridge().setAttribute(MyAccountConstants.EVOZON_USER_STATUS, statusArray.toString(), false); } catch (JSONException e) { log.error(e); } }