Package com.psddev.dari.db

Examples of com.psddev.dari.db.State.save()


        State state = State.getInstance(object);

        try {
            updateUsingParameters(object);
            state.save();
            redirectOnSave("",
                    "_frame", param(boolean.class, "_frame") ? Boolean.TRUE : null,
                    "id", state.getId());
            return true;
View Full Code Here


                                withZone(timeZone).
                                parseMillis(new DateTime(newPublishDate).toString("yyyy-MM-dd HH:mm:ss")));

                        contentData.setPublishUser(page.getUser());
                        contentData.setPublishDate(newPublishDate);
                        state.save();
                    }
                }

            } else if (page.param(String.class, "action-unlock") != null) {
                contentLock.delete();
View Full Code Here

                    (state.isNew() || contentData.isDraft()) &&
                    !page.getCmsTool().isDisableAutomaticallySavingDrafts()) {
                contentData.setDraft(true);
                contentData.setUpdateDate(new Date());
                contentData.setUpdateUser(user);
                state.save();

                Set<UUID> automaticallySavedDraftIds = user.getAutomaticallySavedDraftIds();
                UUID id = state.getId();

                if (!automaticallySavedDraftIds.contains(id)) {
View Full Code Here

                        for (String clear : clears) {
                            itemState.remove(clear);
                        }

                        try {
                            itemState.save();

                        } catch (Exception error) {
                            LOGGER.warn(String.format(
                                    "Can't save [%s] as part of a bulk edit!", itemState.getId()),
                                    error);
View Full Code Here

                        where("_id = ?", page.param(UUID.class, "scheduleId")).
                        first());
            }
        }

        userState.save();

        String returnUrl = page.param(String.class, "returnUrl");

        if (!ObjectUtils.isBlank(returnUrl)) {
            page.getResponse().sendRedirect(returnUrl);
View Full Code Here

                    map.remove("_type");
                    map.remove("_id");
                    State state = State.getInstance(section);
                    state.getValues().putAll(map);
                    if (((Section) section).isShareable()) {
                        state.save();
                    } else {
                        state.setId(null);
                        state.setStatus(null);
                    }
                    return section;
View Full Code Here

            } else {
                objectSiteMod.getConsumers().remove(site);
                if (objectSiteMod.isGlobal()) {
                    objectSiteMod.getBlacklist().add(site);
                }
                objectState.save();
                return null;
            }
        }

        /**
 
View Full Code Here

            contentData.setUpdateDate(now);
            contentData.setUpdateUser(user);

            if (object instanceof Draft) {
                state.save();
                return null;

            } else {
                try {
                    History history = new History(user, object);
View Full Code Here

            } else {
                try {
                    History history = new History(user, object);

                    state.beginWrites();
                    state.save();
                    history.save();
                    state.commitWrites();
                    return history;

                } finally {
View Full Code Here

                ObjectModification contentData = state.as(ObjectModification.class);

                contentData.setTrash(true);
                contentData.setUpdateDate(new Date());
                contentData.setUpdateUser(user);
                state.save();

            } else {
                siteData.getConsumers().remove(site);

                if (siteData.isGlobal()) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.