Skip to content

Commit

Permalink
closes #13 - menu orders; also new finders for ApplicationTenancy
Browse files Browse the repository at this point in the history
namely:
- ApplicationTenancies#findTenancyByName
- ApplicationTenancies#findTenancyByPath
  • Loading branch information
danhaywood committed Mar 5, 2015
1 parent 2a2e979 commit 21714d1
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 23 deletions.
2 changes: 1 addition & 1 deletion dom/pom.xml
Expand Up @@ -53,7 +53,7 @@ language governing permissions and limitations under the License.
<compileSource>1.7</compileSource>
<compileTarget>1.7</compileTarget>

<isis.version>1.8.0</isis.version>
<isis.version>1.9.0-SNAPSHOT</isis.version>

<datanucleus-maven-plugin.version>3.3.2</datanucleus-maven-plugin.version>

Expand Down
Expand Up @@ -104,7 +104,7 @@ public AllPackagesDomainEvent(final ApplicationFeatureViewModels source, final I
@ActionLayout(
cssClassFa = "fa-list"
)
@MemberOrder(sequence = "10")
@MemberOrder(sequence = "100.40.1")
public List<ApplicationPackage> allPackages() {
return asViewModels(applicationFeatures.allPackages(), ApplicationPackage.class);
}
Expand All @@ -126,7 +126,7 @@ public AllClassesDomainEvent(final ApplicationFeatureViewModels source, final Id
@ActionLayout(
cssClassFa = "fa-list"
)
@MemberOrder(sequence = "20")
@MemberOrder(sequence = "100.40.2")
public List<ApplicationClass> allClasses() {
return asViewModels(applicationFeatures.allClasses(), ApplicationClass.class);
}
Expand All @@ -150,7 +150,7 @@ public AllActionsDomainEvent(final ApplicationFeatureViewModels source, final Id
@ActionLayout(
cssClassFa = "fa-list"
)
@MemberOrder(sequence = "40")
@MemberOrder(sequence = "100.40.3")
public List<ApplicationClassAction> allActions() {
return asViewModels(applicationFeatures.allActions(), ApplicationClassAction.class);
}
Expand All @@ -172,7 +172,7 @@ public AllPropertiesDomainEvent(final ApplicationFeatureViewModels source, final
@ActionLayout(
cssClassFa = "fa-list"
)
@MemberOrder(sequence = "50")
@MemberOrder(sequence = "100.40.4")
public List<ApplicationClassProperty> allProperties() {
return asViewModels(applicationFeatures.allProperties(), ApplicationClassProperty.class);
}
Expand All @@ -196,7 +196,7 @@ public AllCollectionsDomainEvent(final ApplicationFeatureViewModels source, fina
@ActionLayout(
cssClassFa = "fa-list"
)
@MemberOrder(sequence = "60")
@MemberOrder(sequence = "100.40.5")
public List<ApplicationClassCollection> allCollections() {
return asViewModels(applicationFeatures.allCollections(), ApplicationClassCollection.class);
}
Expand Down
Expand Up @@ -277,7 +277,7 @@ public AllPermissionsDomainEvent(final ApplicationPermissions source, final Iden
@ActionLayout(
cssClassFa = "fa-list"
)
@MemberOrder(sequence = "60.9")
@MemberOrder(sequence = "100.50.1")
public List<ApplicationPermission> allPermissions() {
return container.allInstances(ApplicationPermission.class);
}
Expand Down
Expand Up @@ -114,7 +114,7 @@ public FindByRoleNameDomainEvent(final ApplicationRoles source, final Identifier
@ActionLayout(
cssClassFa = "fa-crosshairs"
)
@MemberOrder(sequence = "20.1")
@MemberOrder(sequence = "100.20.1")
public ApplicationRole findRoleByName(
@Parameter(maxLength = ApplicationRole.MAX_LENGTH_NAME)
@ParameterLayout(named="Name", typicalLength=ApplicationRole.TYPICAL_LENGTH_NAME)
Expand Down Expand Up @@ -142,7 +142,7 @@ public NewRoleDomainEvent(final ApplicationRoles source, final Identifier identi
@ActionLayout(
cssClassFa = "fa-plus"
)
@MemberOrder(sequence = "20.2")
@MemberOrder(sequence = "100.20.2")
public ApplicationRole newRole(
@Parameter(maxLength = ApplicationRole.MAX_LENGTH_NAME)
@ParameterLayout(named="Name", typicalLength=ApplicationRole.TYPICAL_LENGTH_NAME)
Expand Down Expand Up @@ -177,7 +177,7 @@ public AllRolesDomainEvent(final ApplicationRoles source, final Identifier ident
@ActionLayout(
cssClassFa = "fa-list"
)
@MemberOrder(sequence = "20.3")
@MemberOrder(sequence = "100.20.3")
public List<ApplicationRole> allRoles() {
return allInstances(ApplicationRole.class);
}
Expand Down
Expand Up @@ -103,19 +103,51 @@ public void init() {

//endregion

//region > findTenancyByName (programmatic)
//region > findTenancyByName

@Programmatic
public ApplicationTenancy findTenancyByName(final String name) {
public static class FindTenancyByNameDomainEvent extends ActionDomainEvent {
public FindTenancyByNameDomainEvent(final ApplicationTenancies source, final Identifier identifier, final Object... args) {
super(source, identifier, args);
}
}

@Action(
domainEvent = FindTenancyByNameDomainEvent.class,
semantics = SemanticsOf.SAFE
)
@ActionLayout(
cssClassFa = "fa-crosshairs"
)
@MemberOrder(sequence = "100.30.1")
public ApplicationTenancy findTenancyByName(
@Parameter(maxLength = ApplicationTenancy.MAX_LENGTH_NAME)
@ParameterLayout(named = "Name", typicalLength = ApplicationTenancy.TYPICAL_LENGTH_NAME)
final String name) {
return uniqueMatch(new QueryDefault<>(ApplicationTenancy.class, "findByName", "name", name));
}

//endregion

//region > findTenancyByPath (programmatic)
//region > findTenancyByPath

@Programmatic
public ApplicationTenancy findTenancyByPath(final String path) {
public static class FindTenancyByPathDomainEvent extends ActionDomainEvent {
public FindTenancyByPathDomainEvent(final ApplicationTenancies source, final Identifier identifier, final Object... args) {
super(source, identifier, args);
}
}

@Action(
domainEvent = FindTenancyByPathDomainEvent.class,
semantics = SemanticsOf.SAFE
)
@ActionLayout(
cssClassFa = "fa-crosshairs"
)
@MemberOrder(sequence = "100.30.2")
public ApplicationTenancy findTenancyByPath(
@Parameter(maxLength = ApplicationTenancy.MAX_LENGTH_PATH)
@ParameterLayout(named = "Path")
final String path) {
if(path == null) {
return null;
}
Expand All @@ -140,7 +172,7 @@ public NewTenancyDomainEvent(final ApplicationTenancies source, final Identifier
@ActionLayout(
cssClassFa = "fa-plus"
)
@MemberOrder(sequence = "90.3")
@MemberOrder(sequence = "100.30.3")
public ApplicationTenancy newTenancy(
@Parameter(maxLength = ApplicationTenancy.MAX_LENGTH_NAME)
@ParameterLayout(named = "Name", typicalLength = ApplicationTenancy.TYPICAL_LENGTH_NAME)
Expand Down Expand Up @@ -179,7 +211,7 @@ public AllTenanciesDomainEvent(final ApplicationTenancies source, final Identifi
@ActionLayout(
cssClassFa = "fa-list"
)
@MemberOrder(sequence = "90.4")
@MemberOrder(sequence = "100.30.4")
public List<ApplicationTenancy> allTenancies() {
return allInstances(ApplicationTenancy.class);
}
Expand Down
Expand Up @@ -153,7 +153,7 @@ public FindUserByUserNameDomainEvent(final ApplicationUsers source, final Identi
@ActionLayout(
cssClassFa = "fa-crosshairs"
)
@MemberOrder(sequence = "10")
@MemberOrder(sequence = "100.10.1")
public ApplicationUser findUserByUsername(
@Parameter(maxLength = ApplicationUser.MAX_LENGTH_USERNAME)
@ParameterLayout(named = "Username")
Expand Down Expand Up @@ -191,7 +191,7 @@ public FindUsersByNameDomainEvent(final ApplicationUsers source, final Identifie
@ActionLayout(
cssClassFa = "fa-search"
)
@MemberOrder(sequence = "20")
@MemberOrder(sequence = "100.10.2")
public List<ApplicationUser> findUsersByName(
final @ParameterLayout(named="Name") String name) {
final String nameRegex = "(?i).*" + name + ".*";
Expand All @@ -216,7 +216,7 @@ public NewDelegateUserDomainEvent(final ApplicationUsers source, final Identifie
@ActionLayout(
cssClassFa = "fa-plus"
)
@MemberOrder(sequence = "30")
@MemberOrder(sequence = "100.10.3")
public ApplicationUser newDelegateUser(
@Parameter(maxLength = ApplicationUser.MAX_LENGTH_USERNAME)
@ParameterLayout(named="Name")
Expand Down Expand Up @@ -266,7 +266,7 @@ public NewLocalUserDomainEvent(final ApplicationUsers source, final Identifier i
@ActionLayout(
cssClassFa = "fa-plus"
)
@MemberOrder(sequence = "10.4")
@MemberOrder(sequence = "100.10.4")
public ApplicationUser newLocalUser(
@Parameter(maxLength = ApplicationUser.MAX_LENGTH_USERNAME)
@ParameterLayout(named="Name")
Expand Down Expand Up @@ -338,7 +338,7 @@ public AllUsersDomainEvent(final ApplicationUsers source, final Identifier ident
@ActionLayout(
cssClassFa = "fa-list"
)
@MemberOrder(sequence = "10.9")
@MemberOrder(sequence = "100.10.5")
public List<ApplicationUser> allUsers() {
return allInstances(ApplicationUser.class);
}
Expand Down

0 comments on commit 21714d1

Please sign in to comment.