directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r496902 [3/3] - in /directory/sandbox/triplesec-jacc2: ./ admin-api2/src/main/java/org/safehaus/triplesec/admin/ admin-api2/src/main/java/org/safehaus/triplesec/admin/persistence/ changelog/src/main/java/org/safehaus/triplesec/changelog/bet...
Date Wed, 17 Jan 2007 00:29:27 GMT
Modified: directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/RolePanel.java
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/RolePanel.java?view=diff&rev=496902&r1=496901&r2=496902
==============================================================================
--- directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/RolePanel.java
(original)
+++ directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/RolePanel.java
Tue Jan 16 16:29:24 2007
@@ -21,6 +21,7 @@
 
 
 import javax.swing.JPanel;
+
 import java.awt.BorderLayout;
 
 import javax.swing.ImageIcon;
@@ -39,10 +40,12 @@
 import javax.swing.tree.DefaultMutableTreeNode;
 import javax.swing.tree.DefaultTreeModel;
 import javax.swing.tree.TreePath;
+import javax.naming.NamingException;
 
 import org.safehaus.triplesec.admin.DataAccessException;
 import org.safehaus.triplesec.admin.Role;
-import org.safehaus.triplesec.admin.RoleModifier;
+import org.safehaus.triplesec.admin.Application;
+import org.safehaus.triplesec.admin.persistence.PCException;
 
 
 public class RolePanel extends JPanel
@@ -87,8 +90,6 @@
 
     /**
      * This method initializes this
-     * 
-     * @return void
      */
     private void initialize()
     {
@@ -102,15 +103,15 @@
         this.setLayout( new GridBagLayout() );
         this.setSize( 550, 417 );
         this.setBorder( javax.swing.BorderFactory.createTitledBorder( null, "Existing Role",
-            javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION,
-            null, null ) );
+                javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION,
+                null, null ) );
         this.add( getMainPanel(), gridBagConstraints );
     }
 
 
     /**
      * This method initializes jPanel
-     * 
+     *
      * @return javax.swing.JPanel
      */
     private JPanel getMainPanel()
@@ -128,7 +129,7 @@
 
     /**
      * This method initializes jPanel
-     * 
+     *
      * @return javax.swing.JPanel
      */
     private JPanel getButtonPanel()
@@ -137,7 +138,7 @@
         {
             buttonPanel = new JPanel();
             buttonPanel.setBorder( javax.swing.BorderFactory.createEmptyBorder( 0, 0, 0,
0 ) );
-            buttonPanel.add(getDeleteButton(), null);
+            buttonPanel.add( getDeleteButton(), null );
             buttonPanel.add( getRevertButton(), null );
             buttonPanel.add( getSaveButton(), null );
         }
@@ -147,7 +148,7 @@
 
     /**
      * This method initializes jButton
-     * 
+     *
      * @return javax.swing.JButton
      */
     private JButton getRevertButton()
@@ -167,8 +168,8 @@
                     catch ( DataAccessException e1 )
                     {
                         JOptionPane.showMessageDialog( RolePanel.this,
-                            "Failed to access application permissions for role: " + role.getName()
+ "\n\n"
-                                + e1.getMessage(), "Data access error", JOptionPane.ERROR_MESSAGE
);
+                                "Failed to access application permissions for role: " + role.getRoleName()
+ "\n\n"
+                                        + e1.getMessage(), "Data access error", JOptionPane.ERROR_MESSAGE
);
                     }
                 }
             } );
@@ -179,7 +180,7 @@
 
     /**
      * This method initializes jButton
-     * 
+     *
      * @return javax.swing.JButton
      */
     private JButton getSaveButton()
@@ -202,7 +203,7 @@
 
     /**
      * This method initializes jPanel
-     * 
+     *
      * @return javax.swing.JPanel
      */
     private JPanel getAboveButtonPanel()
@@ -221,7 +222,7 @@
 
     /**
      * This method initializes jPanel
-     * 
+     *
      * @return javax.swing.JPanel
      */
     private JPanel getNorthPanel()
