本文整理汇总了Java中org.apache.isis.applib.services.bookmark.Bookmark类的典型用法代码示例。如果您正苦于以下问题:Java Bookmark类的具体用法?Java Bookmark怎么用?Java Bookmark使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Bookmark类属于org.apache.isis.applib.services.bookmark包,在下文中一共展示了Bookmark类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: recentActivity
import org.apache.isis.applib.services.bookmark.Bookmark; //导入依赖的package包/类
/**
* Depending on which services are available, returns either a list of {@link org.isisaddons.module.command.dom.CommandJdo command}s that have
* caused a change in the domain object or a list of {@link org.isisaddons.module.audit.dom.AuditEntry audit entries} capturing the 'effect'
* of that change.
*
* <p>
* If {@link org.isisaddons.module.command.dom.CommandJdo command}s are returned, then the corresponding {@link org.isisaddons.module.audit.dom.AuditEntry audit entries} are
* available from each command.
*/
@Action(
semantics = SemanticsOf.SAFE
)
@MemberOrder(sequence="30")
public List<? extends DomainChangeJdoAbstract> recentActivity (
final Object targetDomainObject,
@Parameter(optionality= Optionality.OPTIONAL)
final LocalDate from,
@Parameter(optionality= Optionality.OPTIONAL)
final LocalDate to) {
final Bookmark targetBookmark = bookmarkService.bookmarkFor(targetDomainObject);
final List<DomainChangeJdoAbstract> changes = Lists.newArrayList();
if(commandServiceRepository != null) {
changes.addAll(commandServiceRepository.findByTargetAndFromAndTo(targetBookmark, from, to));
}
if(publishedEventRepository != null) {
changes.addAll(publishedEventRepository.findByTargetAndFromAndTo(targetBookmark, from, to));
}
changes.addAll(auditingServiceRepository.findByTargetAndFromAndTo(targetBookmark, from, to));
Collections.sort(changes, DomainChangeJdoAbstract.compareByTimestampDescThenType());
return changes;
}
示例2: map
import org.apache.isis.applib.services.bookmark.Bookmark; //导入依赖的package包/类
@Programmatic
@Override
public Object map(
final Object object,
final List<MediaType> acceptableMediaTypes,
final RepresentationType representationType) {
if(object instanceof QuickObject) {
final Bookmark bookmark = bookmarkService.bookmarkFor(object);
final QuickObjectDto dto = mapperFactory.getMapperFacade().map(object, QuickObjectDto.class);
final OidDto oidDto = mapperFactory.getMapperFacade().map(bookmark, OidDto.class);
// manually wire together
dto.setOid(oidDto);
return dto;
}
return null;
}
示例3: recentActivity
import org.apache.isis.applib.services.bookmark.Bookmark; //导入依赖的package包/类
/**
* Depending on which services are available, returns either a list of {@link org.isisaddons.module.command.dom.CommandJdo command}s that have
* caused a change in the domain object or a list of {@link org.isisaddons.module.audit.dom.AuditEntry audit entries} capturing the 'effect'
* of that change.
*
* <p>
* If {@link org.isisaddons.module.command.dom.CommandJdo command}s are returned, then the corresponding {@link org.isisaddons.module.audit.dom.AuditEntry audit entries} are
* available from each command.
*/
@Action(
semantics = SemanticsOf.SAFE
)
@MemberOrder(sequence="30")
public List<? extends DomainChangeJdoAbstract> recentActivity (
final Object targetDomainObject,
@Parameter(optionality= Optionality.OPTIONAL)
final LocalDate from,
@Parameter(optionality= Optionality.OPTIONAL)
final LocalDate to) {
final Bookmark targetBookmark = bookmarkService.bookmarkFor(targetDomainObject);
final List<DomainChangeJdoAbstract> changes = Lists.newArrayList();
if(commandServiceRepository != null) {
changes.addAll(commandServiceRepository.findByTargetAndFromAndTo(targetBookmark, from, to));
}
if(publishingServiceRepository != null) {
changes.addAll(publishingServiceRepository.findByTargetAndFromAndTo(targetBookmark, from, to));
}
changes.addAll(auditingServiceRepository.findByTargetAndFromAndTo(targetBookmark, from, to));
Collections.sort(changes, DomainChangeJdoAbstract.compareByTimestampDescThenType());
return changes;
}
示例4: recentChanges
import org.apache.isis.applib.services.bookmark.Bookmark; //导入依赖的package包/类
/**
* Depending on which services are available, returns either a list of {@link CommandJdo command}s that have
* caused a change in the domain object or a list of {@link AuditEntryJdo audit entries} capturing the 'effect'
* of that change.
*
* <p>
* If {@link CommandJdo command}s are returned, then the corresponding {@link AuditEntryJdo audit entries} are
* available from each command.
*/
@NotInServiceMenu
@ActionSemantics(Of.SAFE)
@MemberOrder(sequence="30")
public List<? extends DomainChangeJdoAbstract> recentChanges (
final Object targetDomainObject,
final @Optional @Named("From") LocalDate from,
final @Optional @Named("To") LocalDate to) {
final Bookmark targetBookmark = bookmarkService.bookmarkFor(targetDomainObject);
final List<DomainChangeJdoAbstract> changes = Lists.newArrayList();
if(commandServiceRepository != null) {
changes.addAll(commandServiceRepository.findByTargetAndFromAndTo(targetBookmark, from, to));
}
if(publishingServiceRepository != null) {
changes.addAll(publishingServiceRepository.findByTargetAndFromAndTo(targetBookmark, from, to));
}
changes.addAll(auditingServiceRepository.findByTargetAndFromAndTo(targetBookmark, from, to));
Collections.sort(changes, DomainChangeJdoAbstract.compareByTimestampDescThenType());
return changes;
}
示例5: findNumerator
import org.apache.isis.applib.services.bookmark.Bookmark; //导入依赖的package包/类
@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());
}
}
示例6: createNumerator
import org.apache.isis.applib.services.bookmark.Bookmark; //导入依赖的package包/类
private Numerator createNumerator(
final String numeratorName,
final Object scopedToIfAny,
final String format,
final BigInteger lastIncrement,
final ApplicationTenancy applicationTenancy) {
final Numerator numerator = newTransientInstance();
numerator.setName(numeratorName);
numerator.setApplicationTenancyPath(applicationTenancy.getPath());
if(scopedToIfAny != null) {
final Bookmark bookmark = getBookmarkService().bookmarkFor(scopedToIfAny);
numerator.setObjectType(bookmark.getObjectType());
numerator.setObjectIdentifier(bookmark.getIdentifier());
}
numerator.setFormat(format);
numerator.setLastIncrement(lastIncrement);
persist(numerator);
return numerator;
}
示例7: findBySourceAndCalendarName
import org.apache.isis.applib.services.bookmark.Bookmark; //导入依赖的package包/类
@Programmatic
public EventSourceLink findBySourceAndCalendarName(
final EventSource eventSource,
final String calendarName) {
if(eventSource == null) {
return null;
}
if(calendarName == null) {
return null;
}
final Bookmark bookmark = bookmarkService.bookmarkFor(eventSource);
if(bookmark == null) {
return null;
}
return container.firstMatch(
new QueryDefault<>(EventSourceLink.class,
"findBySourceAndCalendarName",
"sourceObjectType", bookmark.getObjectType(),
"sourceIdentifier", bookmark.getIdentifier(),
"calendarName", calendarName));
}
示例8: create
import org.apache.isis.applib.services.bookmark.Bookmark; //导入依赖的package包/类
@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;
}
示例9: findByOwnerAndCommunicationChannelType
import org.apache.isis.applib.services.bookmark.Bookmark; //导入依赖的package包/类
@Programmatic
public List<CommunicationChannelOwnerLink> findByOwnerAndCommunicationChannelType(
final CommunicationChannelOwner owner,
final CommunicationChannelType communicationChannelType) {
if(owner == null) {
return null;
}
if(communicationChannelType == null) {
return null;
}
final Bookmark bookmark = bookmarkService.bookmarkFor(owner);
if(bookmark == null) {
return null;
}
return container.allMatches(
new QueryDefault<>(CommunicationChannelOwnerLink.class,
"findByOwnerAndCommunicationChannelType",
"ownerObjectType", bookmark.getObjectType(),
"ownerIdentifier", bookmark.getIdentifier(),
"communicationChannelType", communicationChannelType));
}
示例10: create
import org.apache.isis.applib.services.bookmark.Bookmark; //导入依赖的package包/类
@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;
}
示例11: findByAttachedToAndRoleName
import org.apache.isis.applib.services.bookmark.Bookmark; //导入依赖的package包/类
@Programmatic
public List<Paperclip> findByAttachedToAndRoleName(
final Object attachedTo,
final String roleName) {
if(attachedTo == null) {
return null;
}
if(roleName == null) {
return null;
}
final Bookmark bookmark = bookmarkService.bookmarkFor(attachedTo);
if(bookmark == null) {
return null;
}
final String attachedToStr = bookmark.toString();
return repositoryService.allMatches(
new QueryDefault<>(Paperclip.class,
"findByAttachedToAndRoleName",
"attachedToStr", attachedToStr,
"roleName", roleName));
}
示例12: findByDocumentAndAttachedTo
import org.apache.isis.applib.services.bookmark.Bookmark; //导入依赖的package包/类
@Programmatic
public List<Paperclip> findByDocumentAndAttachedTo(
final DocumentAbstract<?> document,
final Object attachedTo) {
if(document == null) {
return null;
}
if(attachedTo == null) {
return null;
}
final Bookmark bookmark = bookmarkService.bookmarkFor(attachedTo);
if(bookmark == null) {
return null;
}
final String attachedToStr = bookmark.toString();
return repositoryService.allMatches(
new QueryDefault<>(Paperclip.class,
"findByDocumentAndAttachedTo",
"document", document,
"attachedToStr", attachedToStr));
}
示例13: findByDocumentAndAttachedToAndRoleName
import org.apache.isis.applib.services.bookmark.Bookmark; //导入依赖的package包/类
@Programmatic
public Paperclip findByDocumentAndAttachedToAndRoleName(
final DocumentAbstract<?> document,
final Object attachedTo,
final String roleName) {
if(document == null) {
return null;
}
if(attachedTo == null) {
return null;
}
if(roleName == null) {
return null;
}
final Bookmark bookmark = bookmarkService.bookmarkFor(attachedTo);
if(bookmark == null) {
return null;
}
final String attachedToStr = bookmark.toString();
return repositoryService.firstMatch(
new QueryDefault<>(Paperclip.class,
"findByDocumentAndAttachedToAndRoleName",
"document", document,
"attachedToStr", attachedToStr,
"roleName", roleName));
}
示例14: init
import org.apache.isis.applib.services.bookmark.Bookmark; //导入依赖的package包/类
@Programmatic
@PostConstruct
public void init() {
mapperFactory = new DefaultMapperFactory.Builder().build();
mapperFactory.registerClassMap(
mapperFactory.classMap(QuickObject.class, QuickObjectDto.class)
.byDefault() // all fields are the compatible
.toClassMap());
mapperFactory.registerClassMap(
mapperFactory.classMap(Bookmark.class, OidDto.class)
.field("identifier", "objectIdentifier") // customized
.byDefault() // all other fields are compatible
.toClassMap());
}
示例15: lookup
import org.apache.isis.applib.services.bookmark.Bookmark; //导入依赖的package包/类
@MemberOrder(sequence = "20")
public Object lookup(
@ParameterLayout(named = "Bookmark")
final String bookmarkStr) {
Bookmark bookmark = new Bookmark(bookmarkStr);
final Object obj = bookmarkService.lookup(bookmark, BookmarkService2.FieldResetPolicy.DONT_RESET);
return obj;
}