本文整理了Java中org.apache.isis.core.metamodel.adapter.oid.Oid.enStringNoVersion()
方法的一些代码示例,展示了Oid.enStringNoVersion()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Oid.enStringNoVersion()
方法的具体详情如下:
包路径:org.apache.isis.core.metamodel.adapter.oid.Oid
类名称:Oid
方法名:enStringNoVersion
暂无
代码示例来源:origin: org.apache.isis.core/isis-core-viewer-restfulobjects-rendering
public static String getOidStr(final ObjectAdapter objectAdapter) {
final Oid oid = objectAdapter.getOid();
if (!(oid instanceof RootOid)) {
throw new IllegalArgumentException("objectAdapter must be a root adapter");
}
return oid.enStringNoVersion();
}
代码示例来源:origin: org.apache.isis.viewer/isis-viewer-restfulobjects-rendering
public static String getOidStr(final RendererContext renderContext, final ObjectAdapter objectAdapter) {
final Oid oid = objectAdapter.getOid();
if (!(oid instanceof RootOid)) {
throw new IllegalArgumentException("objectAdapter must be a root adapter");
}
return oid != null ? oid.enStringNoVersion(getOidMarshaller()) : null;
}
代码示例来源:origin: org.apache.isis.viewer/isis-viewer-wicket-model
/**
* Factory method for creating {@link PageParameters} to represent an
* entity.
*/
public static PageParameters createPageParameters(final ObjectAdapter adapter) {
final PageParameters pageParameters = PageParametersUtils.newPageParameters();
final Boolean persistent = adapter != null && adapter.representsPersistent();
if (persistent) {
final String oidStr = adapter.getOid().enStringNoVersion();
PageParameterNames.OBJECT_OID.addStringTo(pageParameters, oidStr);
} else {
// don't do anything; instead the page should be redirected back to
// an EntityPage so that the underlying EntityModel that contains
// the memento for the transient ObjectAdapter can be accessed.
}
return pageParameters;
}
代码示例来源:origin: org.apache.isis.core/isis-core-viewer-wicket-model
private String encodeArg(final ObjectAdapter adapter) {
if(adapter == null) {
return NULL_ARG;
}
final ObjectSpecification objSpec = adapter.getSpecification();
if(objSpec.isEncodeable()) {
final EncodableFacet encodeable = objSpec.getFacet(EncodableFacet.class);
return encodeable.toEncodedString(adapter);
}
return adapter.getOid().enStringNoVersion();
}
代码示例来源:origin: org.apache.isis.viewer/isis-viewer-wicket-model
private String encodeArg(final ObjectAdapter adapter) {
if(adapter == null) {
return NULL_ARG;
}
final ObjectSpecification objSpec = adapter.getSpecification();
if(objSpec.isEncodeable()) {
final EncodableFacet encodeable = objSpec.getFacet(EncodableFacet.class);
return encodeable.toEncodedString(adapter);
}
return adapter.getOid().enStringNoVersion();
}
代码示例来源:origin: org.apache.isis.core/isis-core-viewer-wicket-model
/**
* Factory method for creating {@link PageParameters} to represent an
* entity.
*/
public static PageParameters createPageParameters(final ObjectAdapter adapter) {
final PageParameters pageParameters = PageParametersUtils.newPageParameters();
final Boolean persistent = adapter != null && adapter.representsPersistent();
if (persistent) {
final String oidStr = adapter.getOid().enStringNoVersion();
PageParameterNames.OBJECT_OID.addStringTo(pageParameters, oidStr);
} else {
// don't do anything; instead the page should be redirected back to
// an EntityPage so that the underlying EntityModel that contains
// the memento for the transient ObjectAdapter can be accessed.
}
return pageParameters;
}
代码示例来源:origin: org.apache.isis.viewer/isis-viewer-wicket-model
private boolean addToGraphIfParented(BookmarkableModel<?> candidateBookmarkableModel) {
boolean whetherAdded = false;
// TODO: this ought to be move into a responsibility of BookmarkableModel, perhaps, rather than downcasting
if(candidateBookmarkableModel instanceof EntityModel) {
EntityModel entityModel = (EntityModel) candidateBookmarkableModel;
final ObjectAdapter candidateAdapter = entityModel.getObject();
final List<ObjectAssociation> properties = candidateAdapter.getSpecification().getAssociations(Contributed.EXCLUDED, ObjectAssociation.Filters.REFERENCE_PROPERTIES);
for (ObjectAssociation objectAssoc : properties) {
final ObjectAdapter possibleParentAdapter = objectAssoc.get(candidateAdapter, InteractionInitiatedBy.USER);
if(possibleParentAdapter == null) {
continue;
}
final Oid possibleParentOid = possibleParentAdapter.getOid();
if(possibleParentOid == null) {
continue;
}
final String possibleParentOidStr = possibleParentOid.enStringNoVersion();
if(Objects.equal(this.oidNoVerStr, possibleParentOidStr)) {
this.addChild(candidateBookmarkableModel);
whetherAdded = true;
}
}
}
return whetherAdded;
}
代码示例来源:origin: org.apache.isis.core/isis-core-viewer-wicket-model
private boolean addToGraphIfParented(BookmarkableModel<?> candidateBookmarkableModel) {
boolean whetherAdded = false;
// TODO: this ought to be move into a responsibility of BookmarkableModel, perhaps, rather than downcasting
if(candidateBookmarkableModel instanceof EntityModel) {
EntityModel entityModel = (EntityModel) candidateBookmarkableModel;
final ObjectAdapter candidateAdapter = entityModel.getObject();
final List<ObjectAssociation> properties = candidateAdapter.getSpecification().getAssociations(Contributed.EXCLUDED, ObjectAssociation.Filters.REFERENCE_PROPERTIES);
for (ObjectAssociation objectAssoc : properties) {
final ObjectAdapter possibleParentAdapter = objectAssoc.get(candidateAdapter, InteractionInitiatedBy.USER);
if(possibleParentAdapter == null) {
continue;
}
final Oid possibleParentOid = possibleParentAdapter.getOid();
if(possibleParentOid == null) {
continue;
}
final String possibleParentOidStr = possibleParentOid.enStringNoVersion();
if(Objects.equal(this.oidNoVerStr, possibleParentOidStr)) {
this.addChild(candidateBookmarkableModel);
whetherAdded = true;
}
}
}
return whetherAdded;
}
代码示例来源:origin: org.apache.isis.core/isis-core-viewer-wicket-model
/**
* Factory method for creating {@link PageParameters}.
*
* see {@link #ActionModel(PageParameters, SpecificationLoader)}
*/
public static PageParameters createPageParameters(
final ObjectAdapter adapter, final ObjectAction objectAction, final ConcurrencyChecking concurrencyChecking) {
final PageParameters pageParameters = PageParametersUtils.newPageParameters();
final String oidStr = concurrencyChecking == ConcurrencyChecking.CHECK?
adapter.getOid().enString():
adapter.getOid().enStringNoVersion();
PageParameterNames.OBJECT_OID.addStringTo(pageParameters, oidStr);
final ActionType actionType = objectAction.getType();
PageParameterNames.ACTION_TYPE.addEnumTo(pageParameters, actionType);
final ObjectSpecification actionOnTypeSpec = objectAction.getOnType();
if (actionOnTypeSpec != null) {
PageParameterNames.ACTION_OWNING_SPEC.addStringTo(pageParameters, actionOnTypeSpec.getFullIdentifier());
}
final String actionId = determineActionId(objectAction);
PageParameterNames.ACTION_ID.addStringTo(pageParameters, actionId);
return pageParameters;
}
代码示例来源:origin: org.apache.isis.viewer/isis-viewer-wicket-model
/**
* Factory method for creating {@link PageParameters}.
*
* see {@link #ActionModel(PageParameters, SpecificationLoader)}
*/
public static PageParameters createPageParameters(
final ObjectAdapter adapter, final ObjectAction objectAction, final ConcurrencyChecking concurrencyChecking) {
final PageParameters pageParameters = PageParametersUtils.newPageParameters();
final String oidStr = concurrencyChecking == ConcurrencyChecking.CHECK?
adapter.getOid().enString():
adapter.getOid().enStringNoVersion();
PageParameterNames.OBJECT_OID.addStringTo(pageParameters, oidStr);
final ActionType actionType = objectAction.getType();
PageParameterNames.ACTION_TYPE.addEnumTo(pageParameters, actionType);
final ObjectSpecification actionOnTypeSpec = objectAction.getOnType();
if (actionOnTypeSpec != null) {
PageParameterNames.ACTION_OWNING_SPEC.addStringTo(pageParameters, actionOnTypeSpec.getFullIdentifier());
}
final String actionId = determineActionId(objectAction);
PageParameterNames.ACTION_ID.addStringTo(pageParameters, actionId);
return pageParameters;
}
内容来源于网络,如有侵权,请联系作者删除!