dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #23555
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11459: minor cleanup
------------------------------------------------------------
revno: 11459
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-07-22 12:41:12 +0700
message:
minor cleanup
modified:
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/view/PdfView.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-web/dhis-web-api/src/main/java/org/hisp/dhis/api/view/PdfView.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/view/PdfView.java 2013-07-22 05:14:19 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/view/PdfView.java 2013-07-22 05:41:12 +0000
@@ -44,7 +44,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
import java.lang.reflect.Field;
import java.util.Collection;
import java.util.Map;
@@ -58,24 +57,23 @@
@Override
protected void buildPdfDocument( Map<String, Object> model, Document document, PdfWriter writer,
- HttpServletRequest request, HttpServletResponse response ) throws Exception
+ HttpServletRequest request, HttpServletResponse response ) throws DocumentException
{
Object object = model.get( "model" );
if ( WebMetaData.class.isAssignableFrom( object.getClass() ) )
{
WebMetaData webMetaData = (WebMetaData) object;
- buildList( webMetaData, document, writer, request, response );
+ buildList( webMetaData, document );
}
else
{
IdentifiableObject identifiableObject = (IdentifiableObject) object;
- buildSingleObject( identifiableObject, document, writer, request, response );
+ buildSingleObject( identifiableObject, document );
}
}
- private void buildList( WebMetaData webMetaData, Document document, PdfWriter writer,
- HttpServletRequest request, HttpServletResponse response ) throws Exception
+ private void buildList( WebMetaData webMetaData, Document document ) throws DocumentException
{
Collection<Field> fields = ReflectionUtils.collectFields( WebMetaData.class, PredicateUtils.idObjectCollections );
@@ -102,8 +100,7 @@
}
}
- private void buildSingleObject( IdentifiableObject identifiableObject, Document document, PdfWriter writer,
- HttpServletRequest request, HttpServletResponse response ) throws Exception
+ private void buildSingleObject( IdentifiableObject identifiableObject, Document document ) throws DocumentException
{
PdfPTable table = new PdfPTable( 2 );
table.setSpacingAfter( 10 );
@@ -111,7 +108,7 @@
document.add( table );
}
- private void renderIdentifiableObject( IdentifiableObject identifiableObject, PdfPTable table ) throws DocumentException, IOException
+ private void renderIdentifiableObject( IdentifiableObject identifiableObject, PdfPTable table )
{
table.addCell( new Phrase( "Name", boldFont ) );
table.addCell( identifiableObject.getDisplayName() );
@@ -129,7 +126,7 @@
table.addCell( identifiableObject.getLastUpdated().toString() );
}
- private void renderIdentifiableObjectRowHeader( PdfPTable table ) throws DocumentException, IOException
+ private void renderIdentifiableObjectRowHeader( PdfPTable table ) throws DocumentException
{
table.setWidths( new int[]{ 3, 1 } );
@@ -142,7 +139,7 @@
table.addCell( uidCell );
}
- private void renderIdentifiableObjectRow( IdentifiableObject identifiableObject, PdfPTable table ) throws DocumentException, IOException
+ private void renderIdentifiableObjectRow( IdentifiableObject identifiableObject, PdfPTable table )
{
PdfPCell nameCell = new PdfPCell( new Phrase( identifiableObject.getDisplayName() ) );
nameCell.setHorizontalAlignment( Element.ALIGN_LEFT );