[JBoss Portal] - Re: integrate alfresco and jboss portal
by piergiorgiolucidi
To expose Alfresco Webscripts as portlets you must declare each Webscript as a portlet in the Alfresco portlet.xml.
You must add in Alfresco a portlet.xml file in alfresco.war/WEB-INF/.
Here the snippet to expose your Alfresco WebScript as a portlet.
You need to use WebScriptPorlet class to do this integration.
You can see how you can use Alfresco authentication, if your webscript need to authenticate users. In this way the user session is taken from portal session.
Hope this helps.
portlet.xml:
| <portlet>
| <description>Your Alfresco Webscript</description>
| <portlet-name>Your Alfresco Webscript</portlet-name>
| <portlet-class>org.alfresco.web.scripts.portlet.WebScriptPortlet</portlet-class>
|
| <init-param>
| <name>authenticator</name>
| <value>webscripts.authenticator.jsr168.webclient</value>
| </init-param>
|
| <init-param>
| <name>scriptUrl</name>
| <value>/alfresco/168s/yourWebscriptUrl</value>
| </init-param>
| <expiration-cache>0</expiration-cache>
| <supports>
| <mime-type>text/html</mime-type>
| <portlet-mode>VIEW</portlet-mode>
| </supports>
| <portlet-info>
| <title>Your Alfresco Webscript Portlet</title>
| <short-title>Your Alfresco Webscript Portlet</short-title>
| </portlet-info>
| </portlet>
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4211936#4211936
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4211936
17 years, 2 months
[JBoss Portal] - Re: Upload portlet
by piergiorgiolucidi
Hi Audran,
here you can see an example to implement an upload portlet using PortletFileUpload class:
http://commons.apache.org/fileupload/apidocs/org/apache/commons/fileuploa...
You can follow the example below ;)
Hope this helps.
FileUploadPortlet.java:
| package com.yourcompany.yourapp.view.portlet;
|
| import java.io.FileOutputStream;
| import java.io.IOException;
| import java.io.InputStream;
| import java.util.Iterator;
| import java.util.List;
|
| import javax.portlet.ActionRequest;
| import javax.portlet.ActionResponse;
| import javax.portlet.GenericPortlet;
| import javax.portlet.PortletException;
| import javax.portlet.PortletRequestDispatcher;
| import javax.portlet.RenderRequest;
| import javax.portlet.RenderResponse;
|
|
| import org.apache.commons.fileupload.FileItem;
| import org.apache.commons.fileupload.FileUploadException;
| import org.apache.commons.fileupload.disk.DiskFileItemFactory;
| import org.apache.commons.fileupload.portlet.PortletFileUpload;
|
| public class FileUploadPortlet extends GenericPortlet {
|
| protected void doEdit(RenderRequest renderRequest,
| RenderResponse renderResponse) throws PortletException, IOException {
| renderResponse.setContentType("text/html");
| PortletRequestDispatcher requestDispacther = getPortletContext()
| .getRequestDispatcher("/yourFileUpload.jsp");
| requestDispacther.include(renderRequest, renderResponse);
| }
|
| public void processAction(ActionRequest actionRequest,
| ActionResponse actionResponse) throws PortletException, IOException {
| DiskFileItemFactory diskFileItemFactory = new DiskFileItemFactory();
| PortletFileUpload portletFileUpload = new PortletFileUpload(
| diskFileItemFactory);
| try {
| List fileItemList = portletFileUpload.parseRequest(actionRequest);
| Iterator fileIt = fileItemList.iterator();
| while (fileIt.hasNext()) {
| FileItem fileItem = (FileItem) fileIt.next();
| InputStream is = fileItem.getInputStream();
| String filePath = "yourFilePath";
| FileOutputStream fis = new FileOutputStream(filePath+fileItem.getName());
| int c;
| while((c = is.read()) != -1) {
| fis.write(c);
| }
| }
| } catch (FileUploadException e) {
| e.printStackTrace(System.out);
| }
| }
| }
|
yourFileUpload.jsp:
| <%@ taglib uri='http://java.sun.com/portlet' prefix='portlet'%>
| <portlet:defineObjects/>
| <form action="<portlet:actionURL/>" method="POST" enctype="multipart/form-data">
| Upload your file
| <table>
| <tr>
| <td>Your file</td>
| <td><input type="file" name="yourFile"></td>
| </tr>
| <tr>
| <td><input type="submit" name="submit" Value="Submit"></td>
| <td><input type="reset" name="reset" title="Reset"></td>
| </tr>
| </table>
| </form>
|
portlet.xml:
| <portlet>
| <description>YourFileUploadForm</description>
| <portlet-name>YourFileUploadForm</portlet-name>
| <portlet-class> com.yourcompany.yourapp.view.portlet.FileUploadPortlet</portlet-class>
|
| <supports>
| <mime-type>text/html</mime-type>
| <portlet-mode>EDIT</portlet-mode>
| </supports>
|
| <portlet-info>
| <title>YourFileUploadForm</title>
| <short-title>YourFileUploadForm</short-title>
| </portlet-info>
| </portlet>
|
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4211935#4211935
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4211935
17 years, 2 months
[JBoss jBPM] - JBPM Assignment Handler 3.3.1.GA Problems
by bradsdavis
JBPM 3.3.1 does not seem to pass execution to the configured assignment handler delegate. Can someone please validate my configuration below?
In the database, I see that the column ASSIGNMENTDELEGATION_ does have an entry, but in my logs, I get:
| 2009-02-20 12:55:35,703 DEBUG [org.jbpm.graph.def.GraphElement] event 'task-create' on 'Task(do-something)' for 'Token(/)'
| 2009-02-20 12:55:35,984 DEBUG [org.jbpm.identity.assignment.ExpressionAssignmentHandler] resolving first term 'user(jie)'
| 2009-02-20 12:55:35,984 WARN [org.hibernate.hql.QuerySplitter] no persistent classes found for query class: select u from org.jbpm.identity.User as u where u.name = :userName
|
Here is the task assignment handler configuration:
| <task-node name="task-node1">
| <task name="do-something">
| <assignment class="org.jbpm.identity.ldap.LdapAssignmentHandler" expression="user(jie)"></assignment>
| </task>
| <transition to="end-state1"></transition>
| </task-node>
|
Additionally, I have a log statement in my LdapAssignmentHandler, which never is displayed in my logs, indicating it is not called.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4211919#4211919
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4211919
17 years, 2 months
[JBoss Portal] - Re: Dashboard configuration - drag and drop
by sambit_dixit
Hi,
By design, Jboss Portal can be accessed by any user where as dashboard are user specific. That is why you can when accessing portal you can access, http://abc/portal/portal/yourportalname where as for dashboard it is http://abc/portal/auth/dashboard. In Portal-Server.war WEB-INF/web.xml, you might see entries to for the servlet mapping to auth, authsec. These are first level of FORM authentication which is handled through login.jsp. Then internally it checks if the same user under specific role has access to the dashboard or not. What you have achieved so far is authenticating the user against a specific LDAP or DB. Jboss internally maintains it set of roles and users in JBP tables. It needs to be validated against them as well to render the dashboard correctly. To achieve this you need to use the following modules exposed by Jboss. You can make a look up these services through JNDI.
java:portal/UserProfileModule, java:portal/RoleModule,java:portal/MembershipModule,java:/TransactionManager.
Make sure that you use transaction manager before using the UserProfile, Role or MemberShip modules.
What you can do is write a filter and add the filter to web.xml of Portal-Server.war. Inside the filter, check if the user in the request is present in Jboss using UserProfile if not create it and assign to appropriate Role using Membership module.
Hope this helps.
Regards
-Sambit
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4211912#4211912
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4211912
17 years, 2 months