com.atlassian.jira.issue.history
Class ChangeLogUtils

java.lang.Object
  extended by com.atlassian.jira.issue.history.ChangeLogUtils

public class ChangeLogUtils
extends java.lang.Object

Utility methods for managing ChangeGroup entities on issues, also known as the Change Log or Change History.

TODO: Migrate methods to ChangeHistoryManager and deprecate


Constructor Summary
ChangeLogUtils()
           
 
Method Summary
static org.ofbiz.core.entity.GenericValue createChangeGroup(com.opensymphony.user.User changeAuthor, org.ofbiz.core.entity.GenericValue before, org.ofbiz.core.entity.GenericValue after, java.util.Collection incomingChangeItems, boolean generateChangeItems)
          Writes the given field changes to the db and optionally a changelog.
static org.ofbiz.core.entity.GenericValue createChangeGroup(com.opensymphony.user.User changeAuthor, Issue before, Issue after, java.util.Collection incomingChangeItems, boolean generateChangeItems)
           
static void deleteChangesForIssue(org.ofbiz.core.entity.GenericValue issue)
          Deletes all the change groups and change items associated with the provided issue.
static ChangeItemBean generateChangeItem(org.ofbiz.core.entity.GenericValue before, org.ofbiz.core.entity.GenericValue after, java.lang.String fieldname)
           
static java.util.List generateChangeItems(org.ofbiz.core.entity.GenericValue before, org.ofbiz.core.entity.GenericValue after)
          Returns a List of ChangeItemBean objects for each of the relevant fields that differ between the two issues.
static ChangeItemBean generateSecurityChangeItem(java.lang.String fieldname, java.lang.String from, java.lang.String to)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangeLogUtils

public ChangeLogUtils()
Method Detail

deleteChangesForIssue

public static void deleteChangesForIssue(org.ofbiz.core.entity.GenericValue issue)
Deletes all the change groups and change items associated with the provided issue.

Parameters:
issue - represents the issue that is being deleted

createChangeGroup

public static org.ofbiz.core.entity.GenericValue createChangeGroup(com.opensymphony.user.User changeAuthor,
                                                                   org.ofbiz.core.entity.GenericValue before,
                                                                   org.ofbiz.core.entity.GenericValue after,
                                                                   java.util.Collection incomingChangeItems,
                                                                   boolean generateChangeItems)
Writes the given field changes to the db and optionally a changelog.

Parameters:
before - The issue before the update.
after - This issue after the update.
incomingChangeItems - Some ChangeItemBean.
generateChangeItems - if true, a changelog is actually generated.
changeAuthor - the User making the change.
Returns:
the ChangeGroup GenericValue

createChangeGroup

public static org.ofbiz.core.entity.GenericValue createChangeGroup(com.opensymphony.user.User changeAuthor,
                                                                   Issue before,
                                                                   Issue after,
                                                                   java.util.Collection incomingChangeItems,
                                                                   boolean generateChangeItems)

generateChangeItems

public static java.util.List generateChangeItems(org.ofbiz.core.entity.GenericValue before,
                                                 org.ofbiz.core.entity.GenericValue after)
Returns a List of ChangeItemBean objects for each of the relevant fields that differ between the two issues.

Parameters:
before - A GenericValue for the issue before the change.
after - A GenericValue for the issue after the change.
Returns:
the list of ChangeItemBeans.

generateChangeItem

public static ChangeItemBean generateChangeItem(org.ofbiz.core.entity.GenericValue before,
                                                org.ofbiz.core.entity.GenericValue after,
                                                java.lang.String fieldname)

generateSecurityChangeItem

public static ChangeItemBean generateSecurityChangeItem(java.lang.String fieldname,
                                                        java.lang.String from,
                                                        java.lang.String to)


Copyright © 2002-2010 Atlassian. All Rights Reserved.