Skip to content
Snippets Groups Projects
Commit 922cab25 authored by jez04's avatar jez04
Browse files

feat: initial commit

parent f0bdaf14
No related merge requests found
Pipeline #2047 failed with stages
in 0 seconds
Showing
with 810 additions and 89 deletions
# Eclipse
.classpath
.project
.settings/
# Intellij
.idea/
*.iml
*.iws
# Mac
.DS_Store
# Maven
log/
target/
# jakarta-jsf-archetype # jakarta jsf quicksatr archetype
This project is base template to use jakartaEE technology with JakartaFaces (JSF) with PrimeFaces Bootstrap, fontAwesome on WildFly server together with CDI, JPA, Hibernate JPA Model Gen, lombok, SLF4J and others.
And contains seting to generate maven archetype io.github.jez04-cs.jakarta-jsf-quickstart
## Getting started
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
## Add your files
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
```
cd existing_repo
git remote add origin https://gitlab.vsb.cz/jez04-vyuka/java2/jakarta-jsf-archetype.git
git branch -M main
git push -uf origin main
```
## Integrate with your tools
- [ ] [Set up project integrations](https://gitlab.vsb.cz/jez04-vyuka/java2/jakarta-jsf-archetype/-/settings/integrations)
## Collaborate with your team
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
## License
For open source projects, say how it is licensed.
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
#!/bin/bash
mvn clean archetype:create-from-project
GENERATED_ARCHETYPE_ROOT=target/generated-sources/archetype
echo ======Updating archetype ...=========================
echo Inserting deployment plugins into project pom.xml
sed -i "/<\/project>/d" "$GENERATED_ARCHETYPE_ROOT/pom.xml"
cat "partial-archetype-pom.xml" >> "$GENERATED_ARCHETYPE_ROOT/pom.xml"
echo "</project>" >> "$GENERATED_ARCHETYPE_ROOT/pom.xml"
sed -i "s/jakarta-jsf-quickstart-archetype/jakarta-jsf-quickstart/g" "$GENERATED_ARCHETYPE_ROOT/pom.xml"
echo Updating archetype template pom.xml
sed -i "s/<warName>jakarta-jsf-quickstart<\/warName>/<warName>\${artifactId}<\/warName>/g" "$GENERATED_ARCHETYPE_ROOT/src/main/resources/archetype-resources/pom.xml"
cp src/main/resources/META-INF/maven/archetype-metadata.xml $GENERATED_ARCHETYPE_ROOT/src/main/resources/META-INF/maven/archetype-metadata.xml
echo Rmoving script
rm $GENERATED_ARCHETYPE_ROOT/src/main/resources/archetype-resources/create-archetype-and-install.sh
echo Rmoving partial pom
rm $GENERATED_ARCHETYPE_ROOT/src/main/resources/archetype-resources/partial-archetype-pom.xml
echo Rmoving eclipse project files
rm -R $GENERATED_ARCHETYPE_ROOT/src/main/resources/archetype-resources/.settings
rm $GENERATED_ARCHETYPE_ROOT/src/main/resources/archetype-resources/.classpath
rm $GENERATED_ARCHETYPE_ROOT/src/main/resources/archetype-resources/.project
echo ======Update archetype done.=========================
cd $GENERATED_ARCHETYPE_ROOT
mvn clean install
cd ../../..
\ No newline at end of file
<distributionManagement>
<snapshotRepository>
<id>vsb-archetypes-snapshots</id>
<url>https://artifactory.cs.vsb.cz/repository/archetype-snapshots/</url>
</snapshotRepository>
<repository>
<id>vsb-archetypes-releases</id>
<url>https://artifactory.cs.vsb.cz/repository/archetype-releases/</url>
</repository>
</distributionManagement>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.10.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<phase>verify</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.nicoulaj.maven.plugins</groupId>
<artifactId>checksum-maven-plugin</artifactId>
<version>1.11</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>artifacts</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>deploy</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<keyname>9B4FA2AD277F10F5</keyname>
<passphraseServerId>gpg.passphrase</passphraseServerId>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.5.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<tokenAuth>true</tokenAuth>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
pom.xml 0 → 100644
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.jez04-cs</groupId>
<artifactId>jakarta-jsf-quickstart</artifactId>
<version>1.0.0</version>
<packaging>war</packaging>
<name>jakarta-jsf-quickstart</name>
<description>This artifact is base template to use
jakartaEE technology with JakartaFaces (JSF), PrimeFaces, Bootstrap,
Font Awesome on WildFly server together with CDI, JPA, Hibernate JPA Model Gen,
lombok, SLF4J and others.</description>
<url>https://gitlab.vsb.cz/jez04-vyuka/java2/jakarta-jsf-quickstart</url>
<licenses>
<license>
<name>MIT License</name>
<url>https://spdx.org/licenses/MIT.html</url>
</license>
</licenses>
<developers>
<developer>
<name>David Ježek</name>
<email>david.jezek@vsb.cz</email>
<organization>VSB - Technical University of Ostrava</organization>
<organizationUrl>https://www.vsb.cz</organizationUrl>
</developer>
</developers>
<scm>
<connection>
https://gitlab.vsb.cz/jez04-vyuka/java2/jakarta-jsf-quickstart.git</connection>
<developerConnection>
https://gitlab.vsb.cz/jez04-vyuka/java2/jakarta-jsf-quickstart.git</developerConnection>
<url>https://gitlab.vsb.cz/jez04-vyuka/java2/jakarta-jsf-quickstart.git</url>
</scm>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>21</maven.compiler.release>
<JUnit.version>5.11.0</JUnit.version>
<log4j.version>2.23.1</log4j.version>
<lombok.version>1.18.34</lombok.version>
<primefaces.version>14.0.5</primefaces.version>
<font.awesome.version>6.5.2</font.awesome.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${JUnit.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.wildfly.bom</groupId>
<artifactId>wildfly-ee</artifactId>
<version>33.0.2.Final</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<!-- Import the CDI API, we use provided scope as the API is included in
WildFly / JBoss EAP -->
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- Import the JPA API, we use provided scope as the API is included in
WildFly / JBoss EAP -->
<dependency>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/jakarta.data/jakarta.data-api -->
<dependency>
<groupId>jakarta.data</groupId>
<artifactId>jakarta.data-api</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>jakarta.faces</groupId>
<artifactId>jakarta.faces-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.primefaces/primefaces -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>${primefaces.version}</version>
<classifier>jakarta</classifier>
</dependency>
<!-- https://mvnrepository.com/artifact/org.webjars/font-awesome -->
<dependency>
<groupId>org.webjars</groupId>
<artifactId>font-awesome</artifactId>
<version>${font.awesome.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.webjars/bootstrap -->
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>5.3.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.omnifaces/omnifaces -->
<dependency>
<groupId>org.omnifaces</groupId>
<artifactId>omnifaces</artifactId>
<version>4.5.1</version>
</dependency>
<!-- Servlet API -->
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- Required for e.g. "javax.annotation.PostConstruct" -->
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>
<dependency>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
<path>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<sources>
<source>target/generated-sources/annotations</source>
</sources>
</configuration>
<executions>
<execution>
<id>add-source</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.4.0</version>
<configuration>
<warName>jakarta-jsf-quickstart</warName>
</configuration>
</plugin>
</plugins>
</build>
</project>
package cz.vsb.fei.java;
import java.io.IOException;
import jakarta.servlet.Filter;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.annotation.WebFilter;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@WebFilter(urlPatterns = {"/hello/*"})
public class FilterExample implements Filter {
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
log.info("Filter works!!");
chain.doFilter(request, response);
}
}
package cz.vsb.fei.java;
import java.io.IOException;
import java.io.PrintWriter;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = { "/hello/*" })
public class ServletExample extends HttpServlet {
private static final long serialVersionUID = -6787199898225083657L;
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
try (PrintWriter pw = resp.getWriter()) {
pw.println("<html><body>");
pw.println("<h1>Hello world from servlet!!</h1>");
pw.println("<p>Path info: " + req.getPathInfo() + "</p>");
pw.println("</body></html>");
}
}
}
package cz.vsb.fei.java.controllers;
import jakarta.enterprise.context.RequestScoped;
import jakarta.inject.Named;
@Named
@RequestScoped
public class HelloController {
public String getGreeting() {
return "Hello";
}
}
package cz.vsb.fei.java.controllers;
import java.io.Serializable;
import java.util.List;
import cz.vsb.fei.java.entities.Person;
import cz.vsb.fei.java.transactionalscripts.PersonTS;
import jakarta.enterprise.context.SessionScoped;
import jakarta.inject.Inject;
import jakarta.inject.Named;
import lombok.Getter;
@Named
@SessionScoped
public class PersonController implements Serializable {
private static final long serialVersionUID = -4854945208036369881L;
@Getter
private Person editedPerson;
@Inject
private PersonTS personTS;
public Person save(Person entity) {
return personTS.save(entity);
}
public List<Person> findAll() {
return personTS.findAll();
}
public String edit(Person person) {
editedPerson = person;
return "editPerson";
}
public String create() {
editedPerson = new Person();
return "editPerson";
}
public String delete(Person person) {
personTS.delete(person);
return "";
}
public String save() {
personTS.save(editedPerson);
return "persons";
}
}
package cz.vsb.fei.java.controllers;
import java.util.Objects;
import cz.vsb.fei.java.entities.Person;
import cz.vsb.fei.java.transactionalscripts.PersonTS;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.faces.application.FacesMessage;
import jakarta.faces.component.UIComponent;
import jakarta.faces.context.FacesContext;
import jakarta.faces.convert.Converter;
import jakarta.faces.convert.ConverterException;
import jakarta.faces.convert.FacesConverter;
import jakarta.inject.Inject;
@ApplicationScoped
@FacesConverter(forClass = Person.class, managed = true)
public class PersonConverter implements Converter<Person> {
public static final String NULL_TEXT = "null";
@Inject
private PersonTS personTS;
@Override
public Person getAsObject(FacesContext context, UIComponent component, String value) {
if (Objects.equals(NULL_TEXT, value)) {
return null;
}
long id;
try {
id = Long.parseLong(value);
} catch (NumberFormatException e) {
throw new ConverterException(new FacesMessage(FacesMessage.SEVERITY_ERROR,
"Cannot convert ID value into object.", "Cannot convert ID value into object."));
}
return personTS.findById(id);
}
@Override
public String getAsString(FacesContext context, UIComponent component, Person value) {
if (value == null || value.getId() == null) {
return NULL_TEXT;
}
return value.getId().toString();
}
}
package cz.vsb.fei.java.entities;
import java.util.List;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.OneToMany;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
@Data
@Entity
@NoArgsConstructor
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
public class Person {
@Id
@GeneratedValue
@EqualsAndHashCode.Include
private Long id;
private String name;
@OneToMany(mappedBy = Person_.FOLLOW)
private List<Person> followers;
@ManyToOne
private Person follow;
public Person(String name) {
this(name, null);
}
public Person(String name, Person follow) {
super();
this.name = name;
this.follow = follow;
}
}
package cz.vsb.fei.java.repositoris;
import java.io.Serializable;
import java.util.List;
import cz.vsb.fei.java.entities.Person;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceContext;
import jakarta.transaction.Transactional;
@ApplicationScoped
public class PersonRepository implements Serializable {
private static final long serialVersionUID = -220112245841041832L;
@PersistenceContext
private EntityManager em;
public Person findById(Long id) {
return em.find(Person.class, id);
}
@Transactional
public Person save(Person entity) {
if (entity.getId() == null || entity.getId() == 0) {
em.persist(entity);
return entity;
} else {
return em.merge(entity);
}
}
public List<Person> findAll() {
return em.createQuery("select p from Person p", Person.class).getResultList();
}
@Transactional
public void delete(Person entity) {
em.remove(refresh(entity));
}
public Person refresh(Person person) {
Person p = em.find(Person.class, person.getId());
return p;
}
}
package cz.vsb.fei.java.transactionalscripts;
import java.io.Serializable;
import java.util.List;
import cz.vsb.fei.java.entities.Person;
import cz.vsb.fei.java.repositoris.PersonRepository;
import jakarta.annotation.PostConstruct;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import lombok.extern.slf4j.Slf4j;
@ApplicationScoped
@Slf4j
public class PersonTS implements Serializable {
private static final long serialVersionUID = 5431735653459156669L;
@Inject
private PersonRepository personRepository;
@PostConstruct
public void init() {
Person aa = new Person("aa");
Person bb = new Person("bb");
Person cc = new Person("cc", aa);
save(aa);
save(bb);
save(cc);
log.info("Default data initialized");
}
public Person save(Person entity) {
return personRepository.save(entity);
}
public Person findById(Long id) {
return personRepository.findById(id);
}
public List<Person> findAll() {
return personRepository.findAll();
}
public void delete(Person entity) {
personRepository.delete(entity);
}
public Person refresh(Person person) {
return personRepository.refresh(person);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<archetype-descriptor xsi:schemaLocation="https://maven.apache.org/plugins/maven-archetype-plugin/archetype-catalog/1.1.0 https://maven.apache.org/xsd/archetype-catalog-1.1.0.xsd" name="jakarta-jsf-quickstart"
xmlns="https://maven.apache.org/plugins/maven-archetype-plugin/archetype-catalog/1.1.0"
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance">
<fileSets>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>src/main/java</directory>
<includes>
<include>**</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory>src/main/resources</directory>
<excludes>
<exclude>**</exclude>
</excludes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory>src/main/webapp</directory>
<includes>
<include>**</include>
</includes>
</fileSet>
<fileSet encoding="UTF-8">
<directory>src/main/webapp</directory>
<includes>
<include>**</include>
</includes>
</fileSet>
<fileSet encoding="UTF-8">
<directory></directory>
<includes>
<include>README.md</include>
<include>.gitignore</include>
</includes>
<excludes>
<exclude>.settings/**</exclude>
<exclude>create-archetype-and-install.sh</exclude>
<exclude>partial-archetype-pom.xml</exclude>
</excludes>
</fileSet>
</fileSets>
</archetype-descriptor>
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="3.0"
xmlns="https://jakarta.ee/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd">
<persistence-unit name="jakarta-jsf-quickstart">
<jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
<properties>
<property
name="jakarta.persistence.schema-generation.database.action"
value="drop-and-create" />
<property name="hibernate.enable_lazy_load_no_trans"
value="true" />
<property name="hibernate.show_sql" value="true" />
</properties>
</persistence-unit>
</persistence>
Manifest-Version: 1.0
Class-Path:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_4_1.xsd"
version="4.1" bean-discovery-mode="annotated">
</beans>
\ No newline at end of file
<?xml version="1.0"?>
<!-- This file is not required if you don't need any extra configuration. -->
<faces-config version="4.1"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
https://jakarta.ee/xml/ns/jakartaee
https://jakarta.ee/xml/ns/jakartaee/web-facesconfig_4_1.xsd">
<!-- This descriptor activates the JSF Servlet -->
<!-- Write your navigation rules here. You are encouraged to use CDI for
creating @Named managed beans. -->
<application>
<resource-handler>org.omnifaces.resourcehandler.UnmappedResourceHandler</resource-handler>
</application>
</faces-config>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="6.0"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd">
<display-name>pokus</display-name>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>jakarta.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
<url-pattern>/jakarta.faces.resource/*</url-pattern>
</servlet-mapping>
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>nova-light</param-value>
</context-param>
</web-app>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Use old JSF namespaces to allow content assist in eclipse -->
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:pt="jakarta.faces.passthrough">
<!--
xmlns:h="jakarta.faces.html"
xmlns:f="jakarta.faces.core"
-->
<h:head>
<title>Edit person</title>
<h:outputStylesheet
name="webjars/font-awesome/6.5.2/css/fontawesome.css" />
<h:outputStylesheet name="webjars/font-awesome/6.5.2/css/solid.css" />
<h:outputStylesheet name="webjars/font-awesome/6.5.2/css/regular.css" />
<h:outputStylesheet name="webjars/font-awesome/6.5.2/css/brands.css" />
<h:outputStylesheet name="webjars/bootstrap/5.3.3/css/bootstrap.css" />
</h:head>
<body>
<h2>
Edit Person <i class="fa-regular fa-thumbs-up"></i>
</h2>
<h:form>
<h:messages />
<h:panelGrid columns="2">
<h:outputText value="Name:" />
<h:inputText value="#{personController.editedPerson.name}" pt:placeholder="some name" >
<f:validateLength minimum="2" />
</h:inputText>
<h:outputText value="Follow:" />
<h:selectOneMenu value="#{personController.editedPerson.follow}">
<f:selectItem itemLabel="No one" itemValue="#{null}"
noSelectionOption="true" />
<f:selectItems value="#{personController.findAll()}" var="p"
itemLabel="#{p.name}" itemValue="#{p}" />
</h:selectOneMenu>
<p:button outcome="persons" value="Cancel" icon="fas fa-xmark" />
<h:commandButton action="#{personController.save()}" value="Save" styleClass="btn btn-success"/>
</h:panelGrid>
</h:form>
<h:outputScript name="webjars/font-awesome/6.5.2/js/fontawesome.js" />
<h:outputScript name="webjars/bootstrap/5.3.3/js/bootstrap.min.js" />
</body>
</html>
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment