Commit 61d7d76e authored by Sonia Zorba's avatar Sonia Zorba
Browse files

TAP 1.1 XML config changes, UserEditor changes and various improvements

parent e24e5873
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -164,6 +164,7 @@ Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
                <updatable>false</updatable>
                <updatable>false</updatable>
                <nullable>false</nullable>
                <nullable>false</nullable>
                <key>indexed</key>
                <key>indexed</key>
                <default-value>0</default-value>
                <description>an indexed column; 1 means true, 0 means false</description>
                <description>an indexed column; 1 means true, 0 means false</description>
            </property>
            </property>
            <property>
            <property>
+31 −1
Original line number Original line Diff line number Diff line
@@ -35,15 +35,45 @@ Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
        <add>
        <add>
            <property>
            <property>
                <name>arraysize</name>
                <name>arraysize</name>
                <type>java.lang.Integer</type>
                <type>java.lang.String</type>
                <updatable>false</updatable> 
                <updatable>false</updatable> 
                <key>arraysize</key>  
                <key>arraysize</key>  
            </property>
            </property>
            <property>
                <name>xtype</name>
                <type>java.lang.String</type>
                <updatable>true</updatable>
            </property>
            <property>
            <property>
                <name>column_index</name>
                <name>column_index</name>
                <type>java.lang.Integer</type>
                <type>java.lang.Integer</type>
                <updatable>true</updatable>   
                <updatable>true</updatable>   
            </property>
            </property>
            <property>
                <name>indexed</name>
                <type>java.lang.Boolean</type>
                <updatable>false</updatable>
                <nullable>false</nullable>
                <default-value>false</default-value>
                <key>indexed</key>
                <description>an indexed column</description>
            </property>
            <property>
                <name>principal</name>
                <type>java.lang.Boolean</type>
                <updatable>true</updatable>
                <nullable>false</nullable>
                <default-value>false</default-value>
                <description>a principal column</description>
            </property>
            <property>
                <name>std</name>
                <type>java.lang.Boolean</type>
                <updatable>true</updatable>
                <nullable>false</nullable>
                <default-value>false</default-value>
                <description>a standard column</description>  
            </property>
        </add>
        </add>
    </table>
    </table>
</tap_schema>
</tap_schema>
+15 −1
Original line number Original line Diff line number Diff line
@@ -148,6 +148,20 @@ public class ConfigurationManager {
        return false;
        return false;
    }
    }


    public synchronized boolean editUser(String username, String role, String password) {

        for (UserConfiguration u : usersConfig.getUsers()) {
            if (u.getUsername().equals(username)) {
                u.setRole(role);
                u.setPassword(password);
                updateUsersConfigurationFile();
                return true;
            }
        }

        return false;
    }

    /**
    /**
     * Add a new UCD to the list, but only if the word has not already been
     * Add a new UCD to the list, but only if the word has not already been
     * entered.
     * entered.
+4 −0
Original line number Original line Diff line number Diff line
@@ -65,6 +65,10 @@ public class CredentialsEditing implements Serializable {
    private boolean separateCredentials;
    private boolean separateCredentials;
    private int currentEditingRow;
    private int currentEditingRow;


    public void test() {
        String x = "";
    }
    
    @PostConstruct
    @PostConstruct
    public void init() {
    public void init() {
        sourceCredentials = new Credentials();
        sourceCredentials = new Credentials();
+0 −32
Original line number Original line Diff line number Diff line
@@ -57,8 +57,6 @@ public class TapSchemaEditingBean implements Serializable {
    private static final long serialVersionUID = -6251004452688984277L;
    private static final long serialVersionUID = -6251004452688984277L;
    private static final Logger LOG = LoggerFactory.getLogger(TapSchemaEditingBean.class);
    private static final Logger LOG = LoggerFactory.getLogger(TapSchemaEditingBean.class);


    private static final String COLUMNS_COMPONENT_ID = "main:columns-list";

    @Inject
    @Inject
    SchemaSelectionBean schemaSelection;
    SchemaSelectionBean schemaSelection;


@@ -352,53 +350,23 @@ public class TapSchemaEditingBean implements Serializable {
    public void removeColumn(String name) {
    public void removeColumn(String name) {
        selectedTable.removeChild(name);
        selectedTable.removeChild(name);


        Integer selectedColumnIndex = null;
        if (selectedColumn != null) {
        if (selectedColumn != null) {
            int index = 0;
            for (Column column : selectedTable.getAddedOrRemovedChildren()) {
            for (Column column : selectedTable.getAddedOrRemovedChildren()) {
                if (column.getName().equals(selectedColumn.getName())) {
                if (column.getName().equals(selectedColumn.getName())) {
                    selectedColumnIndex = index;
                    break;
                    break;
                }
                }
                index++;
            }
            }
            }

        CustomPartialResponseWriter writer = CustomPartialResponseWriter.getCurrentInstance();

        final String updateResult = selectedColumnIndex == null ? "{}" : "{\"selectedColumn\":" + selectedColumnIndex + "}";

        writer.encodeComponent(COLUMNS_COMPONENT_ID);
        writer.addCustomJSUpdate(COLUMNS_COMPONENT_ID, new JSUpdateHandler() {

            @Override
            public String getUpdate() {
                return updateResult;
        }
        }
        });
    }
    }


    public void undoRemoveColumn() throws SQLException {
    public void undoRemoveColumn() throws SQLException {
        this.undoRemove(selectedColumn);
        this.undoRemove(selectedColumn);


        int i = 0;
        for (Column column : selectedTable.getAddedOrRemovedChildren()) {
        for (Column column : selectedTable.getAddedOrRemovedChildren()) {
            if (column.getName().equals(selectedColumn.getName())) {
            if (column.getName().equals(selectedColumn.getName())) {
                break;
                break;
            }
            }
            i++;
        }

        final int columnIndex = i;

        CustomPartialResponseWriter writer = CustomPartialResponseWriter.getCurrentInstance();
        writer.addCustomJSUpdate(COLUMNS_COMPONENT_ID, new JSUpdateHandler() {

            @Override
            public String getUpdate() {
                return columnIndex + "";
        }
        }
        });
    }
    }


    public void reload() {
    public void reload() {
Loading