Exemple #1
0
 public org.osid.repository.PartIterator getPartsByPartStructure(
     org.osid.shared.Id partStructureId) throws org.osid.repository.RepositoryException {
   if (partStructureId == null) {
     throw new org.osid.repository.RepositoryException(
         org.osid.shared.SharedException.NULL_ARGUMENT);
   }
   try {
     java.util.Vector results = new java.util.Vector();
     org.osid.repository.RecordIterator recordIterator = getRecords();
     while (recordIterator.hasNextRecord()) {
       org.osid.repository.Record record = recordIterator.nextRecord();
       org.osid.repository.PartIterator partIterator = record.getParts();
       while (partIterator.hasNextPart()) {
         org.osid.repository.Part part = partIterator.nextPart();
         if (part.getPartStructure().getId().isEqual(partStructureId)) {
           results.addElement(part);
         }
       }
     }
     return new PartIterator(results);
   } catch (Throwable t) {
     LOG.warn(t.getMessage());
     throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED);
   }
 }