Example usage for com.liferay.portal.kernel.workflow WorkflowConstants STATUS_DRAFT

List of usage examples for com.liferay.portal.kernel.workflow WorkflowConstants STATUS_DRAFT

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.workflow WorkflowConstants STATUS_DRAFT.

Prototype

int STATUS_DRAFT

To view the source code for com.liferay.portal.kernel.workflow WorkflowConstants STATUS_DRAFT.

Click Source Link

Usage

From source file:com.service.feedback.service.impl.FeedbackLocalServiceImpl.java

License:Open Source License

public Feedback saveFeedback(String subject, String feedbackText, long userId, long companyId, long groupId)
        throws SystemException {
    long feedbackId = counterLocalService.increment(Feedback.class.getName());
    Feedback feedback = feedbackPersistence.create(feedbackId);
    feedback.setFeedbackSubject(subject);
    feedback.setFeedbackText(feedbackText);
    feedback.setFeedbackDate(new Date());
    feedback.setCompanyId(companyId);/*www. ja  va 2 s .  c o m*/
    feedback.setGroupId(groupId);
    feedback.setUserId(userId);
    feedback.setFeedBackStatus(WorkflowConstants.STATUS_DRAFT);
    feedback.setStatusByUserId(userId);

    return feedbackPersistence.update(feedback);

}

From source file:com.xtivia.book.portlet.service.impl.BookLocalServiceImpl.java

License:Open Source License

public Book createBook(Book newBook, long userId, ServiceContext context) throws PortalException {
    Date now = new Date();
    User user = userLocalService.getUser(userId);

    Book book = this.bookPersistence.create(counterLocalService.increment(Book.class.getName()));
    book.setTitle(newBook.getTitle());/*from   ww w . j  ava2  s.  c  om*/
    book.setAuthor(newBook.getAuthor());
    book.setIsbn(newBook.getIsbn());
    book.setSummary(newBook.getSummary());
    book.setUserId(context.getUserId());
    book.setCompanyId(context.getCompanyId());
    book.setGroupId(context.getScopeGroupId());
    book.setStatus(WorkflowConstants.STATUS_DRAFT);
    book.setStatusByUserId(userId);
    book.setStatusByUserName(user.getFullName());
    book.setStatusDate(context.getModifiedDate(null));
    book.setUuid(context.getUuid());
    book.setCreatedDate(context.getCreateDate(now));
    book.setModifiedDate(context.getModifiedDate(now));

    validate(newBook.getTitle());

    this.bookPersistence.update(book);

    resourceLocalService.addResources(context.getCompanyId(), context.getScopeGroupId(), userId,
            Book.class.getName(), book.getPrimaryKey(), false, true, true);

    AssetEntry assetEntry = AssetEntryLocalServiceUtil.updateEntry(userId, context.getScopeGroupId(),
            Book.class.getName(), book.getBookId(), context.getAssetCategoryIds(), context.getAssetTagNames());

    this.assetLinkLocalService.updateLinks(userId, assetEntry.getEntryId(), context.getAssetLinkEntryIds(),
            AssetLinkConstants.TYPE_RELATED);

    WorkflowHandlerRegistryUtil.startWorkflowInstance(book.getCompanyId(), book.getGroupId(), book.getUserId(),
            Book.class.getName(), book.getPrimaryKey(), book, context);

    Indexer<Book> indexer = IndexerRegistryUtil.nullSafeGetIndexer(Book.class);
    indexer.reindex(book);

    return book;
}

From source file:joolz.test.MyBean.java

License:Open Source License

/**
 * Checks if a site is draft./*from w w w . j ava  2 s . c o m*/
 *
 * @param groupId
 *            the group id
 * @return true, if is site draft
 */
private boolean isSiteDraft(final long groupId) {
    boolean result = false;
    try {
        Product product = ProductLocalServiceUtil.getProductByG(groupId);
        if (product != null) {
            int state = product.getState();
            if (WorkflowConstants.STATUS_DRAFT == state) {
                result = true;
            }
        }
    } catch (SystemException e) {
        LOG.error(e);
    }
    return result;
}

From source file:org.apache.jsp.html.edit_005fslogan_jsp.java

License:Open Source License

