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

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


        }

    // DIVISION: metadata-import
    Division div = body.addInteractiveDivision("metadata-import",contextPath + "/admin/metadataimport", Division.METHOD_MULTIPART,"primary administrative");
    div.setHead(T_head1);
                Para para = div.addPara();
                para.addContent(T_success);
                para.addContent(" " + changes.size() + " ");
                para.addContent(T_changes);

                if(changes.size() > 0) {
                    Table mdchanges = div.addTable("metadata-changes", changes.size(), 2);


                    // Display the changes
                    int changeCounter = 0;
                    for (BulkEditChange change : changes)
                    {
                        // Get the changes
                        ArrayList<DCValue> adds = change.getAdds();
                        ArrayList<DCValue> removes = change.getRemoves();
                        ArrayList<Collection> newCollections = change.getNewMappedCollections();
                        ArrayList<Collection> oldCollections = change.getOldMappedCollections();

                        if ((adds.size() > 0) || (removes.size() > 0) ||
                            (newCollections.size() > 0) || (oldCollections.size() > 0) ||
                            (change.getNewOwningCollection() != null) || (change.getOldOwningCollection() != null))
                        {
                            Row headerrow = mdchanges.addRow(Row.ROLE_HEADER);

                            // Show the item
                            if (!change.isNewItem())
                            {
                                Item i = change.getItem();
                                Cell cell = headerrow.addCell();
                                cell.addContent(T_changes_committed);
                                cell.addContent(" " + i.getID() + " (" + i.getHandle() + ")");

                            }
                            else
                            {
                              headerrow.addCellContent(T_new_item);
                            }
                            headerrow.addCell();
                            changeCounter++;
                        }

                        // Show new owning collection
                        if (change.getNewOwningCollection() != null)
                        {
                            Collection c = change.getNewOwningCollection();
                            if (c != null)
                            {
                                String cHandle = c.getHandle();
                                String cName = c.getName();
                                Row colrow = mdchanges.addRow("addition",Row.ROLE_DATA,"metadata-addition");
                                colrow.addCellContent(T_collection_newowner);
                                colrow.addCellContent(cHandle + " (" + cName + ")");
                            }
                        }

                        // Show old owning collection
                        if (change.getOldOwningCollection() != null)
                        {
                            Collection c = change.getOldOwningCollection();
                            if (c != null)
                            {
                                String cHandle = c.getHandle();
                                String cName = c.getName();
                                Row colrow = mdchanges.addRow("deletion",Row.ROLE_DATA,"metadata-deletion");
                                colrow.addCellContent(T_collection_oldowner);
                                colrow.addCellContent(cHandle + " (" + cName + ")");
                            }
                        }

                        // Show new mapped collections
                        for (Collection c : newCollections)
                        {
                            String cHandle = c.getHandle();
                            String cName = c.getName();
                            Row colrow = mdchanges.addRow("addition",Row.ROLE_DATA,"metadata-addition");
                            colrow.addCellContent(T_collection_mapped);
                            colrow.addCellContent(cHandle + " (" + cName + ")");
                        }

                        // Show old mapped collections
                        for (Collection c : oldCollections)
                        {
                            String cHandle = c.getHandle();
                            String cName = c.getName();
                            Row colrow = mdchanges.addRow("deletion",Row.ROLE_DATA,"metadata-deletion");
                            colrow.addCellContent(T_collection_unmapped);
                            colrow.addCellContent(cHandle + " (" + cName + ")");
                        }

                        // Show additions
                        for (DCValue dcv : adds)
                        {
                            Row mdrow = mdchanges.addRow("addition",Row.ROLE_DATA,"metadata-addition");
                            String md = dcv.schema + "." + dcv.element;
                            if (dcv.qualifier != null)
                            {
                                md += "." + dcv.qualifier;
                            }
                            if (dcv.language != null)
                            {
                                md += "[" + dcv.language + "]";
                            }

                            Cell cell = mdrow.addCell();
                            cell.addContent(T_item_addition);
                            cell.addContent(" (" + md + ")");
                            mdrow.addCellContent(dcv.value);
                        }

                        // Show removals
                        for (DCValue dcv : removes)
                        {
                            Row mdrow = mdchanges.addRow("deletion",Row.ROLE_DATA,"metadata-deletion");
                            String md = dcv.schema + "." + dcv.element;
                            if (dcv.qualifier != null)
                            {
                                md += "." + dcv.qualifier;
                            }
                            if (dcv.language != null)
                            {
                                md += "[" + dcv.language + "]";
                            }

                            Cell cell = mdrow.addCell();
                            cell.addContent(T_item_deletion);
                            cell.addContent(" (" + md + ")");
                            mdrow.addCellContent(dcv.value);
                        }
                    }
                }
                else
                {
                    Para nochanges = div.addPara();
                    nochanges.addContent(T_no_changes);
                }
                Para actions = div.addPara();
                Button cancel = actions.addButton("submit_return");
                cancel.setValue(T_submit_return);

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


    // DIVISION: metadata-import
    Division div = body.addInteractiveDivision("metadata-import",contextPath + "/admin/metadataimport", Division.METHOD_MULTIPART,"primary administrative");
    div.setHead(T_head1);

                Para file = div.addPara();
                file.addFile("file");

                Para actions = div.addPara();
                Button button = actions.addButton("submit_upload");
                button.setValue(T_submit_upload);

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

    }

   
   
    // 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

        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);
        }
        else
        {
            String link = contextPath + "/handle/" + item.getHandle()
                    + "?show=full";
            showfullPara.addXref(link).addContent(T_show_full);
        }
    }
