Niloofar, I think you are looking for a versioner. A versioner determines where a product is archived after ingestion. The versioner is declared in the product-types.xml file. Hope that helps.
Cameron On Mar 17, 2011 6:24 PM, "niloofar montazeri" <[email protected]> wrote: > Hi! > > I am having trouble with trackimg a design decision about the FileManager > component back into the code. > > The decision is: "The system Interface uses the information about Product > Type policy made available by the Repository Manager in order to understand > whether or not the product should be transferred, where its root repository > path should be, and so on ." > > Looking at the code of ingestProduct method and examining all the methods > that access the FileManager's repositoryManager instance, I found that the > only role the repositoryManager plays in ingestProduct method is to assign > meta-data to the product. After that, there is no such decision point for > sending or not sending the product (the product is always transferred): > > public String ingestProduct(Hashtable<String, Object> productHash, > Hashtable<String, String> metadata, boolean clientTransfer) > throws VersioningException, RepositoryManagerException, > DataTransferException, CatalogException { > > Product p = XmlRpcStructFactory.getProductFromXmlRpc(productHash); > > try { > // first, create the product > p.setTransferStatus(Product.STATUS_TRANSFER); > catalogProduct(p); > > // now add the metadata > Metadata m = new Metadata(); > m.addMetadata((Hashtable)metadata); > > *addMetadata(p, m);* > > if (!clientTransfer) { > LOG.log(Level.FINEST, > "File Manager: ingest: no client transfer enabled, " > + "server transfering product: [" + p.getProductName() + > "]"); > > // version the product > Versioner versioner = null; > try { > versioner = GenericFileManagerObjectFactory > .getVersionerFromClassName(p.getProductType().getVersioner()); > versioner.createDataStoreReferences(p, m); > } catch (Exception e) { > LOG.log(Level.SEVERE, > "ingestProduct: VersioningException when versioning Product: " > + p.getProductName() + " with Versioner " > + p.getProductType().getVersioner() + ": Message: " > + e.getMessage()); > throw new VersioningException(e); > } > > // add the newly versioned references to the data store > addProductReferences(p); > > // now transfer the product > try { > dataTransfer.transferProduct(p); > // now update the product's transfer status in the data store > p.setTransferStatus(Product.STATUS_RECEIVED); > > try { > catalog.setProductTransferStatus(p); > } catch (CatalogException e) { > LOG.log(Level.SEVERE, "ingestProduct: CatalogException " > + "when updating product transfer status for Product: " > + p.getProductName() + " Message: " + e.getMessage()); > throw e; > } > } catch (Exception e) { > LOG.log(Level.SEVERE, > "ingestProduct: DataTransferException when transfering > Product: " > + p.getProductName() + ": Message: " + e.getMessage()); > throw new DataTransferException(e); > } > } > > // that's it! > return p.getProductId(); > } catch (Exception e) { > e.printStackTrace(); > throw new CatalogException("Error ingesting product [" + p + "] : " > + e.getMessage()); > } > > > Am I missing something? > > Thanks, > Niloofar
