001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
006 *
007 * This library is free software; you can redistribute it and/or
008 * modify it under the terms of the GNU Lesser General Public
009 * License as published by the Free Software Foundation; either
010 * version 2.1 of the License, or (at your option) any later version.
011 *
012 * This library is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * For further information about Alkacon Software GmbH & Co. KG, please see the
018 * company website: http://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: http://www.opencms.org
022 *
023 * You should have received a copy of the GNU Lesser General Public
024 * License along with this library; if not, write to the Free Software
025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
026 */
027
028package org.opencms.importexport;
029
030import org.opencms.configuration.CmsParameterConfiguration;
031import org.opencms.file.CmsFile;
032import org.opencms.file.CmsObject;
033import org.opencms.file.CmsProperty;
034import org.opencms.file.CmsResource;
035import org.opencms.file.types.CmsResourceTypePlain;
036import org.opencms.file.types.I_CmsResourceType;
037import org.opencms.i18n.CmsMessageContainer;
038import org.opencms.loader.CmsLoaderException;
039import org.opencms.main.CmsException;
040import org.opencms.main.CmsLog;
041import org.opencms.main.OpenCms;
042import org.opencms.relations.I_CmsLinkParseable;
043import org.opencms.report.I_CmsReport;
044import org.opencms.security.CmsAccessControlEntry;
045import org.opencms.security.CmsRole;
046import org.opencms.security.I_CmsPasswordHandler;
047import org.opencms.security.I_CmsPrincipal;
048import org.opencms.util.CmsDateUtil;
049import org.opencms.util.CmsUUID;
050import org.opencms.xml.CmsXmlException;
051import org.opencms.xml.CmsXmlUtils;
052
053import java.io.File;
054import java.io.IOException;
055import java.text.ParseException;
056import java.util.ArrayList;
057import java.util.Collections;
058import java.util.HashMap;
059import java.util.Iterator;
060import java.util.List;
061import java.util.Map;
062import java.util.zip.ZipFile;
063
064import org.apache.commons.logging.Log;
065
066import org.dom4j.Document;
067import org.dom4j.Element;
068import org.dom4j.Node;
069
070/**
071 * Implementation of the OpenCms Import Interface ({@link org.opencms.importexport.I_CmsImport}) for
072 * the import version 4.<p>
073 *
074 * This import format is used in OpenCms since 5.1.6.<p>
075 *
076 * @since 6.0.0
077 *
078 * @see org.opencms.importexport.A_CmsImport
079 *
080 * @deprecated this import class is no longer in use and should only be used to import old export files
081 */
082@Deprecated
083public class CmsImportVersion4 extends A_CmsImport {
084
085    /** The version number of this import implementation.<p> */
086    private static final int IMPORT_VERSION = 4;
087
088    /** The log object for this class. */
089    private static final Log LOG = CmsLog.getLog(CmsImportVersion4.class);
090
091    /** Stores all resource of type that implements the {@link I_CmsLinkParseable} interface. */
092    private List<CmsResource> m_parseables;
093
094    /**
095     * Creates a new CmsImportVerion4 object.<p>
096     */
097    public CmsImportVersion4() {
098
099        m_convertToXmlPage = true;
100    }
101
102    /**
103     * @see org.opencms.importexport.I_CmsImport#getVersion()
104     * @return the version number of this import implementation
105     */
106    public int getVersion() {
107
108        return CmsImportVersion4.IMPORT_VERSION;
109    }
110
111    /**
112     * @see org.opencms.importexport.I_CmsImport#importData(CmsObject, I_CmsReport, CmsImportParameters)
113     */
114    public void importData(CmsObject cms, I_CmsReport report, CmsImportParameters params)
115    throws CmsImportExportException, CmsXmlException {
116
117        // initialize the import
118        initialize();
119        m_cms = cms;
120        m_importPath = params.getDestinationPath();
121        m_report = report;
122
123        m_linkStorage = new HashMap<String, String>();
124        m_linkPropertyStorage = new HashMap<String, List<CmsProperty>>();
125        m_parseables = new ArrayList<CmsResource>();
126
127        CmsImportHelper helper = new CmsImportHelper(params);
128        try {
129            helper.openFile();
130            m_importResource = helper.getFolder();
131            m_importZip = helper.getZipFile();
132            m_docXml = CmsXmlUtils.unmarshalHelper(helper.getFileBytes(CmsImportExportManager.EXPORT_MANIFEST), null);
133            // first import the user information
134            if (OpenCms.getRoleManager().hasRole(m_cms, CmsRole.ACCOUNT_MANAGER)) {
135                importGroups();
136                importUsers();
137            }
138            // now import the VFS resources
139            readResourcesFromManifest();
140            convertPointerToSiblings();
141            rewriteParseables();
142        } catch (IOException ioe) {
143            CmsMessageContainer msg = Messages.get().container(
144                Messages.ERR_IMPORTEXPORT_ERROR_READING_FILE_1,
145                CmsImportExportManager.EXPORT_MANIFEST);
146            if (LOG.isErrorEnabled()) {
147                LOG.error(msg.key(), ioe);
148            }
149            throw new CmsImportExportException(msg, ioe);
150        } finally {
151            helper.closeFile();
152            cleanUp();
153        }
154    }
155
156    /**
157     * @see org.opencms.importexport.I_CmsImport#importResources(org.opencms.file.CmsObject, java.lang.String, org.opencms.report.I_CmsReport, java.io.File, java.util.zip.ZipFile, org.dom4j.Document)
158     *
159     * @deprecated use {@link #importData(CmsObject, I_CmsReport, CmsImportParameters)} instead
160     */
161    @Deprecated
162    public void importResources(
163        CmsObject cms,
164        String importPath,
165        I_CmsReport report,
166        File importResource,
167        ZipFile importZip,
168        Document docXml)
169    throws CmsImportExportException {
170
171        CmsImportParameters params = new CmsImportParameters(
172            importResource != null ? importResource.getAbsolutePath() : importZip.getName(),
173            importPath,
174            true);
175
176        try {
177            importData(cms, report, params);
178        } catch (CmsXmlException e) {
179            throw new CmsImportExportException(e.getMessageContainer(), e);
180        }
181    }
182
183    /**
184     * @see org.opencms.importexport.A_CmsImport#importUser(String, String, String, String, String, String, long, Map, List)
185     */
186    @Override
187    protected void importUser(
188        String name,
189        String flags,
190        String password,
191        String firstname,
192        String lastname,
193        String email,
194        long dateCreated,
195        Map<String, Object> userInfo,
196        List<String> userGroups)
197    throws CmsImportExportException {
198
199        boolean convert = false;
200
201        CmsParameterConfiguration config = OpenCms.getPasswordHandler().getConfiguration();
202        if ((config != null) && config.containsKey(I_CmsPasswordHandler.CONVERT_DIGEST_ENCODING)) {
203            convert = config.getBoolean(I_CmsPasswordHandler.CONVERT_DIGEST_ENCODING, false);
204        }
205
206        if (convert) {
207            password = convertDigestEncoding(password);
208        }
209
210        super.importUser(name, flags, password, firstname, lastname, email, dateCreated, userInfo, userGroups);
211    }
212
213    /**
214     * Rewrites all parseable files, to assure link check.<p>
215     */
216    protected void rewriteParseables() {
217
218        if (m_parseables.isEmpty()) {
219            return;
220        }
221
222        m_report.println(Messages.get().container(Messages.RPT_START_PARSE_LINKS_0), I_CmsReport.FORMAT_HEADLINE);
223
224        int i = 0;
225        Iterator<CmsResource> it = m_parseables.iterator();
226        while (it.hasNext()) {
227            CmsResource res = it.next();
228
229            m_report.print(
230                org.opencms.report.Messages.get().container(
231                    org.opencms.report.Messages.RPT_SUCCESSION_2,
232                    String.valueOf(i + 1),
233                    String.valueOf(m_parseables.size())),
234                I_CmsReport.FORMAT_NOTE);
235
236            m_report.print(
237                Messages.get().container(Messages.RPT_PARSE_LINKS_FOR_1, m_cms.getSitePath(res)),
238                I_CmsReport.FORMAT_NOTE);
239            m_report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0));
240
241            try {
242                // make sure the date last modified is kept...
243                CmsFile file = m_cms.readFile(res);
244                file.setDateLastModified(res.getDateLastModified());
245                m_cms.writeFile(file);
246
247                m_report.println(
248                    org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
249                    I_CmsReport.FORMAT_OK);
250            } catch (Throwable e) {
251                m_report.addWarning(e);
252                m_report.println(
253                    org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_FAILED_0),
254                    I_CmsReport.FORMAT_ERROR);
255                if (LOG.isWarnEnabled()) {
256                    LOG.warn(Messages.get().getBundle().key(Messages.LOG_IMPORTEXPORT_REWRITING_1, res.getRootPath()));
257                }
258                if (LOG.isDebugEnabled()) {
259                    LOG.debug(e.getLocalizedMessage(), e);
260                }
261            }
262            i++;
263        }
264
265        m_report.println(Messages.get().container(Messages.RPT_END_PARSE_LINKS_0), I_CmsReport.FORMAT_HEADLINE);
266    }
267
268    /**
269     * Convert a given timestamp from a String format to a long value.<p>
270     *
271     * The timestamp is either the string representation of a long value (old export format)
272     * or a user-readable string format.
273     *
274     * @param timestamp timestamp to convert
275     * @return long value of the timestamp
276     */
277    private long convertTimestamp(String timestamp) {
278
279        long value = 0;
280        // try to parse the timestamp string
281        // if it successes, its an old style long value
282        try {
283            value = Long.parseLong(timestamp);
284
285        } catch (NumberFormatException e) {
286            // the timestamp was in in a user-readable string format, create the long value form it
287            try {
288                value = CmsDateUtil.parseHeaderDate(timestamp);
289            } catch (ParseException pe) {
290                value = System.currentTimeMillis();
291            }
292        }
293        return value;
294    }
295
296    /**
297     * Imports a resource (file or folder) into the cms.<p>
298     *
299     * @param source the path to the source-file
300     * @param destination the path to the destination-file in the cms
301     * @param type the resource type name of the file
302     * @param uuidresource  the resource uuid of the resource
303     * @param datelastmodified the last modification date of the resource
304     * @param userlastmodified the user who made the last modifications to the resource
305     * @param datecreated the creation date of the resource
306     * @param usercreated the user who created
307     * @param datereleased the release date of the resource
308     * @param dateexpired the expire date of the resource
309     * @param flags the flags of the resource
310     * @param properties a list with properties for this resource
311     *
312     * @return imported resource
313     */
314    private CmsResource importResource(
315        String source,
316        String destination,
317        I_CmsResourceType type,
318        String uuidresource,
319        long datelastmodified,
320        String userlastmodified,
321        long datecreated,
322        String usercreated,
323        long datereleased,
324        long dateexpired,
325        String flags,
326        List<CmsProperty> properties) {
327
328        byte[] content = null;
329        CmsResource result = null;
330
331        try {
332
333            // get the file content
334            if (source != null) {
335                content = getFileBytes(source);
336            }
337            int size = 0;
338            if (content != null) {
339                size = content.length;
340            }
341
342            // get UUIDs for the user
343            CmsUUID newUserlastmodified;
344            CmsUUID newUsercreated;
345            // check if user created and user lastmodified are valid users in this system.
346            // if not, use the current user
347            try {
348                newUserlastmodified = m_cms.readUser(userlastmodified).getId();
349            } catch (CmsException e) {
350                newUserlastmodified = m_cms.getRequestContext().getCurrentUser().getId();
351                // datelastmodified = System.currentTimeMillis();
352            }
353
354            try {
355                newUsercreated = m_cms.readUser(usercreated).getId();
356            } catch (CmsException e) {
357                newUsercreated = m_cms.getRequestContext().getCurrentUser().getId();
358                // datecreated = System.currentTimeMillis();
359            }
360
361            // get UUIDs for the resource and content
362            CmsUUID newUuidresource = null;
363            if ((uuidresource != null) && (!type.isFolder())) {
364                // create a UUID from the provided string
365                newUuidresource = new CmsUUID(uuidresource);
366            } else {
367                // folders get always a new resource record UUID
368                newUuidresource = new CmsUUID();
369            }
370
371            // create a new CmsResource
372            CmsResource resource = new CmsResource(
373                new CmsUUID(), // structure ID is always a new UUID
374                newUuidresource,
375                destination,
376                type.getTypeId(),
377                type.isFolder(),
378                Integer.valueOf(flags).intValue(),
379                m_cms.getRequestContext().getCurrentProject().getUuid(),
380                CmsResource.STATE_NEW,
381                datecreated,
382                newUsercreated,
383                datelastmodified,
384                newUserlastmodified,
385                datereleased,
386                dateexpired,
387                1,
388                size,
389                System.currentTimeMillis(),
390                0);
391
392            // import this resource in the VFS
393            result = m_cms.importResource(destination, resource, content, properties);
394
395            if (result != null) {
396                m_report.println(
397                    org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
398                    I_CmsReport.FORMAT_OK);
399            }
400        } catch (Exception exc) {
401            // an error while importing the file
402            m_report.println(exc);
403            try {
404                // Sleep some time after an error so that the report output has a chance to keep up
405                Thread.sleep(1000);
406            } catch (Exception e) {
407                //
408            }
409        }
410        return result;
411    }
412
413    /**
414     * Reads all file nodes plus their meta-information (properties, ACL)
415     * from the <code>manifest.xml</code> and imports them as Cms resources to the VFS.<p>
416     *
417     * @throws CmsImportExportException if something goes wrong
418     */
419    private void readResourcesFromManifest() throws CmsImportExportException {
420
421        String source = null, destination = null, uuidresource = null, userlastmodified = null, usercreated = null,
422        flags = null, timestamp = null;
423        long datelastmodified = 0, datecreated = 0, datereleased = 0, dateexpired = 0;
424
425        List<Node> fileNodes = null;
426        List<Node> acentryNodes = null;
427        Element currentElement = null, currentEntry = null;
428        List<CmsProperty> properties = null;
429
430        // get list of immutable resources
431        List<String> immutableResources = OpenCms.getImportExportManager().getImmutableResources();
432        if (immutableResources == null) {
433            immutableResources = Collections.emptyList();
434        }
435        if (LOG.isDebugEnabled()) {
436            LOG.debug(
437                Messages.get().getBundle().key(
438                    Messages.LOG_IMPORTEXPORT_IMMUTABLE_RESOURCES_SIZE_1,
439                    Integer.toString(immutableResources.size())));
440        }
441        // get list of ignored properties
442        List<String> ignoredProperties = OpenCms.getImportExportManager().getIgnoredProperties();
443        if (ignoredProperties == null) {
444            ignoredProperties = Collections.emptyList();
445        }
446
447        // get the desired page type for imported pages
448        m_convertToXmlPage = OpenCms.getImportExportManager().convertToXmlPage();
449
450        try {
451            // get all file-nodes
452            fileNodes = m_docXml.selectNodes("//" + A_CmsImport.N_FILE);
453            int importSize = fileNodes.size();
454
455            // walk through all files in manifest
456            for (int i = 0; i < fileNodes.size(); i++) {
457                m_report.print(
458                    org.opencms.report.Messages.get().container(
459                        org.opencms.report.Messages.RPT_SUCCESSION_2,
460                        String.valueOf(i + 1),
461                        String.valueOf(importSize)),
462                    I_CmsReport.FORMAT_NOTE);
463                currentElement = (Element)fileNodes.get(i);
464
465                // <source>
466                source = getChildElementTextValue(currentElement, A_CmsImport.N_SOURCE);
467                // <destination>
468
469                destination = getChildElementTextValue(currentElement, A_CmsImport.N_DESTINATION);
470
471                // <type>
472                String typeName = getChildElementTextValue(currentElement, A_CmsImport.N_TYPE);
473                I_CmsResourceType type;
474                try {
475                    type = OpenCms.getResourceManager().getResourceType(typeName);
476                } catch (CmsLoaderException e) {
477                    // unknown resource type, import resource as type "plain"
478                    type = OpenCms.getResourceManager().getResourceType(CmsResourceTypePlain.getStaticTypeName());
479                }
480
481                if (!type.isFolder()) {
482                    // <uuidresource>
483                    uuidresource = getChildElementTextValue(currentElement, A_CmsImport.N_UUIDRESOURCE);
484                } else {
485                    uuidresource = null;
486                }
487
488                // <datelastmodified>
489                timestamp = getChildElementTextValue(currentElement, A_CmsImport.N_DATELASTMODIFIED);
490                if (timestamp != null) {
491                    datelastmodified = convertTimestamp(timestamp);
492                } else {
493                    datelastmodified = System.currentTimeMillis();
494                }
495
496                // <userlastmodified>
497                userlastmodified = getChildElementTextValue(currentElement, A_CmsImport.N_USERLASTMODIFIED);
498                userlastmodified = OpenCms.getImportExportManager().translateUser(userlastmodified);
499
500                // <datecreated>
501                timestamp = getChildElementTextValue(currentElement, A_CmsImport.N_DATECREATED);
502                if (timestamp != null) {
503                    datecreated = convertTimestamp(timestamp);
504                } else {
505                    datecreated = System.currentTimeMillis();
506                }
507
508                // <usercreated>
509                usercreated = getChildElementTextValue(currentElement, A_CmsImport.N_USERCREATED);
510                usercreated = OpenCms.getImportExportManager().translateUser(usercreated);
511
512                // <datereleased>
513                timestamp = getChildElementTextValue(currentElement, A_CmsImport.N_DATERELEASED);
514                if (timestamp != null) {
515                    datereleased = convertTimestamp(timestamp);
516                } else {
517                    datereleased = CmsResource.DATE_RELEASED_DEFAULT;
518                }
519
520                // <dateexpired>
521                timestamp = getChildElementTextValue(currentElement, A_CmsImport.N_DATEEXPIRED);
522                if (timestamp != null) {
523                    dateexpired = convertTimestamp(timestamp);
524                } else {
525                    dateexpired = CmsResource.DATE_EXPIRED_DEFAULT;
526                }
527
528                // <flags>
529                flags = getChildElementTextValue(currentElement, A_CmsImport.N_FLAGS);
530
531                // apply name translation and import path
532                String translatedName = m_cms.getRequestContext().addSiteRoot(m_importPath + destination);
533                if (type.isFolder()) {
534                    // ensure folders end with a "/"
535                    if (!CmsResource.isFolder(translatedName)) {
536                        translatedName += "/";
537                    }
538                }
539
540                // check if this resource is immutable
541                boolean resourceNotImmutable = checkImmutable(translatedName, immutableResources);
542                translatedName = m_cms.getRequestContext().removeSiteRoot(translatedName);
543                // if the resource is not immutable and not on the exclude list, import it
544                if (resourceNotImmutable) {
545                    // print out the information to the report
546                    m_report.print(Messages.get().container(Messages.RPT_IMPORTING_0), I_CmsReport.FORMAT_NOTE);
547                    m_report.print(
548                        org.opencms.report.Messages.get().container(
549                            org.opencms.report.Messages.RPT_ARGUMENT_1,
550                            translatedName));
551                    m_report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0));
552                    // get all properties
553                    properties = readPropertiesFromManifest(currentElement, ignoredProperties);
554
555                    // import the resource
556                    CmsResource res = importResource(
557                        source,
558                        translatedName,
559                        type,
560                        uuidresource,
561                        datelastmodified,
562                        userlastmodified,
563                        datecreated,
564                        usercreated,
565                        datereleased,
566                        dateexpired,
567                        flags,
568                        properties);
569
570                    // if the resource was imported add the access control entrys if available
571                    if (res != null) {
572
573                        List<CmsAccessControlEntry> aceList = new ArrayList<CmsAccessControlEntry>();
574
575                        // write all imported access control entries for this file
576                        acentryNodes = currentElement.selectNodes("*/" + A_CmsImport.N_ACCESSCONTROL_ENTRY);
577
578                        // collect all access control entries
579                        for (int j = 0; j < acentryNodes.size(); j++) {
580                            currentEntry = (Element)acentryNodes.get(j);
581
582                            // get the data of the access control entry
583                            String id = getChildElementTextValue(currentEntry, A_CmsImport.N_ACCESSCONTROL_PRINCIPAL);
584                            String principalId = new CmsUUID().toString();
585                            String principal = id.substring(id.indexOf('.') + 1, id.length());
586
587                            try {
588                                if (id.startsWith(I_CmsPrincipal.PRINCIPAL_GROUP)) {
589                                    principal = OpenCms.getImportExportManager().translateGroup(principal);
590                                    principalId = m_cms.readGroup(principal).getId().toString();
591                                } else {
592                                    principal = OpenCms.getImportExportManager().translateUser(principal);
593                                    principalId = m_cms.readUser(principal).getId().toString();
594                                }
595
596                                String acflags = getChildElementTextValue(currentEntry, A_CmsImport.N_FLAGS);
597
598                                String allowed = ((Element)currentEntry.selectNodes("./"
599                                    + A_CmsImport.N_ACCESSCONTROL_PERMISSIONSET
600                                    + "/"
601                                    + A_CmsImport.N_ACCESSCONTROL_ALLOWEDPERMISSIONS).get(0)).getTextTrim();
602
603                                String denied = ((Element)currentEntry.selectNodes("./"
604                                    + A_CmsImport.N_ACCESSCONTROL_PERMISSIONSET
605                                    + "/"
606                                    + A_CmsImport.N_ACCESSCONTROL_DENIEDPERMISSIONS).get(0)).getTextTrim();
607
608                                // add the entry to the list
609                                aceList.add(getImportAccessControlEntry(res, principalId, allowed, denied, acflags));
610                            } catch (CmsException e) {
611                                // user or group of ACE might not exist in target system, ignore ACE
612                                if (LOG.isWarnEnabled()) {
613                                    LOG.warn(
614                                        Messages.get().getBundle().key(
615                                            Messages.LOG_IMPORTEXPORT_ERROR_IMPORTING_ACE_1,
616                                            translatedName),
617                                        e);
618                                }
619                                m_report.println(e);
620                            }
621                        }
622
623                        importAccessControlEntries(res, aceList);
624                        if (OpenCms.getResourceManager().getResourceType(
625                            res.getTypeId()) instanceof I_CmsLinkParseable) {
626                            // store for later use
627                            m_parseables.add(res);
628                        }
629                        if (LOG.isInfoEnabled()) {
630                            LOG.info(
631                                Messages.get().getBundle().key(
632                                    Messages.LOG_IMPORTING_4,
633                                    new Object[] {
634                                        String.valueOf(i + 1),
635                                        String.valueOf(importSize),
636                                        translatedName,
637                                        destination}));
638                        }
639                    } else {
640                        // resource import failed, since no CmsResource was created
641                        m_report.print(Messages.get().container(Messages.RPT_SKIPPING_0), I_CmsReport.FORMAT_NOTE);
642                        m_report.println(
643                            org.opencms.report.Messages.get().container(
644                                org.opencms.report.Messages.RPT_ARGUMENT_1,
645                                translatedName));
646
647                        if (LOG.isInfoEnabled()) {
648                            LOG.info(
649                                Messages.get().getBundle().key(
650                                    Messages.LOG_SKIPPING_3,
651                                    String.valueOf(i + 1),
652                                    String.valueOf(importSize),
653                                    translatedName));
654                        }
655                    }
656                } else {
657                    // skip the file import, just print out the information to the report
658                    m_report.print(Messages.get().container(Messages.RPT_SKIPPING_0), I_CmsReport.FORMAT_NOTE);
659                    m_report.println(
660                        org.opencms.report.Messages.get().container(
661                            org.opencms.report.Messages.RPT_ARGUMENT_1,
662                            translatedName));
663
664                    if (LOG.isInfoEnabled()) {
665                        LOG.info(
666                            Messages.get().getBundle().key(
667                                Messages.LOG_SKIPPING_3,
668                                String.valueOf(i + 1),
669                                String.valueOf(importSize),
670                                translatedName));
671                    }
672                }
673            }
674        } catch (Exception e) {
675            m_report.println(e);
676            m_report.addError(e);
677
678            CmsMessageContainer message = Messages.get().container(
679                Messages.ERR_IMPORTEXPORT_ERROR_IMPORTING_RESOURCES_0);
680            if (LOG.isDebugEnabled()) {
681                LOG.debug(message.key(), e);
682            }
683            throw new CmsImportExportException(message, e);
684        }
685    }
686}