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

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


    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);
View Full Code Here


      
      
      
      
      
       List form = profile.addList("form",List.TYPE_FORM);
      
       List identity = form.addList("identity",List.TYPE_FORM);
       identity.setHead(T_head_identify);
      
       // Email
       identity.addLabel(T_email_address);
       identity.addItem(email);
      
       // First name
       Text firstName = identity.addItem().addText("first_name");
       firstName.setRequired();
       firstName.setLabel(T_first_name);
       firstName.setValue(defaultFirstName);
       if (errors.contains("first_name"))
       {
           firstName.addError(T_error_required);
       }
       if (!registering && !ConfigurationManager.getBooleanProperty("xmlui.user.editmetadata", true))
           firstName.setDisabled();
      
       // Last name
       Text lastName = identity.addItem().addText("last_name");
       lastName.setRequired();
       lastName.setLabel(T_last_name);
       lastName.setValue(defaultLastName);
       if (errors.contains("last_name"))
       {
           lastName.addError(T_error_required);
       }
       if (!registering &&!ConfigurationManager.getBooleanProperty("xmlui.user.editmetadata", true))
           lastName.setDisabled();
      
       // Phone
       Text phone = identity.addItem().addText("phone");
       phone.setLabel(T_telephone);
       phone.setValue(defaultPhone);
       if (errors.contains("phone"))
       {
           phone.addError(T_error_required);
       }
       if (!registering && !ConfigurationManager.getBooleanProperty("xmlui.user.editmetadata", true))
           phone.setDisabled();
       
       // Language
       Select lang = identity.addItem().addSelect("language");
       lang.setLabel(T_language);
       if (supportedLocales.length > 0)
       {
           for (Locale lc : supportedLocales)
           {
               lang.addOption(lc.toString(), lc.getDisplayName());
           }
       }
       else
       {
           lang.addOption(I18nUtil.DEFAULTLOCALE.toString(), I18nUtil.DEFAULTLOCALE.getDisplayName());
       }
       lang.setOptionSelected((defaultLanguage == null || defaultLanguage.equals("")) ?
                              I18nUtil.DEFAULTLOCALE.toString() : defaultLanguage);
       if (!registering && !ConfigurationManager.getBooleanProperty("xmlui.user.editmetadata", true))
           lang.setDisabled();

       // Subscriptions
       if (!registering)
       {
           List subscribe = form.addList("subscriptions",List.TYPE_FORM);
           subscribe.setHead(T_subscriptions);
          
           subscribe.addItem(T_subscriptions_help);
          
           Collection[] currentList = Subscribe.getSubscriptions(context, context.getCurrentUser());
           Collection[] possibleList = Collection.findAll(context);
          
           Select subscriptions = subscribe.addItem().addSelect("subscriptions");
           subscriptions.setLabel(T_email_subscriptions);
           subscriptions.setHelp("");
           subscriptions.enableAddOperation();
           subscriptions.enableDeleteOperation();
          
           subscriptions.addOption(-1,T_select_collection);
           for (Collection possible : possibleList)
           {
                   String name = possible.getMetadata("name");
                   if (name.length() > 50)
                           name = name.substring(0, 47) + "...";
                   subscriptions.addOption(possible.getID(), name);
           }
                  
           for (Collection collection: currentList)
                   subscriptions.addInstance().setOptionSelected(collection.getID());
       }
      
      
       if (allowSetPassword)
       {
           List security = form.addList("security",List.TYPE_FORM);
           security.setHead(T_head_security);
          
           if (registering)
           {
                   security.addItem().addContent(T_create_password_instructions);
           }
           else
           {
                   security.addItem().addContent(T_update_password_instructions);
           }
          
          
           Field password = security.addItem().addPassword("password");
           password.setLabel(T_password);
           if (registering)
                   password.setRequired();
           if (errors.contains("password"))
           {
               password.addError(T_error_invalid_password);
           }
          
           Field passwordConfirm = security.addItem().addPassword("password_confirm");
           passwordConfirm.setLabel(T_confirm_password);
           if (registering)
                   passwordConfirm.setRequired();
           if (errors.contains("password_confirm"))
           {
               passwordConfirm.addError(T_error_unconfirmed_password);
           }
       }
      
       Button submit = form.addItem().addButton("submit");
       if (registering)
           submit.setValue(T_submit_update);
       else
           submit.setValue(T_submit_create);
      
       profile.addHidden("eperson-continue").setValue(knot.getId());
      
      
      
       if (!registering)
       {
                // Add a list of groups that this user is apart of.
                        Group[] memberships = Group.allMemberGroups(context, context.getCurrentUser());
               
               
                        // Not a member of any groups then don't do anything.
                        if (!(memberships.length > 0))
                                return;
                       
                        List list = profile.addList("memberships");
                        list.setHead(T_head_auth);
                        for (Group group: memberships)
                        {
                                list.addItem(group.getName());
                        }
       }
   }
