Class DynamicViewEntity

java.lang.Object
org.apache.ofbiz.entity.model.DynamicViewEntity

public class DynamicViewEntity extends Object
This class is used for declaring Dynamic View Entities, to be used and thrown away. A special method exists on the Delegator to accept a DynamicViewEntity instead of an entity-name.
  • Constructor Details

    • DynamicViewEntity

      public DynamicViewEntity()
  • Method Details

    • makeModelViewEntity

      public ModelViewEntity makeModelViewEntity(Delegator delegator)
      Make model view entity model view entity.
      Parameters:
      delegator - the delegator
      Returns:
      the model view entity
    • getViewXml

      public String getViewXml(String entityName) throws IOException
      Gets view xml.
      Parameters:
      entityName - the entity name
      Returns:
      the view xml
      Throws:
      IOException - the io exception
    • getViewElement

      public Element getViewElement(Document doc, String entityName)
      Gets view element.
      Parameters:
      doc - the doc
      entityName - the entity name
      Returns:
      the view element
    • getOneRealEntityName

      public String getOneRealEntityName()
      Gets one real entity name.
      Returns:
      the one real entity name
    • getEntityName

      public String getEntityName()
      Getter for property entityName.
      Returns:
      Value of property entityName.
    • setEntityName

      public void setEntityName(String entityName)
      Setter for property entityName.
      Parameters:
      entityName - New value of property entityName.
    • getPackageName

      public String getPackageName()
      Getter for property packageName.
      Returns:
      Value of property packageName.
    • setPackageName

      public void setPackageName(String packageName)
      Setter for property packageName.
      Parameters:
      packageName - New value of property packageName.
    • getDefaultResourceName

      public String getDefaultResourceName()
      Getter for property defaultResourceName.
      Returns:
      Value of property defaultResourceName.
    • setDefaultResourceName

      public void setDefaultResourceName(String defaultResourceName)
      Setter for property defaultResourceName.
      Parameters:
      defaultResourceName - New value of property defaultResourceName.
    • getTitle

      public String getTitle()
      Getter for property title.
      Returns:
      Value of property title.
    • setTitle

      public void setTitle(String title)
      Setter for property title.
      Parameters:
      title - New value of property title.
    • addMemberEntity

      public void addMemberEntity(String entityAlias, String entityName)
      Add member entity.
      Parameters:
      entityAlias - the entity alias
      entityName - the entity name
    • getModelMemberEntitiesEntryIter

      public Iterator<Map.Entry<String,ModelViewEntity.ModelMemberEntity>> getModelMemberEntitiesEntryIter()
      Gets model member entities entry iter.
      Returns:
      the model member entities entry iter
    • addAliasAll

      @Deprecated public void addAliasAll(String entityAlias, String prefix)
    • addAliasAll

      public void addAliasAll(String entityAlias, String prefix, Collection<String> excludes)
      Add alias all.
      Parameters:
      entityAlias - the entity alias
      prefix - the prefix
      excludes - the excludes
    • addAllAliasAllsToList

      public void addAllAliasAllsToList(List<ModelViewEntity.ModelAliasAll> addList)
      Add all alias alls to list.
      Parameters:
      addList - the add list
    • addAlias

      public void addAlias(String entityAlias, String name)
      Add alias.
      Parameters:
      entityAlias - the entity alias
      name - the name
    • addAlias

      public void addAlias(String entityAlias, String name, String field, String colAlias, Boolean primKey, Boolean groupBy, String function)
      Add an alias, full detail. All parameters can be null except entityAlias and name.
    • addAlias

      public void addAlias(String entityAlias, String name, String field, String colAlias, Boolean primKey, Boolean groupBy, String function, ModelViewEntity.ComplexAliasMember complexAliasMember)
      Add alias.
      Parameters:
      entityAlias - the entity alias
      name - the name
      field - the field
      colAlias - the col alias
      primKey - the prim key
      groupBy - the group by
      function - the function
      complexAliasMember - the complex alias member
    • addAlias

      public void addAlias(String entityAlias, String name, String field, String colAlias, Boolean primKey, Boolean groupBy, String function, String fieldSet, ModelViewEntity.ComplexAliasMember complexAliasMember)
      Add alias.
      Parameters:
      entityAlias - the entity alias
      name - the name
      field - the field
      colAlias - the col alias
      primKey - the prim key
      groupBy - the group by
      function - the function
      fieldSet - the field set
      complexAliasMember - the complex alias member
    • addAllAliasesToList

      public void addAllAliasesToList(List<ModelViewEntity.ModelAlias> addList)
      Add all aliases to list.
      Parameters:
      addList - the add list
    • addViewLink

      public void addViewLink(String entityAlias, String relEntityAlias, Boolean relOptional, List<ModelKeyMap> modelKeyMaps)
      Add view link.
      Parameters:
      entityAlias - the entity alias
      relEntityAlias - the rel entity alias
      relOptional - the rel optional
      modelKeyMaps - the model key maps
    • addViewLink

      public void addViewLink(String entityAlias, String relEntityAlias, Boolean relOptional, ModelViewEntity.ViewEntityCondition viewCond)
      Add view link.
      Parameters:
      entityAlias - the entity alias
      relEntityAlias - the rel entity alias
      relOptional - the rel optional
      viewCond - the condition of the view link
    • addViewLink

      public void addViewLink(String entityAlias, String relEntityAlias, Boolean relOptional, List<ModelKeyMap> modelKeyMaps, ModelViewEntity.ViewEntityCondition viewCond)
      Add view link.
      Parameters:
      entityAlias - the entity alias
      relEntityAlias - the rel entity alias
      relOptional - the rel optional
      modelKeyMaps - the model key maps
      viewCond - the condition of the view link
    • makeViewEntityCondition

      public ModelViewEntity.ViewEntityCondition makeViewEntityCondition(Delegator delegator, String entityAlias, String fieldName, String operator, String value)
      Prepare a ViewEntityCondition to use in view link
      Parameters:
      delegator -
      entityAlias -
      fieldName -
      operator -
      value -
      Returns:
    • makeViewEntityCondition

      public ModelViewEntity.ViewEntityCondition makeViewEntityCondition(Delegator delegator, String entityAlias, String fieldName, String operator, String relEntityAlias, String relFieldName)
      Prepare a ViewEntityCondition to use in view link
      Parameters:
      delegator -
      entityAlias -
      fieldName -
      operator -
      relEntityAlias -
      relFieldName -
      Returns:
    • makeViewEntityCondition

      public ModelViewEntity.ViewEntityCondition makeViewEntityCondition(Delegator delegator, Element entityConditionElement)
      Prepare a ViewEntityCondition to use in view link
      Parameters:
      delegator -
      entityConditionElement -
      Returns:
    • addAllViewLinksToList

      public void addAllViewLinksToList(List<ModelViewEntity.ModelViewLink> addList)
      Add all view links to list.
      Parameters:
      addList - the add list
    • addRelation

      public void addRelation(String type, String title, String relEntityName, List<ModelKeyMap> modelKeyMaps)
      Add relation.
      Parameters:
      type - the type
      title - the title
      relEntityName - the rel entity name
      modelKeyMaps - the model key maps
    • addAllRelationsToList

      public void addAllRelationsToList(List<ModelRelation> addList)
      Add all relations to list.
      Parameters:
      addList - the add list
    • setGroupBy

      public void setGroupBy(List<String> groupBy)
      Sets group by.
      Parameters:
      groupBy - the group by
    • addAllGroupByFieldsToList

      public void addAllGroupByFieldsToList(List<String> addList)
      Add all group by fields to list.
      Parameters:
      addList - the add list