Skip to content

Commit

Permalink
Merge pull request #4 from KlasJoenssson/NewAccountCreation
Browse files Browse the repository at this point in the history
New account creation
  • Loading branch information
jonalv committed Mar 6, 2012
2 parents 94f5094 + 046bc51 commit 6b69f26
Show file tree
Hide file tree
Showing 10 changed files with 773 additions and 52 deletions.
Expand Up @@ -64,14 +64,14 @@ public UserContainerTest() {
@Before
public void addMockAccountType() {

ACCOUNTTYPE.addProperty( REQUIREDPROPERTYKEY, true );
ACCOUNTTYPE.addProperty( NOTREQUIREDPROPERTYKEY, false );
ACCOUNTTYPE.addProperty( "username", true );
ACCOUNTTYPE.addProperty( "password", true );
ACCOUNTTYPE2.addProperty( "username", true );
ACCOUNTTYPE2.addProperty( "password", true );
ACCOUNTTYPE2.addProperty( REQUIREDPROPERTYKEY, true );
ACCOUNTTYPE2.addProperty( NOTREQUIREDPROPERTYKEY, false );
ACCOUNTTYPE.addProperty( REQUIREDPROPERTYKEY, true, false );
ACCOUNTTYPE.addProperty( NOTREQUIREDPROPERTYKEY, false, false );
ACCOUNTTYPE.addProperty( "username", true, false );
ACCOUNTTYPE.addProperty( "password", true, true );
ACCOUNTTYPE2.addProperty( "username", true, false );
ACCOUNTTYPE2.addProperty( "password", true, true );
ACCOUNTTYPE2.addProperty( REQUIREDPROPERTYKEY, true, false );
ACCOUNTTYPE2.addProperty( NOTREQUIREDPROPERTYKEY, false, false );
userContainer.availableAccountTypes.add( ACCOUNTTYPE );
userContainer.availableAccountTypes.add( ACCOUNTTYPE2 );
}
Expand Down Expand Up @@ -273,7 +273,7 @@ public void testThatOnlyAccountsWithAvailableAccountTypesAreShown() {

final String testAccountId = "testAccountId";
AccountType testAccountType = new AccountType("unavailableAcccount");
testAccountType.addProperty( NOTREQUIREDPROPERTYKEY, false );
testAccountType.addProperty( NOTREQUIREDPROPERTYKEY, false, false );

try {
userContainer.createAccount( "other" + testAccountId,
Expand Down
Expand Up @@ -56,14 +56,14 @@ public UserManagerTest() {
*/
@Before
public void addMockAccountType() {
ACCOUNTTYPE.addProperty( REQUIREDPROPERTYKEY, true );
ACCOUNTTYPE.addProperty( NOTREQUIREDPROPERTYKEY, false );
ACCOUNTTYPE.addProperty( "username", true );
ACCOUNTTYPE.addProperty( "password", true );
ACCOUNTTYPE2.addProperty( "username", true );
ACCOUNTTYPE2.addProperty( "password", true );
ACCOUNTTYPE2.addProperty( REQUIREDPROPERTYKEY, true );
ACCOUNTTYPE2.addProperty( NOTREQUIREDPROPERTYKEY, false );
ACCOUNTTYPE.addProperty( REQUIREDPROPERTYKEY, true, false );
ACCOUNTTYPE.addProperty( NOTREQUIREDPROPERTYKEY, false, false );
ACCOUNTTYPE.addProperty( "username", true, false );
ACCOUNTTYPE.addProperty( "password", true, true );
ACCOUNTTYPE2.addProperty( "username", true, false );
ACCOUNTTYPE2.addProperty( "password", true, true );
ACCOUNTTYPE2.addProperty( REQUIREDPROPERTYKEY, true, false );
ACCOUNTTYPE2.addProperty( NOTREQUIREDPROPERTYKEY, false, false );

UserContainerModifier.addAccountType(
((UserManager)userManager).userContainer,
Expand Down
11 changes: 10 additions & 1 deletion plugins/net.bioclipse.usermanager/plugin.xml
Expand Up @@ -2,6 +2,7 @@
<?eclipse version="3.2"?>
<plugin>
<extension-point id="accountType" name="AccountType" schema="schema/accountType.exsd"/>
<extension-point id="net.bioclipse.usermanager.accounts" name="Accounts" schema="schema/net.bioclipse.usermanager.accounts.exsd"/>
<extension
point="org.eclipse.ui.preferencePages">
<page
Expand Down Expand Up @@ -143,6 +144,14 @@
</command>
</menuContribution>
</extension>

<extension
point="org.eclipse.ui.newWizards">
<wizard
id="net.bioclipse.usermanager.newAccountWizard"
class="net.bioclipse.usermanager.NewAccountWizard"
name="Account"
hasPages="true">
</wizard>
</extension>

</plugin>
73 changes: 52 additions & 21 deletions plugins/net.bioclipse.usermanager/schema/accountType.exsd
@@ -1,16 +1,21 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="net.bioclipse.keyring">
<schema targetNamespace="net.bioclipse.keyring" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<appinfo>
<meta.schema plugin="net.bioclipse.keyring" id="accountType" name="AccountType"/>
</appInfo>
</appinfo>
<documentation>
An account type defines which key value pairs an account should persist.
</documentation>
</annotation>

<element name="extension">
<annotation>
<appinfo>
<meta.element />
</appinfo>
</annotation>
<complexType>
<sequence minOccurs="1" maxOccurs="unbounded">
<element ref="AccountType"/>
Expand Down Expand Up @@ -44,6 +49,16 @@
</documentation>
</annotation>
</attribute>
<attribute name="logoPath" type="string">
<annotation>
<documentation>

</documentation>
<appinfo>
<meta.attribute kind="resource"/>
</appinfo>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>
Expand All @@ -70,33 +85,57 @@
</documentation>
</annotation>
</attribute>
<attribute name="secret" type="boolean" use="required">
<annotation>
<documentation>

</documentation>
</annotation>
</attribute>
</complexType>
</element>

<element name="newAccountUI">
<complexType>
<attribute name="class" type="string" use="required">
<annotation>
<documentation>

</documentation>
<appinfo>
<meta.attribute kind="java" basedOn="org.eclipse.swt.widgets.Composite:net.bioclipse.usermanager.IAccounts"/>
</appinfo>
</annotation>
</attribute>
</complexType>
</element>

<annotation>
<appInfo>
<appinfo>
<meta.section type="since"/>
</appInfo>
</appinfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>

<annotation>
<appInfo>
<appinfo>
<meta.section type="examples"/>
</appInfo>
</appinfo>
<documentation>
&lt;p&gt;
&lt;pre&gt;
&lt;extension
point=&quot;net.bioclipse.keyring.accountType&quot;&gt;
&lt;AccountType
id=&quot;lis.accounttype&quot;
name=&quot;LisAccountType&quot;&gt;
name=&quot;LisAccountType&quot;
logoPath=&quot;icons/logo.jpg&quot;&gt;
&lt;property
name=&quot;URL&quot;
required=&quot;true&quot;/&gt;
required=&quot;true&quot;
secret=&quot;false&quot;/&gt;
&lt;/AccountType&gt;
&lt;/extension&gt;
&lt;/pre&gt;
Expand All @@ -105,30 +144,22 @@
</annotation>

<annotation>
<appInfo>
<appinfo>
<meta.section type="apiInfo"/>
</appInfo>
</appinfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>

<annotation>
<appInfo>
<appinfo>
<meta.section type="implementation"/>
</appInfo>
</appinfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>

<annotation>
<appInfo>
<meta.section type="copyright"/>
</appInfo>
<documentation>

</documentation>
</annotation>

</schema>

0 comments on commit 6b69f26

Please sign in to comment.