View Full Code Here

  private void addAlerts(Division div) throws WingException
  {
    // Remember we're in the alerts section
    div.addHidden("alerts").setValue("true");
   
    List form = div.addList("system-wide-alerts",List.TYPE_FORM);
    form.setHead(T_alerts_head);
   
    form.addItem(T_alerts_warning);
   
    TextArea message = form.addItem().addTextArea("message");
    message.setLabel(T_alerts_message_label);
    message.setSize(5, 45);
    if (SystemwideAlerts.getMessage() == null)
      message.setValue(T_alerts_message_default);
    else
      message.setValue(SystemwideAlerts.getMessage());
   
    Select countdown = form.addItem().addSelect("countdown");
    countdown.setLabel(T_alerts_countdown_label);
   
    countdown.addOption(0,T_alerts_countdown_none);
    countdown.addOption(5,T_alerts_countdown_5);
    countdown.addOption(15,T_alerts_countdown_15);
    countdown.addOption(30,T_alerts_countdown_30);
    countdown.addOption(60,T_alerts_countdown_60);
   
    // Is there a current count down active?
    if (SystemwideAlerts.isAlertActive() && SystemwideAlerts.getCountDownToo() - System.currentTimeMillis() > 0)
      countdown.addOption(true,-1,T_alerts_countdown_keep);
    else
      countdown.setOptionSelected(0);
   
    Select restrictsessions = form.addItem().addSelect("restrictsessions");
    restrictsessions.setLabel(T_alerts_session_label);
    restrictsessions.addOption(SystemwideAlerts.STATE_ALL_SESSIONS,T_alerts_session_all_sessions);
    restrictsessions.addOption(SystemwideAlerts.STATE_CURRENT_SESSIONS,T_alerts_session_current_sessions);
    restrictsessions.addOption(SystemwideAlerts.STATE_ONLY_ADMINISTRATIVE_SESSIONS,T_alerts_session_only_administrative);
    restrictsessions.setOptionSelected(SystemwideAlerts.getRestrictSessions());
   
    form.addItem(T_alerts_session_note);
   
   
    Item actions = form.addItem();
    actions.addButton("submit_activate").setValue(T_alerts_submit_activate);
    actions.addButton("submit_deactivate").setValue(T_alerts_submit_deactivate);
   
  }