public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    PageContext pageContext = null;/*  www.  java  2  s  .c o  m*/
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;

    try {
        response.setContentType("text/html");
        pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true);
        _jspx_page_context = pageContext;
        application = pageContext.getServletContext();
        config = pageContext.getServletConfig();
        session = pageContext.getSession();
        out = pageContext.getOut();
        _jspx_out = out;

        /**
        * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
        *
        * This library is free software; you can redistribute it and/or modify it under
        * the terms of the GNU Lesser General Public License as published by the Free
        * Software Foundation; either version 2.1 of the License, or (at your option)
        * any later version.
        *
        * This library is distributed in the hope that it will be useful, but WITHOUT
        * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
        * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
        * details.
        */

        out.write('\n');
        out.write('\n');

        /**
        * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
        *
        * This library is free software; you can redistribute it and/or modify it under
        * the terms of the GNU Lesser General Public License as published by the Free
        * Software Foundation; either version 2.1 of the License, or (at your option)
        * any later version.
        *
        * This library is distributed in the hope that it will be useful, but WITHOUT
        * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
        * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
        * details.
        */

        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        out.write("\n");
        //  portlet:defineObjects
        com.liferay.taglib.portlet.DefineObjectsTag _jspx_th_portlet_005fdefineObjects_005f0 = (com.liferay.taglib.portlet.DefineObjectsTag) _005fjspx_005ftagPool_005fportlet_005fdefineObjects_005fnobody
                .get(com.liferay.taglib.portlet.DefineObjectsTag.class);
        _jspx_th_portlet_005fdefineObjects_005f0.setPageContext(_jspx_page_context);
        _jspx_th_portlet_005fdefineObjects_005f0.setParent(null);
        int _jspx_eval_portlet_005fdefineObjects_005f0 = _jspx_th_portlet_005fdefineObjects_005f0.doStartTag();
        if (_jspx_th_portlet_005fdefineObjects_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
            _005fjspx_005ftagPool_005fportlet_005fdefineObjects_005fnobody
                    .reuse(_jspx_th_portlet_005fdefineObjects_005f0);
            return;
        }
        _005fjspx_005ftagPool_005fportlet_005fdefineObjects_005fnobody
                .reuse(_jspx_th_portlet_005fdefineObjects_005f0);
        javax.portlet.ActionRequest actionRequest = null;
        javax.portlet.ActionResponse actionResponse = null;
        javax.portlet.EventRequest eventRequest = null;
        javax.portlet.EventResponse eventResponse = null;
        javax.portlet.PortletConfig portletConfig = null;
        java.lang.String portletName = null;
        javax.portlet.PortletPreferences portletPreferences = null;
        java.util.Map portletPreferencesValues = null;
        javax.portlet.PortletSession portletSession = null;
        java.util.Map portletSessionScope = null;
        javax.portlet.RenderRequest renderRequest = null;
        javax.portlet.RenderResponse renderResponse = null;
        javax.portlet.ResourceRequest resourceRequest = null;
        javax.portlet.ResourceResponse resourceResponse = null;
        actionRequest = (javax.portlet.ActionRequest) _jspx_page_context.findAttribute("actionRequest");
        actionResponse = (javax.portlet.ActionResponse) _jspx_page_context.findAttribute("actionResponse");
        eventRequest = (javax.portlet.EventRequest) _jspx_page_context.findAttribute("eventRequest");
        eventResponse = (javax.portlet.EventResponse) _jspx_page_context.findAttribute("eventResponse");
        portletConfig = (javax.portlet.PortletConfig) _jspx_page_context.findAttribute("portletConfig");
        portletName = (java.lang.String) _jspx_page_context.findAttribute("portletName");
        portletPreferences = (javax.portlet.PortletPreferences) _jspx_page_context
                .findAttribute("portletPreferences");
        portletPreferencesValues = (java.util.Map) _jspx_page_context.findAttribute("portletPreferencesValues");
        portletSession = (javax.portlet.PortletSession) _jspx_page_context.findAttribute("portletSession");
        portletSessionScope = (java.util.Map) _jspx_page_context.findAttribute("portletSessionScope");
        renderRequest = (javax.portlet.RenderRequest) _jspx_page_context.findAttribute("renderRequest");
        renderResponse = (javax.portlet.RenderResponse) _jspx_page_context.findAttribute("renderResponse");
        resourceRequest = (javax.portlet.ResourceRequest) _jspx_page_context.findAttribute("resourceRequest");
        resourceResponse = (javax.portlet.ResourceResponse) _jspx_page_context
                .findAttribute("resourceResponse");
        out.write('\n');
        out.write('\n');
        //  liferay-theme:defineObjects
        com.liferay.taglib.theme.DefineObjectsTag _jspx_th_liferay_002dtheme_005fdefineObjects_005f0 = (com.liferay.taglib.theme.DefineObjectsTag) _005fjspx_005ftagPool_005fliferay_002dtheme_005fdefineObjects_005fnobody
                .get(com.liferay.taglib.theme.DefineObjectsTag.class);
        _jspx_th_liferay_002dtheme_005fdefineObjects_005f0.setPageContext(_jspx_page_context);
        _jspx_th_liferay_002dtheme_005fdefineObjects_005f0.setParent(null);
        int _jspx_eval_liferay_002dtheme_005fdefineObjects_005f0 = _jspx_th_liferay_002dtheme_005fdefineObjects_005f0
                .doStartTag();
        if (_jspx_th_liferay_002dtheme_005fdefineObjects_005f0
                .doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
            _005fjspx_005ftagPool_005fliferay_002dtheme_005fdefineObjects_005fnobody
                    .reuse(_jspx_th_liferay_002dtheme_005fdefineObjects_005f0);
            return;
        }
        _005fjspx_005ftagPool_005fliferay_002dtheme_005fdefineObjects_005fnobody
                .reuse(_jspx_th_liferay_002dtheme_005fdefineObjects_005f0);
        com.liferay.portal.theme.ThemeDisplay themeDisplay = null;
        com.liferay.portal.model.Company company = null;
        com.liferay.portal.model.Account account = null;
        com.liferay.portal.model.User user = null;
        com.liferay.portal.model.User realUser = null;
        com.liferay.portal.model.Contact contact = null;
        com.liferay.portal.model.Layout layout = null;
        java.util.List layouts = null;
        java.lang.Long plid = null;
        com.liferay.portal.model.LayoutTypePortlet layoutTypePortlet = null;
        java.lang.Long scopeGroupId = null;
        com.liferay.portal.security.permission.PermissionChecker permissionChecker = null;
        java.util.Locale locale = null;
        java.util.TimeZone timeZone = null;
        com.liferay.portal.model.Theme theme = null;
        com.liferay.portal.model.ColorScheme colorScheme = null;
        com.liferay.portal.theme.PortletDisplay portletDisplay = null;
        java.lang.Long portletGroupId = null;
        themeDisplay = (com.liferay.portal.theme.ThemeDisplay) _jspx_page_context.findAttribute("themeDisplay");
        company = (com.liferay.portal.model.Company) _jspx_page_context.findAttribute("company");
        account = (com.liferay.portal.model.Account) _jspx_page_context.findAttribute("account");
        user = (com.liferay.portal.model.User) _jspx_page_context.findAttribute("user");
        realUser = (com.liferay.portal.model.User) _jspx_page_context.findAttribute("realUser");
        contact = (com.liferay.portal.model.Contact) _jspx_page_context.findAttribute("contact");
        layout = (com.liferay.portal.model.Layout) _jspx_page_context.findAttribute("layout");
        layouts = (java.util.List) _jspx_page_context.findAttribute("layouts");
        plid = (java.lang.Long) _jspx_page_context.findAttribute("plid");
        layoutTypePortlet = (com.liferay.portal.model.LayoutTypePortlet) _jspx_page_context
                .findAttribute("layoutTypePortlet");
        scopeGroupId = (java.lang.Long) _jspx_page_context.findAttribute("scopeGroupId");
        permissionChecker = (com.liferay.portal.security.permission.PermissionChecker) _jspx_page_context
                .findAttribute("permissionChecker");
        locale = (java.util.Locale) _jspx_page_context.findAttribute("locale");
        timeZone = (java.util.TimeZone) _jspx_page_context.findAttribute("timeZone");
        theme = (com.liferay.portal.model.Theme) _jspx_page_context.findAttribute("theme");
        colorScheme = (com.liferay.portal.model.ColorScheme) _jspx_page_context.findAttribute("colorScheme");
        portletDisplay = (com.liferay.portal.theme.PortletDisplay) _jspx_page_context
                .findAttribute("portletDisplay");
        portletGroupId = (java.lang.Long) _jspx_page_context.findAttribute("portletGroupId");
        out.write('\n');
        out.write('\n');

        String currentURL = PortalUtil.getCurrentURL(request);

        out.write('\n');
        out.write('\n');
        //  portlet:renderURL
        com.liferay.taglib.portlet.RenderURLTag _jspx_th_portlet_005frenderURL_005f0 = (com.liferay.taglib.portlet.RenderURLTag) _005fjspx_005ftagPool_005fportlet_005frenderURL_0026_005fwindowState_005fvar
                .get(com.liferay.taglib.portlet.RenderURLTag.class);
        _jspx_th_portlet_005frenderURL_005f0.setPageContext(_jspx_page_context);
        _jspx_th_portlet_005frenderURL_005f0.setParent(null);
        // /html/edit_slogan.jsp(19,0) name = windowState type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
        _jspx_th_portlet_005frenderURL_005f0.setWindowState("normal");
        // /html/edit_slogan.jsp(19,0) name = var type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
        _jspx_th_portlet_005frenderURL_005f0.setVar("backURL");
        int _jspx_eval_portlet_005frenderURL_005f0 = _jspx_th_portlet_005frenderURL_005f0.doStartTag();
        if (_jspx_eval_portlet_005frenderURL_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
            if (_jspx_eval_portlet_005frenderURL_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
                out = _jspx_page_context.pushBody();
                _jspx_th_portlet_005frenderURL_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
                _jspx_th_portlet_005frenderURL_005f0.doInitBody();
            }
            do {
                out.write('\n');
                out.write(' ');
                out.write(' ');
                if (_jspx_meth_portlet_005fparam_005f0(_jspx_th_portlet_005frenderURL_005f0,
                        _jspx_page_context))
                    return;
                out.write('\n');
                int evalDoAfterBody = _jspx_th_portlet_005frenderURL_005f0.doAfterBody();
                if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
                    break;
            } while (true);
            if (_jspx_eval_portlet_005frenderURL_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
                out = _jspx_page_context.popBody();
            }
        }
        if (_jspx_th_portlet_005frenderURL_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
            _005fjspx_005ftagPool_005fportlet_005frenderURL_0026_005fwindowState_005fvar
                    .reuse(_jspx_th_portlet_005frenderURL_005f0);
            return;
        }
        _005fjspx_005ftagPool_005fportlet_005frenderURL_0026_005fwindowState_005fvar
                .reuse(_jspx_th_portlet_005frenderURL_005f0);
        java.lang.String backURL = null;
        backURL = (java.lang.String) _jspx_page_context.findAttribute("backURL");
        out.write('\n');
        out.write('\n');
        //  liferay-ui:header
        com.liferay.taglib.ui.HeaderTag _jspx_th_liferay_002dui_005fheader_005f0 = (com.liferay.taglib.ui.HeaderTag) _005fjspx_005ftagPool_005fliferay_002dui_005fheader_0026_005ftitle_005fbackURL_005fnobody
                .get(com.liferay.taglib.ui.HeaderTag.class);
        _jspx_th_liferay_002dui_005fheader_005f0.setPageContext(_jspx_page_context);
        _jspx_th_liferay_002dui_005fheader_005f0.setParent(null);
        // /html/edit_slogan.jsp(23,0) name = backURL type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
        _jspx_th_liferay_002dui_005fheader_005f0.setBackURL(backURL);
        // /html/edit_slogan.jsp(23,0) name = title type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
        _jspx_th_liferay_002dui_005fheader_005f0.setTitle("Slogan Contest Entry");
        int _jspx_eval_liferay_002dui_005fheader_005f0 = _jspx_th_liferay_002dui_005fheader_005f0.doStartTag();
        if (_jspx_th_liferay_002dui_005fheader_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
            _005fjspx_005ftagPool_005fliferay_002dui_005fheader_0026_005ftitle_005fbackURL_005fnobody
                    .reuse(_jspx_th_liferay_002dui_005fheader_005f0);
            return;
        }
        _005fjspx_005ftagPool_005fliferay_002dui_005fheader_0026_005ftitle_005fbackURL_005fnobody
                .reuse(_jspx_th_liferay_002dui_005fheader_005f0);
        out.write('\n');
        out.write('\n');

        Slogan slogan = (Slogan) request.getAttribute(WebKeys.SLOGAN_ENTRY);
        String redirect = ParamUtil.getString(request, "redirect");

        long resourcePrimKey = BeanParamUtil.getLong(slogan, request, "sloganId");
        int status = BeanParamUtil.getInteger(slogan, request, "status", WorkflowConstants.STATUS_DRAFT);

        out.write('\n');
        out.write('\n');
        //  portlet:actionURL
        com.liferay.taglib.portlet.ActionURLTag _jspx_th_portlet_005factionURL_005f0 = (com.liferay.taglib.portlet.ActionURLTag) _005fjspx_005ftagPool_005fportlet_005factionURL_0026_005fvar_005fname
                .get(com.liferay.taglib.portlet.ActionURLTag.class);
        _jspx_th_portlet_005factionURL_005f0.setPageContext(_jspx_page_context);
        _jspx_th_portlet_005factionURL_005f0.setParent(null);
        // /html/edit_slogan.jsp(36,0) name = name type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
        _jspx_th_portlet_005factionURL_005f0.setName("updateSlogan");
        // /html/edit_slogan.jsp(36,0) name = var type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
        _jspx_th_portlet_005factionURL_005f0.setVar("updateSloganURL");
        int _jspx_eval_portlet_005factionURL_005f0 = _jspx_th_portlet_005factionURL_005f0.doStartTag();
        if (_jspx_eval_portlet_005factionURL_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
            if (_jspx_eval_portlet_005factionURL_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
                out = _jspx_page_context.pushBody();
                _jspx_th_portlet_005factionURL_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
                _jspx_th_portlet_005factionURL_005f0.doInitBody();
            }
            do {
                out.write('\n');
                out.write(' ');
                out.write(' ');
                //  portlet:param
                com.liferay.taglib.util.ParamTag _jspx_th_portlet_005fparam_005f1 = (com.liferay.taglib.util.ParamTag) _005fjspx_005ftagPool_005fportlet_005fparam_0026_005fvalue_005fname_005fnobody
                        .get(com.liferay.taglib.util.ParamTag.class);
                _jspx_th_portlet_005fparam_005f1.setPageContext(_jspx_page_context);
                _jspx_th_portlet_005fparam_005f1
                        .setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_portlet_005factionURL_005f0);
                // /html/edit_slogan.jsp(37,2) name = name type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
                _jspx_th_portlet_005fparam_005f1.setName("redirect");
                // /html/edit_slogan.jsp(37,2) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
                _jspx_th_portlet_005fparam_005f1.setValue(redirect);
                int _jspx_eval_portlet_005fparam_005f1 = _jspx_th_portlet_005fparam_005f1.doStartTag();
                if (_jspx_th_portlet_005fparam_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
                    _005fjspx_005ftagPool_005fportlet_005fparam_0026_005fvalue_005fname_005fnobody
                            .reuse(_jspx_th_portlet_005fparam_005f1);
                    return;
                }
                _005fjspx_005ftagPool_005fportlet_005fparam_0026_005fvalue_005fname_005fnobody
                        .reuse(_jspx_th_portlet_005fparam_005f1);
                out.write('\n');
                int evalDoAfterBody = _jspx_th_portlet_005factionURL_005f0.doAfterBody();
                if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
                    break;
            } while (true);
            if (_jspx_eval_portlet_005factionURL_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
                out = _jspx_page_context.popBody();
            }
        }
        if (_jspx_th_portlet_005factionURL_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
            _005fjspx_005ftagPool_005fportlet_005factionURL_0026_005fvar_005fname
                    .reuse(_jspx_th_portlet_005factionURL_005f0);
            return;
        }
        _005fjspx_005ftagPool_005fportlet_005factionURL_0026_005fvar_005fname
                .reuse(_jspx_th_portlet_005factionURL_005f0);
        java.lang.String updateSloganURL = null;
        updateSloganURL = (java.lang.String) _jspx_page_context.findAttribute("updateSloganURL");
        out.write('\n');
        out.write('\n');
        //  portlet:renderURL
        com.liferay.taglib.portlet.RenderURLTag _jspx_th_portlet_005frenderURL_005f1 = (com.liferay.taglib.portlet.RenderURLTag) _005fjspx_005ftagPool_005fportlet_005frenderURL_0026_005fvar
                .get(com.liferay.taglib.portlet.RenderURLTag.class);
        _jspx_th_portlet_005frenderURL_005f1.setPageContext(_jspx_page_context);
        _jspx_th_portlet_005frenderURL_005f1.setParent(null);
        // /html/edit_slogan.jsp(40,0) name = var type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
        _jspx_th_portlet_005frenderURL_005f1.setVar("cancelURL");
        int _jspx_eval_portlet_005frenderURL_005f1 = _jspx_th_portlet_005frenderURL_005f1.doStartTag();
        if (_jspx_eval_portlet_005frenderURL_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
            if (_jspx_eval_portlet_005frenderURL_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
                out = _jspx_page_context.pushBody();
                _jspx_th_portlet_005frenderURL_005f1.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
                _jspx_th_portlet_005frenderURL_005f1.doInitBody();
            }
            do {
                if (_jspx_meth_portlet_005fparam_005f2(_jspx_th_portlet_005frenderURL_005f1,
                        _jspx_page_context))
                    return;
                int evalDoAfterBody = _jspx_th_portlet_005frenderURL_005f1.doAfterBody();
                if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
                    break;
            } while (true);
            if (_jspx_eval_portlet_005frenderURL_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
                out = _jspx_page_context.popBody();
            }
        }
        if (_jspx_th_portlet_005frenderURL_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
            _005fjspx_005ftagPool_005fportlet_005frenderURL_0026_005fvar
                    .reuse(_jspx_th_portlet_005frenderURL_005f1);
            return;
        }
        _005fjspx_005ftagPool_005fportlet_005frenderURL_0026_005fvar
                .reuse(_jspx_th_portlet_005frenderURL_005f1);
        java.lang.String cancelURL = null;
        cancelURL = (java.lang.String) _jspx_page_context.findAttribute("cancelURL");
        out.write('\n');
        out.write('\n');
        //  aui:form
        com.liferay.taglib.aui.FormTag _jspx_th_aui_005fform_005f0 = (com.liferay.taglib.aui.FormTag) _005fjspx_005ftagPool_005faui_005fform_0026_005fname_005fmethod_005faction
                .get(com.liferay.taglib.aui.FormTag.class);
        _jspx_th_aui_005fform_005f0.setPageContext(_jspx_page_context);
        _jspx_th_aui_005fform_005f0.setParent(null);
        // /html/edit_slogan.jsp(42,0) name = name type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
        _jspx_th_aui_005fform_005f0.setName("fm");
        // /html/edit_slogan.jsp(42,0) name = action type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
        _jspx_th_aui_005fform_005f0.setAction(updateSloganURL.toString());
        // /html/edit_slogan.jsp(42,0) null
        _jspx_th_aui_005fform_005f0.setDynamicAttribute(null, "method", new String("post"));
        int _jspx_eval_aui_005fform_005f0 = _jspx_th_aui_005fform_005f0.doStartTag();
        if (_jspx_eval_aui_005fform_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
            if (_jspx_eval_aui_005fform_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
                out = _jspx_page_context.pushBody();
                _jspx_th_aui_005fform_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
                _jspx_th_aui_005fform_005f0.doInitBody();
            }
            do {
                out.write("\n");
                out.write("\n");
                out.write("  ");
                //  aui:fieldset
                com.liferay.taglib.aui.FieldsetTag _jspx_th_aui_005ffieldset_005f0 = (com.liferay.taglib.aui.FieldsetTag) _005fjspx_005ftagPool_005faui_005ffieldset
                        .get(com.liferay.taglib.aui.FieldsetTag.class);
                _jspx_th_aui_005ffieldset_005f0.setPageContext(_jspx_page_context);
                _jspx_th_aui_005ffieldset_005f0
                        .setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_aui_005fform_005f0);
                int _jspx_eval_aui_005ffieldset_005f0 = _jspx_th_aui_005ffieldset_005f0.doStartTag();
                if (_jspx_eval_aui_005ffieldset_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
                    if (_jspx_eval_aui_005ffieldset_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
                        out = _jspx_page_context.pushBody();
                        _jspx_th_aui_005ffieldset_005f0
                                .setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
                        _jspx_th_aui_005ffieldset_005f0.doInitBody();
                    }
                    do {
                        out.write("\n");
                        out.write("\n");
                        out.write("    ");
                        //  aui:model-context
                        com.liferay.taglib.aui.ModelContextTag _jspx_th_aui_005fmodel_002dcontext_005f0 = (com.liferay.taglib.aui.ModelContextTag) _005fjspx_005ftagPool_005faui_005fmodel_002dcontext_0026_005fmodel_005fbean_005fnobody
                                .get(com.liferay.taglib.aui.ModelContextTag.class);
                        _jspx_th_aui_005fmodel_002dcontext_005f0.setPageContext(_jspx_page_context);
                        _jspx_th_aui_005fmodel_002dcontext_005f0
                                .setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_aui_005ffieldset_005f0);
                        // /html/edit_slogan.jsp(46,4) name = bean type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
                        _jspx_th_aui_005fmodel_002dcontext_005f0.setBean(slogan);
                        // /html/edit_slogan.jsp(46,4) name = model type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
                        _jspx_th_aui_005fmodel_002dcontext_005f0.setModel(Slogan.class);
                        int _jspx_eval_aui_005fmodel_002dcontext_005f0 = _jspx_th_aui_005fmodel_002dcontext_005f0
                                .doStartTag();
                        if (_jspx_th_aui_005fmodel_002dcontext_005f0
                                .doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
                            _005fjspx_005ftagPool_005faui_005fmodel_002dcontext_0026_005fmodel_005fbean_005fnobody
                                    .reuse(_jspx_th_aui_005fmodel_002dcontext_005f0);
                            return;
                        }
                        _005fjspx_005ftagPool_005faui_005fmodel_002dcontext_0026_005fmodel_005fbean_005fnobody
                                .reuse(_jspx_th_aui_005fmodel_002dcontext_005f0);
                        out.write("\n");
                        out.write("\n");
                        out.write("    ");
                        //  c:if
                        org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f0 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest
                                .get(org.apache.taglibs.standard.tag.rt.core.IfTag.class);
                        _jspx_th_c_005fif_005f0.setPageContext(_jspx_page_context);
                        _jspx_th_c_005fif_005f0
                                .setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_aui_005ffieldset_005f0);
                        // /html/edit_slogan.jsp(48,4) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
                        _jspx_th_c_005fif_005f0.setTest(slogan != null);
                        int _jspx_eval_c_005fif_005f0 = _jspx_th_c_005fif_005f0.doStartTag();
                        if (_jspx_eval_c_005fif_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
                            do {
                                out.write("\n");
                                out.write("      ");
                                //  aui:workflow-status
                                com.liferay.taglib.aui.WorkflowStatusTag _jspx_th_aui_005fworkflow_002dstatus_005f0 = (com.liferay.taglib.aui.WorkflowStatusTag) _005fjspx_005ftagPool_005faui_005fworkflow_002dstatus_0026_005fstatus_005fid_005fnobody
                                        .get(com.liferay.taglib.aui.WorkflowStatusTag.class);
                                _jspx_th_aui_005fworkflow_002dstatus_005f0.setPageContext(_jspx_page_context);
                                _jspx_th_aui_005fworkflow_002dstatus_005f0
                                        .setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fif_005f0);
                                // /html/edit_slogan.jsp(49,6) name = id type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
                                _jspx_th_aui_005fworkflow_002dstatus_005f0
                                        .setId(String.valueOf(resourcePrimKey));
                                // /html/edit_slogan.jsp(49,6) name = status type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
                                _jspx_th_aui_005fworkflow_002dstatus_005f0.setStatus(status);
                                int _jspx_eval_aui_005fworkflow_002dstatus_005f0 = _jspx_th_aui_005fworkflow_002dstatus_005f0
                                        .doStartTag();
                                if (_jspx_th_aui_005fworkflow_002dstatus_005f0
                                        .doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
                                    _005fjspx_005ftagPool_005faui_005fworkflow_002dstatus_0026_005fstatus_005fid_005fnobody
                                            .reuse(_jspx_th_aui_005fworkflow_002dstatus_005f0);
                                    return;
                                }
                                _005fjspx_005ftagPool_005faui_005fworkflow_002dstatus_0026_005fstatus_005fid_005fnobody
                                        .reuse(_jspx_th_aui_005fworkflow_002dstatus_005f0);
                                out.write("\n");
                                out.write("    ");
                                int evalDoAfterBody = _jspx_th_c_005fif_005f0.doAfterBody();
                                if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
                                    break;
                            } while (true);
                        }
                        if (_jspx_th_c_005fif_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
                            _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f0);
                            return;
                        }
                        _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f0);
                        out.write("\n");
                        out.write("\n");
                        out.write("    ");
                        if (_jspx_meth_aui_005finput_005f0(_jspx_th_aui_005ffieldset_005f0, _jspx_page_context))
                            return;
                        out.write("\n");
                        out.write("\n");
                        out.write("    <h1>Slogan Contest Entry</h1>\n");
                        out.write("\n");
                        out.write("    ");
                        //  liferay-ui:error
                        com.liferay.taglib.ui.ErrorTag _jspx_th_liferay_002dui_005ferror_005f0 = (com.liferay.taglib.ui.ErrorTag) _005fjspx_005ftagPool_005fliferay_002dui_005ferror_0026_005fmessage_005fkey_005fnobody
                                .get(com.liferay.taglib.ui.ErrorTag.class);
                        _jspx_th_liferay_002dui_005ferror_005f0.setPageContext(_jspx_page_context);
                        _jspx_th_liferay_002dui_005ferror_005f0
                                .setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_aui_005ffieldset_005f0);
                        // /html/edit_slogan.jsp(56,4) name = key type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
                        _jspx_th_liferay_002dui_005ferror_005f0.setKey("slogan-required");
                        // /html/edit_slogan.jsp(56,4) name = message type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
                        _jspx_th_liferay_002dui_005ferror_005f0.setMessage("slogan-required");
                        int _jspx_eval_liferay_002dui_005ferror_005f0 = _jspx_th_liferay_002dui_005ferror_005f0
                                .doStartTag();
                        if (_jspx_th_liferay_002dui_005ferror_005f0
                                .doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
                            _005fjspx_005ftagPool_005fliferay_002dui_005ferror_0026_005fmessage_005fkey_005fnobody
                                    .reuse(_jspx_th_liferay_002dui_005ferror_005f0);
                            return;
                        }
                        _005fjspx_005ftagPool_005fliferay_002dui_005ferror_0026_005fmessage_005fkey_005fnobody
                                .reuse(_jspx_th_liferay_002dui_005ferror_005f0);
                        out.write("\n");
                        out.write("\n");
                        out.write("    ");
                        if (_jspx_meth_aui_005finput_005f1(_jspx_th_aui_005ffieldset_005f0, _jspx_page_context))
                            return;
                        out.write("\n");
                        out.write("\n");
                        out.write("    ");
                        if (_jspx_meth_aui_005finput_005f2(_jspx_th_aui_005ffieldset_005f0, _jspx_page_context))
                            return;
                        out.write("\n");
                        out.write("\n");
                        out.write("    ");
                        if (_jspx_meth_aui_005finput_005f3(_jspx_th_aui_005ffieldset_005f0, _jspx_page_context))
                            return;
                        out.write("\n");
                        out.write("\n");
                        out.write("    ");
                        //  aui:button-row
                        com.liferay.taglib.aui.ButtonRowTag _jspx_th_aui_005fbutton_002drow_005f0 = (com.liferay.taglib.aui.ButtonRowTag) _005fjspx_005ftagPool_005faui_005fbutton_002drow
                                .get(com.liferay.taglib.aui.ButtonRowTag.class);
                        _jspx_th_aui_005fbutton_002drow_005f0.setPageContext(_jspx_page_context);
                        _jspx_th_aui_005fbutton_002drow_005f0
                                .setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_aui_005ffieldset_005f0);
                        int _jspx_eval_aui_005fbutton_002drow_005f0 = _jspx_th_aui_005fbutton_002drow_005f0
                                .doStartTag();
                        if (_jspx_eval_aui_005fbutton_002drow_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
                            if (_jspx_eval_aui_005fbutton_002drow_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
                                out = _jspx_page_context.pushBody();
                                _jspx_th_aui_005fbutton_002drow_005f0
                                        .setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
                                _jspx_th_aui_005fbutton_002drow_005f0.doInitBody();
                            }
                            do {
                                out.write("\n");
                                out.write("\n");
                                out.write("      ");
                                if (_jspx_meth_aui_005fbutton_005f0(_jspx_th_aui_005fbutton_002drow_005f0,
                                        _jspx_page_context))
                                    return;
                                out.write("\n");
                                out.write("\n");
                                out.write("      ");
                                //  aui:button
                                com.liferay.taglib.aui.ButtonTag _jspx_th_aui_005fbutton_005f1 = (com.liferay.taglib.aui.ButtonTag) _005fjspx_005ftagPool_005faui_005fbutton_0026_005fvalue_005ftype_005fonClick_005fnobody
                                        .get(com.liferay.taglib.aui.ButtonTag.class);
                                _jspx_th_aui_005fbutton_005f1.setPageContext(_jspx_page_context);
                                _jspx_th_aui_005fbutton_005f1.setParent(
                                        (javax.servlet.jsp.tagext.Tag) _jspx_th_aui_005fbutton_002drow_005f0);
                                // /html/edit_slogan.jsp(70,6) name = type type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
                                _jspx_th_aui_005fbutton_005f1.setType("cancel");
                                // /html/edit_slogan.jsp(70,6) name = value type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
                                _jspx_th_aui_005fbutton_005f1.setValue("Cancel");
                                // /html/edit_slogan.jsp(70,6) name = onClick type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
                                _jspx_th_aui_005fbutton_005f1.setOnClick(cancelURL);
                                int _jspx_eval_aui_005fbutton_005f1 = _jspx_th_aui_005fbutton_005f1
                                        .doStartTag();
                                if (_jspx_th_aui_005fbutton_005f1
                                        .doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
                                    _005fjspx_005ftagPool_005faui_005fbutton_0026_005fvalue_005ftype_005fonClick_005fnobody
                                            .reuse(_jspx_th_aui_005fbutton_005f1);
                                    return;
                                }
                                _005fjspx_005ftagPool_005faui_005fbutton_0026_005fvalue_005ftype_005fonClick_005fnobody
                                        .reuse(_jspx_th_aui_005fbutton_005f1);
                                out.write("\n");
                                out.write("\n");
                                out.write("    ");
                                int evalDoAfterBody = _jspx_th_aui_005fbutton_002drow_005f0.doAfterBody();
                                if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
                                    break;
                            } while (true);
                            if (_jspx_eval_aui_005fbutton_002drow_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
                                out = _jspx_page_context.popBody();
                            }
                        }
                        if (_jspx_th_aui_005fbutton_002drow_005f0
                                .doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
                            _005fjspx_005ftagPool_005faui_005fbutton_002drow
                                    .reuse(_jspx_th_aui_005fbutton_002drow_005f0);
                            return;
                        }
                        _005fjspx_005ftagPool_005faui_005fbutton_002drow
                                .reuse(_jspx_th_aui_005fbutton_002drow_005f0);
                        out.write("\n");
                        out.write("\n");
                        out.write("  ");
                        int evalDoAfterBody = _jspx_th_aui_005ffieldset_005f0.doAfterBody();
                        if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
                            break;
                    } while (true);
                    if (_jspx_eval_aui_005ffieldset_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
                        out = _jspx_page_context.popBody();
                    }
                }
                if (_jspx_th_aui_005ffieldset_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
                    _005fjspx_005ftagPool_005faui_005ffieldset.reuse(_jspx_th_aui_005ffieldset_005f0);
                    return;
                }
                _005fjspx_005ftagPool_005faui_005ffieldset.reuse(_jspx_th_aui_005ffieldset_005f0);
                out.write('\n');
                out.write('\n');
                int evalDoAfterBody = _jspx_th_aui_005fform_005f0.doAfterBody();
                if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
                    break;
            } while (true);
            if (_jspx_eval_aui_005fform_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
                out = _jspx_page_context.popBody();
            }
        }
        if (_jspx_th_aui_005fform_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
            _005fjspx_005ftagPool_005faui_005fform_0026_005fname_005fmethod_005faction
                    .reuse(_jspx_th_aui_005fform_005f0);
            return;
        }
        _005fjspx_005ftagPool_005faui_005fform_0026_005fname_005fmethod_005faction
                .reuse(_jspx_th_aui_005fform_005f0);
    } catch (Throwable t) {
        if (!(t instanceof SkipPageException)) {
            out = _jspx_out;
            if (out != null && out.getBufferSize() != 0)
                try {
                    out.clearBuffer();
                } catch (java.io.IOException e) {
                }
            if (_jspx_page_context != null)
                _jspx_page_context.handlePageException(t);
        }
    } finally {
        _jspxFactory.releasePageContext(_jspx_page_context);
    }
}

