private String getLabel(RcObjectMetadata rcObjMd) { if ((rcObjMd.getObjectType() == RcObjectType.SERIAL || rcObjMd.getObjectType() == RcObjectType.NEWSPAPER) && rcObjMd.getDatePublished() != null) { return rcObjMd.getTitle() + " " + rcObjMd.getDatePublished(); } else { return rcObjMd.getTitle(); } }
public static List<RcNameMetadata> getNames(RcObjectMetadata rcObjMd, RcMarcRelator role) { return rcObjMd.getNames(role); }
private static File getVideoFile(RcVideoMetadata rcVidMd) throws RcMetadataException, IOException, SAXException { File objDir = rcVidMd.getParentFileSystemDataSourceMetadata().getDirectory(rcVidMd); File videoFile; synchronized (rcVidMd) { rcVidMd.loadStructure(); videoFile = new File(objDir.getPath() + File.separator + rcVidMd.getVideoFileMetadata().getFilename()); rcVidMd.clearStructure(); } return videoFile; }
private static Map<String, RcObjectMetadata> mapCollection(RcCollectionMetadata rcCollMd) { HashMap<String, RcObjectMetadata> m = new HashMap<String, RcObjectMetadata>(); for (RcObjectMetadata rcObjMd : rcCollMd.getObjectMap().values()) { m.put(rcObjMd.getId(), rcObjMd); } for (RcCollectionMetadata rcSubCollMd : rcCollMd.getCollectionMap().values()) { m.putAll(mapCollection(rcSubCollMd)); } return m; }
private static void mapCollection(RcCollectionMetadata rcCollMd, Map<String, RcCollectionMetadata> rcCollMdMap, boolean allCollections) { if (allCollections) { rcCollMdMap.put(rcCollMd.getId(), rcCollMd); } else if (rcCollMd.getObjectMap().size() > 0) { rcCollMdMap.put(rcCollMd.getId(), rcCollMd); } for (RcCollectionMetadata rcSubCollMd : rcCollMd.getCollectionMap().values()) { mapCollection(rcSubCollMd, rcCollMdMap, allCollections); } } }
private static File getSrtFile(RcVideoMetadata rcVidMd, RcSrtFileMetadata rcSrtFileMd) throws RcMetadataException, IOException, SAXException { File objDir = rcVidMd.getParentFileSystemDataSourceMetadata().getDirectory(rcVidMd); return new File(objDir.getPath() + File.separator + rcSrtFileMd.getFilename()); }
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; }
/** * Returns a JLabel displaying IP Filter. */ @SuppressWarnings("rawtypes") public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { JLabel listCellRendererComponent = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); listCellRendererComponent.setText(((RcPermissionMetadata) value).getType() + " " + ((RcPermissionMetadata) value).getPrincipalType().toString().toLowerCase() + ": " + ((RcPermissionMetadata) value).getPrincipal()); listCellRendererComponent.setIcon(this.permissionIcon); return listCellRendererComponent; } }
private static boolean isUploaded(RcObjectMetadata rcObjMd) { for (RcIdentifierMetadata rcAltIdMd : rcObjMd.getAlternateIdentifiers()) { if (rcAltIdMd.getType().equals("kaltura")) { return true; } } return false; }
public static String getCollectionIdForFacetPath(RcIrFacetPath facetPath) { RcCollectionMetadata rcCollMd = RcWebApp.getInstance().getCollectionMetadata(facetPath); if (rcCollMd == null) { return null; } return rcCollMd.getId(); }
/** * Save a new metadata template using data from the selected object. */ private void saveMdTemplate() { RcMdTemplateManager.getInstance().saveTemplate(this.getWindow(), this.menuBar.templatesJMenu, this.rcObjMdJPanel); }
/** * Builds the templates sub-menu. */ private void buildTemplatesMenu() { RcMdTemplateManager.getInstance().buildApplyTemplateMenu(this.getWindow(), this.menuBar.templatesJMenu, this.rcObjMdJPanel); }
public static String getCollectionTitleForFacetPath(RcIrFacetPath facetPath) { RcCollectionMetadata rcCollMd = RcWebApp.getInstance().getCollectionMetadata(facetPath); if (rcCollMd == null) { return null; } return rcCollMd.getTitle(); }