dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #42494
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21719: Not-so-nice solution for providing short names for category option groups.
------------------------------------------------------------
revno: 21719
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2016-01-14 11:57:58 +0100
message:
Not-so-nice solution for providing short names for category option groups.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroupSet.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroupSet.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.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-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroupSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroupSet.java 2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroupSet.java 2016-01-14 10:57:58 +0000
@@ -102,6 +102,19 @@
return null;
}
+ @Override
+ public String getShortName()
+ {
+ if ( getName() == null || getName().length() <= 50 )
+ {
+ return getName();
+ }
+ else
+ {
+ return getName().substring( 0, 49 );
+ }
+ }
+
// -------------------------------------------------------------------------
// Dimensional object
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroupSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroupSet.java 2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroupSet.java 2016-01-14 10:57:58 +0000
@@ -185,6 +185,19 @@
return sortedGroups;
}
+ @Override
+ public String getShortName()
+ {
+ if ( getName() == null || getName().length() <= 50 )
+ {
+ return getName();
+ }
+ else
+ {
+ return getName().substring( 0, 49 );
+ }
+ }
+
// -------------------------------------------------------------------------
// Dimensional object
// -------------------------------------------------------------------------
@@ -210,19 +223,6 @@
// Getters and setters
// -------------------------------------------------------------------------
- @Override
- public String getShortName()
- {
- if ( getName() == null || getName().length() <= 50 )
- {
- return getName();
- }
- else
- {
- return getName().substring( 0, 49 );
- }
- }
-
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java 2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java 2016-01-14 10:57:58 +0000
@@ -167,6 +167,19 @@
return sortedGroups;
}
+ @Override
+ public String getShortName()
+ {
+ if ( getName() == null || getName().length() <= 50 )
+ {
+ return getName();
+ }
+ else
+ {
+ return getName().substring( 0, 49 );
+ }
+ }
+
// -------------------------------------------------------------------------
// Dimensional object
// -------------------------------------------------------------------------
@@ -193,19 +206,6 @@
// -------------------------------------------------------------------------
@Override
- public String getShortName()
- {
- if ( getName() == null || getName().length() <= 50 )
- {
- return getName();
- }
- else
- {
- return getName().substring( 0, 49 );
- }
- }
-
- @Override
public boolean isAutoGenerated()
{
return name != null && (name.equals( "Type" ) || name.equals( "Ownership" ));