com.atlassian.jira.util
Class JiraEntityUtils

java.lang.Object
  extended bycom.atlassian.jira.util.JiraEntityUtils

public class JiraEntityUtils
extends Object


Constructor Summary
JiraEntityUtils()
           
 
Method Summary
static Map createEntityMap(List entities, String key, String value)
          Convert any list of entities into a sequenced hash map with two fields.
static org.ofbiz.core.entity.GenericValue getPermissionScheme(org.ofbiz.core.entity.GenericValue entity)
          This method will return the permission scheme relevant to a given entity.
static org.ofbiz.core.entity.GenericValue getProject(org.ofbiz.core.entity.GenericValue entity)
          This method will return the project relevant to a given entity.
static List updateDependentEntities(org.ofbiz.core.entity.GenericValue issue, Collection newEntities, String relationType, String changeItemField)
          Update the dependent entities of this issue (for example versions, fix versions or components)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JiraEntityUtils

public JiraEntityUtils()
Method Detail

getProject

public static org.ofbiz.core.entity.GenericValue getProject(org.ofbiz.core.entity.GenericValue entity)
This method will return the project relevant to a given entity.

For example if you pass in an issue, it will get the related project. If you pass in an action, it will find the issue, and then get the project for it.


getPermissionScheme

public static org.ofbiz.core.entity.GenericValue getPermissionScheme(org.ofbiz.core.entity.GenericValue entity)
This method will return the permission scheme relevant to a given entity.

For example if you pass in a project, it will get the relevant permission scheme. If you pass in an issue, it will find the project, and then get the permission scheme for it.


updateDependentEntities

public static List updateDependentEntities(org.ofbiz.core.entity.GenericValue issue,
                                           Collection newEntities,
                                           String relationType,
                                           String changeItemField)
                                    throws org.ofbiz.core.entity.GenericEntityException
Update the dependent entities of this issue (for example versions, fix versions or components)

Parameters:
issue - The issue to update entities for
newEntities - The list of new dependent entities
relationType - The dependency (association) type to look at, from IssueRelationConstants
changeItemField - The fieldname of the change items generated
Returns:
A list of change items or an empty list if nothing was changed
Throws:
org.ofbiz.core.entity.GenericEntityException

createEntityMap

public static Map createEntityMap(List entities,
                                  String key,
                                  String value)
Convert any list of entities into a sequenced hash map with two fields.

This is most useful for creating ordered maps used to create select boxes in the web interface. (ie createEntityMap(entities, "id", "name") to create an id to name map.



Copyright © 2002-2006 Atlassian. All Rights Reserved.