Author: mputz
Date: 2012-01-12 12:33:27 -0500 (Thu, 12 Jan 2012)
New Revision: 8296
Modified:
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/importer/Imported.java
Log:
JBEPP-1478: Port of GTNPORTAL-2325 fixes to the EPP_5_2_Branch codebase to prevent
NullPointerException during startup
Modified:
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2012-01-12
17:31:34 UTC (rev 8295)
+++
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2012-01-12
17:33:27 UTC (rev 8296)
@@ -222,23 +222,28 @@
{
Imported imported = workspace.adapt(Imported.class);
imported.setCreationDate(new Date());
- session.save();
// for legacy checking
if (dataStorage_.getPortalConfig(defaultPortal) != null)
{
perform = false;
+ imported.setStatus(Status.DONE.status());
}
else
{
isFirstStartup = true;
}
+ session.save();
}
else
{
Imported imported = workspace.adapt(Imported.class);
- Status status = Status.getStatus(imported.getStatus());
- perform = (Status.WANT_REIMPORT == status);
+ Integer st = imported.getStatus();
+ if (st != null)
+ {
+ Status status = Status.getStatus(st);
+ perform = (Status.WANT_REIMPORT == status);
+ }
}
if (overrideExistingData)
Modified:
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/importer/Imported.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/importer/Imported.java 2012-01-12
17:31:34 UTC (rev 8295)
+++
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/importer/Imported.java 2012-01-12
17:33:27 UTC (rev 8296)
@@ -69,9 +69,9 @@
}
@Property(name = "gtn:status")
- public abstract int getStatus();
+ public abstract Integer getStatus();
- public abstract void setStatus(int status);
+ public abstract void setStatus(Integer status);
@Property(name = "gtn:creationdate")
public abstract Date getCreationDate();
Show replies by date