View Full Code Here

  private void addHarvest(Division div) throws WingException, SQLException
  {
    // Remember we're in the harvest section
    div.addHidden("harvest").setValue("true");
           
    List harvesterControls = div.addList("oai-harvester-controls",List.TYPE_FORM);
    harvesterControls.setHead(T_harvest_scheduler_head);
    harvesterControls.addLabel(T_harvest_label_status);
    Item status = harvesterControls.addItem();
    status.addContent(HarvestScheduler.getStatus());
    status.addXref(contextPath + "/admin/panel?harvest", "(refresh)");
   
    harvesterControls.addLabel(T_harvest_label_actions);
    Item actionsItem = harvesterControls.addItem();
    if (HarvestScheduler.status == HarvestScheduler.HARVESTER_STATUS_STOPPED) {
      actionsItem.addButton("submit_harvest_start").setValue(T_harvest_submit_start);
      actionsItem.addButton("submit_harvest_reset").setValue(T_harvest_submit_reset);
    }
    if (HarvestScheduler.status == HarvestScheduler.HARVESTER_STATUS_PAUSED)
      actionsItem.addButton("submit_harvest_resume").setValue(T_harvest_submit_resume);
    if (HarvestScheduler.status == HarvestScheduler.HARVESTER_STATUS_RUNNING ||
        HarvestScheduler.status == HarvestScheduler.HARVESTER_STATUS_SLEEPING)
      actionsItem.addButton("submit_harvest_pause").setValue(T_harvest_submit_pause);
    if (HarvestScheduler.status != HarvestScheduler.HARVESTER_STATUS_STOPPED)
      actionsItem.addButton("submit_harvest_stop").setValue(T_harvest_submit_stop);
   
    // Can be retrieved via "{context-path}/admin/collection?collectionID={id}"
    String baseURL = contextPath + "/admin/collection?collectionID=";
   
    harvesterControls.addLabel(T_harvest_label_collections);
    Item allCollectionsItem = harvesterControls.addItem();
    java.util.List<Integer> allCollections =  HarvestedCollection.findAll(context);
    for (Integer oaiCollection : allCollections) {
      allCollectionsItem.addXref(baseURL + oaiCollection, oaiCollection.toString());
    }
    harvesterControls.addLabel(T_harvest_label_active);
    Item busyCollectionsItem = harvesterControls.addItem();
    java.util.List<Integer> busyCollections =  HarvestedCollection.findByStatus(context, HarvestedCollection.STATUS_BUSY);
    for (Integer busyCollection : busyCollections) {
      busyCollectionsItem.addXref(baseURL + busyCollection, busyCollection.toString());
    }
    harvesterControls.addLabel(T_harvest_label_queued);
    Item queuedCollectionsItem = harvesterControls.addItem();
    java.util.List<Integer> queuedCollections =  HarvestedCollection.findByStatus(context, HarvestedCollection.STATUS_QUEUED);
    for (Integer queuedCollection : queuedCollections) {
      queuedCollectionsItem.addXref(baseURL + queuedCollection, queuedCollection.toString());
    }
    harvesterControls.addLabel(T_harvest_label_oai_errors);
    Item oaiErrorsItem = harvesterControls.addItem();
    java.util.List<Integer> oaiErrors =  HarvestedCollection.findByStatus(context, HarvestedCollection.STATUS_OAI_ERROR);
    for (Integer oaiError : oaiErrors) {
      oaiErrorsItem.addXref(baseURL + oaiError, oaiError.toString());
    }
    harvesterControls.addLabel(T_harvest_label_internal_errors);
    Item internalErrorsItem = harvesterControls.addItem();
    java.util.List<Integer> internalErrors =  HarvestedCollection.findByStatus(context, HarvestedCollection.STATUS_UNKNOWN_ERROR);
    for (Integer internalError : internalErrors) {
      internalErrorsItem.addXref(baseURL + internalError, internalError.toString());
    }
   
    // OAI Generator settings
    List generatorSettings = div.addList("oai-generator-settings");
    generatorSettings.setHead(T_harvest_head_generator_settings);
   
    generatorSettings.addLabel(T_harvest_label_oai_url);
    String oaiUrl = ConfigurationManager.getProperty("dspace.oai.url");
    if (oaiUrl != null && oaiUrl != "")
      generatorSettings.addItem(oaiUrl);

    generatorSettings.addLabel(T_harvest_label_oai_source);
    String oaiAuthoritativeSource = ConfigurationManager.getProperty("ore.authoritative.source");
    if (oaiAuthoritativeSource != null && oaiAuthoritativeSource != "")
      generatorSettings.addItem(oaiAuthoritativeSource);
    else
      generatorSettings.addItem("oai");
   
    // OAI Harvester settings (just iterate over all the values that start with "harvester")
    List harvesterSettings = div.addList("oai-harvester-settings");
    harvesterSettings.setHead(T_harvest_head_harvester_settings);
   
    String metaString = "harvester.";
        Enumeration pe = ConfigurationManager.propertyNames();
        while (pe.hasMoreElements())
        {
            String key = (String)pe.nextElement();
            if (key.startsWith(metaString)) {
              harvesterSettings.addLabel(key);
              harvesterSettings.addItem(ConfigurationManager.getProperty(key) + " ");
            }
        }
  }
View Full Code Here

    {
      /* Create skeleton menu structure to ensure consistent order between aspects,
       * even if they are never used
       */
        options.addList("browse");
        List account = options.addList("account");
        options.addList("context");
        options.addList("administrative");
       
        account.setHead(T_my_account);
        EPerson eperson = this.context.getCurrentUser();
        if (eperson != null)
        {
            String fullName = eperson.getFullName();
            account.addItemXref(contextPath+"/logout",T_logout);
            account.addItemXref(contextPath+"/profile",T_profile.parameterize(fullName));
        }
        else
        {
            account.addItemXref(contextPath+"/login",T_login);
            if (ConfigurationManager.getBooleanProperty("xmlui.user.registration", true))
              account.addItemXref(contextPath+"/register",T_register);
        }
    }
