[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-967) JBoss Seam - Support authentication from a realm (on Tomcat)
by Bradley Smith (JIRA)
JBoss Seam - Support authentication from a realm (on Tomcat)
------------------------------------------------------------
Key: JBSEAM-967
URL: http://jira.jboss.com/jira/browse/JBSEAM-967
Project: JBoss Seam
Issue Type: Feature Request
Components: Security
Reporter: Bradley Smith
Please see discussion in the JBoss forum reference.
The idea is to allow the Seam Identity (security) component to get the Principal from the HttpServletRequest and to delegate the hasRole() calls to the HttpServletRequest as well. This is because, in my case, Tomcat has already forced the user to authenticate if necessary and the authentication, authorization information is available in the container's HttpServletRequest impl.
Principal userPrincipal = httpServletRequest.getUserPrincipal();
boolean hasRole(String roleName) {
return httpServletRequest.isUserInRole(roleName);
}
public String getUsername() {
return httpServletRequest.getRemoteUser();
}
public boolean isLoggedIn() {
return httpServletRequest.getUserPrincipal() != null;
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 4 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-994) seam-gen and mutiple foreign keys
by Niels Hoogeveen (JIRA)
seam-gen and mutiple foreign keys
---------------------------------
Key: JBSEAM-994
URL: http://jira.jboss.com/jira/browse/JBSEAM-994
Project: JBoss Seam
Issue Type: Bug
Components: Tools
Affects Versions: 1.2.0.GA
Environment: JBoss-4.0.5
Reporter: Niels Hoogeveen
I have generated a project with seam-gen based on generate-entities. All works fine, except for the generation of the home interfaces. In one of my tables I have two foreign keys to the same table. In the home interface two references are created to the appropriate object, but with the same name (which of course doesn't compile).
Here is a simplified example:
Table 1
Code:
CREATE TABLE test
(
id int4 NOT NULL DEFAULT nextval('test_id_seq'::regclass),
name varchar,
id_test2_1 int4,
id_test2_2 int4,
CONSTRAINT test_pkey PRIMARY KEY (id),
CONSTRAINT test_id_test2_1_fkey FOREIGN KEY (id_test2_1)
REFERENCES test2 (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT test_id_test2_2_fkey FOREIGN KEY (id_test2_2)
REFERENCES test2 (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
)
Table2
Code:
CREATE TABLE test2
(
id int4 NOT NULL DEFAULT nextval('test2_id_seq'::regclass),
name varchar,
CONSTRAINT test2_pkey PRIMARY KEY (id)
)
First Entity
Code:
@Entity
@Table(name = "test", schema = "public")
public class Test implements java.io.Serializable {
private int id;
private Test2 test2ByIdTest22;
private Test2 test2ByIdTest21;
private String name;
public Test() {
}
public Test(int id) {
this.id = id;
}
public Test(int id, Test2 test2ByIdTest22, Test2 test2ByIdTest21,
String name) {
this.id = id;
this.test2ByIdTest22 = test2ByIdTest22;
this.test2ByIdTest21 = test2ByIdTest21;
this.name = name;
}
@Id
@Column(name = "id", unique = true, nullable = false)
@NotNull
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "id_test2_2")
public Test2 getTest2ByIdTest22() {
return this.test2ByIdTest22;
}
public void setTest2ByIdTest22(Test2 test2ByIdTest22) {
this.test2ByIdTest22 = test2ByIdTest22;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "id_test2_1")
public Test2 getTest2ByIdTest21() {
return this.test2ByIdTest21;
}
public void setTest2ByIdTest21(Test2 test2ByIdTest21) {
this.test2ByIdTest21 = test2ByIdTest21;
}
@Column(name = "name", length = 0)
@Length(max = 0)
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
}
second entity
Code:
@Entity
@Table(name = "test2", schema = "public")
public class Test2 implements java.io.Serializable {
private int id;
private String name;
private Set<Test> testsForIdTest21 = new HashSet<Test>(0);
private Set<Test> testsForIdTest22 = new HashSet<Test>(0);
public Test2() {
}
public Test2(int id) {
this.id = id;
}
public Test2(int id, String name, Set<Test> testsForIdTest21,
Set<Test> testsForIdTest22) {
this.id = id;
this.name = name;
this.testsForIdTest21 = testsForIdTest21;
this.testsForIdTest22 = testsForIdTest22;
}
@Id
@Column(name = "id", unique = true, nullable = false)
@NotNull
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
@Column(name = "name", length = 0)
@Length(max = 0)
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "test2ByIdTest21")
public Set<Test> getTestsForIdTest21() {
return this.testsForIdTest21;
}
public void setTestsForIdTest21(Set<Test> testsForIdTest21) {
this.testsForIdTest21 = testsForIdTest21;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "test2ByIdTest22")
public Set<Test> getTestsForIdTest22() {
return this.testsForIdTest22;
}
public void setTestsForIdTest22(Set<Test> testsForIdTest22) {
this.testsForIdTest22 = testsForIdTest22;
}
}
Home interface of first entity. Here we have two Test2Home references, both with the name test2Home.
Code:
@Name("testHome")
public class TestHome extends EntityHome<Test> {
@In(create = true)
Test2Home test2Home;
@In(create = true)
Test2Home test2Home;
public void setTestId(Integer id) {
setId(id);
}
public Integer getTestId() {
return (Integer) getId();
}
@Override
protected Test createInstance() {
Test test = new Test();
return test;
}
public void wire() {
Test2 test2ByIdTest22 = test2Home.getDefinedInstance();
if (test2ByIdTest22 != null) {
getInstance().setTest2ByIdTest22(test2ByIdTest22);
}
Test2 test2ByIdTest21 = test2Home.getDefinedInstance();
if (test2ByIdTest21 != null) {
getInstance().setTest2ByIdTest21(test2ByIdTest21);
}
}
public boolean isWired() {
return true;
}
public Test getDefinedInstance() {
return isIdDefined() ? getInstance() : null;
}
}
BTW. I used the latest seam version from CVS.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 6 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-633) remoting extension in handling exceptions on client side
by Nico Gau (JIRA)
remoting extension in handling exceptions on client side
--------------------------------------------------------
Key: JBSEAM-633
URL: http://jira.jboss.com/jira/browse/JBSEAM-633
Project: JBoss Seam
Issue Type: Patch
Components: Remoting
Affects Versions: 1.1.0.GA
Reporter: Nico Gau
Priority: Optional
Hi all,
I don't really know what JIRA is by the way, so hopefully nobody is upset by this post. I first mailed Gavin but he told me I should put it in JIRA.
I currently work on a project which uses Seam Remoting directly and I didn't find a neat way in handling errors on the client side as Exceptions are not propagated to it. Therefore I changed Seam to transmit all exceptions which can be handled in the javascript part via another callback. E.g.:
Seam.Component.getInstance('userManager').currentUser(function(user) {
alert("user: " + user);
},
function(ex) {
alert("exception occured: " + ex.getMessage());
});
As the exception handler is optional, the change would not brake any client code. If you are interested in the change, you can reach me at heinzbeinz AT googlemail.com
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 8 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-541) ConversationEntry reports the wrong description
by Norman Richards (JIRA)
ConversationEntry reports the wrong description
-----------------------------------------------
Key: JBSEAM-541
URL: http://jira.jboss.com/jira/browse/JBSEAM-541
Project: JBoss Seam
Issue Type: Bug
Affects Versions: 1.1.0.CR1
Reporter: Norman Richards
Assigned To: Gavin King
The linked forum post shows one example of this bug, though it is not directly the issue the poster is complaining of.
Using the forum application as a guide, start a conversation and then start a nested conversation. End the nested conversation. The description of the parent conversation in the converstion list on will be incorrect. (it will have the name of the current conversation that just ended)
This happens because of the following code:
public String getDescription()
{
if ( isCurrent() )
{
String desc = Conversation.instance().description;
if (desc!=null) return desc;
}
return description;
}
public boolean isCurrent()
{
Manager manager = Manager.instance();
if ( manager.isLongRunningConversation() )
{
return id.equals( manager.getCurrentConversationId() );
}
else if ( manager.isNestedConversation() )
{
return id.equals( manager.getParentConversationId() );
}
else
{
return false;
}
}
The parent conversation entry is considered "current". (isLongRunning() is false and isNestedConversation() is true) Because of this, the ConversationEntry description is ignored in favor of Conversation.instance().description. (Again, Conversation.instance(), is the nested conversation that just ended)
Subsequent requests display the conversation description correctly since they are done in the context of the correct conversation.
The isNestedConversation() check looks to be the source of the problem. I can't figure out what case that would make sense for.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years