[jboss-user] [JBoss Portal Users] - Re: Jboss Portal Maven Repository url

2009-09-16 Thread guenther.her...@softcon.de
I do not now if this answer really helps, but I had also problems in that 
direction. I also missed native support for sar files and so on. So I decied 
for me to convert my project to ant. 

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4255442#4255442

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4255442
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Portal Users] - Re: ava.lang.ClassCastException: org.jboss.portal.portlet.im

2009-09-10 Thread guenther.her...@softcon.de
the download use the window-name from *-object.xml instead:


  
 default
 overwrite
 
 invserverproject

invserverprojectPortletWindow
invserverprojectPortletInstance
center
0
maximized


  

  



View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4254374#4254374

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4254374
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user



[jboss-user] [JBoss Portal Users] - Re: ava.lang.ClassCastException: org.jboss.portal.portlet.im

2009-09-10 Thread guenther.her...@softcon.de
If I use our default SEAM Solution:
/**
 * 
 */
package de.softcon.ivory.invserver.action.report;



import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Iterator;
import java.util.Map;

import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.portlet.PortletMode;
import javax.portlet.PortletModeException;
import javax.portlet.WindowState;
import javax.portlet.WindowStateException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponseWrapper;

import org.jboss.portal.portlet.impl.jsr168.api.ActionResponseImpl;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Import;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.core.Manager;
import org.jboss.seam.document.ByteArrayDocumentData;
import org.jboss.seam.document.DocumentData;
import org.jboss.seam.document.DocumentStore;
import org.jboss.seam.log.Log;





/**
 * @author mbaumgar
 *
 */
@Name("downloadComponent")
@Import("org.jboss.seam.pdf")
public class DownloadComponent
{


@In(value = "#{facesContext.externalContext}")
private ExternalContext externalContext;
@Logger
private Log log;

public void download(String filename, File reportFile)
{
int read = 0;
byte[] bytes = new byte[1000];

ActionResponseImpl res = 
(ActionResponseImpl)FacesContext.getCurrentInstance().getExternalContext().getResponse();
   
 
HttpServletResponseWrapper response = res.getRealResponse();
response.setContentType("application/xls");
response.setContentLength((int) reportFile.length());
response.setHeader("Content-Disposition", "attachment; filename=\"" + 
filename + "\";");
log.info("Content-Disposition attachment; filename=\"" + filename + 
"\";");
log.error("Content-Disposition attachment; filename=\"" + filename + 
"\";");
try
{
ServletOutputStream os = response.getOutputStream();

FileInputStream fis = new FileInputStream(reportFile);

while ((read = fis.read(bytes)) != -1)
{
os.write(bytes, 0, read);
}
fis.close();

os.flush();
os.close();

FacesContext.getCurrentInstance().responseComplete();
}
catch (Exception e)
{
if (log.isErrorEnabled())
{
log.error(DownloadComponent.class, e);
}
}
}
}

I get the follwing exception with wrong file-names and lost extension (.pdf or 
.xls):

