@ -87,7 +87,7 @@ public class ContactManagerBackend extends ApplicationObjectSupport
@@ -87,7 +87,7 @@ public class ContactManagerBackend extends ApplicationObjectSupport
@Secured({"ROLE_USER","AFTER_ACL_READ"})
@Transactional(readOnly=true)
publicContactgetById(Integerid){
publicContactgetById(Longid){
if(logger.isDebugEnabled()){
logger.debug("Returning contact with id: "+id);
}
@ -143,7 +143,7 @@ public class ContactManagerBackend extends ApplicationObjectSupport
@@ -143,7 +143,7 @@ public class ContactManagerBackend extends ApplicationObjectSupport
@Secured({"ROLE_USER"})
publicvoidcreate(Contactcontact){
// Create the Contact itself
contact.setId(newInteger(counter++));
contact.setId(newLong(counter++));
contactDao.create(contact);
// Grant the current principal access to the contact
@ -61,7 +62,8 @@ public class AddPermissionController extends SimpleFormController
@@ -61,7 +62,8 @@ public class AddPermissionController extends SimpleFormController
}
publicvoidafterPropertiesSet()throwsException{
Assert.notNull(contactManager,"A ContactManager implementation is required");
@ -80,7 +82,7 @@ public class AddPermissionController extends SimpleFormController
@@ -80,7 +82,7 @@ public class AddPermissionController extends SimpleFormController
@ -45,7 +45,7 @@ public class ContactManagerBackend extends ApplicationObjectSupport
@@ -45,7 +45,7 @@ public class ContactManagerBackend extends ApplicationObjectSupport
@ -76,7 +76,7 @@ public class ContactManagerBackend extends ApplicationObjectSupport
@@ -76,7 +76,7 @@ public class ContactManagerBackend extends ApplicationObjectSupport
returnbasicAclExtendedDao;
}
publicContactgetById(Integerid){
publicContactgetById(Longid){
if(logger.isDebugEnabled()){
logger.debug("Returning contact with id: "+id);
}
@ -130,7 +130,7 @@ public class ContactManagerBackend extends ApplicationObjectSupport
@@ -130,7 +130,7 @@ public class ContactManagerBackend extends ApplicationObjectSupport
publicvoidcreate(Contactcontact){
// Create the Contact itself
contact.setId(newInteger(counter++));
contact.setId(newLong(counter++));
contactDao.create(contact);
// Grant the current principal access to the contact
@ -65,7 +65,7 @@ public class DataSourcePopulator implements InitializingBean {
@@ -65,7 +65,7 @@ public class DataSourcePopulator implements InitializingBean {
JdbcTemplatetemplate=newJdbcTemplate(dataSource);
template.execute(
"CREATE TABLE CONTACTS(ID INTEGER NOT NULL PRIMARY KEY, CONTACT_NAME VARCHAR_IGNORECASE(50) NOT NULL, EMAIL VARCHAR_IGNORECASE(50) NOT NULL)");
"CREATE TABLE CONTACTS(ID BIGINT NOT NULL PRIMARY KEY, CONTACT_NAME VARCHAR_IGNORECASE(50) NOT NULL, EMAIL VARCHAR_IGNORECASE(50) NOT NULL)");
template.execute(
"INSERT INTO contacts VALUES (1, 'John Smith', 'john@somewhere.com');");// marissa
template.execute(
@ -93,7 +93,7 @@ public class DataSourcePopulator implements InitializingBean {
@@ -93,7 +93,7 @@ public class DataSourcePopulator implements InitializingBean {
}
template.execute(
"CREATE TABLE ACL_OBJECT_IDENTITY(ID INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 100) NOT NULL PRIMARY KEY,OBJECT_IDENTITY VARCHAR_IGNORECASE(250) NOT NULL,PARENT_OBJECT INTEGER,ACL_CLASS VARCHAR_IGNORECASE(250) NOT NULL,CONSTRAINT UNIQUE_OBJECT_IDENTITY UNIQUE(OBJECT_IDENTITY),CONSTRAINT SYS_FK_3 FOREIGN KEY(PARENT_OBJECT) REFERENCES ACL_OBJECT_IDENTITY(ID))");
"CREATE TABLE ACL_OBJECT_IDENTITY(ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 100) NOT NULL PRIMARY KEY,OBJECT_IDENTITY VARCHAR_IGNORECASE(250) NOT NULL,PARENT_OBJECT BIGINT,ACL_CLASS VARCHAR_IGNORECASE(250) NOT NULL,CONSTRAINT UNIQUE_OBJECT_IDENTITY UNIQUE(OBJECT_IDENTITY),CONSTRAINT SYS_FK_3 FOREIGN KEY(PARENT_OBJECT) REFERENCES ACL_OBJECT_IDENTITY(ID))");
template.execute(
"INSERT INTO acl_object_identity VALUES (1, 'sample.contact.Contact:1', null, 'net.sf.acegisecurity.acl.basic.SimpleAclEntry');");
template.execute(
@ -120,7 +120,7 @@ public class DataSourcePopulator implements InitializingBean {
@@ -120,7 +120,7 @@ public class DataSourcePopulator implements InitializingBean {
}
template.execute(
"CREATE TABLE ACL_PERMISSION(ID INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 100) NOT NULL PRIMARY KEY,ACL_OBJECT_IDENTITY INTEGER NOT NULL,RECIPIENT VARCHAR_IGNORECASE(100) NOT NULL,MASK INTEGER NOT NULL,CONSTRAINT UNIQUE_RECIPIENT UNIQUE(ACL_OBJECT_IDENTITY,RECIPIENT),CONSTRAINT SYS_FK_7 FOREIGN KEY(ACL_OBJECT_IDENTITY) REFERENCES ACL_OBJECT_IDENTITY(ID))");
"CREATE TABLE ACL_PERMISSION(ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 100) NOT NULL PRIMARY KEY,ACL_OBJECT_IDENTITY BIGINT NOT NULL,RECIPIENT VARCHAR_IGNORECASE(100) NOT NULL,MASK INTEGER NOT NULL,CONSTRAINT UNIQUE_RECIPIENT UNIQUE(ACL_OBJECT_IDENTITY,RECIPIENT),CONSTRAINT SYS_FK_7 FOREIGN KEY(ACL_OBJECT_IDENTITY) REFERENCES ACL_OBJECT_IDENTITY(ID))");
template.execute(
"INSERT INTO acl_permission VALUES (null, 1, 'marissa', 1);");// administer
@ -65,7 +66,8 @@ public class DeletePermissionController implements Controller, InitializingBean
@@ -65,7 +66,8 @@ public class DeletePermissionController implements Controller, InitializingBean
}
publicvoidafterPropertiesSet()throwsException{
Assert.notNull(contactManager,"A ContactManager implementation is required");
Assert.notNull(contactManager,
"A ContactManager implementation is required");
Assert.notNull(aclManager,"An aclManager implementation is required");
}
@ -76,7 +78,7 @@ public class DeletePermissionController implements Controller, InitializingBean
@@ -76,7 +78,7 @@ public class DeletePermissionController implements Controller, InitializingBean