From source file:org.goodreturn.service.impl.StoryLocalServiceImpl.java

License:Open Source License

/**
 * Creates a new Story and stores it in the database and returns the new Story object.
 * The new story object is based on the 'newStory' Story object.
 * //  w ww  .java 2  s  .  com
 * @param newStory - the Story object which the new story will be stored in db.
 * @param userId - the user which this object is associated with.
 * @param serviceContext
 * @return a new Story object based on newStory which is now within the database. 
 */
public Story addStory(Story newStory, long userId, ServiceContext serviceContext)
        throws SystemException, PortalException {

    //Creates the FinalStory and sets all variables.
    Story story = storyPersistence.create(counterLocalService.increment(Story.class.getName()));
    story.setAbacus_Borrower_Loan_Id(newStory.getAbacus_Borrower_Loan_Id());

    story.setStory_Type(newStory.getStory_Type());
    story.setStory_Text(newStory.getStory_Text());
    story.setVideo_Url(newStory.getVideo_Url());
    story.setIs_Good_Enough_For_Marketing(newStory.getIs_Good_Enough_For_Marketing());
    story.setIs_Good_Enough_For_Story(newStory.getIs_Good_Enough_For_Story());

    story.setCompanyId(newStory.getCompanyId());
    story.setGroupId(newStory.getGroupId());
    story.setUserId(userId);

    story.setStatus(WorkflowConstants.STATUS_DRAFT);

    //Updates in the database.
    storyPersistence.update(story, false);

    resourceLocalService.addResources(story.getCompanyId(), story.getGroupId(), userId, Story.class.getName(),
            story.getPrimaryKey(), false, true, true);

    assetEntryLocalService.updateEntry(userId, story.getGroupId(), Story.class.getName(), story.getStory_Id(),
            serviceContext.getAssetCategoryIds(), serviceContext.getAssetTagNames());

    WorkflowHandlerRegistryUtil.startWorkflowInstance(story.getCompanyId(), userId, Story.class.getName(),
            story.getPrimaryKey(), story, serviceContext);

    return story;
}

