dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #43882
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 22254: Code style
------------------------------------------------------------
revno: 22254
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2016-03-11 17:19:54 +0100
message:
Code style
modified:
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JdbcEventStore.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/event/EventController.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JdbcEventStore.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JdbcEventStore.java 2016-03-11 13:24:12 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JdbcEventStore.java 2016-03-11 16:19:54 +0000
@@ -492,26 +492,25 @@
return sql;
}
- private String getOrderQuery(List<Order> orders)
+ private String getOrderQuery( List<Order> orders )
{
- if( orders != null )
+ if ( orders != null )
{
ArrayList<String> orderFields = new ArrayList<String>();
- for( Order order : orders )
+ for ( Order order : orders )
{
- if( QUERY_PARAM_COL_MAP.containsKey( order.getProperty().getName() ) )
+ if ( QUERY_PARAM_COL_MAP.containsKey( order.getProperty().getName() ) )
{
String orderText = QUERY_PARAM_COL_MAP.get( order.getProperty().getName() );
- orderText += order.isAscending() ? " asc" : " desc";
-
+ orderText += order.isAscending() ? " asc" : " desc";
orderFields.add( orderText );
}
}
- if( !orderFields.isEmpty() )
+ if ( !orderFields.isEmpty() )
{
- return "order by " + StringUtils.join(orderFields, ',') + " ";
+ return "order by " + StringUtils.join( orderFields, ',' ) + " ";
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/event/EventController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/event/EventController.java 2016-03-11 13:24:12 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/event/EventController.java 2016-03-11 16:19:54 +0000
@@ -119,7 +119,6 @@
public class EventController
{
public static final String RESOURCE_PATH = "/events";
-
private static final String META_DATA_KEY_DE = "de";
//--------------------------------------------------------------------------
@@ -375,13 +374,14 @@
return "event";
}
- private List<Order> getOrderParams(String order)
+ private List<Order> getOrderParams( String order )
{
- if( order != null && !StringUtils.isEmpty(order) )
+ if ( order != null && !StringUtils.isEmpty( order ) )
{
- OrderParams op = new OrderParams( Sets.newLinkedHashSet( Arrays.asList( order.split(",") ) ) );
- return op.getOrders(getSchema());
+ OrderParams op = new OrderParams( Sets.newLinkedHashSet( Arrays.asList( order.split( "," ) ) ) );
+ return op.getOrders( getSchema() );
}
+
return null;
}
@@ -457,13 +457,14 @@
if ( fileResource.getStorageStatus() != FileResourceStorageStatus.STORED )
{
- // Special case:
- // The FileResource exists and has been tied to this DataValue, however, the underlying file
- // content is still not stored to the (most likely external) file store provider.
-
- // HTTP 409, for lack of a more suitable status code
+ // -----------------------------------------------------------------
+ // The FileResource exists and is tied to DataValue, however the
+ // underlying file content still not stored to external file store
+ // -----------------------------------------------------------------
+
WebMessage webMessage = WebMessageUtils.conflict( "The content is being processed and is not available yet. Try again later.",
"The content requested is in transit to the file store and will be available at a later time." );
+
webMessage.setResponse( new FileResourceWebMessageResponse( fileResource ) );
throw new WebMessageException( webMessage );
@@ -513,7 +514,7 @@
{
throw new WebMessageException( WebMessageUtils.error( "Failed fetching the file from storage",
"There was an exception when trying to fetch the file from the storage backend. " +
- "Depending on the provider the root cause could be network or file system related." ) );
+ "Depending on the provider the root cause could be network or file system related." ) );
}
finally
{