@Override public long performCount() throws PortalException, SystemException { long count = super.performCount(); ManifestSummary manifestSummary = _portletDataContext.getManifestSummary(); manifestSummary.addModelCount(getManifestSummaryKey(), count); return count; }
@Override protected void doPrepareManifestSummary(PortletDataContext portletDataContext) throws Exception { ManifestSummary manifestSummary = portletDataContext.getManifestSummary(); ActionableDynamicQuery layoutPrototypeExportActionableDynamicQuery = new LayoutPrototypeExportActionableDynamicQuery(portletDataContext); manifestSummary.addModelAdditionCount( LayoutPrototype.class, layoutPrototypeExportActionableDynamicQuery.performCount()); }
@Override public long performCount() throws PortalException, SystemException { ManifestSummary manifestSummary = _portletDataContext.getManifestSummary(); long modelAdditionCount = super.performCount(); manifestSummary.addModelAdditionCount(getManifestSummaryKey(), modelAdditionCount); long modelDeletionCount = getModelDeletionCount(); manifestSummary.addModelDeletionCount(getManifestSummaryKey(), modelDeletionCount); return modelAdditionCount; }
public long performCount() throws PortalException, SystemException { ManifestSummary manifestSummary = _portletDataContext.getManifestSummary(); StagedModelType stagedModelType = getStagedModelType(); long modelAdditionCount = super.performCount(); manifestSummary.addModelAdditionCount(stagedModelType.toString(), modelAdditionCount); long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(_portletDataContext, stagedModelType); manifestSummary.addModelDeletionCount(stagedModelType.toString(), modelDeletionCount); return modelAdditionCount; }
@Override protected void validateExport( PortletDataContext portletDataContext, StagedModel stagedModel, Map<String, List<StagedModel>> dependentStagedModelsMap) throws Exception { ManifestSummary manifestSummary = portletDataContext.getManifestSummary(); Map<String, LongWrapper> modelAdditionCounters = manifestSummary.getModelAdditionCounters(); Assert.assertEquals(4, modelAdditionCounters.size()); Assert.assertEquals( 1, manifestSummary.getModelAdditionCount(DDMStructure.class, JournalArticle.class)); Assert.assertEquals( 1, manifestSummary.getModelAdditionCount(DDMTemplate.class, DDMStructure.class)); Assert.assertEquals(1, manifestSummary.getModelAdditionCount(JournalArticle.class)); Assert.assertEquals(1, manifestSummary.getModelAdditionCount(JournalFolder.class)); Document document = SAXReaderUtil.createDocument(); Element rootElement = document.addElement("root"); Element headerElement = rootElement.addElement("header"); _exportDate = new Date(); headerElement.addAttribute("export-date", Time.getRFC822(_exportDate)); ExportImportHelperUtil.writeManifestSummary(document, manifestSummary); zipWriter.addEntry("/manifest.xml", document.asXML()); }
@Override protected void validateImport( StagedModel stagedModel, StagedModelAssets stagedModelAssets, Map<String, List<StagedModel>> dependentStagedModelsMap, Group group) throws Exception { ManifestSummary manifestSummary = ExportImportHelperUtil.getManifestSummary(portletDataContext); Map<String, LongWrapper> modelAdditionCounters = manifestSummary.getModelAdditionCounters(); Assert.assertEquals(4, modelAdditionCounters.size()); Assert.assertEquals( 1, manifestSummary.getModelAdditionCount(DDMStructure.class, JournalArticle.class)); Assert.assertEquals( 1, manifestSummary.getModelAdditionCount(DDMTemplate.class, DDMStructure.class)); Assert.assertEquals(1, manifestSummary.getModelAdditionCount(JournalArticle.class)); Assert.assertEquals(1, manifestSummary.getModelAdditionCount(JournalFolder.class)); Assert.assertTrue(DateUtil.equals(_exportDate, manifestSummary.getExportDate(), true)); }