From source file:org.liferay.jukebox.service.impl.AlbumLocalServiceImpl.java

License:Open Source License

protected void moveDependentsToTrash(List<Song> songs, long trashEntryId)
        throws PortalException, SystemException {

    for (Song song : songs) {

        // Entry/*w ww  . j  a v  a2  s  . c o  m*/

        if (song.isInTrash()) {
            continue;
        }

        int oldStatus = song.getStatus();

        song.setStatus(WorkflowConstants.STATUS_IN_TRASH);

        songPersistence.update(song);

        // Trash

        int status = oldStatus;

        if (oldStatus == WorkflowConstants.STATUS_PENDING) {
            status = WorkflowConstants.STATUS_DRAFT;
        }

        if (oldStatus != WorkflowConstants.STATUS_APPROVED) {
            trashVersionLocalService.addTrashVersion(trashEntryId, Song.class.getName(), song.getSongId(),
                    status, null);
        }

        // Asset

        assetEntryLocalService.updateVisible(Song.class.getName(), song.getSongId(), false);

        // Indexer

        Indexer indexer = IndexerRegistryUtil.nullSafeGetIndexer(Song.class);

        indexer.reindex(song);
    }
}

From source file:org.portlets.lia.mine.service.impl.IssueLocalServiceImpl.java