2009-09-10 11:51:08,161 DEBUG [org.jboss.seam.Component] trying to inject with 
EL expression: #{facesContext.externalContext}
2009-09-10 11:51:08,161 INFO  
[de.softcon.ivory.invserver.action.report.DownloadComponent] 
Content-Disposition attachment; filename="listOfAsset.pdf";
2009-09-10 11:51:08,161 ERROR 
[de.softcon.ivory.invserver.action.report.DownloadComponent] 
Content-Disposition attachment; filename="listOfAsset.pdf";
2009-09-10 11:51:08,161 DEBUG 
[javax.enterprise.resource.webcontainer.jsf.lifecycle] Exiting 
InvokeApplicationsPhase
2009-09-10 11:51:08,161 DEBUG [org.ajax4jsf.event.AjaxPhaseListener] Process 
after phase INVOKE_APPLICATION 5
2009-09-10 11:51:08,161 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] committing 
transaction after phase: INVOKE_APPLICATION 5
2009-09-10 11:51:08,161 DEBUG [org.jboss.seam.transaction.UTTransaction] 
committing JTA transaction
2009-09-10 11:51:08,161 DEBUG [org.hibernate.transaction.CacheSynchronization] 
transaction before completion callback
2009-09-10 11:51:08,161 DEBUG [org.hibernate.jdbc.JDBCContext] before 
transaction completion
2009-09-10 11:51:08,161 DEBUG [org.hibernate.impl.SessionImpl] before 
transaction completion
2009-09-10 11:51:08,161 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] 
automatically flushing session
2009-09-10 11:51:08,161 DEBUG [org.hibernate.impl.SessionImpl] automatically 
flushing session
2009-09-10 11:51:08,161 DEBUG 
[org.hibernate.event.def.AbstractFlushingEventListener] flushing session
2009-09-10 11:51:08,161 DEBUG 
[org.hibernate.event.def.AbstractFlushingEventListener] processing flush-time 
cascades
2009-09-10 11:51:08,161 DEBUG [org.hibernate.engine.Cascade] processing cascade 
ACTION_PERSIST_ON_FLUSH for: de.softcon.ivory.invserver.model.tenant.Tenant
2009-09-10 11:51:08,161 DEBUG [org.hibernate.engine.Cascade] done processing 
cascade ACTION_PERSIST_ON_FLUSH for: 
de.softcon.ivory.invserver.model.tenant.Tenant
..
Lines Deleted
..
2009-09-10 11:51:08,161 DEBUG [org.jboss.seam.contexts.FacesLifecycle] <<< End 
JSF request for /invserverproject/faces
2009-09-10 11:51:08,161 DEBUG 
[javax.enterprise.resource.webcontainer.jsf.timing]  [TIMING] - [516ms] : 
Execution time for phase (inclu

[jboss-user] [JBoss Portal Users] - Re: ava.lang.ClassCastException: org.jboss.portal.portlet.im

2009-09-08 Thread guenther.her...@softcon.de
To day I tried a more seam like way:
/**
 * 
 */
package de.softcon.ivory.invserver.action.report;



import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;

import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;

import org.jboss.portal.portlet.impl.jsr168.api.ActionResponseImpl;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Import;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.core.Manager;
import org.jboss.seam.document.ByteArrayDocumentData;
import org.jboss.seam.document.DocumentData;
import org.jboss.seam.document.DocumentStore;
import org.jboss.seam.log.Log;





/**
 * @author mbaumgar
 *
 */
@Name("downloadComponent")
@Import("org.jboss.seam.pdf")
public class DownloadComponent
{
@In private Manager manager;
@In(create = true, value = "#{org.jboss.seam.document.DocumentStore}") 
private DocumentStore documentStore;


@In(value = "#{facesContext.externalContext}")
private ExternalContext externalContext;
/*
@In(value = "#{org.jboss.seam.faces.facesContext}")
private FacesContext facesContext;
*/
@Logger
private Log log;

public void download(String filename, File reportFile)
{
int read = 0;
byte[] bytes = new byte[1000];

//ActionResponseImpl res = 
(ActionResponseImpl)FacesContext.getCurrentInstance().getExternalContext().getResponse();
//HttpServletResponseWrapper response 
=(HttpServletResponseWrapper)FacesContext.getCurrentInstance().getExternalContext().getResponse();
 ActionResponseImpl res = (ActionResponseImpl) 
externalContext.getResponse();
   
 
//HttpServletResponseWrapper response = res.getRealResponse();
//response.setContentType("application/xls");
//response.setContentLength((int) reportFile.length());
//response.setHeader("Content-Disposition", "attachment; filename=\"" + 
filename + "\";");
//log.info("Content-Disposition attachment; filename=\"" + filename + 
"\";");
//log.error("Content-Disposition attachment; filename=\"" + filename + 
"\";");
try
{
//ServletOutputStream os = response.getOutputStream();
ByteArrayOutputStream os = new ByteArrayOutputStream();

FileInputStream fis = new FileInputStream(reportFile);

while ((read = fis.read(bytes)) != -1)
{
os.write(bytes, 0, read);
}
fis.close();
//
//os.flush();
//os.close();
byte[] binaryData = os.toByteArray();
DocumentData data = new ByteArrayDocumentData("report",
new DocumentData.DocumentType("pdf", "application/pdf"),
binaryData);
String docId = documentStore.newId();
documentStore.saveData(docId, data);
String documentUrl =
documentStore.preferredUrlForContent(
data.getBaseName(),
data.getDocumentType().getExtension(),
docId);
FacesContext.getCurrentInstance().getExternalContext().redirect(

manager.encodeConversationId(documentUrl));

//
FacesContext.getCurrentInstance().getExternalContext().redirect(reportFile.toURI().toString());
//FacesContext.getCurrentInstance().responseComplete();
//facesContext.responseComplete();
}
catch (Exception e)
{
if (log.isErrorEnabled())
{
log.error(DownloadComponent.class, e);
}
}
}
}


But the injections did not succed. I got:

org.jboss.seam.RequiredException: @In attribute requires non-null value: 
downloadComponent.#{org.jboss.seam.document.DocumentStore}
at org.jboss.seam.Component.getValueToInject(Component.java:2335)

I use PorteltBridge Version CR2 with SEAM jboss-seam-2.1.2.CR2

Any hints how to correct generate PDF an XLS Files and download them with 
correct filename and extension (.pdf and .xls) are welcome.

