Package org.b3log.latke.action

Examples of org.b3log.latke.action.ActionException


        } catch (final Exception e) {
            if (transaction.isActive()) {
                transaction.rollback();
            }
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
            throw new ActionException(e);
        }

        return ret;
    }
View Full Code Here


            ret.put(Common.PAGE_CACHED_CNT, PageCaches.getKeys().size());
        } catch (final JSONException e) {
            LOGGER.log(Level.SEVERE, "Gets page cache status error: {0}",
                       e.getMessage());
            throw new ActionException(e);
        }

        return ret;
    }
View Full Code Here

            ret.put(Page.PAGES, pages.subList(start, end));

            ret.put(Keys.STATUS_CODE, true);
        } catch (final Exception e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
            throw new ActionException(e);
        }

        return ret;
    }
View Full Code Here

            if (transaction.isActive()) {
                transaction.rollback();
            }
            LOGGER.log(Level.SEVERE, "Sets page cache error: {0}",
                       e.getMessage());
            throw new ActionException(e);
        }

        PageCaches.removeAll();
    }
View Full Code Here

            try {
                ret.put(Keys.STATUS_CODE, false);
                ret.put(Keys.MSG, langs.get("setFailLabel"));
                return ret;
            } catch (final JSONException ex) {
                throw new ActionException(
                        "Set plugin status fatal error!");
            }
        }

        final PluginManager pluginManager = PluginManager.getInstance();
        final List<AbstractPlugin> plugins = pluginManager.getPlugins();

        for (final AbstractPlugin plugin : plugins) {
            if (plugin.getId().equals(pluginId)) {
                final Transaction transaction =
                        pluginRepository.beginTransaction();
                try {
                    plugin.setStatus(PluginStatus.valueOf(status));
                   
                    pluginRepository.update(pluginId, plugin.toJSONObject());

                    transaction.commit();

                    pluginManager.update(plugin);

                    ret.put(Keys.STATUS_CODE, true);
                    ret.put(Keys.MSG, langs.get("setSuccLabel"));
                    return ret;
                } catch (final Exception e) {
                    if (transaction.isActive()) {
                        transaction.rollback();
                    }

                    LOGGER.log(Level.SEVERE, "Set plugin status error", e);

                    try {
                        ret.put(Keys.STATUS_CODE, false);
                        ret.put(Keys.MSG, langs.get("setFailLabel"));
                        return ret;
                    } catch (final JSONException ex) {
                        throw new ActionException(
                                "Set plugin status fatal error!");
                    }
                }
            }
        }

        try {
            ret.put(Keys.STATUS_CODE, false);
            ret.put(Keys.MSG, langs.get("refreshAndRetryLabel"));

            return ret;
        } catch (final JSONException ex) {
            throw new ActionException("Set plugin status fatal error!");
        }
    }
View Full Code Here

            ret.put(Plugin.PLUGINS, pluginJSONObjects.subList(start, end));

            ret.put(Keys.STATUS_CODE, StatusCodes.GET_PLUGINS_SUCC);
        } catch (final Exception e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
            throw new ActionException(e);
        }

        return ret;
    }
View Full Code Here

            ret.put(File.FILES, files);

            ret.put(Keys.STATUS_CODE, StatusCodes.GET_FILES_SUCC);
        } catch (final Exception e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
            throw new ActionException(e);
        }

        return ret;
    }
View Full Code Here

        } catch (final Exception e) {
            if (transaction.isActive()) {
                transaction.rollback();
            }
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
            throw new ActionException(e);
        }

        return ret;
    }
View Full Code Here

            ret.put(Keys.STATUS_CODE, StatusCodes.GET_PAGE_SUCC);

            LOGGER.log(Level.FINER, "Got page [oId={0}]", pageId);
        } catch (final Exception e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
            throw new ActionException(e);
        }

        return ret;
    }
View Full Code Here

            ret.put(Pagination.PAGINATION, pagination);
            ret.put(Page.PAGES, pages);
            ret.put(Keys.STATUS_CODE, StatusCodes.GET_PAGES_SUCC);
        } catch (final Exception e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
            throw new ActionException(e);
        }

        return ret;
    }
View Full Code Here

TOP

Related Classes of org.b3log.latke.action.ActionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.