use of com.liferay.ide.core.remote.APIException in project liferay-ide by liferay.
the class PortalConnection method getJournalArticles.
public JSONArray getJournalArticles(long groupId, long userId) throws APIException {
JSONArray journalArticles = null;
// $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
Object jsonResponse = getJSONAPI(GET_JOURNAL_ARTICLES_API, "groupId", groupId, "userId", userId, "start", -1, "end", -1, "-obc", null);
if (jsonResponse instanceof JSONArray) {
journalArticles = (JSONArray) jsonResponse;
} else {
// $NON-NLS-1$
throw new APIException(GET_JOURNAL_ARTICLES_API, "Unable to get JSONArray");
}
return journalArticles;
}
use of com.liferay.ide.core.remote.APIException in project liferay-ide by liferay.
the class PortalConnection method getUserByEmailAddress.
public JSONObject getUserByEmailAddress(long companyId) throws APIException {
JSONObject user = null;
// $NON-NLS-1$ //$NON-NLS-2$
Object jsonResponse = getJSONAPI(GET_USER_BY_EMAIL_ADDRESS_API, "companyId", Long.toString(companyId), "emailAddress", getUsername());
if (jsonResponse instanceof JSONObject) {
user = (JSONObject) jsonResponse;
} else {
// $NON-NLS-1$
throw new APIException(GET_USER_BY_EMAIL_ADDRESS_API, "Unable to get JSONObject");
}
return user;
}
use of com.liferay.ide.core.remote.APIException in project liferay-ide by liferay.
the class PortalConnection method getStructures.
public JSONArray getStructures(long groupId) throws APIException {
JSONArray structures = null;
// $NON-NLS-1$
Object jsonResponse = getJSONAPI(GET_STRUCTURES_API, "groupId", groupId);
if (jsonResponse instanceof JSONArray) {
structures = (JSONArray) jsonResponse;
} else {
// $NON-NLS-1$
throw new APIException(GET_STRUCTURES_API, "Unable to get JSONArray");
}
return structures;
}
use of com.liferay.ide.core.remote.APIException in project liferay-ide by liferay.
the class PortalConnection method getUserSites.
public JSONArray getUserSites() throws APIException {
JSONArray sites = null;
Object jsonResponse = getJSONAPI(GET_USER_SITES_API);
if (jsonResponse instanceof JSONArray) {
sites = (JSONArray) jsonResponse;
} else {
// $NON-NLS-1$
throw new APIException(GET_USER_SITES_API, "Unable to get JSONArray");
}
return sites;
}
use of com.liferay.ide.core.remote.APIException in project liferay-ide by liferay.
the class DebugPortalLaunchParticipant method portalPostLaunch.
public void portalPostLaunch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
final IServer server = org.eclipse.wst.server.core.ServerUtil.getServer(configuration);
final IServerManagerConnection connection = ServerUtil.getServerManagerConnection(server, monitor);
if (connection != null) {
try {
final String fmDebugPassword = connection.getFMDebugPassword();
final int fmDebugPort = connection.getFMDebugPort();
if (fmDebugPassword != null && fmDebugPort != -1) {
launch.setAttribute(PortalCore.PREF_FM_DEBUG_PASSWORD, fmDebugPassword);
launch.setAttribute(PortalCore.PREF_FM_DEBUG_PORT, Integer.toString(fmDebugPort));
final IDebugTarget target = new FMDebugTarget(server.getHost(), launch, launch.getProcesses()[0]);
launch.addDebugTarget(target);
}
} catch (APIException e) {
LiferayServerCore.logError("Unable to determine remote freemarker debugger connection info.", e);
}
}
this.saveLaunchMode = null;
final String stopServer = configuration.getAttribute(STOP_SERVER, "false");
if (ILaunchManager.DEBUG_MODE.equals(mode) && "false".equals(stopServer)) {
if (this.fmDebugPort != null) {
launch.setAttribute(PortalCore.PREF_FM_DEBUG_PORT, this.fmDebugPort);
this.fmDebugPort = null;
final IDebugTarget target = new FMDebugTarget(server.getHost(), launch, launch.getProcesses()[0]);
launch.addDebugTarget(target);
} else {
// $NON-NLS-1$
PortalCore.logError("Launch freemarker port is invalid.");
}
}
}
Aggregations