@@ -248,7 +249,7 @@
 
     /**
      * This method initializes jTabbedPane
-     * 
+     *
      * @return javax.swing.JTabbedPane
      */
     private JTabbedPane getCenterTabbedPane()
@@ -258,7 +259,7 @@
             centerTabbedPane = new JTabbedPane();
             centerTabbedPane.addTab( "General", null, getGeneralPanelTab(), null );
             centerTabbedPane.addTab( "Grants", null, getRoleGrantsPanel(), null );
-            centerTabbedPane.addTab( "Dependent Profiles",  null, getRoleDependentsPanel(),
null );
+            centerTabbedPane.addTab( "Dependent Profiles", null, getRoleDependentsPanel(),
null );
         }
         return centerTabbedPane;
     }
@@ -282,11 +283,11 @@
         }
         return roleGrantsPanel;
     }
-    
-    
+
+
     /**
      * This method initializes jPanel
-     * 
+     *
      * @return javax.swing.JPanel
      */
     private JPanel getSouthPanel()
@@ -296,8 +297,8 @@
             southPanel = new JPanel();
             southPanel.setLayout( new BorderLayout() );
             southPanel.setBorder( javax.swing.BorderFactory.createTitledBorder( null, "Description",
-                javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
-                javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null ) );
+                    javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
+                    javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null ) );
             southPanel.add( getDescriptionTextArea(), java.awt.BorderLayout.NORTH );
         }
         return southPanel;
@@ -306,7 +307,7 @@
 
     /**
      * This method initializes jPanel
-     * 
+     *
      * @return javax.swing.JPanel
      */
     private JPanel getGeneralPanelTab()
@@ -321,7 +322,7 @@
 
     /**
      * This method initializes iconLabel
-     * 
+     *
      * @return javax.swing.JLabel
      */
     private JLabel getIconLabel()
@@ -330,7 +331,7 @@
         {
             iconLabel = new JLabel();
             iconLabel.setIcon( new ImageIcon( getClass().getResource(
-                "/org/safehaus/triplesec/admin/swing/role_48x48.png" ) ) );
+                    "/org/safehaus/triplesec/admin/swing/role_48x48.png" ) ) );
             iconLabel.setPreferredSize( new java.awt.Dimension( 48, 48 ) );
             iconLabel.setText( "" );
             iconLabel.setVerticalTextPosition( javax.swing.SwingConstants.BOTTOM );
@@ -343,7 +344,7 @@
 
     /**
      * This method initializes jPanel
-     * 
+     *
      * @return javax.swing.JPanel
      */
     private JPanel getJPanel()
@@ -407,7 +408,7 @@
 
     /**
      * This method initializes jTextArea
-     * 
+     *
      * @return javax.swing.JTextArea
      */
     private JTextArea getDescriptionTextArea()
@@ -423,7 +424,7 @@
 
     /**
      * This method initializes jPanel4
-     * 
+     *
      * @return javax.swing.JPanel
      */
     private JPanel getJPanel4()
@@ -444,9 +445,9 @@
         {
             return;
         }
-        generalPanel.setFields( role );
-        applicationNameTextField.setText( role.getApplicationName() );
-        roleNameTextField.setText( role.getName() );
+//        generalPanel.setFields( role );
+//        applicationNameTextField.setText( role.getApplicationName() );
+        roleNameTextField.setText( role.getRoleName() );
         descriptionTextArea.setText( role.getDescription() );
         roleGrantsPanel.populateLists( ( DefaultMutableTreeNode ) node.getParent().getParent(),
role.getGrants() );
     }
@@ -474,7 +475,7 @@
         catch ( DataAccessException e )
         {
             JOptionPane.showMessageDialog( RolePanel.this, "Failed to access application
permissions for role: "
-                + role.getName() + "\n\n" + e.getMessage(), "Data access error", JOptionPane.ERROR_MESSAGE
);
+                    + role.getRoleName() + "\n\n" + e.getMessage(), "Data access error",
JOptionPane.ERROR_MESSAGE );
         }
         roleDependentsPanel.setSelectedNode( node );
     }
