Commit ca6d414f by unknown

Merge branch 'master' of dev.insomnia.fi:/data/bortal

Conflicts:
	code/LanBortalWeb/WebContent/actionlog/messagelist.xhtml
	code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_fi.properties
2 parents 064e8714 0c03330e
Showing with 291 additions and 158 deletions
eclipse.preferences.version=1
encoding/<project>=UTF-8
......@@ -38,6 +38,8 @@ package fi.insomnia.bortal;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.Set;
import javax.security.auth.login.LoginException;
......@@ -79,6 +81,9 @@ public class BortalLoginModule extends AppservPasswordLoginModule {
throw new LoginException("Realm not SampleRealm");
}
// find cert
log("Trying to find certificates");
RealmBeanRemote authbean = BortalRealm.getAuthBean();
if (authbean == null) {
throw new LoginException(
......@@ -105,14 +110,14 @@ public class BortalLoginModule extends AppservPasswordLoginModule {
} catch (InvalidOperationException invalidoperationexception) {
throw new LoginException(
(new StringBuilder())
.append("An InvalidOperationException was thrown "
).append(" while calling getGroupNames() on the SampleRealm ")
.append("An InvalidOperationException was thrown ")
.append(" while calling getGroupNames() on the SampleRealm ")
.append(invalidoperationexception).toString());
} catch (NoSuchUserException nosuchuserexception) {
throw new LoginException(
(new StringBuilder())
.append("A NoSuchUserException was thrown "
).append(" while calling getGroupNames() on the SampleRealm ")
.append("A NoSuchUserException was thrown ")
.append(" while calling getGroupNames() on the SampleRealm ")
.append(nosuchuserexception).toString());
}
ArrayList<String> authenticatedGroups = new ArrayList<String>();
......@@ -124,18 +129,18 @@ public class BortalLoginModule extends AppservPasswordLoginModule {
}
// Call commitUserAuthentication with the groupNames the user belongs to
String[] groups = authenticatedGroups.toArray(new String[authenticatedGroups.size()]);
String[] groups = authenticatedGroups
.toArray(new String[authenticatedGroups.size()]);
// System.out.println("groups: " + groups.length);
// for (String str : groups) {
// System.out.println("Str " + str);
// }
commitUserAuthentication(groups);
}
private void log(String s) {
System.out.println((new StringBuilder())
.append("BortalLoginModule::").append(s).toString());
System.out.println((new StringBuilder()).append("BortalLoginModule::")
.append(s).toString());
}
}
eclipse.preferences.version=1
encoding/<project>=UTF-8
package fi.insomnia.bortal.beans;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import javax.annotation.security.DeclareRoles;
......@@ -11,6 +8,9 @@ import javax.ejb.EJB;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fi.insomnia.bortal.enums.apps.BillPermission;
import fi.insomnia.bortal.enums.apps.MapPermission;
import fi.insomnia.bortal.enums.apps.PollPermission;
......@@ -19,7 +19,6 @@ import fi.insomnia.bortal.enums.apps.UserPermission;
import fi.insomnia.bortal.facade.MenuNavigationFacade;
import fi.insomnia.bortal.facade.MenuitemFacade;
import fi.insomnia.bortal.model.MenuNavigation;
import fi.insomnia.bortal.model.Menuitem;
/**
* Session Bean implementation class Menubean
......@@ -44,30 +43,36 @@ public class Menubean implements MenubeanLocal {
@EJB
private PermissionBeanLocal permbean;
private static final Logger logger = LoggerFactory.getLogger(Menubean.class);
@Override
public MenuNavigation getMenuNavigation(String url) {
return navifacade.find(url, eventbean.getCurrentEvent());
MenuNavigation ret = navifacade.find(url, eventbean.getCurrentEvent());
logger.warn("Children at bean: {}", ret.getChildren());
return ret;
}
@Override
public List<MenuNavigation> getTopnavigations() {
HashMap<Menuitem, MenuNavigation> ret = new HashMap<Menuitem, MenuNavigation>();
for (MenuNavigation navi : navifacade.findToplevels())
{
if ((navi.getEvent() == null && ret.containsKey(navi.getItem())))
continue;
ret.put(navi.getItem(), navi);
}
ArrayList<MenuNavigation> retlist = new ArrayList<MenuNavigation>(ret.values());
if (retlist.isEmpty())
{
initializeMenu();
}
Collections.sort(retlist);
return retlist;
return navifacade.findToplevels();
// HashMap<Menuitem, MenuNavigation> ret = new HashMap<Menuitem,
// MenuNavigation>();
//
// for (MenuNavigation navi : )
// {
//
// ret.put(navi.getItem(), navi);
// }
// ArrayList<MenuNavigation> retlist = new
// ArrayList<MenuNavigation>(ret.values());
// if (retlist.isEmpty())
// {
// initializeMenu();
// }
// logger.info("Returning topmenus: {}", retlist);
// Collections.sort(retlist);
// return retlist;
}
......
......@@ -120,7 +120,7 @@ public class MenuNavigationFacade extends GenericFacade<Integer, MenuNavigation>
Root<MenuNavigation> root = cq.from(MenuNavigation.class);
Path<LanEvent> eventpath = root.get(MenuNavigation_.event);
cq.where(cb.isNull(root.get(MenuNavigation_.parent)), cb.or(cb.equal(eventpath, eventbean.getCurrentEvent()), cb.isNull(eventpath)));
cq.where(cb.isNull(root.get(MenuNavigation_.parent)), cb.or(cb.equal(eventpath, eventbean.getCurrentEvent()), cb.isNull(eventpath)), cb.isTrue(root.get(MenuNavigation_.visible)));
return em.createQuery(cq).getResultList();
}
......
eclipse.preferences.version=1
encoding/<project>=UTF-8
Manifest-Version: 1.0
Class-Path: lib/LanBortalUtilities.jar
bcprov-jdk16-146.jar
bcmail-jdk16-146.jar
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.math.BigDecimal;
......@@ -22,6 +17,9 @@ import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
* Account event contains the money / credit traffic for the user. Each row
* references a Product entity.
......@@ -29,6 +27,7 @@ import javax.persistence.TemporalType;
@Entity
@Table(name = "account_events")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
// @NamedQueries({
// @NamedQuery(name = "AccountEvent.findAll", query =
// "SELECT a FROM AccountEvent a"),
......
......@@ -11,28 +11,31 @@ import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
import fi.insomnia.bortal.enums.ActionLogMessageState;
@Entity
@Table(name="actionlog_messages")
@Table(name = "actionlog_messages")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class ActionLogMessage extends GenericEntity {
private static final long serialVersionUID = -2902547412412000488L;
@Column(name="time", nullable=false)
@Column(name = "time", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date time = new Date();
@JoinColumn(name="user_id")
@JoinColumn(name = "user_id")
private User user;
@JoinColumn(name="crew", nullable=false)
@JoinColumn(name = "crew", nullable = false)
private Role crew;
@Column(name="message", nullable=false)
@Column(name = "message", nullable = false)
private String message;
@Column(name="state", nullable=true)
@Column(name = "state", nullable = true)
@Enumerated(EnumType.STRING)
private ActionLogMessageState state;
......@@ -76,5 +79,4 @@ public class ActionLogMessage extends GenericEntity {
this.state = state;
}
}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import javax.persistence.Column;
......@@ -12,15 +8,15 @@ import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
import fi.insomnia.bortal.enums.BortalApplication;
import fi.insomnia.bortal.enums.apps.IAppPermission;
/**
*
* @author jkj
*/
@Entity
@Table(name = "application_permissions", uniqueConstraints = { @UniqueConstraint(columnNames = { ApplicationPermission.ROLE_ID_COLUMN, ApplicationPermission.APPLICATION_COLUMN, ApplicationPermission.PERMISSION_COLUMN }) })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class ApplicationPermission extends GenericEntity {
protected static final String APPLICATION_PERMISSION_CONVERTER = "application_permission_perm_typeconverter";
......
......@@ -28,6 +28,8 @@ import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
import org.eclipse.persistence.annotations.PrivateOwned;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -47,6 +49,7 @@ import org.slf4j.LoggerFactory;
@NamedQuery(name = "Bill.findByPaidDate", query = "SELECT b FROM Bill b WHERE b.paidDate = :paidDate"),
@NamedQuery(name = "Bill.findByNotes", query = "SELECT b FROM Bill b WHERE b.notes = :notes"),
@NamedQuery(name = "Bill.findbiggestBillNumber", query = "SELECT max(b.billNumber) from Bill b where b.event = :event") })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class Bill extends GenericEventChild {
/**
......
......@@ -19,6 +19,9 @@ import javax.persistence.OneToOne;
import javax.persistence.OrderBy;
import javax.persistence.Table;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
*
*/
......@@ -31,6 +34,7 @@ import javax.persistence.Table;
@NamedQuery(name = "BillLine.findByQuantity", query = "SELECT b FROM BillLine b WHERE b.quantity = :quantity"),
@NamedQuery(name = "BillLine.findByUnitPrice", query = "SELECT b FROM BillLine b WHERE b.unitPrice = :unitPrice"),
@NamedQuery(name = "BillLine.findByVat", query = "SELECT b FROM BillLine b WHERE b.vat = :vat") })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class BillLine extends GenericEventChild {
private static final long serialVersionUID = 1L;
private static final BigDecimal DEFAULT_VAT = BigDecimal.ZERO;
......
......@@ -17,6 +17,9 @@ import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
* ID-card templates for the event.
*/
......@@ -25,6 +28,7 @@ import javax.persistence.Table;
@NamedQueries({
@NamedQuery(name = "CardTemplate.findAll", query = "SELECT c FROM CardTemplate c"),
@NamedQuery(name = "CardTemplate.findByName", query = "SELECT c FROM CardTemplate c WHERE c.name = :name") })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class CardTemplate extends GenericEntity {
private static final long serialVersionUID = -5754760238181167610L;
......
......@@ -19,6 +19,9 @@ import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
* Competition to be held at the event.
*/
......@@ -34,6 +37,7 @@ import javax.persistence.TemporalType;
@NamedQuery(name = "Compo.findBySubmitEnd", query = "SELECT c FROM Compo c WHERE c.submitEnd = :submitEnd"),
@NamedQuery(name = "Compo.findByHoldVoting", query = "SELECT c FROM Compo c WHERE c.holdVoting = :holdVoting"),
@NamedQuery(name = "Compo.findByDescription", query = "SELECT c FROM Compo c WHERE c.description = :description") })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class Compo extends GenericEventChild {
private static final long serialVersionUID = 1L;
......
......@@ -23,6 +23,8 @@ import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
import org.eclipse.persistence.annotations.PrivateOwned;
/**
......@@ -37,6 +39,7 @@ import org.eclipse.persistence.annotations.PrivateOwned;
@NamedQuery(name = "CompoEntry.findByNotes", query = "SELECT c FROM CompoEntry c WHERE c.notes = :notes"),
@NamedQuery(name = "CompoEntry.findByScreenMessage", query = "SELECT c FROM CompoEntry c WHERE c.screenMessage = :screenMessage"),
@NamedQuery(name = "CompoEntry.findBySort", query = "SELECT c FROM CompoEntry c WHERE c.sort = :sort") })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class CompoEntry extends GenericEventChild {
private static final long serialVersionUID = 1L;
......
......@@ -19,6 +19,9 @@ import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
*
*/
......@@ -31,6 +34,7 @@ import javax.persistence.TemporalType;
@NamedQuery(name = "CompoEntryFile.findByDescription", query = "SELECT c FROM CompoEntryFile c WHERE c.description = :description"),
@NamedQuery(name = "CompoEntryFile.findByHash", query = "SELECT c FROM CompoEntryFile c WHERE c.hash = :hash"),
@NamedQuery(name = "CompoEntryFile.findByUploaded", query = "SELECT c FROM CompoEntryFile c WHERE c.uploaded = :uploaded") })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class CompoEntryFile extends GenericEventChild {
private static final long serialVersionUID = 1L;
@Column(name = "mime_type")
......
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.util.Calendar;
......@@ -18,6 +13,9 @@ import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
*
*/
......@@ -27,6 +25,7 @@ import javax.persistence.TemporalType;
@NamedQuery(name = "CompoEntryParticipant.findAll", query = "SELECT c FROM CompoEntryParticipant c"),
@NamedQuery(name = "CompoEntryParticipant.findByRole", query = "SELECT c FROM CompoEntryParticipant c WHERE c.role = :role") })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class CompoEntryParticipant extends GenericEventChild {
private static final long serialVersionUID = 1L;
......
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.math.BigDecimal;
......
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import javax.persistence.Entity;
......@@ -12,12 +8,16 @@ import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
*
*/
@Entity
@Table(name = "discount_instances")
@NamedQueries({ @NamedQuery(name = "DiscountInstance.findAll", query = "SELECT d FROM DiscountInstance d") })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class DiscountInstance extends GenericEventChild {
/**
......
......@@ -6,7 +6,11 @@ import java.util.Random;
import javax.persistence.MappedSuperclass;
import javax.persistence.Transient;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
@MappedSuperclass
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public abstract class EntityEquals {
@Override
......
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.util.ArrayList;
......@@ -16,6 +12,9 @@ import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
*
*/
......@@ -25,6 +24,7 @@ import javax.persistence.Table;
// @NamedQuery(name = "EventMap.findAll", query = "SELECT e FROM EventMap e"),
// @NamedQuery(name = "EventMap.findByName", query =
// "SELECT e FROM EventMap e WHERE e.name = :name") })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class EventMap extends GenericEntity {
/**
......
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.util.List;
......@@ -15,11 +11,15 @@ import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
*
*/
@Entity
@Table(name = "event_organiser")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class EventOrganiser extends GenericEntity {
private static final long serialVersionUID = 1L;
......
......@@ -14,6 +14,9 @@ import javax.persistence.Enumerated;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
import fi.insomnia.bortal.enums.EventStatusEnum;
/**
......@@ -27,6 +30,7 @@ import fi.insomnia.bortal.enums.EventStatusEnum;
// "SELECT e FROM EventStatus e"),
// @NamedQuery(name = "EventStatus.findByStatusName", query =
// "SELECT e FROM EventStatus e WHERE e.name = :name") })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class EventStatus extends GenericEntity {
private static final long serialVersionUID = 1L;
......
......@@ -20,6 +20,9 @@ import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
*
*/
......@@ -32,6 +35,7 @@ import javax.persistence.TemporalType;
@NamedQuery(name = "FoodWave.findByDescription", query = "SELECT f FROM FoodWave f WHERE f.description = :description"),
@NamedQuery(name = "FoodWave.findByTime", query = "SELECT f FROM FoodWave f WHERE f.time = :time"),
@NamedQuery(name = "FoodWave.findByClosed", query = "SELECT f FROM FoodWave f WHERE f.closed = :closed") })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class FoodWave extends GenericEventChild {
/**
......
......@@ -15,6 +15,9 @@ import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
*
*/
......@@ -25,6 +28,7 @@ import javax.persistence.Table;
@NamedQuery(name = "FoodWaveTemplate.findByName", query = "SELECT f FROM FoodWaveTemplate f WHERE f.name = :name"),
@NamedQuery(name = "FoodWaveTemplate.findByDescription", query = "SELECT f FROM FoodWaveTemplate f WHERE f.description = :description") })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class FoodWaveTemplate extends GenericEventChild {
private static final long serialVersionUID = 1L;
......
......@@ -7,6 +7,8 @@ import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Version;
import org.eclipse.persistence.annotations.ReturnInsert;
import fi.insomnia.bortal.utilities.jpa.ModelInterface;
@MappedSuperclass
......@@ -17,23 +19,10 @@ public class GenericEntity extends EntityEquals implements ModelInterface<Intege
@Id
@Column(name = ID_COLUMN, nullable = false)
@ReturnInsert(returnOnly=true)
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Version
@Column(nullable = false)
private int jpaVersionField = 0;
@Override
public final int getJpaVersionField() {
return jpaVersionField;
}
@Override
public final void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
@Override
public final Integer getId() {
return id;
......
package fi.insomnia.bortal.model;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import javax.persistence.Version;
import fi.insomnia.bortal.utilities.jpa.ModelInterface;
......@@ -17,9 +15,6 @@ public abstract class GenericEventChild extends EntityEquals implements ModelInt
public static final String ID_COLUMN = "id";
@EmbeddedId
private EventPk id;
@Version
@Column(nullable = false)
private int jpaVersionField = 0;
public static final String EVENT_ID_COLUMN = "event_id";
@ManyToOne()
......@@ -49,16 +44,6 @@ public abstract class GenericEventChild extends EntityEquals implements ModelInt
this.id = id;
}
@Override
public final int getJpaVersionField() {
return jpaVersionField;
}
@Override
public final void setJpaVersionField(int jpaVersionField) {
this.jpaVersionField = jpaVersionField;
}
public final void setEvent(LanEvent event) {
this.event = event;
}
......
......@@ -18,6 +18,9 @@ import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
*
*/
......@@ -34,6 +37,7 @@ import javax.persistence.UniqueConstraint;
// "SELECT g FROM GroupMembership g WHERE g.inviteEmail = :inviteEmail"),
// @NamedQuery(name = "GroupMembership.findByInviteName", query =
// "SELECT g FROM GroupMembership g WHERE g.inviteName = :inviteName") })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class GroupMembership extends GenericEntity {
private static final long serialVersionUID = 1L;
......
......@@ -18,6 +18,9 @@ import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
*
*/
......@@ -31,6 +34,7 @@ import javax.persistence.TemporalType;
// "SELECT e FROM LanEvent e WHERE e.endTime = :endTime"),
// @NamedQuery(name = "LanEvent.findByName", query =
// "SELECT e FROM LanEvent e WHERE e.name = :name") })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class LanEvent extends GenericEntity {
/**
......
......@@ -13,6 +13,9 @@ import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
*
*/
......@@ -23,6 +26,7 @@ import javax.persistence.Table;
//
// @NamedQuery(name = "Location.findByLocationName", query =
// "SELECT l FROM Location l WHERE l.name = :name") })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class Location extends GenericEntity {
private static final long serialVersionUID = 1L;
......
......@@ -18,6 +18,9 @@ import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
*
*/
......@@ -27,6 +30,7 @@ import javax.persistence.Temporal;
@NamedQuery(name = "LogEntry.findAll", query = "SELECT l FROM LogEntry l"),
@NamedQuery(name = "LogEntry.findByTime", query = "SELECT l FROM LogEntry l WHERE l.time = :time"),
@NamedQuery(name = "LogEntry.findByDescription", query = "SELECT l FROM LogEntry l WHERE l.description = :description") })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class LogEntry extends GenericEntity {
private static final long serialVersionUID = 1L;
......
......@@ -15,6 +15,9 @@ import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
*
*/
......@@ -26,6 +29,7 @@ import javax.persistence.Table;
@NamedQuery(name = "LogEntryType.findAll", query = "SELECT l FROM LogEntryType l"),
@NamedQuery(name = "LogEntryType.findByName", query = "SELECT l FROM LogEntryType l WHERE l.name = :name"),
@NamedQuery(name = "LogEntryType.findByDescription", query = "SELECT l FROM LogEntryType l WHERE l.description = :description") })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class LogEntryType extends GenericEntity {
private static final long serialVersionUID = 1L;
......
......@@ -8,6 +8,7 @@ import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
......@@ -16,6 +17,8 @@ import javax.persistence.OrderBy;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
import org.eclipse.persistence.annotations.PrivateOwned;
import fi.insomnia.bortal.enums.BortalApplication;
......@@ -25,6 +28,7 @@ import fi.insomnia.bortal.enums.apps.IAppPermission;
@Table(name = "menu_navigation")
// uniqueConstraints = { @UniqueConstraint(columnNames = {
// MenuNavigation.ITEM_COLUMN, MenuNavigation.EVENT_COLUMN }) })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class MenuNavigation extends GenericEntity implements Comparable<MenuNavigation> {
private static final long serialVersionUID = 1404769998091479699L;
......@@ -60,10 +64,10 @@ public class MenuNavigation extends GenericEntity implements Comparable<MenuNavi
@JoinColumn(nullable = true)
private MenuNavigation parent;
@OneToMany(mappedBy = "parent", cascade = ALL)
@OneToMany(mappedBy = "parent", cascade = ALL, fetch = FetchType.EAGER)
@PrivateOwned
@OrderBy("sort")
private List<MenuNavigation> children;
private List<MenuNavigation> children = new ArrayList<MenuNavigation>();
@Transient
transient private IAppPermission privatePerm;
......
......@@ -9,10 +9,13 @@ import javax.persistence.Lob;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
import org.eclipse.persistence.annotations.PrivateOwned;
@Entity
@Table(name = "menuitem")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class Menuitem extends GenericEntity {
private static final long serialVersionUID = -3544095800802935237L;
......
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.util.Date;
......@@ -15,12 +11,16 @@ import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
*
* @author jkj
*/
@Entity
@Table(name = "news")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class News extends GenericEntity {
private static final long serialVersionUID = 498925968565236275L;
......
......@@ -18,6 +18,8 @@ import javax.persistence.OrderBy;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
import org.eclipse.persistence.annotations.PrivateOwned;
/**
......@@ -26,6 +28,7 @@ import org.eclipse.persistence.annotations.PrivateOwned;
*/
@Entity
@Table(name = "news_groups", uniqueConstraints = @UniqueConstraint(columnNames = { "event_id", "group_name" }))
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class NewsGroup extends GenericEntity {
/**
......
......@@ -11,8 +11,12 @@ import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
@Entity
@Table(name = "site_page_content")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class PageContent extends GenericEntity {
private static final long serialVersionUID = 8359021214886290522L;
......
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.util.Calendar;
......@@ -17,6 +13,9 @@ import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
*
*/
......@@ -36,6 +35,7 @@ import javax.persistence.TemporalType;
// "SELECT p FROM Place p WHERE p.details = :details"),
// @NamedQuery(name = "Place.findByCode", query =
// "SELECT p FROM Place p WHERE p.code = :code") })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class Place extends GenericEntity {
/**
......
......@@ -22,6 +22,9 @@ import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
*
*/
......@@ -37,6 +40,7 @@ import javax.persistence.TemporalType;
@NamedQuery(name = "PlaceGroup.findByName", query = "SELECT p FROM PlaceGroup p WHERE p.name = :name"),
@NamedQuery(name = "PlaceGroup.findByActive", query = "SELECT p FROM PlaceGroup p WHERE p.active = :active"),
@NamedQuery(name = "PlaceGroup.findByDetails", query = "SELECT p FROM PlaceGroup p WHERE p.details = :details") })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class PlaceGroup extends GenericEntity {
private static final long serialVersionUID = 1L;
......
......@@ -18,12 +18,16 @@ import javax.persistence.OrderBy;
import javax.persistence.Table;
import javax.persistence.Temporal;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
* Entity implementation class for Entity: Poll
*
*/
@Entity
@Table(name = "poll")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class Poll extends GenericEntity {
/**
......
......@@ -9,8 +9,12 @@ import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
@Entity
@Table(name = "poll_answer")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class PollAnswer extends GenericEntity implements Serializable {
/**
......
......@@ -12,8 +12,12 @@ import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
@Entity
@Table(name = "poll_question")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class PollQuestion extends GenericEntity {
public PollQuestion() {
......
......@@ -11,8 +11,12 @@ import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
@Entity
@Table(name = "possible_answer")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class PossibleAnswer extends GenericEntity {
public PossibleAnswer() {
......
......@@ -23,6 +23,9 @@ import javax.persistence.TemporalType;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
*
*/
......@@ -40,6 +43,7 @@ import javax.persistence.UniqueConstraint;
// "SELECT p FROM PrintedCard p WHERE p.enabled = :enabled"),
// @NamedQuery(name = "PrintedCard.findByRfidUid", query =
// "SELECT p FROM PrintedCard p WHERE p.rfidUid = :rfidUid") })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class PrintedCard extends GenericEntity {
/**
......
......@@ -19,6 +19,9 @@ import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
*
*/
......@@ -34,6 +37,7 @@ import javax.persistence.UniqueConstraint;
// "SELECT p FROM Product p WHERE p.sort = :sort"),
// @NamedQuery(name = "Product.findByBarcode", query =
// "SELECT p FROM Product p WHERE p.barcode = :barcode") })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class Product extends GenericEntity {
private static final long serialVersionUID = 1L;
......
......@@ -16,6 +16,9 @@ import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
*
*/
......@@ -28,6 +31,7 @@ import javax.persistence.UniqueConstraint;
// "SELECT r FROM Reader r WHERE r.identification = :identification"),
// @NamedQuery(name = "Reader.findByDescription", query =
// "SELECT r FROM Reader r WHERE r.description = :description") })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class Reader extends GenericEntity {
public Reader(LanEvent ev, String ident) {
......
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import static javax.persistence.CascadeType.ALL;
......@@ -16,11 +12,15 @@ import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
*
*/
@Entity
@Table(name = "reader_events")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class ReaderEvent extends GenericEntity {
private static final long serialVersionUID = 1L;
......
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.util.ArrayList;
......@@ -17,6 +13,8 @@ import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
import org.eclipse.persistence.annotations.PrivateOwned;
/**
......@@ -24,6 +22,7 @@ import org.eclipse.persistence.annotations.PrivateOwned;
*/
@Entity
@Table(name = "roles", uniqueConstraints = { @UniqueConstraint(columnNames = { Role.EVENT_ID_COLUMN, Role.NAME_COLUMN }) })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class Role extends GenericEntity {
private static final long serialVersionUID = -4602863502464505404L;
......
......@@ -12,10 +12,13 @@ import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
import org.eclipse.persistence.annotations.PrivateOwned;
@Entity
@Table(name = "site_pages", uniqueConstraints = @UniqueConstraint(columnNames = { "event_id", "name" }))
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class SitePage extends GenericEntity {
private static final long serialVersionUID = -4333555423866132524L;
......
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import static javax.persistence.CascadeType.ALL;
......@@ -30,6 +26,8 @@ import javax.persistence.TemporalType;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
import org.eclipse.persistence.annotations.PrivateOwned;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -42,6 +40,7 @@ import fi.insomnia.bortal.utilities.PasswordFunctions;
*/
@Entity
@Table(name = "users")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class User extends GenericEntity {
public static final String ANONYMOUS_LOGINNAME = "anonymous";
private static final long serialVersionUID = -1632200627103418206L;
......
......@@ -16,11 +16,15 @@ import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
*
*/
@Entity
@Table(name = "user_images")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
// @NamedQueries({
// @NamedQuery(name = "UserImage.findAll", query = "SELECT u FROM UserImage u"),
//
......
......@@ -18,6 +18,9 @@ import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
* A vote for a compo entry
*/
......@@ -27,6 +30,7 @@ import javax.persistence.UniqueConstraint;
@NamedQuery(name = "Vote.findAll", query = "SELECT v FROM Vote v"),
@NamedQuery(name = "Vote.findByScore", query = "SELECT v FROM Vote v WHERE v.score = :score"),
@NamedQuery(name = "Vote.findByTime", query = "SELECT v FROM Vote v WHERE v.time = :time") })
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class Vote extends GenericEventChild {
private static final long serialVersionUID = 1L;
......
......@@ -7,9 +7,4 @@ public interface ModelInterface<T extends Serializable> extends Serializable {
T getId();
void setId(T id);
int getJpaVersionField();
void setJpaVersionField(int jpaVersionField);
}
eclipse.preferences.version=1
encoding/<project>=UTF-8
......@@ -114,6 +114,9 @@
<auth-constraint>
<description>Thou shall not read the sources or use utils directly</description>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<servlet>
<description></description>
......
......@@ -4,6 +4,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html" xmlns:users="http://java.sun.com/jsf/composite/cditools/user"
xmlns:tools="http://java.sun.com/jsf/composite/cditools" xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
>
<h:body>
......@@ -45,6 +46,8 @@
<div class="clearfix"></div>
<h2>#{i18n['actionlog.tasklist.header']}</h2>
<div id="actionlog">
<h:form id="refresh">
<p:poll interval="1" update="actionlogtable" />
<h:dataTable styleClass="bordertable" rowClasses="roweven,rowodd" id="actionlogtable" value="#{actionLogMessageView.messages}" var="message">
<h:column>
<f:facet name="header">
......@@ -52,7 +55,6 @@
</f:facet>
<h:outputText value="#{message.time}">
<f:convertDateTime type="both" pattern="dd.MM.yyyy HH:mm" />
<!-- <f:convertDateTime type="both" dateStyle="HH:mm" /> -->
</h:outputText>
</h:column>
<h:column>
......@@ -75,13 +77,12 @@
<h:outputText value="#{message.message}" />
</h:column>
<h:column>
<h:link rendered="#{!empty message.state}" >
Näytä tehtävä
</h:link>
</h:column>
</h:dataTable>
</h:form>
</div>
</ui:define>
</ui:composition>
......
......@@ -43,11 +43,6 @@
</div>
<div id="container" class="top" />
<div id="container" class="clearfix">
<div id="left">
<ui:insert name="title" />
<h:messages globalOnly="true" />
<ui:insert name="content" />
</div>
<c:if test="#{menuView.submenu.size() > 1}">
<div id="right">
......@@ -61,6 +56,12 @@
</ul>
</div>
</c:if>
<div id="left">
<ui:insert name="title" />
<h:messages globalOnly="true" />
<ui:insert name="content" />
</div>
</div>
<div id="container" class="bottom"></div>
</div>
......
......@@ -4,7 +4,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:news="http://java.sun.com/jsf/composite/cditools/news" xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:p="http://primefaces.org/ui"
>
<h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
......
......@@ -4,7 +4,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:news="http://java.sun.com/jsf/composite/cditools/news" xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:p="http://primefaces.org/ui"
>
<h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
......
......@@ -4,7 +4,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:poll="http://java.sun.com/jsf/composite/cditools/poll" xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:p="http://primefaces.org/ui"
>
<h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
......
......@@ -4,7 +4,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:poll="http://java.sun.com/jsf/composite/cditools/poll" xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:p="http://primefaces.org/ui"
>
<h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
......
......@@ -4,7 +4,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:p="http://primefaces.org/ui"
>
......
......@@ -14,11 +14,11 @@ body, html {width: 100%; height: 100%; color: #343434; font-family: trebuchet m
a {color: #0037bc;}
a:hover {color: #7dac0c;}
#container {width: 100%; background:url(../img/container.png) repeat-y; font-size: 13px;}
#container #left {width: 680px; float: left; padding: 10px 20px;}
#container #left {padding: 10px 20px;}
#left h1 {color:#7dac0c; font-size: 24px; padding-top:0px; margin-top: 0px;}
#left h2 {color:#7dac0c; font-size: 18px;}
#left h3 {color:#7dac0c; font-size: 16px;}
#right {float:left; border-left: 1px dotted #c0c0c0; padding: 10px 20px; width: 200px;}
#right {float:right; border-left: 1px dotted #c0c0c0; padding: 10px 20px; width: 200px;}
#right h1, #right h1 a {color:#7dac0c; font-size: 18px; padding-top: 0px; margin-top:0px; text-decoration:none;}
#container.top {width: 100%; background:url(../img/container-top.png) no-repeat; height: 15px;}
......
......@@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html" xmlns:users="http://java.sun.com/jsf/composite/tools/user"
xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui"
>
<h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
......
......@@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:p="http://primefaces.org/ui"
xmlns:users="http://java.sun.com/jsf/composite/cditools/user"
xmlns:shop="http://java.sun.com/jsf/composite/cditools/shop"
>
......
......@@ -15,9 +15,19 @@ import fi.insomnia.bortal.web.cdiview.GenericCDIView;
public class ActionLogMessageView extends GenericCDIView {
private static final long serialVersionUID = 1L;
private boolean updateEnabled = true;
@EJB
private ActionLogBeanLocal actionLogBean;
public boolean getUpdateEnabled() {
return updateEnabled;
}
public void setUpdateEnabled(boolean updateEnabled) {
this.updateEnabled = updateEnabled;
}
public List<ActionLogMessage> getMessages() {
return actionLogBean.getAllActionLogEvents();
}
......
......@@ -23,6 +23,15 @@ public class JsfMenuitem {
// item = new Menuitem("/page/?id=" + sitepage.getId(), null, null);
// text = sitepage.getName();
// }
public String hetFooter()
{
return navigation.getFooter();
}
public String getHeader()
{
return navigation.getHeader();
}
public void setSelected() {
selected = true;
......
......@@ -25,7 +25,6 @@ public class MenuView {
private String pagename;
private List<JsfMenuitem> submenu;
private List<JsfMenuitem> topmenu;
private MenuNavigation currentPage;
@Inject
private FacesContext context;
......@@ -37,6 +36,7 @@ public class MenuView {
@EJB
private SitePageBeanLocal sitepagebean;
private ArrayList<MenuNavigation> menupath;
private static final Logger logger = LoggerFactory.getLogger(MenuView.class);
public String getPagename() {
......@@ -54,18 +54,26 @@ public class MenuView {
{
if (submenu == null)
{
getTopmenu();
MenuNavigation topPage = menupath.get(menupath.size() - 1);
submenu = new ArrayList<JsfMenuitem>();
for (MenuNavigation item : menubean.getMenuNavigation(getPagename()).getChildren()) {
if (permbean.hasPermission(item.getPermission())) {
JsfMenuitem thisitem = new JsfMenuitem(item);
for (MenuNavigation navi : topPage.getChildren()) {
logger.info("Trying to add item {}", navi.getKey());
if (permbean.hasPermission(navi.getPermission())) {
JsfMenuitem thisitem = new JsfMenuitem(navi);
submenu.add(thisitem);
if (currentPage.equals(item)) {
if (menupath.contains(navi)) {
thisitem.setSelected();
}
}
}
logger.info("Initialized submenu {}", submenu);
}
return submenu;
}
......@@ -77,14 +85,21 @@ public class MenuView {
// if there are no results!
List<MenuNavigation> menuitems = menubean.getTopnavigations();
currentPage = menubean.getMenuNavigation(getPagename());
MenuNavigation topPage = currentPage;
while (topPage.getParent() != null)
menupath = new ArrayList<MenuNavigation>();
MenuNavigation currentPage = menubean.getMenuNavigation(getPagename());
while (currentPage != null)
{
topPage = topPage.getParent();
menupath.add(currentPage);
currentPage = currentPage.getParent();
}
for (MenuNavigation m : menuitems) {
if (m.getPermission() != null && !permbean.hasPermission(m.getPermission()))
{
continue;
}
JsfMenuitem thisitem = new JsfMenuitem(m);
if (m.getItem() == null && m.getSitepage() == null)
{
......@@ -99,12 +114,11 @@ public class MenuView {
}
}
logger.info("Trying to add topmenu {}", m.getKey());
if (thisitem.getOutcome() != null)
{
topmenu.add(thisitem);
if (m.equals(topPage)) {
if (menupath.contains(m)) {
thisitem.setSelected();
}
}
......
eclipse.preferences.version=1
encoding/<project>=UTF-8
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!