View Full Code Here

    suited.setHead("Fields suited towards being used inline");
   
    suited.addPara("Below are a list of embedded fields that are normally considered usefully in an inline context.");
   
    // Text field
    Para p = suited.addPara();
    p.addContent("This is a plain 'Text' field, ");
        Text text = p.addText("text");
        text.setLabel("Text");
        if (help)
          text.setHelp("This is helpfull text.");
        if (error)
          text.addError("This field is in error.");
        text.setValue("Current raw value");
        p.addContent(", embedded in a paragraph.");
       
        // Single Checkbox field
        p = suited.addPara();
    p.addContent("This is a singe 'CheckBox' field, ");
        CheckBox checkBox = p.addCheckBox("yes-or-no");
        if (help)
          checkBox.setHelp("Select either yes or no.");
        if (error)
          checkBox.addError("You are incorrect, try again.");
        checkBox.setLabel("Yes or no");
        checkBox.addOption("yes");
        p.addContent(", embedded in a paragraph.");
       
        // File
        p = suited.addPara();
    p.addContent("This is a 'File' field, ");
        File file = p.addFile("file");
        file.setLabel("File");
        if (help)
          file.setHelp("Upload a file.");
        if (error)
          file.addError("This field is in error.");
        p.addContent(", embedded in a paragraph.");
       
        // Select (single)
        p = suited.addPara();
    p.addContent("This is single 'Select' (aka dropdown) field, ");
        Select select = p.addSelect("select");
        select.setLabel("Select (single)");
        if (help)
          select.setHelp("Select one of the options");
        if (error)
          select.addError("This field is in error.");
        select.addOption("one","uno");
        select.addOption("two","dos");
        select.addOption("three","tres");
        select.addOption("four","cuatro");
        select.addOption("five","cinco");
        select.setOptionSelected("one");
        p.addContent(", embedded in a paragraph.");
       
        // Button
        p = suited.addPara();
    p.addContent("This is a 'Button' field, ");
        Button button = p.addButton("button");
        button.setLabel("Button");
        button.setValue("When you touch me I do things, lots of things");
        if (help)
          button.setHelp("Submit buttons allow the user to submit the form.");
        if (error)
          button.addError("This button is in error.");
        p.addContent(", embedded in a paragraph.");
       
       
       
        Division unsuited = body.addDivision("unsuited");
        unsuited.setHead("Fields typicaly unsuited towards being used inline");
   
        unsuited.addPara("Below are a list of embedded fields that are normally considered useless in an inline context. This is because there widgets normally cross multiple lines making them hard to render inline. However these are all legal, but perhaps not advisable, and in some circumstances may be needed.");
   
       
        // Text Area Field
        p = unsuited.addPara();
    p.addContent("This is a 'Text Area' field, ");
        TextArea textArea = p.addTextArea("textarea");
        textArea.setLabel("Text Area");
        if (help)
          textArea.setHelp("This is helpfull text.");
        if (error)
          textArea.addError("This field is in error.");
        textArea.setValue("This is the raw value");
        p.addContent(", embedded in a paragraph.");
       
        // Multi-option Checkbox field
        p = unsuited.addPara();
    p.addContent("This is a multi-option 'CheckBox' field, ");
        checkBox = p.addCheckBox("fruit");
        if (help)
          checkBox.setHelp("Select all the fruits that you like to eat");
        if (error)
          checkBox.addError("You are incorrect you actualy do like Tootse Rolls.");
        checkBox.setLabel("fruits");
        checkBox.addOption("apple","Apples");
        checkBox.addOption(true,"orange","Oranges");
        checkBox.addOption("pear","Pears");
        checkBox.addOption("tootsie","Tootsie Roll");
        checkBox.addOption(true,"cherry","Cherry");
        p.addContent(", embedded in a paragraph.");
       
        // multi-option Radio field
        p = unsuited.addPara();
    p.addContent("This is a multi-option 'Radio' field, ");
        Radio radio = p.addRadio("sex");
        radio.setLabel("Football colors");        
        if (help)
          radio.setHelp("Select the colors of the best (college) football team.");
        if (error)
          radio.addError("Error, Maroon & White is the only acceptable answer.");
        radio.addOption("ut","Burnt Orange & White");
        radio.addOption(true,"tamu","Maroon & White");
        radio.addOption("ttu","Tech Red & Black");
        radio.addOption("baylor","Green & Gold");
        radio.addOption("rice","Blue & Gray");
        radio.addOption("uh","Scarlet Red & Albino White");
        p.addContent(", embedded in a paragraph.");

        // Select (multiple)
        p = unsuited.addPara();
    p.addContent("This is multiple 'Select' field, ");
        select = p.addSelect("multi-select");
        select.setLabel("Select (multiple)");
        select.setMultiple();
        select.setSize(4);
        if (help)
          select.setHelp("Select one or more options");
        if (error)
          select.addError("This field is in error.");
        select.addOption("one","uno");
        select.addOption("two","dos");
        select.addOption("three","tres");
        select.addOption("four","cuatro");
        select.addOption("five","cinco");
        select.setOptionSelected("one");
        select.setOptionSelected("three");
        select.setOptionSelected("five");
        p.addContent(", embedded in a paragraph.");
       
        // Composite
        p = unsuited.addPara();
    p.addContent("This is a 'Composite' field of two text fields, ");
        Composite composite = p.addComposite("composite-2text");
        composite.setLabel("Composite (two text fields)");
        if (help)
          composite.setHelp("I am the help for the entire composite");
        if (error)
          composite.addError("Just the composite is in error");
        text = composite.addText("partA");
        text.setLabel("Part A");
        text.setValue("Value for part A");
        if (help)
          text.setHelp("Part A");
        text = composite.addText("partB");
        text.setLabel("Part B");
        text.setValue("Value for part B");
        if (help)
          text.setHelp("Part B");
        p.addContent(", embedded in a paragraph.");
       
       
       
    }
