/** * @deprecated do not use this method anymore, use the constructors for {@link EntityReference} */ public static String getID(String reference) { return new EntityReference(reference).getId(); }
/** * @return the method (GET, POST, etc.) (from {@link Method}) being used for this view, * defaults to GET if none was set explicitly */ public String getMethod() { return method.name(); } public void setMethod(Method method) {
/** * @deprecated use {@link EntityReference#EntityReference(String)} */ public IdEntityReference(String reference) { super(reference); this.id = getId(); }
public void setEntityBrokerManager(EntityBrokerManager entityBrokerManager) { this.entityBrokerManager = entityBrokerManager; this.requestStorage = entityBrokerManager.getRequestStorage(); this.requestGetter = entityBrokerManager.getRequestGetter(); this.entityPropertiesService = entityBrokerManager.getEntityPropertiesService(); this.entityProviderManager = entityBrokerManager.getEntityProviderManager(); this.entityProviderMethodStore = entityBrokerManager.getEntityProviderMethodStore(); this.entityViewAccessProviderManager = entityBrokerManager.getEntityViewAccessProviderManager(); this.externalIntegrationProvider = entityBrokerManager.getExternalIntegrationProvider(); }
/** * Get the string reference for this entity reference object, * same as calling {@link #toString()} * @return the full entity reference */ public String getReference() { return this.toString(); }
public String getCurrentUserId() { if (currentUserRef != null) { return EntityReference.getIdFromRef(currentUserRef); } return null; }
/** * @return the entity URL of the internal reference based on the * internal viewKey and extension, defaults to {@link TemplateParseUtil#TEMPLATE_SHOW} or * the {@link TemplateParseUtil#TEMPLATE_LIST} one if there is no id, * example: /prefix if there is no id or /prefix/id if there is an id * @throws IllegalArgumentException if there is not enough information to generate a URL */ public String getEntityURL() { String URL = getEntityURL(this.viewKey, this.extension); return URL; }
/** * @return a copy of this object * @see #copy(EntityView) */ public EntityView copy() { return copy(this); }
/** * Get the space reference for this entity reference, * this ignored any id and only returns the reference to the entity space * @return the entity space reference (e.g. /myPrefix) */ public String getSpaceReference() { return makeEntityReference(true); }
/** * A local entity id, represents an entity uniquely in a tool/webapp, * could match with the actual id of a model data object, * this will be null if this reference refers to an entity space only * * @return the entity id (locally unique id for an entity of this entity type) * or null if this this reference refers to an entity space only */ public String getId() { return makeEntityId(); }
public void setServletContext(String servletContext) { if (servletContext != null) { this.servletContext = servletContext; //log.info("Setting the REST servlet context to: " + servletContext); entityBrokerManager.setServletContext(servletContext); } }
/** * @return the entity prefix (uniquely identifies an entity space or entity type), * this should never be null */ public String getPrefix() { return makeEntityPrefix(); }
/** * @return a copy of this reference * @see #copy(EntityReference) */ public EntityReference copy() { return copy(this); }
/** * Get the entity prefix based on an entity reference string, * <b>WARNING:</b> this is meant for internal use, * use {@link EntityReference#EntityReference(String)} and * the methods in {@link EntityBroker} to parse references * * @param reference an entity reference or entity URL * @return the entity prefix */ public static String getPrefix(String reference) { return findPrefix(reference); }
protected void setOriginalReference(String reference) { checkReference(reference); this.originalReference = reference; }
public String getToolIdFromToolRef(String toolReference) { String toolId = null; if (toolReference != null) { toolId = new EntityReference(toolReference).getId(); } return toolId; }
/** * @return the entity URL of the internal reference based on the * internal viewKey and extension, defaults to {@link TemplateParseUtil#TEMPLATE_SHOW} or * the {@link TemplateParseUtil#TEMPLATE_LIST} one if there is no id, * example: /prefix if there is no id or /prefix/id if there is an id * @throws IllegalArgumentException if there is not enough information to generate a URL */ @Override public String toString() { return getEntityURL(); }
/** * @deprecated use {@link EntityReference#EntityReference(String, String)} */ public IdEntityReference(String prefix, String id) { super(prefix, id); this.id = getId(); }
/** * @return the string version of this entity reference, * example: /prefix if there is no id or /prefix/id if there is an id */ @Override public String toString() { return makeEntityReference(false); }
public String getLocationIdFromRef(String locationReference) { String locationId = null; if (locationReference != null) { // assume the form of "/site/siteId" (the Site method is protected) locationId = new EntityReference(locationReference).getId(); } return locationId; }