Skip to content

Commit

Permalink
Add gs-security-model and gs-security projects
Browse files Browse the repository at this point in the history
  • Loading branch information
fducroquet committed Oct 18, 2016
1 parent 162f87f commit 20f428c
Show file tree
Hide file tree
Showing 12 changed files with 225 additions and 0 deletions.
16 changes: 16 additions & 0 deletions gs-security-model/.classpath
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>
1 change: 1 addition & 0 deletions gs-security-model/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target/
23 changes: 23 additions & 0 deletions gs-security-model/.project
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>
23 changes: 23 additions & 0 deletions gs-security-model/pom.xml
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>
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 {

}
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 {

}
}
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 {

}
16 changes: 16 additions & 0 deletions gs-security/.classpath
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>
1 change: 1 addition & 0 deletions gs-security/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target/
23 changes: 23 additions & 0 deletions gs-security/.project
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>
31 changes: 31 additions & 0 deletions gs-security/pom.xml
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>
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();
}
}
}

0 comments on commit 20f428c

Please sign in to comment.