001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portlet.messageboards.service.persistence;
016    
017    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
018    import com.liferay.portal.kernel.exception.PortalException;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.lar.ExportImportHelperUtil;
021    import com.liferay.portal.kernel.lar.ManifestSummary;
022    import com.liferay.portal.kernel.lar.PortletDataContext;
023    import com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil;
024    import com.liferay.portal.kernel.lar.StagedModelType;
025    import com.liferay.portal.util.PortalUtil;
026    
027    import com.liferay.portlet.messageboards.model.MBThreadFlag;
028    
029    /**
030     * @author Brian Wing Shun Chan
031     * @generated
032     */
033    public class MBThreadFlagExportActionableDynamicQuery
034            extends MBThreadFlagActionableDynamicQuery {
035            public MBThreadFlagExportActionableDynamicQuery(
036                    PortletDataContext portletDataContext) throws SystemException {
037                    _portletDataContext = portletDataContext;
038    
039                    setCompanyId(_portletDataContext.getCompanyId());
040    
041                    setGroupId(_portletDataContext.getScopeGroupId());
042            }
043    
044            @Override
045            public long performCount() throws PortalException, SystemException {
046                    ManifestSummary manifestSummary = _portletDataContext.getManifestSummary();
047    
048                    StagedModelType stagedModelType = getStagedModelType();
049    
050                    long modelAdditionCount = super.performCount();
051    
052                    manifestSummary.addModelAdditionCount(stagedModelType.toString(),
053                            modelAdditionCount);
054    
055                    long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(_portletDataContext,
056                                    stagedModelType);
057    
058                    manifestSummary.addModelDeletionCount(stagedModelType.toString(),
059                            modelDeletionCount);
060    
061                    return modelAdditionCount;
062            }
063    
064            @Override
065            protected void addCriteria(DynamicQuery dynamicQuery) {
066                    _portletDataContext.addDateRangeCriteria(dynamicQuery, "modifiedDate");
067            }
068    
069            protected StagedModelType getStagedModelType() {
070                    return new StagedModelType(PortalUtil.getClassNameId(
071                                    MBThreadFlag.class.getName()));
072            }
073    
074            @Override
075            @SuppressWarnings("unused")
076            protected void performAction(Object object)
077                    throws PortalException, SystemException {
078                    MBThreadFlag stagedModel = (MBThreadFlag)object;
079    
080                    StagedModelDataHandlerUtil.exportStagedModel(_portletDataContext,
081                            stagedModel);
082            }
083    
084            private PortletDataContext _portletDataContext;
085    }