License:Open Source License

public Issue addIssue(long userId, long issueId, String summary, String description, String requester,
        String assignee, String priority, String status, ServiceContext serviceContext)
        throws PortalException, SystemException {
    User user = UserUtil.findByPrimaryKey(userId);
    Date now = new Date();

    Issue issue = issuePersistence.create(issueId);

    issue.setSummary(summary);// w  w  w.j a va  2  s .c  o  m
    issue.setRequester(requester);
    issue.setPriority(priority);
    issue.setAssignee(assignee);
    issue.setDescription(description);
    issue.setStatusx(status);
    issue.setStatus(WorkflowConstants.STATUS_DRAFT);

    issue.setCompanyId(user.getCompanyId());
    issue.setUserId(user.getUserId());
    issue.setUserName(user.getFullName());
    issue.setCreateDate(now);
    issue.setModifiedDate(now);

    issuePersistence.update(issue, false);

    return issue;
}

From source file:org.un.ldcportal.ismapplications.service.impl.ISMApplicationLocalServiceImpl.java

License:Open Source License

public ISMApplication addISMApplication(ISMApplication newISMApplication, long userId,
        ServiceContext serviceContext) throws SystemException, PortalException {

    ISMApplication ismApplication = ismApplicationPersistence
            .create(counterLocalService.increment(ISMApplication.class.getName()));

    ismApplication.setCompanyId(newISMApplication.getCompanyId());
    ismApplication.setGroupId(newISMApplication.getGroupId());
    ismApplication.setUserId(serviceContext.getUserId());
    ismApplication.setApplicationReason(newISMApplication.getApplicationReason());
    ismApplication.setApplicationAdditional(newISMApplication.getApplicationAdditional());
    ismApplication.setIsmId(newISMApplication.getIsmId());
    ismApplication.setStatus(WorkflowConstants.STATUS_DRAFT);

    ismApplicationPersistence.update(ismApplication, false);

    resourceLocalService.addResources(newISMApplication.getCompanyId(), newISMApplication.getGroupId(), userId,
            ISMApplication.class.getName(), ismApplication.getPrimaryKey(), false, true, true);

    assetEntryLocalService.updateEntry(userId, ismApplication.getGroupId(), ISMApplication.class.getName(),
            ismApplication.getIsmApplicationId(), serviceContext.getAssetCategoryIds(),
            serviceContext.getAssetTagNames());

    // Workflow/*from   w w  w. j a va 2  s  .co m*/
    long moderatorId = ismLocalService.getISM(newISMApplication.getIsmId()).getModeratorId();

    Map<String, Serializable> workflowContext = new HashMap<String, Serializable>();
    workflowContext.put(ISM_MODERATOR_ID, moderatorId);

    WorkflowHandlerRegistryUtil.startWorkflowInstance(ismApplication.getCompanyId(),
            ismApplication.getGroupId(), userId, ISMApplication.class.getName(), ismApplication.getPrimaryKey(),
            ismApplication, serviceContext, workflowContext);

    return ismApplication;
}

