Package org.dspace.app.xmlui.wing.element

Examples of org.dspace.app.xmlui.wing.element.Division


    }
   
   public void addBody(Body body) throws WingException {
       
       if (accountExists) {
           Division exists = body.addInteractiveDivision("register-account-exists",contextPath+"/register",Division.METHOD_POST,"primary");

           exists.setHead(T_head1);
          
           exists.addPara(T_para1);

           List form = exists.addList("form");
          
           form.addLabel(T_reset_password_for);
           form.addItem(this.email);
          
           form.addLabel();
           Item submit = form.addItem();
           submit.addButton("submit_forgot").setValue(T_submit_reset);
          
           exists.addHidden("email").setValue(this.email);
           exists.addHidden("eperson-continue").setValue(knot.getId());
       }
      
      
       Division register = body.addInteractiveDivision("register",
               contextPath+"/register",Division.METHOD_POST,"primary");
      
       register.setHead(T_head2);
      
       EPersonUtils.registrationProgressList(register,1);
      
       register.addPara(T_para2);
      
       List form = register.addList("form",List.TYPE_FORM);
      
       Text email = form.addItem().addText("email");
       email.setRequired();
       email.setLabel(T_email_address);
       email.setHelp(T_email_address_help);
       email.setValue(this.email);
       if (errors.contains("email"))
           email.addError(T_error_bad_email);
      
       Item submit = form.addItem();
       submit.addButton("submit").setValue(T_submit_register);
      
       register.addHidden("eperson-continue").setValue(knot.getId());
   }
View Full Code Here





    // DIVISION: main
    Division div = body.addInteractiveDivision("edit-bitstream", contextPath+"/admin/item", Division.METHOD_MULTIPART, "primary administrative item");     
    div.setHead(T_head1);


    // LIST: edit form
    List edit = div.addList("edit-bitstream-list", List.TYPE_FORM);

    edit.addLabel(T_file_label);
    edit.addItem().addXref(fileUrl, fileName);

   
    Select primarySelect = edit.addItem().addSelect("primary");
    primarySelect.setLabel(T_primary_label);
    primarySelect.addOption(primaryBitstream,"yes",T_primary_option_yes);
    primarySelect.addOption(!primaryBitstream,"no",T_primary_option_no);
   
    Text description = edit.addItem().addText("description");
    description.setLabel(T_description_label);
    description.setHelp(T_description_help);
    description.setValue(bitstream.getDescription());

    edit.addItem(T_para1);

    // System supported formats
    Select format = edit.addItem().addSelect("formatID");
    format.setLabel(T_format_label);

                // load the options menu, skipping the "Unknown" format since "Not on list" takes its place
                int unknownFormatID = BitstreamFormat.findUnknown(context).getID();
    format.addOption(-1,T_format_default);
    for (BitstreamFormat bitstreamFormat : bitstreamFormats)
    {
                        if (bitstreamFormat.getID() == unknownFormatID)
                            continue;
      String supportLevel = "Unknown";
      if (bitstreamFormat.getSupportLevel() == BitstreamFormat.KNOWN)
        supportLevel = "known";
      else if (bitstreamFormat.getSupportLevel() == BitstreamFormat.SUPPORTED)
        supportLevel = "Supported";
      String name = bitstreamFormat.getShortDescription()+" ("+supportLevel+")";
                        if (bitstreamFormat.isInternal())
                            name += " (Internal)";
      int id = bitstreamFormat.getID();

      format.addOption(id,name);
    }
    if (currentFormat != null)
    {
      format.setOptionSelected(currentFormat.getID());
    }
    else
    {
      format.setOptionSelected(-1);
    }

    edit.addItem(T_para2);

    // User supplied format
    Text userFormat = edit.addItem().addText("user_format");
    userFormat.setLabel(T_user_label);
    userFormat.setHelp(T_user_help);
    userFormat.setValue(bitstream.getUserFormatDescription());




    // ITEM: form actions
    org.dspace.app.xmlui.wing.element.Item actions = edit.addItem();
    actions.addButton("submit_save").setValue(T_submit_save);
    actions.addButton("submit_cancel").setValue(T_submit_cancel);

    div.addHidden("administrative-continue").setValue(knot.getId());

  }
