Package org.apache.oodt.cas.webcomponents.filemgr

Examples of org.apache.oodt.cas.webcomponents.filemgr.FileManagerConn


   * @param productId
   */
  public TraceableProductBrowser(String componentId, final String fmUrlStr,
      final String productId, final boolean enableNotCat, final List<String> excludes) {
    super(componentId, fmUrlStr, productId);
    final FileManagerConn fm = new FileManagerConn(fmUrlStr);
    final Product product = fm.safeGetProductById(productId);
    final OpsuiApp app = (OpsuiApp)getApplication();

    Form traceForm = new Form("trace_form");
    traceForm.add(new Button("trace_button") {
      /*
       * (non-Javadoc)
       *
       * @see org.apache.wicket.markup.html.form.Button#onSubmit()
       */
      @Override
      public void onSubmit() {
        Trace tracer = new Trace("pedigree", fmUrlStr, enableNotCat, excludes,
            product);
        tracer.setVisible(true);
        getParent().getParent().replace(tracer);
        setVisible(false);
      }

    });
    add(traceForm);
    add(new WebMarkupContainer("pedigree").setVisible(false));

    List<Reference> refs = fm.getProductReferences(product);
    if (refs != null && refs.size() > 0) {
      replace(new Label("no_prod_ref_display") {
        /*
         * (non-Javadoc)
         *
         * @see org.apache.wicket.Component#isVisible()
         */
        @Override
        public boolean isVisible() {
          return false;
        }
      });

      replace(new ListView<Reference>("ref_list", new ListModel<Reference>(refs)) {
        /*
         * (non-Javadoc)
         *
         * @see
         * org.apache.wicket.markup.html.list.ListView#populateItem(org.apache
         * .wicket.markup.html.list.ListItem)
         */
        @Override
        protected void populateItem(ListItem<Reference> refItem) {
          Reference r = refItem.getModelObject();
          String filePath = null;
          try {
            filePath = new File(new URI(r.getDataStoreReference()))
                .getAbsolutePath();
          } catch (Exception ignore) {
          }
         
          ExternalLink refLink = new ExternalLink("ref_file_path_link",
              "/" + app.getRootContext() + "/data?productID="+productId);
          refLink.add(new Label("ref_file_path", filePath));
          refItem.add(refLink);
          refItem.add(new Label("ref_file_size",
              String.valueOf(r.getFileSize())));
          try {
            refItem.add(new Label("ref_pct_transferred", NumberFormat
                .getPercentInstance()
                .format(fm.getFm().getRefPctTransferred(r))));
          } catch (DataTransferException e) {
            LOG.log(
                Level.WARNING,
                "Unable to determine product reference size: Reason: "
                    + e.getMessage());
View Full Code Here


  private static final String BLANK_SPACE = " ";

  public Types(String componentId, String fmUrlStr, final Class<? extends WebPage> typeBrowser) {
    super(componentId);
    this.fm = new FileManagerConn(fmUrlStr);
    List<ProductType> types = this.fm.safeGetProductTypes();
    Collections.sort(types, new Comparator<ProductType>() {
      public int compare(ProductType type1, ProductType type2) {
           return type1.getName().compareTo(type2.getName());
      }
View Full Code Here

      final Class<? extends WebPage> produdctBrowser,
      final Class<? extends WebPage> prodRefsBrowser,
      final Class<? extends WebPage> prodMetBrowser) {

    super(componentId);
    this.fm = new FileManagerConn(fmUrlStr);
    this.type = fm.safeGetProductTypeByName(productTypeName);
    this.pageNum = pageNum;
    this.criteria = ((FMBrowserSession) getSession()).getCriteria();
    this.refreshProductPage();
    this.computeStartEndIdx();
View Full Code Here

 
  private FileManagerConn fm;

  public ProductBrowser(String componentId, String fmUrlStr, String productId) {
    super(componentId);
    this.fm = new FileManagerConn(fmUrlStr);
    Product product = fm.safeGetProductById(productId);
    try {
      String productPctTransferred = NumberFormat.getPercentInstance().format(
          fm.getFm().getProductPctTransferred(
              product));
View Full Code Here

 
  private FileManagerConn fm;
 
  public ProductRefsBrowser(String componentId, String fmUrlStr, String productId){
    super(componentId);
    this.fm = new FileManagerConn(fmUrlStr);
    List<Reference> refs = null;
    try {
      refs = fm.getProductReferences(fm.getFm().getProductById(productId));
    } catch (CatalogException e1) {
      e1.printStackTrace();
View Full Code Here

  private FileManagerConn fm;

  public MetadataBrowser(String componentId, String fmUrlStr, String productId) {
    super(componentId);
    this.fm = new FileManagerConn(fmUrlStr);
    final SerializableMetadata met = new SerializableMetadata(this.fm
        .getMetadata(this.fm.safeGetProductById(productId)));
    setDefaultModel(new Model(met));

    if (met != null) {
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.webcomponents.filemgr.FileManagerConn

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.