Activity Service

- add PostgreSQL support
- add generic schema generation, plus extras (indexes, sequences, workaround for Derby)
- fix feed cleaner keepDate, also increase default from 14 to 31 days
- fix Oracle-specifc issue (when retrieving site feed)
- reformatting sqlMap config files
- improve exception handling
Add Derby warning message

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@9649 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2008-07-04 13:12:31 +00:00
parent 87096f0b2a
commit cc051d8274
28 changed files with 653 additions and 485 deletions

View File

@@ -262,12 +262,16 @@ public class ActivityServiceImpl implements ActivityService
}
catch (SQLException e)
{
throw new AlfrescoRuntimeException("Failed to post activity: " + e, e);
throw new AlfrescoRuntimeException("Failed to post activity: " + e, e);
}
catch (Throwable t)
{
throw new AlfrescoRuntimeException("Failed to post activity: " + t, t);
}
}
catch (AlfrescoRuntimeException e)
{
// log error, subsume exception
// log error, subsume exception (for post activity)
logger.error(e);
}
}
@@ -313,13 +317,17 @@ public class ActivityServiceImpl implements ActivityService
}
catch (SQLException se)
{
throw new AlfrescoRuntimeException("Unable to get user feed entries: " + se.getMessage());
AlfrescoRuntimeException are = new AlfrescoRuntimeException("Unable to get user feed entries: " + se.getMessage());
logger.error(are);
throw are;
}
catch (JSONException je)
{
throw new AlfrescoRuntimeException("Unable to get user feed entries: " + je.getMessage());
AlfrescoRuntimeException are = new AlfrescoRuntimeException("Unable to get user feed entries: " + je.getMessage());
logger.error(are);
throw are;
}
return activityFeedEntries;
}
@@ -350,11 +358,15 @@ public class ActivityServiceImpl implements ActivityService
}
catch (SQLException se)
{
throw new AlfrescoRuntimeException("Unable to get site feed entries: " + se.getMessage());
AlfrescoRuntimeException are = new AlfrescoRuntimeException("Unable to get site feed entries: " + se.getMessage());
logger.error(are);
throw are;
}
catch (JSONException je)
{
throw new AlfrescoRuntimeException("Unable to get site feed entries: " + je.getMessage());
AlfrescoRuntimeException are = new AlfrescoRuntimeException("Unable to get site feed entries: " + je.getMessage());
logger.error(are);
throw are;
}
return activityFeedEntries;
@@ -382,7 +394,9 @@ public class ActivityServiceImpl implements ActivityService
}
catch (SQLException e)
{
throw new AlfrescoRuntimeException("Failed to set feed control: " + e, e);
AlfrescoRuntimeException are = new AlfrescoRuntimeException("Failed to set feed control: " + e, e);
logger.error(are);
throw are;
}
}
@@ -433,7 +447,9 @@ public class ActivityServiceImpl implements ActivityService
}
catch (SQLException e)
{
throw new AlfrescoRuntimeException("Failed to get feed controls: " + e, e);
AlfrescoRuntimeException are = new AlfrescoRuntimeException("Failed to get feed controls: " + e, e);
logger.error(are);
throw are;
}
}
@@ -456,7 +472,9 @@ public class ActivityServiceImpl implements ActivityService
}
catch (SQLException e)
{
throw new AlfrescoRuntimeException("Failed to unset feed control: " + e, e);
AlfrescoRuntimeException are = new AlfrescoRuntimeException("Failed to unset feed control: " + e, e);
logger.error(are);
throw are;
}
}
@@ -481,7 +499,9 @@ public class ActivityServiceImpl implements ActivityService
}
catch (SQLException e)
{
throw new AlfrescoRuntimeException("Failed to query feed control: " + e, e);
AlfrescoRuntimeException are = new AlfrescoRuntimeException("Failed to query feed control: " + e, e);
logger.error(are);
throw are;
}
}
}

View File

@@ -78,7 +78,7 @@ public class FeedCleaner
try
{
long nowTimeOffset = new Date().getTime();
long keepTimeOffset = nowTimeOffset - (maxAgeMins*60*1000); // millsecs = mins * 60 secs * 1000 msecs
long keepTimeOffset = nowTimeOffset - ((long)maxAgeMins*60000L); // millsecs = mins * 60 secs * 1000 msecs
Date keepDate = new Date(keepTimeOffset);
// clean old entries