use of org.apache.isis.applib.annotation.Programmatic in project estatio by estatio.
the class NumeratorRepository method findNumerator.
@Programmatic
public Numerator findNumerator(final String numeratorName, final Object scopedToIfAny, final ApplicationTenancy applicationTenancy) {
if (scopedToIfAny == null) {
return firstMatch("findByNameAndApplicationTenancyPath", "name", numeratorName, "applicationTenancyPath", applicationTenancy == null ? "/" : applicationTenancy.getPath());
} else {
final Bookmark bookmark = getBookmarkService().bookmarkFor(scopedToIfAny);
final String objectType = bookmark.getObjectType();
final String objectIdentifier = bookmark.getIdentifier();
return firstMatch("findByNameAndObjectTypeAndObjectIdentifierAndApplicationTenancyPath", "name", numeratorName, "objectType", objectType, "objectIdentifier", objectIdentifier, "applicationTenancyPath", applicationTenancy == null ? "/" : applicationTenancy.getPath());
}
}
use of org.apache.isis.applib.annotation.Programmatic in project estatio by estatio.
the class CommunicationChannel method getId.
// //////////////////////////////////////
@Programmatic
public String getId() {
Object objectId = JDOHelper.getObjectId(this);
if (objectId == null) {
return "";
}
String objectIdStr = objectId.toString();
final String id = objectIdStr.split("\\[OID\\]")[0];
return id;
}
use of org.apache.isis.applib.annotation.Programmatic in project estatio by estatio.
the class AliasRepository method create.
// endregion
// region > create (programmatic)
@Programmatic
public Alias create(final Object aliased, final String atPath, final AliasType aliasType, final String aliasReference) {
Class<? extends Alias> aliasSubtype = subtypeClassFor(aliased);
final Alias alias = repositoryService.instantiate(aliasSubtype);
alias.setAtPath(atPath);
alias.setAliasTypeId(aliasType.getId());
alias.setReference(aliasReference);
final Bookmark bookmark = bookmarkService.bookmarkFor(aliased);
alias.setAliased(aliased);
alias.setAliasedStr(bookmark.toString());
repositoryService.persist(alias);
return alias;
}
use of org.apache.isis.applib.annotation.Programmatic in project estatio by estatio.
the class CategoryRepository method createTaxonomy.
// endregion
// region > createTaxonomy (programmatic)
@Programmatic
public Taxonomy createTaxonomy(final String name) {
final Taxonomy taxonomy = new Taxonomy(name);
repositoryService.persistAndFlush(taxonomy);
taxonomy.setTaxonomy(taxonomy);
return taxonomy;
}
use of org.apache.isis.applib.annotation.Programmatic in project estatio by estatio.
the class ClassificationRepository method create.
// endregion
// region > create (programmatic)
@Programmatic
public Classification create(final Category category, final Object classified) {
final Taxonomy taxonomy = category.getTaxonomy();
final Class<? extends Classification> subtype = subtypeClassFor(classified, taxonomy);
final Classification classification = repositoryService.instantiate(subtype);
classification.setCategory(category);
classification.setTaxonomy(taxonomy);
final Bookmark bookmark = bookmarkService.bookmarkFor(classified);
classification.setClassified(classified);
classification.setClassifiedStr(bookmark.toString());
repositoryService.persist(classification);
return classification;
}
Aggregations