View Full Code Here

        pageMeta.addTrail().addContent(T_trail_new_registration);
    }
   
    public void addBody(Body body) throws WingException
    {
        Division cannot = body.addDivision("register-cannot","primary");

        cannot.setHead(T_head);

        EPersonUtils.registrationProgressList(cannot, 0);
       
        cannot.addPara(T_para1);
    }
View Full Code Here

        // Get our parameters and state
        int itemID = parameters.getParameterAsInteger("itemID",-1);
        Item item = Item.find(context, itemID);
       
        // DIVISION: Main
        Division main = body.addInteractiveDivision("move-item", contextPath+"/admin/item", Division.METHOD_POST, "primary administrative item");
        main.setHead(T_head1.parameterize(item.getHandle()));

        Collection[] collections = Collection.findAuthorized(context, null, Constants.ADD);

        List list = main.addList("select-collection", List.TYPE_FORM);
        Select select = list.addItem().addSelect("collectionID");
        select.setLabel(T_collection);
        select.setHelp(T_collection_help);
       
        Collection owningCollection = item.getOwningCollection();
        if (owningCollection == null) {
            select.addOption("",T_collection_default);
        }
       
        for (Collection collection : collections)
        {
            String name = collection.getMetadata("name");
            if (name.length() > 50)
                name = name.substring(0, 47) + "...";
            select.addOption(collection.equals(owningCollection), collection.getID(), name);
        }
       
        org.dspace.app.xmlui.wing.element.Item actions = list.addItem();
        actions.addButton("submit_move").setValue(T_submit_move);
    actions.addButton("submit_cancel").setValue(T_submit_cancel);

    main.addHidden("administrative-continue").setValue(knot.getId());
  }
View Full Code Here

 
    public void addBody(Body body) throws SAXException, WingException,
            UIException, SQLException, IOException, AuthorizeException
    {
        Division feedback = body.addDivision("feedback-sent","primary");
    
        feedback.setHead(T_head);
       
        feedback.addPara(T_para1);
       
    }