View Full Code Here

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

    // LIST: upload form
    List upload = div.addList("submit-upload-new", List.TYPE_FORM);
    upload.setHead(T_head1);   

    int bundleCount = 0; // record how many bundles we are able to upload too.
    Select select = upload.addItem().addSelect("bundle");
    select.setLabel(T_bundle_label);
   
    // Get the list of bundles to allow the user to upload too. Either use the default
    // or one supplied from the dspace.cfg.
    String bundleString = ConfigurationManager.getProperty("xmlui.bundle.upload");
        if (bundleString == null || bundleString.length() == 0)
          bundleString = DEFAULT_BUNDLE_LIST;
        String[] parts = bundleString.split(",");
        for (String part : parts)
        {
          if (addBundleOption(item,select,part.trim()))
            bundleCount++;
        }
        select.setOptionSelected("ORIGINAL");
   
    if (bundleCount == 0)
      select.setDisabled();
   

    File file = upload.addItem().addFile("file");
    file.setLabel(T_file_label);
    file.setHelp(T_file_help);
    file.setRequired();

    if (bundleCount == 0)
      file.setDisabled();
   
    Text description = upload.addItem().addText("description");
    description.setLabel(T_description_label);
    description.setHelp(T_description_help);

    if (bundleCount == 0)
      description.setDisabled();
   
    if (bundleCount == 0)
      upload.addItem().addContent(T_no_bundles);
   
    // ITEM: actions
    Item actions = upload.addItem();
    Button button = actions.addButton("submit_upload");
    button.setValue(T_submit_upload);
    if (bundleCount == 0)
      button.setDisabled();
   
