com.atlassian.jira.util
Class ImportUtils

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

public class ImportUtils
extends java.lang.Object

Utility code originally written to support various importers. Contains methods for bypassing security schemes, reindexing issues, creating new issue types, resolutions, custom fields, and various other useful bits of code.

See Also:
BugzillaImportBean, MantisImportBean

Constructor Summary
ImportUtils()
           
 
Method Summary
static int createOrFindIssueType(java.lang.String name, int nextIssueTypeId, java.lang.String description, java.lang.String iconUrl)
          Creates a new issue type (if it doesn't already exist).
static org.ofbiz.core.entity.GenericValue createOrFindNumberCustomField(java.lang.String customFieldName, java.lang.String defaultValue)
          Create a numeric customfield
static int createOrFindResolution(java.lang.String name, int nextResolutionId, java.lang.String description)
          Creates a new resolution (if it doesn't already exist).
static org.ofbiz.core.entity.GenericValue createOrFindSelectListCustomField(java.lang.String customFieldName, java.util.List values, java.lang.String defaultValue)
          Create a drop-down list customfield.
static org.ofbiz.core.entity.GenericValue createOrFindStringCustomField(java.lang.String customFieldName, java.lang.String defaultValue)
          Create a short text customfield
static boolean isEnableNotifications()
           
static boolean isIndexIssues()
           
static boolean isSubvertSecurityScheme()
           
static void setEnableNotifications(boolean enable)
           
static void setIndexIssues(boolean index)
           
static void setSubvertSecurityScheme(boolean subvert)
          Whether to subvert the security scheme or not.
static java.lang.String stripHTMLStrings(java.lang.String str)
          Remove any HTML from text contents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImportUtils

public ImportUtils()
Method Detail

setSubvertSecurityScheme

public static void setSubvertSecurityScheme(boolean subvert)
Whether to subvert the security scheme or not. This is done on a thread local basis, so the subversion only occurs for this thread / request.

Other classes may alter their behaviour based on the value you pass.

Parameters:
subvert - Whether to subvert the scheme or not.
See Also:
ManagerFactory.getPermissionManager()

isSubvertSecurityScheme

public static boolean isSubvertSecurityScheme()

setIndexIssues

public static void setIndexIssues(boolean index)

setEnableNotifications

public static void setEnableNotifications(boolean enable)

isEnableNotifications

public static boolean isEnableNotifications()

isIndexIssues

public static boolean isIndexIssues()

createOrFindSelectListCustomField

public static org.ofbiz.core.entity.GenericValue createOrFindSelectListCustomField(java.lang.String customFieldName,
                                                                                   java.util.List values,
                                                                                   java.lang.String defaultValue)
                                                                            throws org.ofbiz.core.entity.GenericEntityException
Create a drop-down list customfield.

Returns:
A CustomField GenericValue
Throws:
org.ofbiz.core.entity.GenericEntityException

createOrFindNumberCustomField

public static org.ofbiz.core.entity.GenericValue createOrFindNumberCustomField(java.lang.String customFieldName,
                                                                               java.lang.String defaultValue)
                                                                        throws org.ofbiz.core.entity.GenericEntityException
Create a numeric customfield

Throws:
org.ofbiz.core.entity.GenericEntityException

createOrFindStringCustomField

public static org.ofbiz.core.entity.GenericValue createOrFindStringCustomField(java.lang.String customFieldName,
                                                                               java.lang.String defaultValue)
                                                                        throws org.ofbiz.core.entity.GenericEntityException
Create a short text customfield

Throws:
org.ofbiz.core.entity.GenericEntityException

createOrFindResolution

public static int createOrFindResolution(java.lang.String name,
                                         int nextResolutionId,
                                         java.lang.String description)
                                  throws org.ofbiz.core.entity.GenericEntityException
Creates a new resolution (if it doesn't already exist).

Parameters:
name - eg. "Obsolete", "More Info Needed",.
nextResolutionId - A unique (eg 100+) id for this custom resolution
description - Resolution description
Returns:
Id of a created Resolution GenericValue, or Id of an existing Resolution with the specified name
Throws:
org.ofbiz.core.entity.GenericEntityException

createOrFindIssueType

public static int createOrFindIssueType(java.lang.String name,
                                        int nextIssueTypeId,
                                        java.lang.String description,
                                        java.lang.String iconUrl)
                                 throws org.ofbiz.core.entity.GenericEntityException
Creates a new issue type (if it doesn't already exist).

Parameters:
name - eg. "Obsolete", "More Info Needed",.
nextIssueTypeId - A unique (eg 100+) id for this new issue type
description - Issue type description
Returns:
Id of a created IssueType GenericValue, or Id of an existing issue type with the specified name
Throws:
org.ofbiz.core.entity.GenericEntityException

stripHTMLStrings

public static java.lang.String stripHTMLStrings(java.lang.String str)
Remove any HTML from text contents.

Parameters:
str - Text with HTML (eg .. links).
Returns:
str without HTML


Copyright © 2002-2005 Atlassian. All Rights Reserved.