Author: scottbw
Date: Mon Feb 20 14:51:36 2012
New Revision: 1291293
URL: http://svn.apache.org/viewvc?rev=1291293&view=rev
Log:
Removed a method from PersistenceManager that still referred to service types
and updated dependent classes. See WOOKIE-263
Modified:
incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/JPAPersistenceManager.java
incubator/wookie/trunk/src/org/apache/wookie/beans/util/IPersistenceManager.java
incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetInstancesController.java
incubator/wookie/trunk/src/org/apache/wookie/helpers/MigrationHelper.java
Modified:
incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/JPAPersistenceManager.java
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/JPAPersistenceManager.java?rev=1291293&r1=1291292&r2=1291293&view=diff
==============================================================================
---
incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/JPAPersistenceManager.java
(original)
+++
incubator/wookie/trunk/src/org/apache/wookie/beans/jpa/JPAPersistenceManager.java
Mon Feb 20 14:51:36 2012
@@ -648,40 +648,6 @@ public class JPAPersistenceManager imple
}
/* (non-Javadoc)
- * @see
org.apache.wookie.beans.util.IPersistenceManager#findWidgetInstance(java.lang.String,
java.lang.String, java.lang.String, java.lang.String)
- */
- public IWidgetInstance findWidgetInstance(String apiKey, String userId,
String sharedDataKey, String serviceContext)
- {
- // validate entity manager transaction
- if (entityManager == null)
- {
- throw new IllegalStateException("Transaction not initiated or
already closed");
- }
-
- // get widget instance using custom query
- if ((apiKey != null) && (userId != null) && (sharedDataKey != null) &&
(serviceContext != null))
- {
- try
- {
- Query query =
entityManager.createNamedQuery("WIDGET_INSTANCE");
- query.setParameter("apiKey", apiKey);
- query.setParameter("userId", userId);
- query.setParameter("sharedDataKey", sharedDataKey);
- query.setParameter("widgetContext", serviceContext);
- return (IWidgetInstance)query.getSingleResult();
- }
- catch (NoResultException nre)
- {
- }
- catch (Exception e)
- {
- logger.error("Unexpected exception: "+e, e);
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
* @see
org.apache.wookie.beans.util.IPersistenceManager#findWidgetInstanceByGuid(java.lang.String,
java.lang.String, java.lang.String, java.lang.String)
*/
public IWidgetInstance findWidgetInstanceByGuid(String apiKey, String
userId, String sharedDataKey, String widgetGuid)
Modified:
incubator/wookie/trunk/src/org/apache/wookie/beans/util/IPersistenceManager.java
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/beans/util/IPersistenceManager.java?rev=1291293&r1=1291292&r2=1291293&view=diff
==============================================================================
---
incubator/wookie/trunk/src/org/apache/wookie/beans/util/IPersistenceManager.java
(original)
+++
incubator/wookie/trunk/src/org/apache/wookie/beans/util/IPersistenceManager.java
Mon Feb 20 14:51:36 2012
@@ -151,17 +151,6 @@ public interface IPersistenceManager
IWidget findWidgetByGuid(String guid);
/**
- * Custom service type IWidgetInstance query.
- *
- * @param apiKey API key matching query value
- * @param userId user id matching query value
- * @param sharedDataKey shared data key matching query value
- * @param serviceContext service type matching query value
- * @return retrieved IWidgetInstance bean instance or null if not found
- */
- IWidgetInstance findWidgetInstance(String apiKey, String userId, String
sharedDataKey, String serviceContext);
-
- /**
* Custom widget GUID IWidgetInstance query.
*
* @param apiKey API key matching query value
Modified:
incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetInstancesController.java
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetInstancesController.java?rev=1291293&r1=1291292&r2=1291293&view=diff
==============================================================================
---
incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetInstancesController.java
(original)
+++
incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetInstancesController.java
Mon Feb 20 14:51:36 2012
@@ -411,21 +411,20 @@ public class WidgetInstancesController e
String userId =
URLDecoder.decode(request.getParameter("userid"), "UTF-8"); //$NON-NLS-1$
String sharedDataKey = request.getParameter("shareddatakey");
//$NON-NLS-1$;
String widgetId = request.getParameter("widgetid");
- String serviceType = request.getParameter("servicetype");
//
// First see if there is a legacy 0.9.0 instance that matches
//
// NOTE: This step will be deprecated in future releases
//
- instance = MigrationHelper.findLegacyWidgetInstance(apiKey,
userId, sharedDataKey, widgetId, serviceType);
+ instance = MigrationHelper.findLegacyWidgetInstance(apiKey,
userId, sharedDataKey, widgetId);
//
// Otherwise, look for a 0.9.1 or later version
//
if (instance == null){
String internalSharedDataKey =
SharedDataHelper.getInternalSharedDataKey(apiKey, widgetId, sharedDataKey);
- instance = findWidgetInstance(apiKey, userId,
internalSharedDataKey, widgetId, serviceType);
+ instance = findWidgetInstance(apiKey, userId,
internalSharedDataKey, widgetId);
}
if (instance == null) {
@@ -440,27 +439,23 @@ public class WidgetInstancesController e
}
/**
- * Find a widget instance using instance parameters, either by widget
URI (guid) or service type
+ * Find a widget instance using instance parameters, by widget URI
(guid)
*
* @param apiKey
* @param userId
* @param sharedDataKey
* @param widgetId
- * @param serviceType
* @return the widget instance, or null if there is no matching instance
* @throws UnsupportedEncodingException
*/
- public static IWidgetInstance findWidgetInstance(String apiKey, String
userId, String sharedDataKey, String widgetId, String serviceType) throws
UnsupportedEncodingException{
- IWidgetInstance instance;
+ public static IWidgetInstance findWidgetInstance(String apiKey, String
userId, String sharedDataKey, String widgetId) throws
UnsupportedEncodingException{
+ IWidgetInstance instance = null;
IPersistenceManager persistenceManager =
PersistenceManagerFactory.getPersistenceManager();
if (widgetId != null){
widgetId = URLDecoder.decode(widgetId, "UTF-8"); //$NON-NLS-1$
_logger.debug("Looking for widget instance with widgetid of " +
widgetId);
instance = persistenceManager.findWidgetInstanceByGuid(apiKey,
userId, sharedDataKey, widgetId);
- } else {
- _logger.debug("Looking for widget instance of service type " +
serviceType);
- instance = persistenceManager.findWidgetInstance(apiKey, userId,
sharedDataKey, serviceType);
- }
+ }
return instance;
}
}
\ No newline at end of file
Modified:
incubator/wookie/trunk/src/org/apache/wookie/helpers/MigrationHelper.java
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/helpers/MigrationHelper.java?rev=1291293&r1=1291292&r2=1291293&view=diff
==============================================================================
--- incubator/wookie/trunk/src/org/apache/wookie/helpers/MigrationHelper.java
(original)
+++ incubator/wookie/trunk/src/org/apache/wookie/helpers/MigrationHelper.java
Mon Feb 20 14:51:36 2012
@@ -48,7 +48,7 @@ public class MigrationHelper {
* @return the widget instance, or null if there is no match
* @throws UnsupportedEncodingException
*/
- public static IWidgetInstance findLegacyWidgetInstance(String apiKey, String
userId, String sharedDataKey, String widgetId, String serviceType) throws
UnsupportedEncodingException{
+ public static IWidgetInstance findLegacyWidgetInstance(String apiKey, String
userId, String sharedDataKey, String widgetId) throws
UnsupportedEncodingException{
//
// Get shared data key using legacy method
//
@@ -57,7 +57,7 @@ public class MigrationHelper {
//
// Find widget instance
//
- IWidgetInstance instance =
WidgetInstancesController.findWidgetInstance(apiKey, userId,
legacySharedDataKey, widgetId, serviceType);
+ IWidgetInstance instance =
WidgetInstancesController.findWidgetInstance(apiKey, userId,
legacySharedDataKey, widgetId);
//
// Match found, so migrate the instance as well as any sibling instances
that use the same shared data key, and any shared data instances