@@ -504,45 +505,30 @@
         }
 
         // change the description and add remove values from list views then see if anything
changed
-        RoleModifier modifier = role.modifier().setDescription( descriptionTextArea.getText()
);
-        for ( Enumeration ii = roleGrantsPanel.getAvailablePermssionsModel().elements();
ii.hasMoreElements(); /**/)
+        Application application = ( Application ) role.getStateManager().getParent().getPc();
+        role.setRoleName( roleNameTextField.getText() );
+        role.setDescription( descriptionTextArea.getText() );
+        for ( Enumeration ii = roleGrantsPanel.getAvailablePermssionsModel().elements();
ii.hasMoreElements(); /**/ )
         {
-            modifier.removeGrant( ( String ) ii.nextElement() );
+            role.removeGrant( application.getPermission( ( String ) ii.nextElement() ) );
         }
-        for ( Enumeration ii = roleGrantsPanel.getRoleGrantsModel().elements(); ii.hasMoreElements();
/**/)
+        for ( Enumeration ii = roleGrantsPanel.getRoleGrantsModel().elements(); ii.hasMoreElements();
/**/ )
         {
-            modifier.addGrant( ( String ) ii.nextElement() );
+            role.addGrant( application.getPermission( ( String ) ii.nextElement() ) );
         }
 
-        if ( modifier.isUpdateNeeded() )
+        try
         {
-            try
-            {
-                role = modifier.modify();
-            }
-            catch ( DataAccessException e )
-            {
-                JOptionPane.showMessageDialog( this, UiUtils.wrap( "Failed to modify role:\n"
+ e.getMessage(), 79 ),
-                    "Role modification failure!", JOptionPane.ERROR_MESSAGE );
-                return;
-            }
-            node.setUserObject( role );
+            role.getStateManager().commit();
         }
-
-        if ( !role.getName().equals( roleNameTextField.getText() ) )
+        catch ( NamingException e )
         {
-            try
-            {
-                role = role.modifier().rename( roleNameTextField.getText() );
-                ( ( DefaultTreeModel ) tree.getModel() ).valueForPathChanged( new TreePath(
node.getPath() ), role );
-            }
-            catch ( DataAccessException e )
-            {
-                JOptionPane.showMessageDialog( this, UiUtils.wrap( "Failed to rename role:\n"
+ e.getMessage(), 79 ),
-                    "Role rename failure!", JOptionPane.ERROR_MESSAGE );
-                return;
-            }
+            JOptionPane.showMessageDialog( this, UiUtils.wrap( "Failed to modify role:\n"
+ e.getMessage(), 79 ),
+                    "Role modification failure!", JOptionPane.ERROR_MESSAGE );
+            return;
         }
+        node.setUserObject( role );
+
 
         node.setUserObject( role );
         try