From source file:sample.lrdev05.database.service.impl.BooksLocalServiceImpl.java

License:Open Source License

public sample.lrdev05.database.model.Books addBooks(Books booksParam, long userId,
        ServiceContext serviceContext) {
    sample.lrdev05.database.model.Books booksVar;

    try {/*from   w  ww.  j av a  2  s. co m*/
        booksVar = booksPersistence.create(counterLocalService.increment(Books.class.toString()));
    } catch (SystemException e) {
        e.printStackTrace();
        return booksVar = null;
    }

    booksVar.setTitle(booksParam.getTitle());
    booksVar.setAuthor(booksParam.getAuthor());
    booksVar.setIsbn(booksParam.getIsbn());
    booksVar.setSummary(booksParam.getSummary());
    booksVar.setCompanyId(booksParam.getCompanyId());
    booksVar.setGroupId(booksParam.getGroupId());
    booksVar.setTitle(booksParam.getTitle());
    booksVar.setStatus(WorkflowConstants.STATUS_DRAFT);

    try {
        resourceLocalService.addResources(booksParam.getCompanyId(), booksParam.getGroupId(), userId,
                Books.class.getName(), booksParam.getPrimaryKey(), false, true, true);
        assetEntryLocalService.updateEntry(userId, booksVar.getGroupId(), Books.class.getName(),
                booksVar.getBookId(), serviceContext.getAssetCategoryIds(), serviceContext.getAssetTagNames());
        //Workflow
        WorkflowHandlerRegistryUtil.startWorkflowInstance(booksVar.getCompanyId(), booksVar.getGroupId(),
                userId, Books.class.getName(), booksVar.getPrimaryKey(), booksVar, serviceContext);

        sendMessage(booksVar, serviceContext);

    } catch (PortalException e) {
        e.printStackTrace();
        return booksVar = null;
    } catch (SystemException e) {
        e.printStackTrace();
        return booksVar = null;
    }

    try {
        return booksPersistence.update(booksVar, false);
    } catch (SystemException e) {
        e.printStackTrace();
        return booksVar = null;
    }
}