-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add gs-security-model and gs-security projects
- Loading branch information
1 parent
162f87f
commit 20f428c
Showing
12 changed files
with
225 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" output="target/classes" path="src/main/java"> | ||
<attributes> | ||
<attribute name="optional" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>gs-security-model</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.m2e.core.maven2Builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.eclipse.m2e.core.maven2Nature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>gs-security-model</artifactId> | ||
<name>Generic System Security Model</name> | ||
<parent> | ||
<groupId>org.genericsystem</groupId> | ||
<artifactId>genericsystem2015</artifactId> | ||
<version>4.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.genericsystem</groupId> | ||
<artifactId>gs-kernel</artifactId> | ||
<version>4.0-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |
8 changes: 8 additions & 0 deletions
8
gs-security-model/src/main/java/org/genericsystem/security/model/Role.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.genericsystem.security.model; | ||
|
||
import org.genericsystem.api.core.annotations.SystemGeneric; | ||
|
||
@SystemGeneric | ||
public class Role { | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
gs-security-model/src/main/java/org/genericsystem/security/model/User.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.genericsystem.security.model; | ||
|
||
import org.genericsystem.api.core.annotations.Components; | ||
import org.genericsystem.api.core.annotations.Dependencies; | ||
import org.genericsystem.api.core.annotations.SystemGeneric; | ||
import org.genericsystem.api.core.annotations.constraints.SingularConstraint; | ||
import org.genericsystem.security.model.User.Password; | ||
|
||
@SystemGeneric | ||
@Dependencies({ Password.class, UserRole.class }) | ||
public class User { | ||
|
||
@SystemGeneric | ||
@Components(User.class) | ||
@SingularConstraint | ||
public static class Password { | ||
|
||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
gs-security-model/src/main/java/org/genericsystem/security/model/UserRole.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.genericsystem.security.model; | ||
|
||
import org.genericsystem.api.core.annotations.Components; | ||
import org.genericsystem.api.core.annotations.SystemGeneric; | ||
|
||
@SystemGeneric | ||
@Components({ User.class, Role.class }) | ||
public class UserRole { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" output="target/classes" path="src/main/java"> | ||
<attributes> | ||
<attribute name="optional" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>gs-security</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.m2e.core.maven2Builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.eclipse.m2e.core.maven2Nature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.genericsystem</groupId> | ||
<artifactId>genericsystem2015</artifactId> | ||
<version>4.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>gs-security</artifactId> | ||
<name>Generic System Security</name> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.genericsystem</groupId> | ||
<artifactId>gs-security-model</artifactId> | ||
<version>4.0-SNAPSHOT</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.genericsystem</groupId> | ||
<artifactId>gs-reactor</artifactId> | ||
<version>4.0-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |
54 changes: 54 additions & 0 deletions
54
gs-security/src/main/java/org/genericsystem/security/SecurityApp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package org.genericsystem.security; | ||
|
||
import org.genericsystem.reactor.htmltag.HtmlH1; | ||
|
||
import org.genericsystem.reactor.gscomponents.GSApp; | ||
|
||
import org.genericsystem.reactor.gscomponents3.AppHeader; | ||
import org.genericsystem.reactor.gscomponents3.AppHeader.TitleDiv; | ||
import org.genericsystem.reactor.gscomponents3.DivWithTitle.TitledInstancesTable; | ||
import org.genericsystem.reactor.gscomponents3.Modal.ModalEditor; | ||
import org.genericsystem.reactor.gscomponents3.Monitor; | ||
import org.genericsystem.reactor.gscomponents3.Responsive; | ||
|
||
import org.genericsystem.common.Root; | ||
import org.genericsystem.reactor.annotations.Children; | ||
import org.genericsystem.reactor.annotations.DependsOnModel; | ||
import org.genericsystem.reactor.annotations.DirectSelect; | ||
import org.genericsystem.reactor.annotations.RunScript; | ||
import org.genericsystem.reactor.annotations.SetText; | ||
import org.genericsystem.reactor.annotations.Style; | ||
import org.genericsystem.reactor.appserver.ApplicationServer; | ||
import org.genericsystem.reactor.appserver.Script; | ||
import org.genericsystem.security.SecurityApp.ExampleScript; | ||
import org.genericsystem.security.model.Role; | ||
import org.genericsystem.security.model.User; | ||
|
||
/** | ||
* @author Nicolas Feybesse | ||
* | ||
*/ | ||
|
||
@RunScript(ExampleScript.class) | ||
@DependsOnModel({ User.class }) | ||
@Style(name = "background-color", value = "Red") | ||
//@Style(path = Responsive.class, name = "width", value = "80%") | ||
//@Style(name = "align-items", value = "center") | ||
@Children({ ModalEditor.class, AppHeader.class, Responsive.class, Monitor.class }) | ||
@Children(path = Responsive.class, value = { TitledInstancesTable.class, TitledInstancesTable.class }) | ||
@SetText(path = { AppHeader.class, TitleDiv.class, HtmlH1.class }, value = "gs-security") | ||
@DirectSelect(path = { Responsive.class, TitledInstancesTable.class }, value = { User.class, Role.class }) | ||
public class SecurityApp extends GSApp { | ||
|
||
public static void main(String[] mainArgs) { | ||
ApplicationServer.startSimpleGenericApp(mainArgs, SecurityApp.class, "/example"); | ||
} | ||
|
||
public static class ExampleScript implements Script { | ||
|
||
public void run(Root engine) { | ||
// Generic role = engine.find(Role.class); | ||
engine.getCurrentCache().flush(); | ||
} | ||
} | ||
} |