@@ -552,15 +538,15 @@
         catch ( DataAccessException e )
         {
             JOptionPane.showMessageDialog( RolePanel.this, "Failed to access application
permissions for role: "
-                + role.getName() + "\n\n" + e.getMessage(), "Data access error", JOptionPane.ERROR_MESSAGE
);
+                    + role.getRoleName() + "\n\n" + e.getMessage(), "Data access error",
JOptionPane.ERROR_MESSAGE );
         }
     }
 
 
     /**
-     * This method initializes jTextField	
-     * 	
-     * @return javax.swing.JTextField	
+     * This method initializes jTextField
+     *
+     * @return javax.swing.JTextField
      */
     private JTextField getStatusTextField()
     {
@@ -574,9 +560,9 @@
 
 
     /**
-     * This method initializes jTextField1	
-     * 	
-     * @return javax.swing.JTextField	
+     * This method initializes jTextField1
+     *
+     * @return javax.swing.JTextField
      */
     private JTextField getApplicationNameTextField()
     {
@@ -590,9 +576,9 @@
 
 
     /**
-     * This method initializes jTextField2	
-     * 	
-     * @return javax.swing.JTextField	
+     * This method initializes jTextField2
+     *
+     * @return javax.swing.JTextField
      */
     private JTextField getRoleNameTextField()
     {
@@ -605,34 +591,34 @@
 
 
     /**
-     * This method initializes jButton	
-     * 	
-     * @return javax.swing.JButton	
+     * This method initializes jButton
+     *
+     * @return javax.swing.JButton
      */
     private JButton getDeleteButton()
     {
         if ( deleteButton == null )
         {
             deleteButton = new JButton();
-            deleteButton.setText("Delete");
+            deleteButton.setText( "Delete" );
             deleteButton.addActionListener( new java.awt.event.ActionListener()
             {
                 public void actionPerformed( java.awt.event.ActionEvent e )
                 {
                     try
                     {
-                        role.modifier().delete();
+                        role.getStateManager().getEntityManager().remove( role );
                         DefaultMutableTreeNode parentNode = ( DefaultMutableTreeNode ) node.getParent();
                         DefaultTreeModel treeModel = ( DefaultTreeModel ) tree.getModel();
                         treeModel.removeNodeFromParent( node );
                         TreePath path = new TreePath( parentNode.getPath() );
-                        tree.setSelectionPaths( new TreePath[] { path } );
+                        tree.setSelectionPaths( new TreePath[] {path} );
                     }
-                    catch ( DataAccessException e1 )
+                    catch ( PCException e1 )
                     {
-                        JOptionPane.showMessageDialog( RolePanel.this, 
-                            "Failed to delete role: " + e1.getMessage(), "Delete Failed",

-                            JOptionPane.ERROR_MESSAGE );
+                        JOptionPane.showMessageDialog( RolePanel.this,
+                                "Failed to delete role: " + e1.getMessage(), "Delete Failed",
+                                JOptionPane.ERROR_MESSAGE );
                     }
                 }
             } );

Modified: directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/SecretDialog.java
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/SecretDialog.java?view=diff&rev=496902&r1=496901&r2=496902
==============================================================================
--- directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/SecretDialog.java
(original)
+++ directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/SecretDialog.java
Tue Jan 16 16:29:24 2007
@@ -69,7 +69,6 @@
     /**
      * This method initializes this
      * 
-     * @return void
      */
     private void initialize()
     {

Modified: directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/SettingsEditor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/SettingsEditor.java?view=diff&rev=496902&r1=496901&r2=496902
==============================================================================
--- directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/SettingsEditor.java
(original)
+++ directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/SettingsEditor.java
Tue Jan 16 16:29:24 2007
@@ -217,7 +217,6 @@
     /**
      * This method initializes this
      * 
-     * @return void
      */
     private void initialize()
     {

Modified: directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/UserDependentsPanel.java
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/UserDependentsPanel.java?view=diff&rev=496902&r1=496901&r2=496902
==============================================================================
--- directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/UserDependentsPanel.java
(original)
+++ directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/UserDependentsPanel.java
Tue Jan 16 16:29:24 2007
@@ -47,6 +47,7 @@
 import org.safehaus.triplesec.admin.GroupModifier;
 import org.safehaus.triplesec.admin.Profile;
 import org.safehaus.triplesec.admin.User;
+import org.safehaus.triplesec.admin.Application;
 
 
 public class UserDependentsPanel extends JPanel
@@ -61,7 +62,7 @@
     private User user;
     private DependencyModel dependencyModel = null;
     private JTree tree;
-    
+
 
     /**
      * This is the default constructor
@@ -78,7 +79,7 @@
         this.tree = tree;
         this.user = ( User ) node.getUserObject();
         this.dependents.clear();
-        
+
         if ( node == null || node.getParent() == null || node.getParent().getParent() ==
null )
         {
             return;
@@ -103,11 +104,11 @@
                 applicationsNode = child;
             }
         }
-        
+
         // -------------------------------------------------------------------
         // Find the group dependents
         // -------------------------------------------------------------------
-        
+
         for ( Enumeration ii = groupsNode.children(); ii.hasMoreElements(); /**/ )
         {
             DefaultMutableTreeNode child = ( DefaultMutableTreeNode ) ii.nextElement();
@@ -121,17 +122,17 @@
         // -------------------------------------------------------------------
         // Find the profile dependents
         // -------------------------------------------------------------------
-        
+
         for ( Enumeration ii = applicationsNode.children(); ii.hasMoreElements(); /**/ )
         {
             DefaultMutableTreeNode child = ( DefaultMutableTreeNode ) ii.nextElement();
             findDependentProfiles( child );
         }
-        
+
         dependencyModel.fireTableDataChanged();
     }
-    
-    
+
+
     private void findDependentProfiles( DefaultMutableTreeNode applicationNode )
     {
         DefaultMutableTreeNode profilesNode = null;
@@ -144,7 +145,7 @@
                 break;
             }
         }
-        
+
         for ( Enumeration ii = profilesNode.children(); ii.hasMoreElements(); /**/ )
         {
             DefaultMutableTreeNode child = ( DefaultMutableTreeNode ) ii.nextElement();
@@ -155,12 +156,11 @@
             }
         }
     }
-    
-    
+
+
     /**
      * This method initializes this
      * 
-     * @return void
      */
     private void initialize()
     {
@@ -174,7 +174,7 @@
     /**
      * This method initializes jPanel	
      * 	
-     * @return javax.swing.JPanel	
+     * @return javax.swing.JPanel
      */
     private JPanel getCenterPanel()
     {
@@ -198,7 +198,7 @@
     /**
      * This method initializes jPanel1	
      * 	
-     * @return javax.swing.JPanel	
+     * @return javax.swing.JPanel
      */
     private JPanel getSouthPanel()
     {
@@ -214,7 +214,7 @@
     /**
      * This method initializes jButton	
      * 	
-     * @return javax.swing.JButton	
+     * @return javax.swing.JButton
      */
     private JButton getRemoveButton()
     {
@@ -231,20 +231,20 @@
                             "entities other than this user.  User profiles for one will be
deleted.  Group " +
                             "membership will be effected.  You cannot automatically revert
from this operation.  " +
                             "Would you like to continue?", 79 );
-                    int response = JOptionPane.showOptionDialog( UserDependentsPanel.this,
msg, 
-                        "Irreverable operation!", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE,

+                    int response = JOptionPane.showOptionDialog( UserDependentsPanel.this,
msg,
+                        "Irreverable operation!", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE,
                         null, null, null );
                     if ( response == JOptionPane.NO_OPTION )
                     {
                         return;
                     }
-                    
+
                     int[] selectedRows = dependentsTable.getSelectedRows();
                     Set removed = new HashSet();
                     for ( int ii = 0; ii < selectedRows.length; ii++ )
                     {
-                        DefaultMutableTreeNode dependentNode = 
-                            ( DefaultMutableTreeNode ) dependents.get( selectedRows[ii] );

+                        DefaultMutableTreeNode dependentNode =
+                            ( DefaultMutableTreeNode ) dependents.get( selectedRows[ii] );
                         Object dependent = dependentNode.getUserObject();
                         try
                         {
@@ -267,7 +267,7 @@
                             else if ( dependent instanceof Profile )
                             {
                                 Profile profile = ( Profile ) dependent;
-                                profile.modifier().delete();
+                                profile.getStateManager().getEntityManager().remove(profile);
                                 removed.add( dependentNode );
                                 model.removeNodeFromParent( dependentNode );
                             }
@@ -276,16 +276,16 @@
                         {
                             msg = UiUtils.wrap( "Failed to remove all dependency relationships
for user: "
                                 + dae.getMessage(), 79 );
-                            JOptionPane.showMessageDialog( UserDependentsPanel.this, msg,

+                            JOptionPane.showMessageDialog( UserDependentsPanel.this, msg,
                                 "Dependency removal failure!", JOptionPane.ERROR_MESSAGE
);
                         }
                     }
-                    
+
                     for ( Iterator ii = removed.iterator(); ii.hasNext(); /**/ )
                     {
                         dependents.remove( ii.next() );
                     }
-                    
+
                     if ( removed.size() > 0 )
                     {
                         dependencyModel.fireTableDataChanged();
@@ -300,7 +300,7 @@
     /**
      * This method initializes jScrollPane	
      * 	
-     * @return javax.swing.JScrollPane	
+     * @return javax.swing.JScrollPane
      */
     private JScrollPane getJScrollPane()
     {
@@ -316,7 +316,7 @@
     /**
      * This method initializes jTable	
      * 	
-     * @return javax.swing.JTable	
+     * @return javax.swing.JTable
      */
     private JTable getDependentsTable()
     {
@@ -332,7 +332,7 @@
         return dependentsTable;
     }
 
-    
+
     class DependencyModel extends AbstractTableModel
     {
         private static final long serialVersionUID = 5348529870374118604L;
@@ -343,7 +343,7 @@
         {
             return COLNAMES[columnIndex];
         }
-        
+
         public int getRowCount()
         {
             return dependents.size();
@@ -384,7 +384,7 @@
                         return dependent;
                     case ( 2 ):
                         Profile profile = ( Profile ) dependent;
-                        return profile.getApplicationName();
+                        return (( Application )profile.getStateManager().getParent().getPc()).getAppName();
                     case ( 3 ):
                         return "Ownership";
                     default:
@@ -394,7 +394,7 @@
             }
             else
             {
-                throw new IllegalStateException( "Only expecting Group and Profile dependents
for Users not " 
+                throw new IllegalStateException( "Only expecting Group and Profile dependents
for Users not "
                     + dependent.getClass() );
             }
         }

Modified: directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/UserInfoPanel.java
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/UserInfoPanel.java?view=diff&rev=496902&r1=496901&r2=496902
==============================================================================
--- directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/UserInfoPanel.java
(original)
+++ directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/UserInfoPanel.java
Tue Jan 16 16:29:24 2007
@@ -103,7 +103,6 @@
     /**
      * This method initializes this
      * 
-     * @return void
      */
     private void initialize()
     {

Modified: directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/UserNorthPanel.java
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/UserNorthPanel.java?view=diff&rev=496902&r1=496901&r2=496902
==============================================================================
--- directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/UserNorthPanel.java
(original)
+++ directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/UserNorthPanel.java
Tue Jan 16 16:29:24 2007
@@ -166,7 +166,6 @@
     /**
      * This method initializes this
      * 
-     * @return void
      */
     private void initialize()
     {

Modified: directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/UserPanel.java
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/UserPanel.java?view=diff&rev=496902&r1=496901&r2=496902
==============================================================================
--- directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/UserPanel.java
(original)
+++ directory/sandbox/triplesec-jacc2/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/UserPanel.java
Tue Jan 16 16:29:24 2007
@@ -103,7 +103,6 @@
     /**
      * This method initializes this
      * 
-     * @return void
      */
     private void initialize()
     {

Modified: directory/sandbox/triplesec-jacc2/webapp-config/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/webapp-config/pom.xml?view=diff&rev=496902&r1=496901&r2=496902
==============================================================================
--- directory/sandbox/triplesec-jacc2/webapp-config/pom.xml (original)
+++ directory/sandbox/triplesec-jacc2/webapp-config/pom.xml Tue Jan 16 16:29:24 2007
@@ -46,6 +46,20 @@
     </plugins>
   </build>
   <dependencies>
+    <!-- todo should schema jars come from transitive deps? -->
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-schema-bootstrap</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-schema-extras</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-schema-registries</artifactId>
+    </dependency>
+    <!-- -->
     <dependency>
       <groupId>wicket</groupId>
       <artifactId>wicket</artifactId>

Modified: directory/sandbox/triplesec-jacc2/webapp-config/src/main/java/org/safehaus/triplesec/configui/util/TriplesecConfigBuilder.java
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/webapp-config/src/main/java/org/safehaus/triplesec/configui/util/TriplesecConfigBuilder.java?view=diff&rev=496902&r1=496901&r2=496902
==============================================================================
--- directory/sandbox/triplesec-jacc2/webapp-config/src/main/java/org/safehaus/triplesec/configui/util/TriplesecConfigBuilder.java
(original)
+++ directory/sandbox/triplesec-jacc2/webapp-config/src/main/java/org/safehaus/triplesec/configui/util/TriplesecConfigBuilder.java
Tue Jan 16 16:29:24 2007
@@ -44,19 +44,23 @@
 import org.apache.directory.server.core.operational.OperationalAttributeService;
 import org.apache.directory.server.core.referral.ReferralService;
 import org.apache.directory.server.core.schema.SchemaService;
-import org.apache.directory.server.core.schema.bootstrap.ApacheSchema;
-import org.apache.directory.server.core.schema.bootstrap.CollectiveSchema;
-import org.apache.directory.server.core.schema.bootstrap.CorbaSchema;
-import org.apache.directory.server.core.schema.bootstrap.CoreSchema;
-import org.apache.directory.server.core.schema.bootstrap.CosineSchema;
-import org.apache.directory.server.core.schema.bootstrap.InetorgpersonSchema;
-import org.apache.directory.server.core.schema.bootstrap.JavaSchema;
-import org.apache.directory.server.core.schema.bootstrap.Krb5kdcSchema;
-import org.apache.directory.server.core.schema.bootstrap.SystemSchema;
 import org.apache.directory.server.core.subtree.SubentryService;
 import org.apache.directory.server.ldap.support.extended.GracefulShutdownHandler;
 import org.apache.directory.server.ldap.support.extended.LaunchDiagnosticUiHandler;
 import org.apache.directory.server.protocol.shared.store.Krb5KdcEntryFilter;
+import org.apache.directory.server.schema.bootstrap.CorbaSchema;
+import org.apache.directory.server.schema.bootstrap.JavaSchema;
+import org.apache.directory.server.schema.bootstrap.SystemSchema;
+import org.apache.directory.server.schema.bootstrap.ApacheSchema;
+import org.apache.directory.server.schema.bootstrap.InetorgpersonSchema;
+import org.apache.directory.server.schema.bootstrap.CosineSchema;
+import org.apache.directory.server.schema.bootstrap.CoreSchema;
+import org.apache.directory.server.schema.bootstrap.Krb5kdcSchema;
+import org.apache.directory.server.schema.bootstrap.CollectiveSchema;
+import org.apache.directory.server.schema.bootstrap.BootstrapSchemaLoader;
+import org.apache.directory.server.schema.bootstrap.Schema;
+import org.apache.directory.server.schema.registries.DefaultRegistries;
+import org.apache.directory.server.schema.registries.DefaultOidRegistry;
 import org.apache.directory.shared.ldap.util.NamespaceTools;
 import org.safehaus.triplesec.configui.model.TriplesecConfigSettings;
 import org.safehaus.triplesec.configuration.MutableTriplesecStartupConfiguration;
@@ -137,7 +141,7 @@
         contextEntry.get( "administrativeRole" ).add( "collectiveAttributeSpecificArea" );
         partition.setContextEntry( contextEntry );
         
-        config.setContextPartitionConfigurations( partitions );
+        config.setPartitionConfigurations( partitions );
 
         // -------------------------------------------------------------------
         // Configure http settings
@@ -309,7 +313,7 @@
         config.getSmtpConfiguration().setSmtpHost( "localhost" );
         config.getSmtpConfiguration().setSmtpSubject( "Triplesec account activated" );
         
-        Set partitions = new HashSet( config.getContextPartitionConfigurations() );
+        Set partitions = new HashSet( config.getPartitionConfigurations() );
         MutablePartitionConfiguration partitionConfiguration = new MutablePartitionConfiguration();
         partitionConfiguration.setName( "example" );
         partitionConfiguration.setSuffix( "dc=example,dc=com" );
@@ -332,9 +336,11 @@
         contextEntry.get( "administrativeRole" ).add( "collectiveAttributeSpecificArea" );
         partitionConfiguration.setContextEntry( contextEntry );
         partitions.add( partitionConfiguration );
-        config.setContextPartitionConfigurations( partitions );
+        config.setPartitionConfigurations( partitions );
         
-        Set schemas = new HashSet();
+        BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
+        DefaultRegistries bsRegistries = new DefaultRegistries( "bootstrap", loader, new
DefaultOidRegistry() );
+        Set<Schema> schemas = new HashSet<Schema>();
         schemas.add( new CorbaSchema() );
         schemas.add( new CoreSchema() );
         schemas.add( new CosineSchema() );
@@ -345,7 +351,8 @@
         schemas.add( new Krb5kdcSchema() );
         schemas.add( new SystemSchema() );
         schemas.add( new SafehausSchema() );
-        config.setBootstrapSchemas( schemas );
+//        config.setBootstrapSchemas( schemas );
+        loader.loadWithDependencies( schemas, bsRegistries );
 
         return config;
     }

Modified: directory/sandbox/triplesec-jacc2/webapp-config/src/test/java/org/safehaus/triplesec/configui/util/TriplesecConfigBuilderTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/webapp-config/src/test/java/org/safehaus/triplesec/configui/util/TriplesecConfigBuilderTest.java?view=diff&rev=496902&r1=496901&r2=496902
==============================================================================
--- directory/sandbox/triplesec-jacc2/webapp-config/src/test/java/org/safehaus/triplesec/configui/util/TriplesecConfigBuilderTest.java
(original)
+++ directory/sandbox/triplesec-jacc2/webapp-config/src/test/java/org/safehaus/triplesec/configui/util/TriplesecConfigBuilderTest.java
Tue Jan 16 16:29:24 2007
@@ -50,9 +50,9 @@
         
         MutableTriplesecStartupConfiguration config = builder.build( settings );
         assertEquals( 1389, config.getLdapPort() );
-        assertEquals( 1, config.getContextPartitionConfigurations().size() );
+        assertEquals( 1, config.getPartitionConfigurations().size() );
         MutablePartitionConfiguration partition = ( MutablePartitionConfiguration ) 
-            config.getContextPartitionConfigurations().iterator().next();
+            config.getPartitionConfigurations().iterator().next();
         assertEquals( "apache", partition.getName() );
         assertEquals( "dc=apache,dc=org", partition.getSuffix() );
         Attributes attrs = partition.getContextEntry();

Modified: directory/sandbox/triplesec-jacc2/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelFinish.java
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelFinish.java?view=diff&rev=496902&r1=496901&r2=496902
==============================================================================
--- directory/sandbox/triplesec-jacc2/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelFinish.java
(original)
+++ directory/sandbox/triplesec-jacc2/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelFinish.java
Tue Jan 16 16:29:24 2007
@@ -43,6 +43,8 @@
 import org.safehaus.triplesec.admin.HauskeysUser;
 import org.safehaus.triplesec.admin.HauskeysUserModifier;
 import org.safehaus.triplesec.admin.TriplesecAdmin;
+import org.safehaus.triplesec.admin.Profile;
+import org.safehaus.triplesec.admin.persistence.PCException;
 import org.safehaus.triplesec.configuration.SmsConfiguration;
 import org.safehaus.triplesec.configuration.SmtpConfiguration;
 import org.safehaus.triplesec.registration.model.RegistrationInfo;
@@ -178,9 +180,10 @@
                 {
                     try
                     {
-                        demoApp.modifier().newProfile( info.getUsername(), info.getUsername()
).add();
+                        Profile profile = new Profile(info.getUsername(), null, null, null,
null, false, info.getUsername());
+                        demoApp.addProfile( profile);
                     }
-                    catch ( DataAccessException e )
+                    catch ( PCException e )
                     {
                         message = "Triplesec user " + info.getUsername() 
                             + " has been registered but could not create demo account profile.
" 



Mime
View raw message