Kind regards

Günther Herndl

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4254029#4254029

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4254029

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Portal Users] - ava.lang.ClassCastException: org.jboss.portal.portlet.impl.j

2009-08-31 Thread guenther.her...@softcon.de
I have ported our SEAM Application to porteltbridge CR2. One part of the 
application is report PDF or XLS generation with JASPER. To dowdload the code 
we use the following code:

HttpServletResponse response = (HttpServletResponse) 
externalContext.getResponse();
response.setContentType("application/x-download");
response.setContentLength((int) reportFile.length());
response.setHeader("Content-Disposition", "attachment; filename=\"" + 
filename + "\";");
try
{
ServletOutputStream os = response.getOutputStream();
FileInputStream fis = new FileInputStream(reportFile);

while ((read = fis.read(bytes)) != -1)
{
os.write(bytes, 0, read);
}
fis.close();

os.flush();
os.close();
facesContext.responseComplete();
}
catch (Exception e)
{
if (log.isErrorEnabled())
{
log.error(DownloadComponent.class, e);
}
}
Doe a clastcastexception I changed the first line to:

HttpServletResponseWrapper response 
=(HttpServletResponseWrapper)FacesContext.getCurrentInstance().getExternalContext().getResponse();

But I get again a ClassCastException, what die I wrong:
2009-08-31 17:05:03,160 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] 
setRepository, 
repository=org.jboss.mx.loading.heirarchicalloaderreposito...@c93509, 
cl=org.jboss.mx.loading.heirarchicalloaderrepository3$cacheclassloa...@ddf0c3{ 
url=null ,addedOrder=0}
2009-08-31 17:05:03,160 ERROR 
[de.softcon.ivory.invserver.action.report.impl.CreateListOfAssetReportAction] 
class 
de.softcon.ivory.invserver.action.report.impl.CreateListOfAssetReportAction
java.lang.ClassCastException: 
org.jboss.portal.portlet.impl.jsr168.api.ActionResponseImpl cannot be cast to 
javax.servlet.http.HttpServletResponseWrapper
at 
de.softcon.ivory.invserver.action.report.DownloadComponent.download(DownloadComponent.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
at 
org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
at 
org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at 
org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at 
org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at 
org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
at 
org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
at 
org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
at 
de.softcon.ivory.invserver.action.report.DownloadComponent_$$_javassist_seam_36.download(DownloadComponent_$$_javassist_seam_36.java)
at 
de.softcon.ivory.invserver.action.report.impl.AbstractBaseReportAction.createReport(AbstractBaseReportAction.java:105)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
at 
org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
at 
org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
at 
org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at 
org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at 
org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
at 
or

[jboss-user] [JBoss Portal Users] - Re: different Funktionality for PortalBridge 1.0.0.B4 and CR

2009-08-27 Thread guenther.her...@softcon.de
This Problem is solved. I removed PortalIdentity.jar and download SEAM 
2.1.2.CR1 with this version I can use the old login of SEAM..

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4252082#4252082

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4252082
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Portal Users] - different Funktionality for PortalBridge 1.0.0.B4 and CR2 fo

2009-08-27 Thread guenther.her...@softcon.de
I found at http://www.infoq.com/articles/jsf-ajax-seam-portlets-pt-3 a 
description for PortalBridge Version B4 that you can use the Booking 
application with SSO and without. The booking app offered for Version CR2 does 
not describe the same functionality, I guess? I tried to install the B4 with 
given maven commands, without sucess because I got:
The plugin 'org.apache.maven.plugins:maven-cargo-plugin' does not exist or no 
valid version could be found

Are there any possibilities to use the old SEAM-Security and Logon 
functionality with CR2 as shown with B4?

Kind Regards

Günther Herndl

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4252038#4252038

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4252038

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Portal Users] - How to use

2009-08-27 Thread guenther.her...@softcon.de
PostPosted: Thu Aug 27, 2009 05:56 AMPost subject: How to 
use

In component.xml is via security defined how do deal with login and what to do. 
But via the PortletBridge I have to use SSO of JBoss Portal. I found the 
folowing coment:
public boolean authenticate()
{
//This code is not used in portal environment when utilitizing the 
PortalIdentity bridgelet.

To get the UserDate to have added instead:
@In
private Credentials credentials;


So I have to define all user and relates Roles via the AdminPart of the Portal. 
I tried to use the s.hasRole('') also via the PortalBridge but I allways 
got false. All SEAM DemoExamples offered for the Bridge do not use this hasRole 
Part. How is it possible to work with the Roles via the PortletBridge?

Kind Regards
Günther Herndl
softcon

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4252024#4252024

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4252024

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user