View Full Code Here

    Item item = Item.find(context, itemID);
    String baseURL = contextPath+"/admin/item?administrative-continue="+knot.getId();


    // DIVISION: main div
    Division main = body.addInteractiveDivision("edit-item-status", contextPath+"/admin/item", Division.METHOD_POST,"primary administrative item");
    main.setHead(T_option_head);

   
   
    // LIST: options
    List options = main.addList("options",List.TYPE_SIMPLE,"horizontal");
    options.addItem().addXref(baseURL+"&submit_status",T_option_status);
    options.addItem().addHighlight("bold").addXref(baseURL+"&submit_bitstreams",T_option_bitstreams);
    options.addItem().addXref(baseURL+"&submit_metadata",T_option_metadata);
    options.addItem().addXref(baseURL + "&view_item", T_option_view);

   
   
    // TABLE: Bitstream summary
    Table files = main.addTable("editItemBitstreams", 1, 1);

    files.setHead(T_head1);

    Row header = files.addRow(Row.ROLE_HEADER);
    header.addCellContent(T_column1);
    header.addCellContent(T_column2);
    header.addCellContent(T_column3);
    header.addCellContent(T_column4);
    header.addCellContent(T_column5);

    Bundle[] bundles = item.getBundles();

    for (Bundle bundle : bundles)
    {

      Cell bundleCell = files.addRow().addCell(1, 5);
      bundleCell.addContent(T_bundle_label.parameterize(bundle.getName()));



      Bitstream[] bitstreams = bundle.getBitstreams();

      for (Bitstream bitstream : bitstreams)
      {
        boolean primary = (bundle.getPrimaryBitstreamID() == bitstream.getID());
        String name = bitstream.getName();
   
        if (name != null && name.length() > 50)
        {
          // If the fiel name is too long the shorten it so that it will display nicely.
          String shortName = name.substring(0,15);
          shortName += " ... ";
          shortName += name.substring(name.length()-25,name.length());
          name = shortName;
        }
       
        String description = bitstream.getDescription();
        String format = null;
        BitstreamFormat bitstreamFormat = bitstream.getFormat();
        if (bitstreamFormat != null)
          format = bitstreamFormat.getShortDescription();
        String editURL = contextPath + "/admin/item?administrative-continue="+knot.getId()+"&bitstreamID="+bitstream.getID()+"&submit_edit";
        String viewURL = contextPath + "/bitstream/id/"+bitstream.getID()+"/"+bitstream.getName();


        Row row = files.addRow();
        CheckBox remove = row.addCell().addCheckBox("remove");
        remove.setLabel("remove");
        remove.addOption(bundle.getID() + "/" +bitstream.getID() );
        if (!AuthorizeManager.authorizeActionBoolean(context, item, Constants.REMOVE))
        {
          remove.setDisabled();
        }

        if (AuthorizeManager.authorizeActionBoolean(context, bitstream, Constants.WRITE))
        {
          // The user can edit the bitstream give them a link.
          Cell cell = row.addCell();
          cell.addXref(editURL,name);
          if (primary)
            cell.addXref(editURL,T_primary_label);
         
          row.addCell().addXref(editURL,description);
          row.addCell().addXref(editURL,format);
        }
        else
        {
          // The user can't edit the bitstream just show them it.
          Cell cell = row.addCell();
          cell.addContent(name);
          if (primary)
            cell.addContent(T_primary_label);
         
          row.addCell().addContent(description);
          row.addCell().addContent(format);
        }
       
        Highlight highlight = row.addCell().addHighlight("fade");
        highlight.addContent("[");
        highlight.addXref(viewURL,T_view_link);
        highlight.addContent("]");
      }
    }

    if (AuthorizeManager.authorizeActionBoolean(context, item, Constants.ADD))
    {
      Cell cell = files.addRow().addCell(1, 5);
      cell.addXref(contextPath+"/admin/item?administrative-continue="+knot.getId()+"&submit_add",T_submit_add);
    }
    else
    {
      Cell cell = files.addRow().addCell(1, 5);
      cell.addHighlight("fade").addContent(T_no_upload);
    }

   
   
    // PARA: actions
    Para actions = main.addPara("editItemActionsP","editItemActionsP" );
        // Only System Administrators can delete bitstreams
    if (AuthorizeManager.authorizeActionBoolean(context, item, Constants.REMOVE))
      actions.addButton("submit_delete").setValue(T_submit_delete);
    else
    {
      Button button = actions.addButton("submit_delete");
      button.setValue(T_submit_delete);
      button.setDisabled();
     
      main.addPara().addHighlight("fade").addContent(T_no_remove);
    }
    actions.addButton("submit_return").setValue(T_submit_return);


    main.addHidden("administrative-continue").setValue(knot.getId());

  }
View Full Code Here

    pageMeta.addTrail().addContent(T_trail_new_registration);
  }

  public void addBody(Body body) throws WingException
  {
    Division finished = body.addDivision("registration-finished", "primary");

    finished.setHead(T_head);

    EPersonUtils.registrationProgressList(finished, 3);

    finished.addPara(T_para1);

    finished.addPara().addXref(contextPath, T_go_home);
  }
