001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
020    import com.liferay.portal.kernel.exception.PortalException;
021    import com.liferay.portal.model.Team;
022    import com.liferay.portal.util.PortalUtil;
023    
024    import com.liferay.portlet.exportimport.lar.ExportImportHelperUtil;
025    import com.liferay.portlet.exportimport.lar.ManifestSummary;
026    import com.liferay.portlet.exportimport.lar.PortletDataContext;
027    import com.liferay.portlet.exportimport.lar.StagedModelDataHandlerUtil;
028    import com.liferay.portlet.exportimport.lar.StagedModelType;
029    
030    /**
031     * @author Brian Wing Shun Chan
032     * @deprecated As of 7.0.0, replaced by {@link com.liferay.portal.service.TeamLocalServiceUtil#getExportActionableDynamicQuery(PortletDataContext)}
033     * @generated
034     */
035    @Deprecated
036    @ProviderType
037    public class TeamExportActionableDynamicQuery extends TeamActionableDynamicQuery {
038            public TeamExportActionableDynamicQuery(
039                    PortletDataContext portletDataContext) {
040                    _portletDataContext = portletDataContext;
041    
042                    setCompanyId(_portletDataContext.getCompanyId());
043    
044                    setGroupId(_portletDataContext.getScopeGroupId());
045            }
046    
047            @Override
048            public long performCount() throws PortalException {
049                    ManifestSummary manifestSummary = _portletDataContext.getManifestSummary();
050    
051                    StagedModelType stagedModelType = getStagedModelType();
052    
053                    long modelAdditionCount = super.performCount();
054    
055                    manifestSummary.addModelAdditionCount(stagedModelType.toString(),
056                            modelAdditionCount);
057    
058                    long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(_portletDataContext,
059                                    stagedModelType);
060    
061                    manifestSummary.addModelDeletionCount(stagedModelType.toString(),
062                            modelDeletionCount);
063    
064                    return modelAdditionCount;
065            }
066    
067            @Override
068            protected void addCriteria(DynamicQuery dynamicQuery) {
069                    _portletDataContext.addDateRangeCriteria(dynamicQuery, "modifiedDate");
070            }
071    
072            protected StagedModelType getStagedModelType() {
073                    return new StagedModelType(PortalUtil.getClassNameId(
074                                    Team.class.getName()));
075            }
076    
077            @Override
078            protected void performAction(Object object) throws PortalException {
079                    Team stagedModel = (Team)object;
080    
081                    StagedModelDataHandlerUtil.exportStagedModel(_portletDataContext,
082                            stagedModel);
083            }
084    
085            private PortletDataContext _portletDataContext;
086    }