Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5345e25e
authored
Oct 24, 2012
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of codecrew.fi:bortal
2 parents
4aaf3008
d2632cb9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletions
code/LanBortalWeb/WebContent/card/massprint.xhtml
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/card/CardMassPrintView.java
code/LanBortalWeb/WebContent/card/massprint.xhtml
View file @
5345e25
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<h:form>
<h:form>
<p:commandButton
rendered=
"#{cardMassPrintView.file!=null}"
id=
"downloadLink"
value=
"Download"
ajax=
"false"
onclick=
"PrimeFaces.monitorDownload(start, stop)"
icon=
"ui-icon-arrowthichk-s"
>
<p:commandButton
rendered=
"#{cardMassPrintView.file!=null}"
id=
"downloadLink"
value=
"Download"
ajax=
"false"
onclick=
"PrimeFaces.monitorDownload(start, stop)"
icon=
"ui-icon-arrowthichk-s"
>
<p:fileDownload
value=
"#{cardMassPrintView.
f
ile}"
/>
<p:fileDownload
value=
"#{cardMassPrintView.
streamedF
ile}"
/>
</p:commandButton>
</p:commandButton>
</h:form>
</h:form>
</ui:define>
</ui:define>
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/card/CardMassPrintView.java
View file @
5345e25
...
@@ -8,6 +8,9 @@ import javax.faces.context.FacesContext;
...
@@ -8,6 +8,9 @@ import javax.faces.context.FacesContext;
import
javax.inject.Inject
;
import
javax.inject.Inject
;
import
javax.inject.Named
;
import
javax.inject.Named
;
import
org.primefaces.model.DefaultStreamedContent
;
import
org.primefaces.model.StreamedContent
;
import
fi.insomnia.bortal.beans.CardPrintBeanLocal
;
import
fi.insomnia.bortal.beans.CardPrintBeanLocal
;
import
fi.insomnia.bortal.model.EventUser
;
import
fi.insomnia.bortal.model.EventUser
;
import
fi.insomnia.bortal.web.cdiview.user.UserCartView
;
import
fi.insomnia.bortal.web.cdiview.user.UserCartView
;
...
@@ -29,6 +32,7 @@ public class CardMassPrintView implements Serializable {
...
@@ -29,6 +32,7 @@ public class CardMassPrintView implements Serializable {
@EJB
private
CardPrintBeanLocal
cardPrintBean
;
@EJB
private
CardPrintBeanLocal
cardPrintBean
;
private
File
file
;
private
File
file
;
private
StreamedContent
streamedFile
;
public
CardMassPrintView
()
{
public
CardMassPrintView
()
{
// TODO Auto-generated constructor stub
// TODO Auto-generated constructor stub
...
@@ -49,6 +53,8 @@ public class CardMassPrintView implements Serializable {
...
@@ -49,6 +53,8 @@ public class CardMassPrintView implements Serializable {
FileOutputStream
fostream
=
new
FileOutputStream
(
file
);
FileOutputStream
fostream
=
new
FileOutputStream
(
file
);
fostream
.
write
(
printout
);
fostream
.
write
(
printout
);
fostream
.
close
();
fostream
.
close
();
setStreamedFile
(
new
DefaultStreamedContent
(
new
FileInputStream
(
this
.
file
)));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
FacesContext
.
getCurrentInstance
().
addMessage
(
null
,
new
FacesMessage
(
e
.
getMessage
()));
FacesContext
.
getCurrentInstance
().
addMessage
(
null
,
new
FacesMessage
(
e
.
getMessage
()));
}
}
...
@@ -69,4 +75,12 @@ public class CardMassPrintView implements Serializable {
...
@@ -69,4 +75,12 @@ public class CardMassPrintView implements Serializable {
public
void
setFile
(
File
file
)
{
public
void
setFile
(
File
file
)
{
this
.
file
=
file
;
this
.
file
=
file
;
}
}
public
StreamedContent
getStreamedFile
()
{
return
streamedFile
;
}
public
void
setStreamedFile
(
StreamedContent
streamedFile
)
{
this
.
streamedFile
=
streamedFile
;
}
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment