Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Linnea Samila
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c0260079
authored
Dec 04, 2014
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add width and height for map svg
1 parent
ae1af53c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
9 deletions
code/moya-web/WebContent/place/map.xhtml
code/moya-web/WebContent/resources/cditools/map/edit.xhtml
code/moya-web/src/main/java/fi/codecrew/moya/web/cdiview/map/AjaxMapView.java
code/moya-web/WebContent/place/map.xhtml
View file @
c026007
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
<h:outputScript
target=
"head"
library=
"seatjs"
name=
"seatmap.js"
/>
<h:outputScript
target=
"head"
library=
"seatjs"
name=
"seatmap.js"
/>
<h:outputStylesheet
library=
"seatjs"
name=
"placemap.css"
/>
<h:outputStylesheet
library=
"seatjs"
name=
"placemap.css"
/>
<svg
id=
"seatmap"
style=
"margin: auto; border: 1px solid black;"
<svg
id=
"seatmap"
style=
"margin: auto; border: 1px solid black;"
width=
"
1200px"
height=
"800
px"
/>
width=
"
#{ajaxMapView.map.width}px"
height=
"#{ajaxMapView.map.width}
px"
/>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
px
=
placemap
({
px
=
placemap
({
element
:
document
.
getElementById
(
"seatmap"
),
element
:
document
.
getElementById
(
"seatmap"
),
...
...
code/moya-web/WebContent/resources/cditools/map/edit.xhtml
View file @
c026007
...
@@ -19,8 +19,16 @@
...
@@ -19,8 +19,16 @@
<h:panelGrid
columns=
"2"
>
<h:panelGrid
columns=
"2"
>
<h:outputLabel
value=
"#{i18n['eventmap.name']}:"
/>
<h:outputLabel
value=
"#{i18n['eventmap.name']}:"
/>
<h:inputText
value=
"#{mapManageView.map.name}"
/>
<h:inputText
value=
"#{mapManageView.map.name}"
/>
<h:outputLabel
value=
"#{i18n['eventmap.width']}:"
/>
<h:inputText
value=
"#{mapManageView.map.width}"
/>
<h:outputLabel
value=
"#{i18n['eventmap.height']}:"
/>
<h:inputText
value=
"#{mapManageView.map.height}"
/>
<h:outputLabel
value=
"#{i18n['eventmap.notes']}:"
/>
<h:outputLabel
value=
"#{i18n['eventmap.notes']}:"
/>
<h:inputTextarea
cols=
"40"
rows=
"5"
value=
"#{mapManageView.map.notes}"
/>
<h:inputTextarea
cols=
"40"
rows=
"5"
value=
"#{mapManageView.map.notes}"
/>
<h:outputLabel
value=
"#{i18n['eventmap.active']}:"
/>
<h:outputLabel
value=
"#{i18n['eventmap.active']}:"
/>
<h:selectBooleanCheckbox
value=
"#{mapManageView.map.active}"
/>
<h:selectBooleanCheckbox
value=
"#{mapManageView.map.active}"
/>
...
...
code/moya-web/src/main/java/fi/codecrew/moya/web/cdiview/map/AjaxMapView.java
View file @
c026007
package
fi
.
codecrew
.
moya
.
web
.
cdiview
.
map
;
package
fi
.
codecrew
.
moya
.
web
.
cdiview
.
map
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
javax.ejb.EJB
;
import
javax.ejb.EJB
;
...
@@ -13,6 +14,7 @@ import org.slf4j.LoggerFactory;
...
@@ -13,6 +14,7 @@ import org.slf4j.LoggerFactory;
import
fi.codecrew.moya.beans.EventBeanLocal
;
import
fi.codecrew.moya.beans.EventBeanLocal
;
import
fi.codecrew.moya.beans.PlaceBeanLocal
;
import
fi.codecrew.moya.beans.PlaceBeanLocal
;
import
fi.codecrew.moya.enums.apps.MapPermission
;
import
fi.codecrew.moya.model.EventMap
;
import
fi.codecrew.moya.model.EventMap
;
import
fi.codecrew.moya.model.LanEvent
;
import
fi.codecrew.moya.model.LanEvent
;
import
fi.codecrew.moya.model.Place
;
import
fi.codecrew.moya.model.Place
;
...
@@ -22,30 +24,63 @@ import fi.codecrew.moya.web.cdiview.GenericCDIView;
...
@@ -22,30 +24,63 @@ import fi.codecrew.moya.web.cdiview.GenericCDIView;
@ConversationScoped
@ConversationScoped
public
class
AjaxMapView
extends
GenericCDIView
{
public
class
AjaxMapView
extends
GenericCDIView
{
/**
*
*/
private
static
final
long
serialVersionUID
=
8203589456357519480L
;
@Inject
@Inject
private
PlaceView
placeview
;
private
PlaceView
placeview
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AjaxMapView
.
class
);;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AjaxMapView
.
class
);;
private
String
testVal
=
"Testval1"
;
private
String
testVal
=
"Testval1"
;
@EJB
@EJB
private
EventBeanLocal
eventbean
;
private
transient
EventBeanLocal
eventbean
;
@EJB
@EJB
private
PlaceBeanLocal
placebean
;
private
transient
PlaceBeanLocal
placebean
;
@Inject
private
transient
FacesContext
context
;
private
EventMap
map
;
private
EventMap
map
;
private
Place
place
;
private
Place
place
;
private
Integer
mapId
;
public
void
initReserveMap
()
{
initMap
();
map
=
placebean
.
findMap
(
mapId
);
}
public
void
initMap
()
{
public
void
initViewMap
()
{
LanEvent
e
=
eventbean
.
getCurrentEvent
();
initMap
();
setMap
(
e
.
getEventMaps
().
get
(
0
));
}
private
void
initMap
()
{
if
(
mapId
!=
null
)
{
map
=
placebean
.
findMap
(
mapId
);
}
if
(
map
==
null
)
{
List
<
EventMap
>
maps
=
placebean
.
getMaps
();
if
(
maps
!=
null
&&
!
maps
.
isEmpty
())
{
for
(
EventMap
m
:
maps
)
{
if
(
m
.
isActive
())
{
this
.
map
=
m
;
break
;
}
}
}
}
}
public
boolean
isMgmtPermission
()
{
return
permbean
.
hasPermission
(
MapPermission
.
MANAGE_OTHERS
);
}
}
public
void
placeClicked
()
public
void
placeClicked
()
{
{
FacesContext
context
=
FacesContext
.
getCurrentInstance
();
Map
<
String
,
String
>
vmap
=
context
.
getExternalContext
().
getRequestParameterMap
();
logger
.
info
(
"placeid {}"
,
vmap
.
get
(
"pl aceId"
));
Map
<
String
,
String
>
vmap
=
context
.
getExternalContext
().
getRequestParameterMap
();
int
placeId
=
Integer
.
parseInt
(
vmap
.
get
(
"placeId"
));
int
placeId
=
Integer
.
parseInt
(
vmap
.
get
(
"placeId"
));
place
=
placebean
.
find
(
placeId
);
place
=
placebean
.
find
(
placeId
);
logger
.
info
(
"Found place {} with placeid {}"
,
place
,
placeId
);
logger
.
info
(
"Found place {} with placeid {}"
,
place
,
placeId
);
...
@@ -74,4 +109,12 @@ public class AjaxMapView extends GenericCDIView {
...
@@ -74,4 +109,12 @@ public class AjaxMapView extends GenericCDIView {
public
void
setPlace
(
Place
place
)
{
public
void
setPlace
(
Place
place
)
{
this
.
place
=
place
;
this
.
place
=
place
;
}
}
public
FacesContext
getContext
()
{
return
context
;
}
public
void
setContext
(
FacesContext
context
)
{
this
.
context
=
context
;
}
}
}
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