Package org.fluxtream.core.domain

Examples of org.fluxtream.core.domain.WidgetSettings


    }

    @Override
    @Transactional(readOnly=false)
    public void saveWidgetSettings(final long guestId, final long dashboardId, final String widgetName, final String settingsJSON) {
        WidgetSettings settings = JPAUtils.findUnique(em, WidgetSettings.class,
                                                      "widgetSettings.byDashboardAndName",
                                                      guestId, dashboardId, widgetName);
        if (settings==null) {
            settings = new WidgetSettings();
            settings.guestId = guestId;
            settings.dashboardId = dashboardId;
            settings.widgetName = widgetName;
            settings.settingsJSON = settingsJSON;
            em.persist(settings);
View Full Code Here


        }
    }

    @Override
    public WidgetSettings getWidgetSettings(final long guestId, final long dashboardId, final String widgetName) {
        final WidgetSettings settings = JPAUtils.findUnique(em, WidgetSettings.class,
                                                            "widgetSettings.byDashboardAndName",
                                                            guestId, dashboardId, widgetName);
        if (settings==null) {
            saveWidgetSettings(guestId, dashboardId, widgetName, "{}");
            return getWidgetSettings(guestId, dashboardId, widgetName);
View Full Code Here

        DashboardWidgetModel widgetModel = new DashboardWidgetModel();
        widgetModel.manifest = widgetManifestModel;

        if (dashboard!=null && dashboardWidget.HasSettings) {
            final WidgetSettings widgetSettings = widgetsService.getWidgetSettings(guestId, dashboard.getId(),
                    dashboardWidget.WidgetName);
            widgetModel.settings = widgetSettings.settingsJSON;
        }

        return widgetModel;
View Full Code Here

    public Response getWidgetSettings(@PathParam("dashboardId") long dashboardId,
                                      @PathParam("widgetName") String widgetName) throws UnsupportedEncodingException {
        long guestId = AuthHelper.getGuestId();
        try{
            widgetName = URLDecoder.decode(widgetName, "UTF-8");
            final WidgetSettings settings = widgetsService.getWidgetSettings(guestId, dashboardId, widgetName);
            JSONObject jsonSettings = JSONObject.fromObject(settings.settingsJSON);
            return Response.ok(jsonSettings.toString()).build();
        }
        catch (Exception e){
            StringBuilder sb = new StringBuilder("module=API component=dashboardStore action=getWidgetSettings")
View Full Code Here

TOP

Related Classes of org.fluxtream.core.domain.WidgetSettings

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.