public org.osid.shared.ObjectIterator getPartValueByPart(org.osid.shared.Id partStructureId) throws org.osid.repository.RepositoryException { java.util.Vector results = new java.util.Vector(); org.osid.repository.PartIterator partIterator = getPartByPart(partStructureId); while (partIterator.hasNextPart()) { results.addElement(partIterator.nextPart().getValue()); } try { return new ObjectIterator(results); } catch (Throwable t) { log.error(t.getMessage()); throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED); } }
public org.osid.shared.ObjectIterator getPartValueByPart(org.osid.shared.Id partStructureId) throws org.osid.repository.RepositoryException { java.util.Vector results = new java.util.Vector(); org.osid.repository.PartIterator partIterator = getPartByPart(partStructureId); while (partIterator.hasNextPart()) { results.addElement(partIterator.nextPart().getValue()); } try { return new ObjectIterator(results); } catch (Throwable t) { log.warn(t.getMessage()); throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED); } }
public org.osid.shared.ObjectIterator getPartValueByPart(org.osid.shared.Id partStructureId) throws org.osid.repository.RepositoryException { java.util.Vector results = new java.util.Vector(); org.osid.repository.PartIterator partIterator = getPartByPart(partStructureId); while (partIterator.hasNextPart()) { results.addElement(partIterator.nextPart().getValue()); } try { return new ObjectIterator(results); } catch (Throwable t) { log.error(t.getMessage()); throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED); } }
public org.osid.shared.ObjectIterator getPartValueByPart(org.osid.shared.Id partStructureId) throws org.osid.repository.RepositoryException { java.util.Vector results = new java.util.Vector(); org.osid.repository.PartIterator partIterator = getPartByPart(partStructureId); while (partIterator.hasNextPart()) { results.addElement(partIterator.nextPart().getValue()); } try { return new ObjectIterator(results); } catch (Throwable t) { log.warn(t.getMessage()); throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED); } }
public org.osid.shared.ObjectIterator getPartValuesByPartStructure(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.PartIterator partIterator = getPartsByPartStructure(partStructureId); while (partIterator.hasNextPart()) { org.osid.repository.Part part = partIterator.nextPart(); results.addElement(part.getValue()); } return new ObjectIterator(results); } catch (Throwable t) { log.error(t.getMessage()); throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED); } }
public org.osid.shared.ObjectIterator getPartValuesByPartStructure(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.PartIterator partIterator = getPartsByPartStructure(partStructureId); while (partIterator.hasNextPart()) { org.osid.repository.Part part = partIterator.nextPart(); results.addElement(part.getValue()); } return new ObjectIterator(results); } catch (Throwable t) { log.warn(t.getMessage()); throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED); } }
public org.osid.shared.ObjectIterator getPartValuesByPartStructure(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.PartIterator partIterator = getPartsByPartStructure(partStructureId); while (partIterator.hasNextPart()) { org.osid.repository.Part part = partIterator.nextPart(); results.addElement(part.getValue()); } return new ObjectIterator(results); } catch (Throwable t) { log.error(t.getMessage()); throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED); } }
public org.osid.shared.ObjectIterator getPartValuesByPartStructure(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.PartIterator partIterator = getPartsByPartStructure(partStructureId); while (partIterator.hasNextPart()) { org.osid.repository.Part part = partIterator.nextPart(); results.addElement(part.getValue()); } return new ObjectIterator(results); } catch (Throwable t) { log.warn(t.getMessage()); throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED); } }
while (partIterator.hasNextPart())
while (partIterator.hasNextPart())
public org.osid.repository.Part getPart(org.osid.shared.Id partId) throws org.osid.repository.RepositoryException { if (partId == null) { throw new org.osid.repository.RepositoryException(org.osid.shared.SharedException.NULL_ARGUMENT); } try { for (int i=0, size = this.recordVector.size(); i < size; i++) { org.osid.repository.Record record = (org.osid.repository.Record)this.recordVector.elementAt(i); org.osid.repository.PartIterator partIterator = record.getParts(); while (partIterator.hasNextPart()) { org.osid.repository.Part part = partIterator.nextPart(); if (part.getId().isEqual(partId)) { return part; } } } throw new org.osid.repository.RepositoryException(org.osid.shared.SharedException.UNKNOWN_ID); } catch (Throwable t) { log.error(t.getMessage()); throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED); } }
public org.osid.repository.Part getPart(org.osid.shared.Id partId) throws org.osid.repository.RepositoryException { if (partId == null) { throw new org.osid.repository.RepositoryException(org.osid.shared.SharedException.NULL_ARGUMENT); } try { for (int i=0, size = this.recordVector.size(); i < size; i++) { org.osid.repository.Record record = (org.osid.repository.Record)this.recordVector.elementAt(i); org.osid.repository.PartIterator partIterator = record.getParts(); while (partIterator.hasNextPart()) { org.osid.repository.Part part = partIterator.nextPart(); if (part.getId().isEqual(partId)) { return part; } } } throw new org.osid.repository.RepositoryException(org.osid.shared.SharedException.UNKNOWN_ID); } catch (Throwable t) { log.warn(t.getMessage()); throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED); } }
public org.osid.repository.Part getPart(org.osid.shared.Id partId) throws org.osid.repository.RepositoryException { if (partId == null) { throw new org.osid.repository.RepositoryException(org.osid.shared.SharedException.NULL_ARGUMENT); } try { for (int i=0, size = this.recordVector.size(); i < size; i++) { org.osid.repository.Record record = (org.osid.repository.Record)this.recordVector.elementAt(i); org.osid.repository.PartIterator partIterator = record.getParts(); while (partIterator.hasNextPart()) { org.osid.repository.Part part = partIterator.nextPart(); if (part.getId().isEqual(partId)) { return part; } } } throw new org.osid.repository.RepositoryException(org.osid.shared.SharedException.UNKNOWN_ID); } catch (Throwable t) { log.error(t.getMessage()); throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED); } }
/** * This method searches the current record for a Part using its * PartStructure Type. * * @param partStructureType PartStructure Type of Part you need. * @return the Part if it exists in the current record, null if it does not. */ private org.osid.repository.Part recordHasPart( org.osid.shared.Type partStructureType ) { try { org.osid.repository.PartIterator pit = record.getParts(); while( pit.hasNextPart() ) { org.osid.repository.Part part = pit.nextPart(); if( part.getPartStructure().getType().isEqual( partStructureType ) ) { return part; } } } catch( org.osid.repository.RepositoryException re ) { log.warn( "recordHasPart() failed getting Parts.", re ); } // did not find the Part return null; }
public org.osid.repository.Part getPart(org.osid.shared.Id partId) throws org.osid.repository.RepositoryException { if (partId == null) { throw new org.osid.repository.RepositoryException(org.osid.shared.SharedException.NULL_ARGUMENT); } try { for (int i=0, size = this.recordVector.size(); i < size; i++) { org.osid.repository.Record record = (org.osid.repository.Record)this.recordVector.elementAt(i); org.osid.repository.PartIterator partIterator = record.getParts(); while (partIterator.hasNextPart()) { org.osid.repository.Part part = partIterator.nextPart(); if (part.getId().isEqual(partId)) { return part; } } } throw new org.osid.repository.RepositoryException(org.osid.shared.SharedException.UNKNOWN_ID); } catch (Throwable t) { log.warn(t.getMessage()); throw new org.osid.repository.RepositoryException(org.osid.OsidException.OPERATION_FAILED); } }
/** * This method searches the current record for a Part using its * PartStructure Type. * * @param partStructureType PartStructure Type of Part you need. * @return the Part if it exists in the current record, null if it does not. */ private org.osid.repository.Part recordHasPart( org.osid.shared.Type partStructureType ) { try { org.osid.repository.PartIterator pit = record.getParts(); while( pit.hasNextPart() ) { org.osid.repository.Part part = pit.nextPart(); if( part.getPartStructure().getType().isEqual( partStructureType ) ) { return part; } } } catch( org.osid.repository.RepositoryException re ) { log.warn( "recordHasPart() failed getting Parts.", re ); } // did not find the Part return null; }
/** * Constructor takes an org.osid.repository.Asset and extracts all * data for easier presentation. */ public AssetPresentationBean( org.osid.repository.Asset asset ) { parts = new java.util.ArrayList(); try { assetId = asset.getId().getIdString(); displayName = asset.getDisplayName(); description = asset.getDescription(); content = ( Integer )asset.getContent(); org.osid.repository.RecordIterator rit = asset.getRecords(); while( rit.hasNextRecord() ) { org.osid.repository.Record record = rit.nextRecord(); org.osid.repository.PartIterator pit = record.getParts(); while( pit.hasNextPart() ) { parts.add( pit.nextPart() ); } } } catch( Throwable t ) { log.warn( "AssetPresentationBean() failed to loop through Asset, " + "Record, Parts: " + t.getMessage(), t ); } this.asset = asset; }
/** * Constructor takes an org.osid.repository.Asset and extracts all * data for easier presentation. */ public AssetPresentationBean( org.osid.repository.Asset asset ) { parts = new java.util.ArrayList(); try { assetId = asset.getId().getIdString(); displayName = asset.getDisplayName(); description = asset.getDescription(); content = ( Integer )asset.getContent(); org.osid.repository.RecordIterator rit = asset.getRecords(); while( rit.hasNextRecord() ) { org.osid.repository.Record record = rit.nextRecord(); org.osid.repository.PartIterator pit = record.getParts(); while( pit.hasNextPart() ) { parts.add( pit.nextPart() ); } } } catch( Throwable t ) { log.warn( "AssetPresentationBean() failed to loop through Asset, " + "Record, Parts: " + t.getMessage(), t ); } this.asset = asset; }
while (partIterator.hasNextPart())
while (partIterator.hasNextPart())