View Full Code Here

    {
      /* Create skeleton menu structure to ensure consistent order between aspects,
       * even if they are never used
       */
        options.addList("browse");
        List account = options.addList("account");
        List context = options.addList("context");
        List admin = options.addList("administrative");
        account.setHead(T_my_account);         
       
        // My Account options
        if(availableExports!=null && availableExports.size()>0){
            account.addItem().addXref(contextPath+"/admin/export", T_account_export);
        }

        //Check if a system administrator
        boolean isSystemAdmin = AuthorizeManager.isAdmin(this.context);

        // Context Administrative options
        DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
      if (dso instanceof Item)
      {
        Item item = (Item) dso;
        if (item.canEdit())
        {
                    context.setHead(T_context_head);
                    context.addItem().addXref(contextPath+"/admin/item?itemID="+item.getID(), T_context_edit_item);
                    if (AuthorizeManager.isAdmin(this.context, dso))
                    {
                        context.addItem().addXref(contextPath+"/admin/export?itemID="+item.getID(), T_context_export_item );
                        context.addItem().addXref(contextPath+ "/csv/handle/"+dso.getHandle(),T_context_export_metadata );
                    }
                }
      }
      else if (dso instanceof Collection)
      {
        Collection collection = (Collection) dso;
       
        // can they admin this collection?
            if (collection.canEditBoolean(true))
            {
              context.setHead(T_context_head);
              context.addItemXref(contextPath+"/admin/collection?collectionID=" + collection.getID(), T_context_edit_collection);             
              context.addItemXref(contextPath+"/admin/mapper?collectionID="+collection.getID(), T_context_item_mapper);
              if (AuthorizeManager.isAdmin(this.context, dso))
                {
                    context.addItem().addXref(contextPath+"/admin/export?collectionID="+collection.getID(), T_context_export_collection );
                    context.addItem().addXref(contextPath+ "/csv/handle/"+dso.getHandle(),T_context_export_metadata );
                }
            }
      }
      else if (dso instanceof Community)
      {
        Community community = (Community) dso;
       
        // can they admin this collection?
            if (community.canEditBoolean())
            {
              context.setHead(T_context_head);
              context.addItemXref(contextPath+"/admin/community?communityID=" + community.getID(), T_context_edit_community);
              if (AuthorizeManager.isAdmin(this.context, dso))
                    context.addItem().addXref(contextPath+"/admin/export?communityID="+community.getID(), T_context_export_community );
                    context.addItem().addXref(contextPath+ "/csv/handle/"+dso.getHandle(),T_context_export_metadata );
            }
           
            // can they add to this community?
            if (AuthorizeManager.authorizeActionBoolean(this.context, community,Constants.ADD))
            {
              context.setHead(T_context_head);
              context.addItemXref(contextPath+"/admin/collection?createNew&communityID=" + community.getID(), T_context_create_collection);
                context.addItemXref(contextPath+"/admin/community?createNew&communityID=" + community.getID(), T_context_create_subcommunity);     
            }
      }
     
      if ("community-list".equals(this.sitemapURI))
      {
            // Only System administrators can create top-level communities
        if (isSystemAdmin)
            {
              context.setHead(T_context_head);
          context.addItemXref(contextPath+"/admin/community?createNew", T_context_create_community);         
            }
      }
       
       
        // System Administrator options!
        if (isSystemAdmin)
        {
          admin.setHead(T_administrative_head);
                 
          List epeople = admin.addList("epeople");
          List registries = admin.addList("registries");
         
          epeople.setHead(T_administrative_access_control);         
          epeople.addItemXref(contextPath+"/admin/epeople", T_administrative_people);         
          epeople.addItemXref(contextPath+"/admin/groups", T_administrative_groups);         
          epeople.addItemXref(contextPath+"/admin/authorize", T_administrative_authorizations);         
         
          registries.setHead(T_administrative_registries);         
          registries.addItemXref(contextPath+"/admin/metadata-registry",T_administrative_metadata);         
          registries.addItemXref(contextPath+"/admin/format-registry",T_administrative_format);         
         
          admin.addItemXref(contextPath+"/admin/item", T_administrative_items);
            admin.addItemXref(contextPath+"/admin/withdrawn", T_administrative_withdrawn);         
          admin.addItemXref(contextPath+"/admin/panel", T_administrative_control_panel);
            admin.addItemXref(contextPath+"/statistics", T_statistics);
View Full Code Here

        contextPath + "/admin/item", Division.METHOD_POST,
        "primary administrative edit-item-status");
    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().addXref(baseURL + "&submit_bitstreams",
        T_option_bitstreams);
    options.addItem().addXref(baseURL + "&submit_metadata",
        T_option_metadata);
    options.addItem().addHighlight("bold").addXref(tabLink, T_option_view);

    // item
   
    Para showfullPara = main.addPara(null, "item-view-toggle item-view-toggle-top");
View Full Code Here

            para.addButton("submit").setValue(T_go);
            query.addPara().addXref(contextPath + "/handle/" + community.getHandle() + "/advanced-search", T_advanced_search_link);

            // Browse by list
            Division browseDiv = search.addDivision("community-browse","secondary browse");
            List browse = browseDiv.addList("community-browse", List.TYPE_SIMPLE,
                    "community-browse");
            browse.setHead(T_head_browse);
            String url = contextPath + "/handle/" + community.getHandle();

            try
            {
                // Get a Map of all the browse tables
                BrowseIndex[] bis = BrowseIndex.getBrowseIndices();
                for (BrowseIndex bix : bis)
                {
                    // Create a Map of the query parameters for this link
                    Map<String, String> queryParams = new HashMap<String, String>();

                    queryParams.put("type", bix.getName());

                    // Add a link to this browse
                    browse.addItemXref(super.generateURL(url + "/browse", queryParams),
                            message("xmlui.ArtifactBrowser.Navigation.browse_" + bix.getName()));
                }
            }
            catch (BrowseException bex)
            {
                browse.addItemXref(url + "/browse?type=title",T_browse_titles);
                browse.addItemXref(url + "/browse?type=author",T_browse_authors);
                browse.addItemXref(url + "/browse?type=dateissued",T_browse_dates);
            }
        }

        // Add main reference:
        {
View Full Code Here

   
   
   
   
    // LIST: options
    List options = main.addList("options",List.TYPE_SIMPLE,"horizontal");
    options.addItem().addHighlight("bold").addXref(baseURL+"&submit_status",T_option_status);
    options.addItem().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);
   
   
   
   
   
    // PARA: Helpfull instructions
    main.addPara(T_para1);
   
   
   

   
    // LIST: Item meta-meta information
    List itemInfo = main.addList("item-info");
   
    itemInfo.addLabel(T_label_id);
    itemInfo.addItem(String.valueOf(item.getID()));
   
    itemInfo.addLabel(T_label_handle);
    itemInfo.addItem(item.getHandle()==null?"None":item.getHandle());
   
    itemInfo.addLabel(T_label_modified);
    itemInfo.addItem(item.getLastModified().toString());
   
    itemInfo.addLabel(T_label_in);
   
    List subList = itemInfo.addList("collections", List.TYPE_SIMPLE);
    Collection[] collections = item.getCollections();
    for(Collection collection : collections) {
      subList.addItem(collection.getMetadata("name"));
    }
   
    itemInfo.addLabel(T_label_page);
    if(item.getHandle()==null){
      itemInfo.addItem(T_na);   
View Full Code Here

TOP

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

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.