public static RcObjectMetadata getRcObjMd(String extObjId) throws RcMetadataException { RcWebApp rcWebApp = RcWebApp.getInstance(); String extObjIdParts[] = extObjId.split("/", 2); String collId = extObjIdParts[0]; String objId = extObjIdParts[1]; RcCollectionMetadata rcCollMd = rcWebApp.getCollectionMetadata(collId); if (rcCollMd == null) { throw new RcMetadataException("Unable to find collection metadata for " + collId + "."); } RcObjectMetadata rcObjMd = rcCollMd.getObject(objId); if (rcObjMd == null) { throw new RcMetadataException("Unable to find object metadata for " + objId + " in collection " + collId + "."); } return rcObjMd; }
/** * If changes have been made to the current object, this method saves the * changes to memory and notifies the RcCollectionManagerJPanel that the * collection metadata has changed. This method should ALWAYS be called * before an RcObjectMetadataJPanel is closed by this panel and before the * this panel is closed by the RcCollectionManagerJPanel. * * @return True if changes were save successfully or there were no changes, * false changes were not saved due to a metadata entry error. */ protected boolean saveChanges() { try { if (this.rcObjMdJPanel != null && this.rcObjMdJPanel.getChanged()) { this.setChanged(); this.rcObjMdJPanel.saveChanges(); this.rcObjMdJPanel.modify(false); } return true; } catch (RcMetadataException ex) { this.tabbedPane.setSelectedIndex(0); this.showInformationMessageDialog(ex.getMessage(), "Metadata Entry Error"); this.rcObjMdJPanel.requestExceptionSourceComponentFocus(); return false; } }
throw new RcMetadataException(t); ex.printStackTrace(); this.showExceptionMessageDialog(ex);
ex.printStackTrace(); RcJOptionPane.showMessageDialog(this, ex.getMessage(), "Error", RcJOptionPane.ERROR_MESSAGE);
ex.printStackTrace(); this.showExceptionMessageDialog(ex, errDlgTitle);
ex.printStackTrace(); this.showExceptionMessageDialog(ex); return;
throw new RcMetadataException(exceptionPrefix + "object has no parent file system data source.");
this.showInformationMessageDialog(ex.getMessage(), "Metadata Entry Error"); return;
throw new RcMetadataException(exPrefix + "the audio object contains no WAVE files."); throw new RcMetadataException(exPrefix + "the audio object contains multiple WAVE files.");
throw new RcMetadataException(exceptionPrefix + "unknown mode specified."); throw new RcMetadataException(exceptionPrefix + "unsupported ResCarta object type " + rcObjectMetadata.getObjectType() + ".");
RcCollectionMetadata rcCollMd = this.rcWebApp.getCollectionMetadata(collId); if (rcCollMd == null) { throw new RcMetadataException(EXCEPTION_PREFIX + "collection metadata for " + collId + " was not found."); RcObjectMetadata rcObjMd = rcCollMd.getObject(objId); if (rcObjMd == null) { throw new RcMetadataException(EXCEPTION_PREFIX + "object metadata for " + objId + " in collection " + collId + " was not found."); throw new RcMetadataException(EXCEPTION_PREFIX + "page sequence " + pgSeq + " not found."); if (rcFsDsMd == null) { throw new RcMetadataException(EXCEPTION_PREFIX + "object has no parent file system data source.");
throw new RcMetadataException("The object " + rcObjectMetadataToAdd[i].getId() + " already exists in " + this.rcCollectionMetadata.getTitle() + "."); throw new RcMetadataException("The date captured for title \"" + rcObjectMetadataToAdd[i].getTitle() + "\" is not ISO8601 compliant."); if (rcObjectMetadataToAdd[i].getDatePublished() != null && rcObjectMetadataToAdd[i].getDatePublished().trim().length() > 0 && (!RcDateUtils.isISO8601(rcObjectMetadataToAdd[i].getDatePublished()))) throw new RcMetadataException("The date published for title \"" + rcObjectMetadataToAdd[i].getTitle() + "\" is not ISO8601 compliant.");