001: /******************************************************************************
002: * JBoss, a division of Red Hat *
003: * Copyright 2006, Red Hat Middleware, LLC, and individual *
004: * contributors as indicated by the @authors tag. See the *
005: * copyright.txt in the distribution for a full listing of *
006: * individual contributors. *
007: * *
008: * This is free software; you can redistribute it and/or modify it *
009: * under the terms of the GNU Lesser General Public License as *
010: * published by the Free Software Foundation; either version 2.1 of *
011: * the License, or (at your option) any later version. *
012: * *
013: * This software is distributed in the hope that it will be useful, *
014: * but WITHOUT ANY WARRANTY; without even the implied warranty of *
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
016: * Lesser General Public License for more details. *
017: * *
018: * You should have received a copy of the GNU Lesser General Public *
019: * License along with this software; if not, write to the Free *
020: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
021: * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
022: ******************************************************************************/package org.jboss.portal.migration.bean;
023:
024: import org.jboss.portal.migration.MigrationModule22_24;
025:
026: /** @author <a href="mailto:roy@jboss.org">Roy Russo</a> */
027: public class Migrate {
028: public MigrationModule22_24 TXManager;
029:
030: public boolean migrated;
031:
032: public boolean isMigrated() {
033: return migrated;
034: }
035:
036: public void setMigrated(boolean migrated) {
037: this .migrated = migrated;
038: }
039:
040: public MigrationModule22_24 getTXManager() {
041: return TXManager;
042: }
043:
044: public void setTXManager(MigrationModule22_24 TXManager)
045: throws Exception {
046: this .TXManager = TXManager;
047: }
048:
049: public String migrateCMSData() throws Exception {
050: setMigrated(false);
051: try {
052: TXManager.migrateCMSData();
053: setMigrated(true);
054: } catch (Exception e) {
055: setMigrated(false);
056: e.printStackTrace();
057: //TXManager.close();
058: } finally {
059: //
060: }
061: return "migrated";
062: }
063:
064: public String migrateUsersRolesData() throws Exception {
065: setMigrated(false);
066: try {
067: TXManager.migrateUsersRoles();
068: setMigrated(true);
069: } catch (Exception e) {
070: setMigrated(false);
071: e.printStackTrace();
072: //TXManager.close();
073: } finally {
074: //
075: }
076: return "migrated";
077: }
078:
079: public String migratePortalObjectData() throws Exception {
080: setMigrated(false);
081: try {
082: TXManager.migratePortalObjects();
083: setMigrated(true);
084: } catch (Exception e) {
085: setMigrated(false);
086: e.printStackTrace();
087: } finally {
088: //TXManager.close();
089: }
090: return "migrated";
091: }
092:
093: public String migratePortalInstanceData() throws Exception {
094: setMigrated(false);
095: try {
096: TXManager.migratePortletInstances();
097: setMigrated(true);
098: } catch (Exception e) {
099: setMigrated(false);
100: e.printStackTrace();
101: } finally {
102: //TXManager.close();
103: }
104: return "migrated";
105: }
106:
107: public String migrateSecurityData() throws Exception {
108: setMigrated(false);
109: try {
110: TXManager.migrateSecurity();
111: setMigrated(true);
112: } catch (Exception e) {
113: setMigrated(false);
114: e.printStackTrace();
115: } finally {
116: TXManager.close();
117: }
118: return "migrated";
119: }
120: }
|