Skip to content

Commit

Permalink
#28: update user, group and roles functionality + profile
Browse files Browse the repository at this point in the history
  • Loading branch information
andrehertwig committed Jun 28, 2018
1 parent 80e07d6 commit 6b804c9
Show file tree
Hide file tree
Showing 45 changed files with 2,291 additions and 397 deletions.
Original file line number Diff line number Diff line change
@@ -1,142 +1,146 @@
package de.chandre.admintool.core.component;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
* A admin component<br>
* should have at least a minimum of one menu entry
* @author Andre
*
*/
public interface AdminComponent extends Comparable<AdminComponent>
{
/**
* @return the displayName
*/
String getDisplayName();

/**
* @param displayName the displayName to set
*/
void setDisplayName(String displayName);

/**
* @return the mainMenu
*/
MenuEntry getMainMenu();

/**
* @param mainMenu the mainMenu to set
*/
void setMainMenu(MenuEntry mainMenu);

/**
* @return the notificationTemplates
*/
List<String> getNotificationTemplates();

/**
* path to notification template shown in the top right menu<br>
* should start with a "li" tag. eg:<br>
* <code>
* &lt;li class="dropdown messages-menu"&gt;
* </code>
* @see https://almsaeedstudio.com/themes/AdminLTE/documentation/index.html#component-main-header
*
* @param notificationTemplates the notificationTemplates to set
*/
void setNotificationTemplates(List<String> notificationTemplates);

/**
* path to notification template shown in the top right menu<br>
* should start with a "li" tag. eg:<br>
* <code>
* &lt;li class="dropdown messages-menu"&gt;
* </code>
* @see https://almsaeedstudio.com/themes/AdminLTE/documentation/index.html#component-main-header
*
* @param notificationTemplate the template path to notification template
*/
void addNotificationTemplate(String notificationTemplate);

/**
* @return the additionalCSS
*/
Map<String, Boolean> getAdditionalCSS();

/**
* map with paths to CSS.<br>
*
* @param additionalCSS the additionalCSS to set
* @see #addAdditionalCSS(String, boolean)
*/
void setAdditionalCSS(Map<String, Boolean> additionalCSS);

/**
* path to CSS.<br>
* Example:<br>
* <code>
* addAdditionalCSS("/static/myComponent/css/myStyles.css", true);<br>
* addAdditionalCSS("http://example.com/styles.css", false);
* </code>
* @param additionalCSS the additionalCSS to set
*/
void addAdditionalCSS(String additionalCSS, boolean relative);

/**
* @return the additionalJS
*/
Map<String, Boolean> getAdditionalJS();

/**
* map with path to additional JavaScript files. <br>
* @param additionalJS the additionalJS to set
* @see #addAdditionalJS(String, boolean)
*/
void setAdditionalJS(Map<String, Boolean> additionalJS);

/**
* path to additional JavaScript files.<br>
* Example:<br>
* <code>
* addAdditionalJS("/static/myComponent/js/myScripts.js", true);<br>
* addAdditionalJS("http://example.com/script.js", false);
* </code>
* @param additionalJS the additionalJS to set
*/
void addAdditionalJS(String additionalJS, boolean relative);

/**
* should return a list of roles which should be able to access this component
* @return
* @since 1.0.1
*/
Set<String> getSecurityRoles();

/**
* security role like "ROLE_USER" or for anonymous "ROLE_ANONYMOUS" validated with spring security<br>
* requires: admin-tool-core-security<br>
* setting these roles will no effect on access, only for displaying or hiding menu entries<br>
* the access restrictions must be done by your own with the security configuration
*
* @param securityRole
* @since 1.0.1
*/
void addSecurityRole(String securityRole);

/**
* position of component in menu. Initially set to {@link Integer#MAX_VALUE}
* @return
* @since 1.0.1
*/
Integer getPosition();

/**
* position of component in menu. Initially set to {@link Integer#MAX_VALUE}
* @param position
* @since 1.0.1
*/
void setPosition(Integer position);
}
package de.chandre.admintool.core.component;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
* A admin component<br>
* should have at least a minimum of one menu entry
* @author Andre
*
*/
public interface AdminComponent extends Comparable<AdminComponent>
{
/**
* @return the displayName
*/
String getDisplayName();

/**
* @param displayName the displayName to set
*/
void setDisplayName(String displayName);

/**
* @return the mainMenu
*/
MenuEntry getMainMenu();

/**
* @param mainMenu the mainMenu to set
*/
void setMainMenu(MenuEntry mainMenu);

/**
* @return the notificationTemplates
*/
List<String> getNotificationTemplates();

/**
* path to notification template shown in the top right menu<br>
* should start with a "li" tag. eg:<br>
* <code>
* &lt;li class="dropdown messages-menu"&gt;
* </code>
* @see https://almsaeedstudio.com/themes/AdminLTE/documentation/index.html#component-main-header
*
* @param notificationTemplates the notificationTemplates to set
*/
void setNotificationTemplates(List<String> notificationTemplates);

/**
* path to notification template shown in the top right menu<br>
* should start with a "li" tag. eg:<br>
* <code>
* &lt;li class="dropdown messages-menu"&gt;
* </code>
* @see https://almsaeedstudio.com/themes/AdminLTE/documentation/index.html#component-main-header
*
* @param notificationTemplate the template path to notification template
*/
void addNotificationTemplate(String notificationTemplate);

/**
* @return the additionalCSS
*/
Map<String, Boolean> getAdditionalCSS();

/**
* map with paths to CSS.<br>
*
* @param additionalCSS the additionalCSS to set
* @see #addAdditionalCSS(String, boolean)
*/
void setAdditionalCSS(Map<String, Boolean> additionalCSS);

/**
* path to CSS.<br>
* Example:<br>
* <code>
* addAdditionalCSS("/static/myComponent/css/myStyles.css", true);<br>
* addAdditionalCSS("http://example.com/styles.css", false);
* </code>
* @param additionalCSS the additionalCSS to set
*/
void addAdditionalCSS(String additionalCSS, boolean relative);

/**
* @return the additionalJS
*/
Map<String, Boolean> getAdditionalJS();

/**
* map with path to additional JavaScript files. <br>
* @param additionalJS the additionalJS to set
* @see #addAdditionalJS(String, boolean)
*/
void setAdditionalJS(Map<String, Boolean> additionalJS);

/**
* path to additional JavaScript files.<br>
* Example:<br>
* <code>
* addAdditionalJS("/static/myComponent/js/myScripts.js", true);<br>
* addAdditionalJS("http://example.com/script.js", false);
* </code>
* @param additionalJS the additionalJS to set
*/
void addAdditionalJS(String additionalJS, boolean relative);

/**
* should return a list of roles which should be able to access this component
* @return
* @since 1.0.1
* @deprecated unnecessary because url resolving in template will work, will be removed with version 1.2.0
*/
@Deprecated
Set<String> getSecurityRoles();

/**
* security role like "ROLE_USER" or for anonymous "ROLE_ANONYMOUS" validated with spring security<br>
* requires: admin-tool-core-security<br>
* setting these roles will no effect on access, only for displaying or hiding menu entries<br>
* the access restrictions must be done by your own with the security configuration
*
* @param securityRole
* @since 1.0.1
* @deprecated unnecessary because url resolving in template will work, will be removed with version 1.2.0
*/
@Deprecated
void addSecurityRole(String securityRole);

/**
* position of component in menu. Initially set to {@link Integer#MAX_VALUE}
* @return
* @since 1.0.1
*/
Integer getPosition();

/**
* position of component in menu. Initially set to {@link Integer#MAX_VALUE}
* @param position
* @since 1.0.1
*/
void setPosition(Integer position);
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class AdminComponentImpl implements AdminComponent
private Map<String, Boolean> additionalCSS = new LinkedHashMap<>(1);
private Map<String, Boolean> additionalJS = new LinkedHashMap<>(1);

@Deprecated
private Set<String> securityRoles = new HashSet<>();

private Integer position;
Expand Down Expand Up @@ -169,8 +170,10 @@ public void addAdditionalJS(String additionalJS, boolean relative) {
* @since 1.0.1
* @return the securityRoles
* @see #addSecurityRole(String)
* @deprecated unnecessary because url resolving in template will work, will be removed with version 1.2.0
*/
@Override
@Deprecated
public Set<String> getSecurityRoles() {
return securityRoles;
}
Expand All @@ -180,12 +183,15 @@ public Set<String> getSecurityRoles() {
* @since 1.0.1
* @param securityRoles the securityRoles to set
* @see #addSecurityRole(String)
* @deprecated unnecessary because url resolving in template will work, will be removed with version 1.2.0
*/
@Deprecated
public void setSecurityRoles(Set<String> securityRoles) {
this.securityRoles = securityRoles;
}

@Override
@Deprecated
public void addSecurityRole(String securityRole) {
this.securityRoles.add(securityRole);
}
Expand Down Expand Up @@ -380,17 +386,21 @@ public AdminComponentBuilder additionalJS(String additionalJS, boolean relative)
/**
* @see AdminComponent#addSecurityRole(String)
* @param securityRole
* @deprecated unnecessary because url resolving in template will work, will be removed with version 1.2.0
* @return
*/
@Deprecated
public AdminComponentBuilder securityRole(String securityRole) {
component.addSecurityRole(securityRole);
return this;
}
/**
* @see AdminComponent#getSecurityRoles().addAll(set)
* @param securityRoles
* @deprecated unnecessary because url resolving in template will work, will be removed with version 1.2.0
* @return
*/
@Deprecated
public AdminComponentBuilder securityRoles(Set<String> securityRoles) {
component.getSecurityRoles().addAll(securityRoles);
return this;
Expand Down
Loading

0 comments on commit 6b804c9

Please sign in to comment.