[JBoss Portal] - Portal User Creation and Management
by JavaWings
Stats:
4.0.5GA with portal 2.4.2 downloaded. On SUSE 10.0.
Question:
I am new to JBoss and the portal. A search of related keywords (in the developer forum because I was in the wrong forum...now I am cross posting here) didn't show any postings about this so I'd like to ask a question about the 2.4.2 version of the portal.
I need a portlet that deals with user accounts.
I find the user register/subscription model to be inappropriate for corporate use. I am planning to turn off anonymous user subscriptions. (Please note, my question isn't how to do that). Here's the question: I'd like to have the admin user log in and create new users and their profiles. It isn't clear to me how to program this behavior.
Here's some thoughts....
In UserModuleImpl.java there is a createUser method that calls session.save(user). If called from a new user (not the admin) trying to create a new account for himself it makes sense to have the current session save this. But does it make sense, or is it safe, for the admin's current session to save the UserModuleImpl object of another user, a user other than himself? I haven't yet found any programming guides around how to program user management using sessions. I don't understand sessions and what objects can be placed in them. Hints would be appreciated.
Thanks ahead,
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036135#4036135
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036135
19 years
[JBoss Seam] - Re: jBPM can't evaluate method
by smithbstl
I have reworked this a bit but am still having problems getting any methods called from jPdl. As far as I can tell, I am closely following the DVD Seam example
Here is my pageflow.jdpl.xml
<pageflow-definition
| xmlns="http://jboss.com/products/seam/pageflow"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation= "http://jboss.com/products/seam/pageflow http://jboss.com/products/seam/pageflow-1.2.xsd"
| name="serviceRequestCreation">
|
| <start-state name="start">
| <transition to="requestSearch"/>
| </start-state>
| <page name="requestSearch" view-id="/AddressLookup.xhtml">
| <redirect/>
| <transition name="viewRequests" to="requestListing">
| <action expression="#{requestEntry.viewRequests}"/>
| </transition>
| </page>
| <page name="requestListing" view-id="/AddressRequestListing.xhtml">
| <redirect/>
| <end-conversation/>
| </page>
| </pageflow-definition>
SFSB
@Stateful
| @Name("requestEntry")
| public class RequestEntryAction implements com.stlouiscity.csb.ejb.action.RequestEntry {
|
| @PersistenceContext(unitName="CSB_Oracle", type=EXTENDED)
| private EntityManager em;
|
| @In(create=true)
| private Address address;
|
| @In(create=true, required=false)
| private AddressLookup addressLookup;
|
| @DataModel("addresses")
| private List<ParcelAddress> addresses;
|
| @DataModelSelection(value="addresses")
| @Out(required=false)
| private ParcelAddress selectedAddress;
|
| @DataModel("requests")
| private List<ServiceRequest> requests;
|
| @DataModelSelection(value="requests")
| private ServiceRequest selectedRequest;
|
| /**
| * Creates a new instance of RequestEntryAction
| */
| public RequestEntryAction() {
| }
|
| @Begin(join=true)
| public void findAddresses() {
|
| if (address.getStreetName() != null) {
| System.out.println("Address Is NOT NULL");
| //Find ParcelAddress
| Query q = em.createQuery("Select a From ParcelAddress a Where" +
| " (a.structureAddress.nlc.streetDirection = :streetDirection OR :streetDirection IS NULL) AND" +
| " (lower(a.structureAddress.nlc.streetName) LIKE :street) AND" +
| " (((a.structureAddress.structureAddressPK.houseNumber = :houseNumber) OR" +
| " (:houseNumber BETWEEN a.structureAddress.houseLow AND a.structureAddress.houseHigh)) OR (:houseNumber IS NULL))");
| q.setParameter("houseNumber",address.getHouseNumber());
| q.setParameter("streetDirection",address.getStreetDirection());
| q.setParameter("street",address.getStreetName().toLowerCase() + "%");
|
| addresses = q.getResultList();
| } else {
| System.out.println("Address IS NULL");
| }
| }
|
| @Begin(nested=true, pageflow="serviceRequestCreation")
| public void viewRequests() {
| System.out.println("**********Started PageFlow*************");
| }
|
| @End
| public void findRequests(ParcelAddress address) {
| System.out.println("**********Entered findRequests*************");
| System.out.println("**********Selected Address: " + address.toString());
| Query q = em.createQuery("Select s From ServiceRequest s Where" +
| " s.parcelAddress.parcelAddressPK.houseNumber = :houseNumber AND" +
| " s.parcelAddress.parcelAddressPK.houseSuffix = :houseSuffix AND" +
| " s.parcelAddress.parcelAddressPK.nlc = :nlc AND" +
| " s.parcelAddress.parcelAddressPK.cityBlock = :cityBlock AND" +
| " s.parcelAddress.parcelAddressPK.parcelNumber = :parcelNumber)");
| q.setParameter("houseNumber", address.getParcelAddressPK().getHouseNumber());
| q.setParameter("houseSuffix", address.getParcelAddressPK().getHouseSuffix());
| q.setParameter("nlc", address.getParcelAddressPK().getNlc());
| q.setParameter("cityBlock", address.getParcelAddressPK().getCityBlock());
| q.setParameter("parcelNumber", address.getParcelAddressPK().getParcelNumber());
| requests = q.getResultList();
| }
|
| @Remove @Destroy
| public void destroy() {
|
| }
Here is the link I am using to call the Transition. It is in the context of an h:dataTable column.
<h:column>
| <f:facet name="header">
| <h:outputText value="#{msgs['ServiceRequestList.action']}"/>
| </f:facet>
| <h:commandLink id="viewRequestsLink"
| action="viewRequests"
| rendered="#{not empty addressRow.requestCollection}"
| value="#{msgs['AddressList.viewRequest']}">
| </h:commandLink>
| </h:column>
When I click the link, the page just reloads, the transition is never activated. Its driving me nuts.
Thanks for any help
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036132#4036132
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036132
19 years
[JBoss Seam] - Dot notation to "name" @Name / @Factory components
by chane
Two hopefully easy questions:
For our components managed by Seam we use a naming scheme similar to package naming. For example,
@Name("com.domain.blah.blah")
In our xhtml (facelets) we used to (Seam 1.0) have to use a $ in place of the dot to access these components. We are in the process of upgrading to 1.2 and it looks like we no longer have to do the substitution. Just wanted to confirm that this is true and we aren't doing something by mistake.
Second, For our factory components we also have a namespace. For example:
@Out(value="com.domain.blah.attribute)
private String someVariable
@Factory(avlue-"com.damain.blah.attribute")
public void someMethod(){
someVariable = "initialized";
}
Is it possible to use dot to name Outjected/Factory variables.
We couldn't figure out how to do it (and the $ substitution does not work). So we ended up replacing the dots with underscore in all three places (Out/Factory/xhtml).
Thanks,
Chris....
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036131#4036131
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036131
19 years
[JBoss Seam] - page parameters broken in integration tests?
by matt.drees
I think that page parameters do not work in integration tests.
I have the following test:
ItemTest.java
| public class ItemTest extends SeamTest {
|
| @Test
| public void testRequestParameterAnnotation() throws Exception {
| new NonFacesRequest("/item.xhtml") {
|
| @Override
| protected void beforeRequest() {
| setParameter("itemId", "1");
| }
|
| @Override
| protected void renderResponse() throws Exception {
| checkItemRetrieval(getValue("#{itemHome}"));
| }
| }.run();
| }
|
| @Test
| public void testPageParameter() throws Exception {
| new NonFacesRequest("/item.xhtml") {
|
| @Override
| protected void beforeRequest() {
| setParameter("id", "1");
| }
|
| @Override
| protected void renderResponse() throws Exception {
| checkItemRetrieval(getValue("#{itemHome}"));
| }
| }.run();
| }
|
| private void checkItemRetrieval(Object object) {
| ItemHome itemHome = (ItemHome) object;
| assert itemHome.getInstance().getId() != null;
| }
| }
|
ItemHome.java
|
| @Name("itemHome")
| public class ItemHome extends EntityHome<Item>
| {
|
| @RequestParameter
| Long itemId;
|
| @Override
| public Object getId()
| {
| if (itemId==null)
| {
| return super.getId();
| }
| else
| {
| return itemId;
| }
| }
| }
|
pages.xml
| <page view-id="/item.xhtml">
| <param name="id"
| value="#{itemHome.id}"
| converterId="javax.faces.Long"/>
| </page>
|
The first test passes, but the second one fails. Am I doing this correctly?
If so, I'll open a jira issue.
I'm using cvs HEAD.
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036121#4036121
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036121
19 years
[JBoss Seam] - Re: Http Session Management into Seam
by PatrickMadden
Regarding Session, you should look into the code of SeamListener.java and Lifecycle.java
I had similar issues with knowing when a session context actually became active in my components. I found the @Create annotation that you can use inside of you SFSB components that have Session Scope. You put this above a method and that method will be called when Seam fully creates your sessioned component. For example:
| /**
| * This method is called after this component has been successfully
| * instantiated by the Seam framework
| */
| @Create
| public void create()
| {
| log.info("WebDocumentTreeModelBean create method called");
|
| if (Contexts.isSessionContextActive())
| {
| // do what ever you need to do once your session is active
| }
| else
| {
| log.info("SessionContext is still not active after component creation event");
| }
| }
You would also need to define the public void create() method in your local interface but I found this useful. I never knew exactly when Contexts.isSessionContextActive() was valid until I found this annotation.
Hope this helps.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036120#4036120
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036120
19 years