Advertisement
Guest User

Untitled

a guest
Aug 29th, 2015
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. public static long[] getStructureIdByName(List<String> structureNames) {
  2. long[] allStructureIds = new long[structureNames.size()];
  3. try {
  4. List<DDMStructure> ddmStructures = DDMStructureLocalServiceUtil.getDDMStructures(0, DDMStructureLocalServiceUtil.getDDMStructuresCount());
  5. int counter = 0;
  6. for (DDMStructure structure : ddmStructures) {
  7. for (String name : structureNames) {
  8. if (structure.getName(Locale.ENGLISH)
  9. .equalsIgnoreCase(name)) {
  10. allStructureIds[counter] = structure.getStructureId();
  11. counter++;
  12. continue;
  13. }
  14. }
  15. }
  16. } catch (SystemException e) {
  17. e.printStackTrace();
  18. }
  19. return allStructureIds;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement