Changeset 11939


Ignore:
Timestamp:
2006-06-20T09:44:47+12:00 (18 years ago)
Author:
mdewsnip
Message:

Users now have an option to create a "personal" or "shared" collection when creating a new collection using remote building. Personal collections have the user's username prefixed.

Location:
trunk/gli
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/classes/dictionary.properties

    r11882 r11939  
    784784NewCollectionPrompt.Collection_Name:Collection folder:
    785785#NewCollectionPrompt.Collection_Name_Tooltip:Short collection name, used internally (must be 8 characters or less)
     786NewCollectionPrompt.Collection_Scope_Personal:This is a personal collection
     787NewCollectionPrompt.Collection_Scope_Shared:This is not a personal collection
    786788NewCollectionPrompt.Error:Error in new collection.
    787789NewCollectionPrompt.Instructions:To create a new collection fill out the fields below.
  • trunk/gli/src/org/greenstone/gatherer/gui/NewCollectionDetailsPrompt.java

    r11791 r11939  
    3838import org.greenstone.gatherer.Gatherer;
    3939import org.greenstone.gatherer.collection.BasicCollectionConfiguration;
     40import org.greenstone.gatherer.remote.RemoteGreenstoneServer;
    4041import org.greenstone.gatherer.util.StaticStrings;
    4142import org.greenstone.gatherer.util.Utility;
     
    7273    private JComboBox base_collection;
    7374    private JDialog self;
     75    private JRadioButton personal_collection_button = null;
    7476    private JTextArea description;
    7577    private JTextField title;
     
    148150    Dictionary.setTooltip(base_collection, "NewCollectionPrompt.Base_Collection_Tooltip");
    149151
     152    JPanel collection_scope_pane = new JPanel();
     153    personal_collection_button = new JRadioButton();
     154    personal_collection_button.setBackground(Configuration.getColor("coloring.collection_tree_background", false));
     155    personal_collection_button.setOpaque(false);
     156    Dictionary.setText(personal_collection_button, "NewCollectionPrompt.Collection_Scope_Personal");
     157    JRadioButton shared_collection_button = new JRadioButton();
     158    shared_collection_button.setBackground(Configuration.getColor("coloring.collection_tree_background", false));
     159    shared_collection_button.setOpaque(false);
     160    Dictionary.setText(shared_collection_button, "NewCollectionPrompt.Collection_Scope_Shared");
     161    ButtonGroup collection_scope_group = new ButtonGroup();
     162    collection_scope_group.add(personal_collection_button);
     163    collection_scope_group.add(shared_collection_button);
     164    personal_collection_button.setSelected(true);
     165
    150166    JPanel button_pane = new JPanel();
    151167    create_button = new GLIButton();
     
    177193    base_collection_pane.add(base_collection, BorderLayout.CENTER);
    178194
     195    collection_scope_pane.setBorder(BorderFactory.createEmptyBorder(5,0,0,0));
     196    collection_scope_pane.setLayout(new GridLayout(1,2));
     197    collection_scope_pane.add(personal_collection_button);
     198    collection_scope_pane.add(shared_collection_button);
     199
    179200    center_pane.setBorder(BorderFactory.createEmptyBorder(5,0,5,0));
    180201    center_pane.setLayout(new BorderLayout());
     
    182203
    183204    bottom_pane.setLayout(new BorderLayout());
    184     bottom_pane.add(base_collection_pane, BorderLayout.CENTER);
    185     bottom_pane.add(button_pane, BorderLayout.SOUTH);
     205    bottom_pane.add(base_collection_pane, BorderLayout.NORTH);
     206    if (Gatherer.isGsdlRemote) {
     207        bottom_pane.add(collection_scope_pane, BorderLayout.CENTER);
     208        bottom_pane.add(button_pane, BorderLayout.SOUTH);
     209    }
     210    else {
     211        bottom_pane.add(button_pane, BorderLayout.CENTER);
     212    }
    186213
    187214    button_pane.setBorder(BorderFactory.createEmptyBorder(5,0,0,0));
     
    234261    }
    235262
     263    // Remote collections that aren't shared have the user's username prefixed to the collection name
     264    if (Gatherer.isGsdlRemote && personal_collection_button.isSelected()) {
     265        name_buffer = new StringBuffer(RemoteGreenstoneServer.getUsername() + "-" + name_buffer.toString());
     266    }
     267
    236268    // We need to ensure the filename is unique
    237269    int counter = 0;
     
    249281        new_name_buffer.append(suffix);
    250282        }
    251        
    252     }
     283    }
     284
    253285    // All done
    254286    return new_name_buffer.toString();
Note: See TracChangeset for help on using the changeset viewer.