View Full Code Here

            // Preform the actual search
            performSearch();
            DSpaceObject searchScope = getScope();
           
            Para para = search.addPara("result-query","result-query");

            String query = getQuery();
            int hitCount = queryResults.getHitCount();
            para.addContent(T_result_query.parameterize(query,hitCount));
           
            Division results = search.addDivision("search-results","primary");
           
            if (searchScope instanceof Community)
            {
View Full Code Here

      Row row = table.addRow();
      row.addCell().addContent(bitstream.getName());
      row.addCell().addContent(bitstream.getDescription());
      row.addCell().addContent(format);
    }
    Para buttons = deleted.addPara();
    buttons.addButton("submit_confirm").setValue(T_submit_delete);
    buttons.addButton("submit_cancel").setValue(T_submit_cancel);

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

        Division paraT = test.addDivision("para");
        paraT.setHead("1) Paragraph Tests");
       
        paraT.addPara("This is a simple paragraph");
       
        Para para = paraT.addPara();
        para.addContent("This is ");
        para.addHighlight("bold").addContent("not");
        para.addContent(" a ");
        para.addHighlight("bold").addHighlight("italic").addContent("simple");
        para.addContent(" paragraph.");
      
        /////////////////////////////////////
        // List test
        Division listT = test.addDivision("list");
        listT.setHead("2) List Tests");
View Full Code Here

        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");

        if (showFullItem)
        {
            link = baseURL + "&view_item";
            showfullPara.addXref(link).addContent(T_show_simple);
        }
        else
        {
            link = baseURL + "&view_item&show=full";
            showfullPara.addXref(link).addContent(T_show_full);
        }

    ReferenceSet referenceSet;
    referenceSet = main.addReferenceSet("collection-viewer",
        showFullItem?ReferenceSet.TYPE_DETAIL_VIEW: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 = main.addPara(null, "item-view-toggle item-view-toggle-bottom");

    if (showFullItem)
        {
            showfullPara.addXref(link).addContent(T_show_simple);
        }
        else
        {
            showfullPara.addXref(link).addContent(T_show_full);
        }
  }
View Full Code Here

    String loginURL = contextPath+"/login";
    String feedbackURL = contextPath+"/feedback";
   
        Division main = body.addDivision("not-authorized","primary administrative");
    main.setHead(T_head);
    Para para1 = main.addPara();
    para1.addContent(T_para1a);
    para1.addXref(feedbackURL,T_para1b);
    para1.addContent(T_para1c);

    main.addPara().addXref(loginURL,T_para2);
   
  }
View Full Code Here

TOP

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

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.