View Full Code Here

        if (!(dso instanceof Item))
            return;
        Item item = (Item) dso;
       
        // Build the item viewer division.
        Division division = body.addDivision("item-view","primary");
        String title = getItemTitle(item);
        if (title != null)
            division.setHead(title);
        else
            division.setHead(item.getHandle());

        Para showfullPara = division.addPara(null, "item-view-toggle item-view-toggle-top");

        if (showFullItem(objectModel))
        {
            String link = contextPath + "/handle/" + item.getHandle();
            showfullPara.addXref(link).addContent(T_show_simple);
        }
        else
        {
            String link = contextPath + "/handle/" + item.getHandle()
                    + "?show=full";
            showfullPara.addXref(link).addContent(T_show_full);
        }
       
        ReferenceSet referenceSet;
        if (showFullItem(objectModel))
        {
            referenceSet = division.addReferenceSet("collection-viewer",
                    ReferenceSet.TYPE_DETAIL_VIEW);
        }
        else
        {
            referenceSet = division.addReferenceSet("collection-viewer",
                    ReferenceSet.TYPE_SUMMARY_VIEW);
        }

        // Refrence the actual Item
        ReferenceSet appearsInclude = referenceSet.addReference(item).addReferenceSet(ReferenceSet.TYPE_DETAIL_LIST,null,"hierarchy");
        appearsInclude.setHead(T_head_parent_collections);
       
        // Reference all collections the item appears in.
        for (Collection collection : item.getCollections())
        {
            appearsInclude.addReference(collection);
        }
       
        showfullPara = division.addPara(null,"item-view-toggle item-view-toggle-bottom");

        if (showFullItem(objectModel))
        {
            String link = contextPath + "/handle/" + item.getHandle();
            showfullPara.addXref(link).addContent(T_show_simple);
View Full Code Here

    pageMeta.addTrail().addContent(T_trail);
  }

  public void addBody(Body body) throws WingException
  {
    Division updated = body.addDivision("profile-updated", "primary");

    updated.setHead(T_head);

    updated.addPara(T_para1);

    updated.addPara().addXref(contextPath + "/", T_go_home);
  }
View Full Code Here

            UIException, SQLException, IOException, AuthorizeException
    {  
      Request  request = ObjectModelHelper.getRequest(objectModel);
        DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
       
        Division unauthorized = body.addDivision("unauthorized-resource","primary");

        if (dso == null)
        {
            unauthorized.setHead(T_head_resource);
            unauthorized.addPara(T_para_resource);
        }
        else if (dso instanceof Community)
        {
          Community community = (Community) dso;
          unauthorized.setHead(T_head_community);
            unauthorized.addPara(T_para_community.parameterize(community.getMetadata("name")));
        }
        else if (dso instanceof Collection)
        {
          Collection collection = (Collection) dso;
          unauthorized.setHead(T_head_collection);
            unauthorized.addPara(T_para_collection.parameterize(collection.getMetadata("name")));
        }
        else if (dso instanceof Item)
        {
           // The dso may be an item but it could still be an item's bitstream. So let's check for the parameter.
          if (request.getParameter("bitstreamId") != null)
          {
            String identifier = "unknown";
            try {
              Bitstream bit = Bitstream.find(context, new Integer(request.getParameter("bitstreamId")));
              if (bit != null) {
                identifier = bit.getName();
              }
            }
            catch(Exception e) {
              // just forget it - and display the restricted message.
            }
            unauthorized.setHead(T_head_bitstream);
                unauthorized.addPara(T_para_bitstream.parameterize(identifier));
          }
          else
          {
            String identifier = "unknown";
            String handle = dso.getHandle();
              if (handle == null || "".equals(handle))
              {
                identifier =  "internal ID: " + dso.getID();
              }
              else
              {
                identifier = "hdl:"+handle;
              }
            unauthorized.setHead(T_head_item);
                unauthorized.addPara(T_para_item.parameterize(identifier));
          }
        }
        else
        {
          // This case should not occure, but if it does just fall back to the resource message.
          unauthorized.setHead(T_head_resource);
            unauthorized.addPara(T_para_resource);
        }
     
    }
View Full Code Here

TOP

Related Classes of org.dspace.app.xmlui.wing.element.Division

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.