parent
e0cd6f12fc
commit
ad6d3083de
@ -1,8 +1,4 @@
|
||||
.idea/*
|
||||
target/*
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
*.war
|
||||
>>>>>>> 21f7771889fbd331d8067aeaacba276c2ab841e7
|
||||
target/RotanaReg.war
|
||||
com.rotanareg.skolan.iml
|
||||
target/RotanaReg.war
|
@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="web" name="Web">
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
|
||||
</descriptors>
|
||||
<webroots>
|
||||
<root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
|
||||
</webroots>
|
||||
</configuration>
|
||||
</facet>
|
||||
<facet type="jpa" name="JPA">
|
||||
<configuration>
|
||||
<setting name="validation-enabled" value="true" />
|
||||
<setting name="provider-name" value="" />
|
||||
<datasource-mapping>
|
||||
<factory-entry name="Persistence-unit" />
|
||||
</datasource-mapping>
|
||||
<deploymentDescriptor name="persistence.xml" url="file://$MODULE_DIR$/src/main/resources/META-INF/persistence.xml" />
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Maven: javax:javaee-api:7.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.sun.mail:javax.mail:1.5.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.primefaces:primefaces:6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.eclipse.persistence:org.eclipse.persistence.jpa:2.6.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.eclipse.persistence:javax.persistence:2.1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.eclipse.persistence:org.eclipse.persistence.asm:2.6.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.eclipse.persistence:org.eclipse.persistence.antlr:2.6.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.glassfish:javax.json:1.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.eclipse.persistence:org.eclipse.persistence.jpa.jpql:2.6.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.eclipse.persistence:org.eclipse.persistence.core:2.6.4" level="project" />
|
||||
</component>
|
||||
</module>
|
@ -1,20 +0,0 @@
|
||||
package ejb;
|
||||
|
||||
import domain.CourseDomain;
|
||||
|
||||
import javax.ejb.Local;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Solidbeans on 2017-03-20.
|
||||
*/
|
||||
@Local
|
||||
public interface CourseService {
|
||||
|
||||
void addCourse(CourseDomain course);
|
||||
void updateCourse(CourseDomain course);
|
||||
void removeCourse(Long id);
|
||||
CourseDomain getCourse(Long id);
|
||||
List<CourseDomain> getCourses();
|
||||
public List<CourseDomain> getCoursesContaining(String filter);
|
||||
}
|
@ -1,69 +0,0 @@
|
||||
package ejb;
|
||||
|
||||
import domain.CourseDomain;
|
||||
import jpa.Course;
|
||||
|
||||
import javax.ejb.Stateless;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Created by Solidbeans on 2017-03-20.
|
||||
*/
|
||||
|
||||
@Stateless
|
||||
public class CourseServiceImpl implements CourseService{
|
||||
@PersistenceContext
|
||||
EntityManager em;
|
||||
|
||||
@Override
|
||||
public void addCourse(CourseDomain course) {
|
||||
Course c = new Course(course.getName(),course.getDescription(),course.getCourseNr());
|
||||
em.persist(c);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCourse(CourseDomain course) {
|
||||
Course c = em.find(Course.class,course.getId());
|
||||
c.setName(course.getName());
|
||||
c.setDescription(course.getDescription());
|
||||
c.setCourseNr(course.getCourseNr());
|
||||
em.merge(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeCourse(Long id) {
|
||||
Course c = em.find(Course.class, id);
|
||||
em.remove(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CourseDomain getCourse(Long id) {
|
||||
Course c = em.find(Course.class,id);
|
||||
CourseDomain cd = new CourseDomain(c.getId(),c.getName(),c.getDescription(),c.getCourseNr());
|
||||
|
||||
return cd;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CourseDomain> getCourses() {
|
||||
List<Course> courseList = em.createNamedQuery("selectAll").getResultList();
|
||||
|
||||
return courseList.stream().
|
||||
map(c->new CourseDomain(c.getId(),c.getName(),c.getDescription(),c.getCourseNr())).
|
||||
collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CourseDomain> getCoursesContaining(String filter) {
|
||||
List<Course> courseList = em.createNamedQuery("selectSome").setParameter("filt",filter).getResultList();
|
||||
|
||||
return courseList.stream().
|
||||
map(c->new CourseDomain(c.getId(),c.getName(),c.getDescription(),c.getCourseNr())).
|
||||
collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
package com.rotanareg.skolan.course;
|
||||
import java.io.Serializable;
|
||||
|
||||
public final class Course implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final long id;
|
||||
private final String name;
|
||||
private final String description;
|
||||
|
||||
public Course (long id, String name, String description){
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
}
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
package com.rotanareg.skolan.course;
|
||||
|
||||
import javax.faces.view.ViewScoped;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Named
|
||||
@ViewScoped
|
||||
public class CourseDetails implements Serializable{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Inject
|
||||
private CourseService courseService;
|
||||
|
||||
private long courseId;
|
||||
|
||||
private Course course;
|
||||
|
||||
public long getCourseId() {
|
||||
return courseId;
|
||||
}
|
||||
|
||||
public void setCourseId(long courseId) {
|
||||
this.courseId = courseId;
|
||||
}
|
||||
|
||||
public void onload() {
|
||||
course = courseService.getCourse(courseId);
|
||||
}
|
||||
|
||||
//public course getCourse() {
|
||||
// return course;
|
||||
//}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
package com.rotanareg.skolan.course;
|
||||
import java.util.List;
|
||||
|
||||
public interface CourseService {
|
||||
List<Course> getMostStudiedCourses ();
|
||||
Course getCourse (long id);
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
package com.rotanareg.skolan.course;
|
||||
|
||||
import javax.enterprise.context.ApplicationScoped;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ApplicationScoped
|
||||
public class CourseServiceImpl implements CourseService {
|
||||
|
||||
private final Map<Long, Course> courses;
|
||||
|
||||
private final List<Course> mostStudiedCourses;
|
||||
|
||||
public CourseServiceImpl (){
|
||||
Map<Long, Course> map = new HashMap<>();
|
||||
map.put(1L, new Course(1L,"Design och konstruktion av grafiska gränssnitt","Kursen innehåller en genomgång av standardklasserna i ett välutvecklat grafiskt bibliotek, en översikt över vilka riktlinjer som krävs för att skapa lättanvända gränssnitt samt metoder för att iterativt utveckla och förbättra ett gränssnitt. Kursen ger praktisk erfarenhet i implementering samt användbarhet genom ett grupprojekt som ger en fördjupning av delmomentet kring grafiska komponenter från kursen Objektorienterad programvaruutveckling. Projektets mål är att utveckla en applikation för en specifik användargrupp och att genom att låta dessa testa programmet iterativt förbättra det."));
|
||||
map.put(2L, new Course(2L," Objektorienterad programmering","Grundläggande begrepp i objektorienterad programutveckling. Vad som skiljer det objektorienterade synsättet från andra synsätt.I kursen används programspråket Java. Momenten så som objekt och klass, datainkapsling,konstruktorer, metoder, instansvariabler, klassvariabler behandals men även modularisering av program, användning av dokumentation för standardbibliotek, användning av standardklasser för datasamlingar samt kodningsstandard, namnsättning och kommentering. Testning av program också ingår i kursen och det behandlas även arv, dynamisk bindning och polymorfism, abstrakta klasser och gränssnitt, grafiska användargränssnitt, händelser och lyssnare."));
|
||||
map.put(3L, new Course(3L,"Datastrukturer","Abstrakta datatyper. Enkel komplexitetsanalys. Vanliga datastrukturer som fält, listor, träd och hashtabeller samt hur dessa kan användas för att implementera abstrakta datatyper som köer, prioritetsköer, lexika och grafer. Standardalgoritmer för dessa datastrukturer och deras resurskrav. Iteratorer. Sorteringsalgoritmer. Standardbibliotek för datastrukturer och algoritmer."));
|
||||
|
||||
courses =Collections.unmodifiableMap(map);
|
||||
mostStudiedCourses = Collections.unmodifiableList(new ArrayList<>(courses.values()));
|
||||
|
||||
}
|
||||
@Override
|
||||
public List<Course> getMostStudiedCourses() {
|
||||
return mostStudiedCourses;
|
||||
}
|
||||
@Override
|
||||
public Course getCourse (long id) {
|
||||
return courses.get(id);
|
||||
|
||||
}
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
package com.rotanareg.skolan.course;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import java.util.List;
|
||||
|
||||
@Named
|
||||
@RequestScoped
|
||||
public class MostStudiedCourses {
|
||||
|
||||
@Inject
|
||||
private com.rotanareg.skolan.course.CourseService courseService;
|
||||
|
||||
private List<Course> courses;
|
||||
|
||||
@PostConstruct
|
||||
public void initialize() {
|
||||
courses = courseService.getMostStudiedCourses ();
|
||||
}
|
||||
|
||||
public List<Course> getCourses() {
|
||||
return courses;
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.rotanareg.skolan.coursePersist;
|
||||
|
||||
import com.rotanareg.skolan.domains.Course;
|
||||
|
||||
import javax.ejb.Local;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Solidbeans on 2017-03-20.
|
||||
*/
|
||||
@Local
|
||||
public interface CourseService {
|
||||
|
||||
void addCourse(Course course);
|
||||
void updateCourse(Course course);
|
||||
void removeCourse(Long id);
|
||||
Course getCourse(Long id);
|
||||
List<Course> getCourses();
|
||||
public List<Course> getCoursesContaining(String filter);
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
package com.rotanareg.skolan.coursePersist;
|
||||
|
||||
import com.rotanareg.skolan.domains.Course;
|
||||
|
||||
import javax.ejb.Stateless;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Created by Solidbeans on 2017-03-20.
|
||||
*/
|
||||
|
||||
@Stateless
|
||||
public class CourseServiceImpl implements CourseService{
|
||||
@PersistenceContext
|
||||
EntityManager em;
|
||||
|
||||
@Override
|
||||
public void addCourse(Course course) {
|
||||
CourseEntity c = new CourseEntity(course.getName(),course.getDescription(),course.getCourseNr());
|
||||
em.persist(c);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCourse(Course course) {
|
||||
CourseEntity c = em.find(CourseEntity.class,course.getId());
|
||||
c.setName(course.getName());
|
||||
c.setDescription(course.getDescription());
|
||||
c.setCourseNr(course.getCourseNr());
|
||||
em.merge(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeCourse(Long id) {
|
||||
CourseEntity c = em.find(CourseEntity.class, id);
|
||||
em.remove(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Course getCourse(Long id) {
|
||||
CourseEntity c = em.find(CourseEntity.class,id);
|
||||
Course cd = new Course(c.getId(),c.getName(),c.getDescription(),c.getCourseNr());
|
||||
|
||||
return cd;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Course> getCourses() {
|
||||
List<CourseEntity> courseEntityList = em.createNamedQuery("selectAll").getResultList();
|
||||
if (courseEntityList.isEmpty()){
|
||||
CourseEntity a = new CourseEntity("Engelska",
|
||||
"Du som behärskar engelska kommer långt. Engelska är ett världsspråk och antalet engelsktalande människor i världen ökar ständigt. Men engelska är inte bara samtal. Det är också litteratur att läsa och texter att skriva. Välkommen till oss när du vill förbättra din engelska!",
|
||||
"E1234A");
|
||||
em.persist(a);
|
||||
CourseEntity b = new CourseEntity("Svenska",
|
||||
"Utbildningen är individualiserad och innan antagning sker en intestning. Du kan delta i utbildningen även om du inte har avslutat din Svenska för invandrare, SFI. Korta vägen pågår i 25 veckor och därutöver ingår 5 veckors praktik. Utbildningen utförs av Folkuniversitetet i Umeå i samarbete med Umeå universitet. Det finns möjlighet till individuell förlängning.",
|
||||
"Sv234B");
|
||||
em.persist(b);
|
||||
CourseEntity c = new CourseEntity("allmän datakunskap",
|
||||
"Kom igång och lär dig data från början. Folkuniversitetet är en erfaren data- och IT-utbildare. Vi har kurser för både nybörjare och erfarna dataanvändare, för juniorer såväl som seniorer och inom både allmän datakunskap och enskilda datorprogram.",
|
||||
"DK234C");
|
||||
em.persist(c);
|
||||
}
|
||||
return courseEntityList.stream().
|
||||
map(c->new Course(c.getId(),c.getName(),c.getDescription(),c.getCourseNr())).
|
||||
collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Course> getCoursesContaining(String filter) {
|
||||
List<CourseEntity> courseEntityList = em.createNamedQuery("selectSome").setParameter("filt",filter).getResultList();
|
||||
|
||||
return courseEntityList.stream().
|
||||
map(c->new Course(c.getId(),c.getName(),c.getDescription(),c.getCourseNr())).
|
||||
collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.rotanareg.skolan.user;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
public class DateB {
|
||||
|
||||
public static Date date(String s) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
|
||||
try {
|
||||
return dateFormat.parse(s);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,4 @@
|
||||
package com.rotanareg.skolan.user.admin.admindomain;
|
||||
|
||||
public class AdminDomain {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.rotanareg.skolan.user.admin.adminejb;
|
||||
|
||||
public class AdminService {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.rotanareg.skolan.user.admin.adminejb;
|
||||
|
||||
public class AdminServiceImpl {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.rotanareg.skolan.user.admin.adminjpa;
|
||||
|
||||
public class Admin {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.rotanareg.skolan.user.admin.adminjsf;
|
||||
|
||||
public class AdminBean {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.rotanareg.skolan.user.student.studentdomain;
|
||||
|
||||
public class StudentDomain {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.rotanareg.skolan.user.student.studentejb;
|
||||
|
||||
public class StudentService {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.rotanareg.skolan.user.student.studentejb;
|
||||
|
||||
public class StudentServiceImpl {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.rotanareg.skolan.user.student.studentjpa;
|
||||
|
||||
public class Student {
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
package com.rotanareg.skolan.user.student.studentjsf;
|
||||
|
||||
public class StudentBean {
|
||||
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.rotanareg.skolan.user.teacher.teacherdomain;
|
||||
|
||||
public class TeacherDomain {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.rotanareg.skolan.user.teacher.teacherejb;
|
||||
|
||||
public class TeacherServiceImpl {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.rotanareg.skolan.user.teacher.teacherejb;
|
||||
|
||||
public class TeaherService {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.rotanareg.skolan.user.teacher.teacherjpa;
|
||||
|
||||
public class Teacher {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.rotanareg.skolan.user.teacher.teacherjsf;
|
||||
|
||||
public class TeacherBean {
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.rotanareg.skolan.user;
|
||||
package com.rotanareg.skolan.userManager;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
@ -1,4 +1,4 @@
|
||||
package com.rotanareg.skolan.user;
|
||||
package com.rotanareg.skolan.userManager;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.rotanareg.skolan.user;
|
||||
package com.rotanareg.skolan.userManager;
|
||||
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.component.UIComponent;
|
@ -1,4 +1,4 @@
|
||||
package com.rotanareg.skolan.user;
|
||||
package com.rotanareg.skolan.userManager;
|
||||
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.component.UIComponent;
|
@ -1,4 +1,4 @@
|
||||
package com.rotanareg.skolan.user;
|
||||
package com.rotanareg.skolan.userManager;
|
||||
|
||||
|
||||
import javax.faces.view.ViewScoped;
|
@ -1,4 +1,4 @@
|
||||
package com.rotanareg.skolan.user;
|
||||
package com.rotanareg.skolan.userManager;
|
||||
|
||||
public interface UserService {
|
||||
// get information om användare
|
@ -1,4 +1,4 @@
|
||||
package com.rotanareg.skolan.user;
|
||||
package com.rotanareg.skolan.userManager;
|
||||
|
||||
import javax.enterprise.context.ApplicationScoped;
|
||||
import java.util.Map;
|
@ -1,4 +1,4 @@
|
||||
package com.rotanareg.skolan.user;
|
||||
package com.rotanareg.skolan.userManager;
|
||||
|
||||
import javax.validation.Constraint;
|
||||
import javax.validation.Payload;
|
@ -1,32 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
|
||||
xmlns:f="http://xmlns.jcp.org/jsf/core">
|
||||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
|
||||
|
||||
<ui:composition template="templates/template_page.xhtml">
|
||||
<ui:param name="pageTitle" value="Admin sidan"/>
|
||||
|
||||
|
||||
<ui:define name="panel-top">
|
||||
<ui:composition template="/templates/page_template.xhtml">
|
||||
<ui:param name="pageTitle" value="Admin"/>
|
||||
<ui:define name = "panel-top">
|
||||
<section>
|
||||
<h:outputLink value="user_detail.xhtml">Registrera nya användare</h:outputLink>
|
||||
<p> </p>
|
||||
<h:outputLink value="create_course.xhtml">Registrera nya kurser</h:outputLink>
|
||||
<h:commandButton value="Registrera nya kurser" action="#{course.addCourse()}"/> <!--lägg in inom parantes parameter-->
|
||||
<h:commandButton value="Registrera nya användare" action="#{user.addUser()}"/> <!--lägg in inom parantes parameter-->
|
||||
</section>
|
||||
</ui:define>
|
||||
|
||||
<ui:define name="panel-main">
|
||||
<section>
|
||||
|
||||
<ui:define name="panel-main">
|
||||
<section>
|
||||
<h1>här kommer mer</h1>
|
||||
|
||||
</section>
|
||||
</ui:define>
|
||||
|
||||
</section>
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
|
||||
xmlns:f="http://xmlns.jcp.org/jsf/core">
|
||||
|
||||
<ui:composition template="templates/page_template.xhtml">
|
||||
<f:metadata>
|
||||
<f:viewParam name ="courseId" value="#{courseDetail.courseId}"/>
|
||||
<f:viewAction action="#{courseDetail.onload}"/>
|
||||
</f:metadata>
|
||||
|
||||
<ui:param name="pageTitle" value="Course Details"/>
|
||||
<ui:define name="panel-main">
|
||||
<section class="course_detail">
|
||||
<h:form>
|
||||
<h1>#{course.name}</h1>
|
||||
<p> </p>
|
||||
</h:form>
|
||||
</section>
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
</html>
|
@ -1,11 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
|
||||
xmlns:f="http://xmlns.jcp.org/jsf/core">
|
||||
<f:view>
|
||||
<h:outputLabel value="Hello, world"/>
|
||||
</f:view>
|
||||
</html>
|
||||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:f="http://xmlns.jcp.org/jsf/core">
|
||||
|
||||
<ui:composition template="/templates/page_template.xhtml">
|
||||
<ui:param name="pageTitle" value="Kurs"/>
|
||||
<ui:define name="panel-top">
|
||||
<section>
|
||||
|
||||
<p>Ny kurs panel top</p>
|
||||
|
||||
</section>
|
||||
</ui:define>
|
||||
|
||||
<ui:define name="panel-main">
|
||||
<section class="create_course">
|
||||
<h:form>
|
||||
<p> Kurs kod</p>
|
||||
<p>Kurs namn</p>
|
||||
<p>Kurs deskription</p>
|
||||
<p>Ansvarig lärare</p>
|
||||
</h:form>
|
||||
</section>
|
||||
</ui:define>
|
||||
|
||||
</ui:composition>
|
||||
</html>
|
@ -1,19 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
|
||||
xmlns:f="http://xmlns.jcp.org/jsf/core">
|
||||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
|
||||
|
||||
<ui:composition template="/templates/template_page.xhtml">
|
||||
<ui:param name="pageTitle" value="Index sidan"/>
|
||||
|
||||
<ui:composition template="/templates/page_template.xhtml">
|
||||
<ui:param name="pageTitle" value="Index"/>
|
||||
<ui:define name="panel-top">
|
||||
<section>
|
||||
|
||||
<p><h:outputLink value="signIn.xhtml">Logga in</h:outputLink></p>
|
||||
|
||||
</section>
|
||||
</ui:define>
|
||||
|
||||
<ui:define name="panel-main">
|
||||
<section class = "bild">
|
||||
<h:graphicImage library="skola" name="/images/testBild2.jpg"/>
|
||||
<section class="bild">
|
||||
|
||||
<h:graphicImage library="skolan" name="/images/testBild2.jpg"/>
|
||||
</section>
|
||||
</ui:define>
|
||||
|
||||
</ui:composition>
|
||||
</html>
|
||||
|
||||
|
@ -0,0 +1,83 @@
|
||||
html {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: Tahoma, sans-serif;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
margin: 0 0 8px 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 8px 0 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
input, button,select {
|
||||
font-family: Tahoma, sans-serif;
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
body > header {
|
||||
padding: 16px;
|
||||
clear: both;
|
||||
text-align: center;
|
||||
font-size: 200%;
|
||||
}
|
||||
|
||||
body > header > h1 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body > section , body > form > section{
|
||||
margin: 8px 20%;
|
||||
padding: 18px;
|
||||
overflow: hidden;
|
||||
.bild
|
||||
background-image: url("testBild2.jpg");
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
background-position: 100%;
|
||||
}
|
||||
|
||||
body > footer {
|
||||
padding: 8px;
|
||||
clear: both;
|
||||
font-size: 13px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
body > footer > p {
|
||||
margin: 0;
|
||||
}
|
||||
.student-table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.student-header {
|
||||
padding: 4px;
|
||||
text-align: left;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.student-col-name {
|
||||
padding: 4px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.student-col-courseCode, .student-col-courseName, .student-col-teacherName {
|
||||
padding: 4px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.student-footer {
|
||||
padding: 4px;
|
||||
font-weight: bold;
|
||||
text-align: right;
|
||||
}
|
After Width: | Height: | Size: 91 KiB |
@ -0,0 +1,62 @@
|
||||
body {
|
||||
background-color: rgba(118, 203, 224, 0.1);
|
||||
}
|
||||
|
||||
a:link, a:visited {
|
||||
color: #8d52a0;
|
||||
}
|
||||
|
||||
a:hover, a:active {
|
||||
color: #76cbe0;
|
||||
}
|
||||
|
||||
input, select {
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
border: 1px solid #396280;
|
||||
padding: 4px;
|
||||
}
|
||||
option {
|
||||
background-color: white;
|
||||
color: black;
|
||||
}
|
||||
input[readonly] {
|
||||
color: #808080;
|
||||
}
|
||||
|
||||
input[type="submit"], input[type="button"] {
|
||||
border-radius: 4px;
|
||||
padding: 4px 12px;
|
||||
}
|
||||
|
||||
body > header {
|
||||
background-color: #2badca;
|
||||
color: white;
|
||||
}
|
||||
|
||||
body > section, body > form > section {
|
||||
background-color: rgba(114, 207, 179, 0.38);
|
||||
color: black;
|
||||
}
|
||||
|
||||
body > footer {
|
||||
background-color: #2badca;
|
||||
color: #e5e5e5;
|
||||
}
|
||||
.student-header {
|
||||
background-color: #2a17f1;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.student-row-odd {
|
||||
background-color: #e0e0e0;
|
||||
}
|
||||
|
||||
.student-row-even {
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
.student-footer {
|
||||
background-color: #2a17f1;
|
||||
color: white;
|
||||
}
|
@ -1,53 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
|
||||
xmlns:f="http://xmlns.jcp.org/jsf/core">
|
||||
|
||||
<ui:composition template="/templates/template_page.xhtml">
|
||||
<ui:param name="pageTitle" value="Sign In"/>
|
||||
|
||||
<ui:composition template="/templates/page_template.xhtml">
|
||||
<ui:param name="pageTitle" value="Logga in"/>
|
||||
<ui:define name="panel-top">
|
||||
<section>
|
||||
<ui:fragment rendered="#{not userManager.signedIn}">
|
||||
<h1>Logga in</h1>
|
||||
<p>Skriv ditt användarnamn</p>
|
||||
</ui:fragment>
|
||||
|
||||
<ui:fragment rendered="#{userManager.signedIn}">
|
||||
<h:form>
|
||||
<h1>Välkommen, #{userManager.currentUser.firstName}!</h1>
|
||||
<p>Du är redan inloggad.
|
||||
Vill du<h:commandLink action="#{userManager.signOut}">logga ut</h:commandLink>?</p>
|
||||
</h:form>
|
||||
</ui:fragment>
|
||||
|
||||
<h:outputText value="Välkommen till Rotana Reg skolan!"/>
|
||||
<p> </p>
|
||||
<h:outputText value="Vänligen logga in"/>
|
||||
|
||||
</section>
|
||||
</ui:define>
|
||||
|
||||
|
||||
<ui:define name="panel-main">
|
||||
<ui:fragment rendered="#{not userManager.signedIn}">
|
||||
<section>
|
||||
<h:messages styleClass="validation-messages"/>
|
||||
<h:form>
|
||||
<h:panelGrid columns="2" styleClass="form-grid" columnClasses="form-column-label,form-column-input">
|
||||
<h:outputLabel for="username">Användarnamn</h:outputLabel>
|
||||
<h:inputText id="username" value="#{signIn.username}" size="20"/>
|
||||
|
||||
|
||||
|
||||
<h:outputLabel for="password">Password</h:outputLabel>
|
||||
<h:inputSecret id="password" value="#{signIn.password}" size="20"/>
|
||||
|
||||
<h:outputText value=""/>
|
||||
<h:commandButton value="Submit" action="#{signIn.submit}"/> <!--anroppar usermanager-->
|
||||
</h:panelGrid>
|
||||
</h:form>
|
||||
</section>
|
||||
<section>
|
||||
<h:form>
|
||||
<h:panelGrid columns="2" styleClass="form-grid" columnClasses="form-column-label,form-column-input">
|
||||
|
||||
<h:outputLabel for="username">Användarnamn</h:outputLabel>
|
||||
<h:inputText id="username" value="#{signIn.username}" size="20"/>
|
||||
|
||||
<h:outputLabel for="password">Password</h:outputLabel>
|
||||
<h:inputSecret id="password" value="#{signIn.password}" size="20"/>
|
||||
|
||||
<h:outputText value=""/>
|
||||
<h:commandButton value="Submit" action="#{signIn.submit}"/> <!--anroppar usermanager-->
|
||||
</h:panelGrid>
|
||||
</h:form>
|
||||
</section>
|
||||
</ui:fragment>
|
||||
</ui:define>
|
||||
|
||||
</ui:composition>
|
||||
</html>
|
||||
</html>
|
@ -1,34 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
|
||||
xmlns:f="http://xmlns.jcp.org/jsf/core">
|
||||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:f="http://xmlns.jcp.org/jsf/core">
|
||||
<f:view>
|
||||
<ui:composition template="/templates/page_template.xhtml">
|
||||
<ui:param name="pageTitle" value="Student"/>
|
||||
<ui:define name = "panel-top">
|
||||
|
||||
<ui:composition template="templates/template_page.xhtml">
|
||||
<ui:param name="pageTitle" value="Student sidan"/>
|
||||
|
||||
<ui:define name="panel-top">
|
||||
<section>
|
||||
<!-- <h:outputLink value="index.xhtml">Logga ut</h:outputLink> måste redict på rätt sätt-->
|
||||
<section>
|
||||
<h:form>
|
||||
<h:dataTable value="#{student.lines}" var="line"
|
||||
styleClass="student-table"
|
||||
headerClass="student-header"
|
||||
rowClasses="student-row-odd,student-row-even"
|
||||
columnClasses="student-col-courseCode,student-col-courseName,student-col-teacherName"
|
||||
footerClass="student-footer">
|
||||
<h:column>
|
||||
<f:facet name="header">Kurs kod</f:facet>
|
||||
<h:outputLink value="course_detail.xhtml">
|
||||
<f:param name="courseId" value="#{line.course.id}"/>
|
||||
#{line.courseCode.name}
|
||||
</h:outputLink>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">Kurs namn</f:facet>
|
||||
#{line.courseName.name}
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">Ansvarig lärare</f:facet>
|
||||
#{line.teacherName}
|
||||
|
||||
</h:column>
|
||||
<f:facet name="footer">
|
||||
<h:commandButton value="Avregistrera" action="#{course.removeCourse(line.course)}"/>
|
||||
</f:facet>
|
||||
|
||||
</h:dataTable>
|
||||
</h:form>
|
||||
</section>
|
||||
</ui:define>
|
||||
|
||||
|
||||
<ui:define name="panel-main">
|
||||
<section>
|
||||
<h1>Mest lästa kurser</h1>
|
||||
<h:form>
|
||||
<ui:repeat value="#{mostStudiedCourses.courses}" var="course">
|
||||
<ui:param name="course" value="#{course}"/>
|
||||
<ui:define name="course-description">
|
||||
<h:dataTable value="#{student.lines}" var="line"
|
||||
styleClass="student-table"
|
||||
headerClass="student-header"
|
||||
rowClasses="student-row-odd,student-row-even"
|
||||
columnClasses="student-col-courseCode,student-col-courseName,student-col-teacherName"
|
||||
footerClass="student-footer">
|
||||
<h:column>
|
||||
<f:facet name="header">Kurs kod</f:facet>
|
||||
<h:outputLink value="course_detail.xhtml">
|
||||
<f:param name="courseId" value="#{line.course.id}"/>
|
||||
#{line.courseCode.name}
|
||||
</h:outputLink>
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">Kurs namn</f:facet>
|
||||
#{line.courseName.name}
|
||||
</h:column>
|
||||
<h:column>
|
||||
<f:facet name="header">Ansvarig lärare</f:facet>
|
||||
#{line.teacherName}
|
||||
|
||||
</h:column>
|
||||
<f:facet name="footer">
|
||||
<h:commandButton value="Sök" action="course_detail"/>
|
||||
<h:commandButton value="Registrera" action="#{course.addCourse(line.course)}"/>
|
||||
</f:facet>
|
||||
|
||||
</ui:define>
|
||||
</ui:repeat>
|
||||
</h:dataTable>
|
||||
</h:form>
|
||||
</section>
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
|
||||
</html>
|
||||
|
||||
</f:view>
|
||||
</html>
|
@ -1,21 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
|
||||
xmlns:f="http://xmlns.jcp.org/jsf/core">
|
||||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
|
||||
|
||||
<ui:composition template="templates/template_page.xhtml">
|
||||
<ui:param name="pageTitle" value="Lärare sidan"/>
|
||||
<ui:define name="panel-top">
|
||||
<ui:composition template="/templates/page_template.xhtml">
|
||||
<ui:param name="pageTitel" value="Lärare"/>
|
||||
<ui:define name = "panel-top">
|
||||
<section>
|
||||
|
||||
|
||||
<p> lärare sidan panel top</p>
|
||||
<!--TODO vet ej -->
|
||||
</section>
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
|
||||
<ui:define name="panel-main">
|
||||
<section>
|
||||
<p> lärare sidan panel main</p>
|
||||
|
||||
</html>
|
||||
</section>
|
||||
</ui:define>
|
||||
|
||||
</ui:composition>
|
||||
</html>
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
|
||||
|
||||
<ui:composition>
|
||||
<footer>
|
||||
<h1>Skolan 2017</h1>
|
||||
</footer>
|
||||
</ui:composition>
|
||||
</html>
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
|
||||
|
||||
<ui:composition>
|
||||
<header>
|
||||
<h1>Rotana Reg skola</h1>
|
||||
</header>
|
||||
</ui:composition>
|
||||
</html>
|
@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
|
||||
xmlns:f="http://xmlns.jcp.org/jsf/core">
|
||||
<f:view contentType="text/html">
|
||||
<h:head>
|
||||
<meta charset="UTF-8"/>
|
||||
<title>RotanaReg Skolan #{pageTitel} </title>
|
||||
<h:outputStylesheet library="skolan" name="/css/style.css"/>
|
||||
<h:outputStylesheet library="skolan" name="/theme/blueheven.css"/>
|
||||
</h:head>
|
||||
|
||||
<h:body>
|
||||
<ui:include src="header_template.xhtml"/>
|
||||
<nav>
|
||||
<h:link styleClass="menuItem" value="Home" outcome="index"/>
|
||||
<span class="text_grey"> | </span>
|
||||
<h:link styleClass="menuItem" value="Admin" outcome="admin"/>
|
||||
<span class="text_grey"> | </span>
|
||||
<h:link styleClass="menuItem" value="Student" outcome="student"/>
|
||||
<span class="text_grey"> | </span>
|
||||
<h:link styleClass="menuItem" value="Teacher" outcome="teacher"/>
|
||||
</nav>
|
||||
<ui:insert name="panel-top">
|
||||
<section>
|
||||
<p>Hej<h:outputLink value="signIn.xhtml"></h:outputLink></p>
|
||||
</section>
|
||||
</ui:insert>
|
||||
|
||||
<ui:insert name="panel-main">
|
||||
<section>
|
||||
<h1>Main Panel</h1>
|
||||
<p>Placeholder text.</p> <!--används bara en content för panel main inte är specifierad i relevant page-->
|
||||
</section>
|
||||
</ui:insert>
|
||||
<ui:include src="footer_template.xhtml"/>
|
||||
</h:body>
|
||||
</f:view>
|
||||
</html>
|
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
|
||||
xmlns:f="http://xmlns.jcp.org/jsf/core">
|
||||
|
||||
<f:view>
|
||||
<h:outputLabel value="Hello, world"/>
|
||||
</f:view>
|
||||
</html>
|
Loading…
Reference in new issue