com.liferay.portal.tools.samplesqlbuilder
Class DataFactory
java.lang.Object
com.liferay.portal.tools.samplesqlbuilder.DataFactory
public class DataFactory
- extends Object
|
Constructor Summary |
DataFactory(String baseDir,
int maxAssetCategoryCount,
int maxBlogsEntryCount,
int maxGroupsCount,
int maxJournalArticleCount,
int maxJournalArticleSize,
int maxMBCategoryCount,
int maxMBThreadCount,
int maxMBMessageCount,
int maxUserToGroupCount)
|
|
Method Summary |
Account |
getAccount()
|
Role |
getAdministratorRole()
|
List<AssetCategory> |
getAssetCategories()
|
long |
getAssetCategoryId(long groupId,
int currentIndex)
|
List<AssetVocabulary> |
getAssetVocabularies()
|
long |
getBlogsEntryClassNameId()
|
List<ClassName> |
getClassNames()
|
Company |
getCompany()
|
SimpleCounter |
getCounter()
|
String |
getDateLong(Date date)
|
String |
getDateString(Date date)
|
long |
getDDLRecordSetClassNameId()
|
DDMStructure |
getDefaultDLDDMStructure()
|
long |
getDefaultDLDDMStructureId()
|
DLFileEntryType |
getDefaultDLFileEntryType()
|
User |
getDefaultUser()
|
long |
getDLFileEntryClassNameId()
|
Group |
getGlobalGroup()
|
long |
getGroupClassNameId()
|
List<Group> |
getGroups()
|
Group |
getGuestGroup()
|
User |
getGuestUser()
|
long |
getJournalArticleClassNameId()
|
String |
getJournalArticleLayoutColumn(String portletPrefix)
|
long |
getLayoutClassNameId()
|
List<Long> |
getNewUserGroupIds(long groupId)
|
Role |
getPowerUserRole()
|
List<Role> |
getRoles()
|
User |
getSampleUser()
|
Role |
getUserRole()
|
VirtualHost |
getVirtualHost()
|
long |
getWikiPageClassNameId()
|
void |
initAssetCateogries()
|
void |
initCompany()
|
void |
initDLFileEntryType()
|
void |
initGroups()
|
void |
initJournalArticle(int maxJournalArticleSize)
|
void |
initRoles()
|
void |
initUserNames()
|
void |
initUsers()
|
void |
initVirtualHost()
|
AssetEntry |
newAssetEntry(BlogsEntry blogsEntry)
|
AssetEntry |
newAssetEntry(DLFileEntry dlFileEntry)
|
AssetEntry |
newAssetEntry(JournalArticle journalArticle)
|
protected AssetEntry |
newAssetEntry(long groupId,
Date createDate,
Date modifiedDate,
long classNameId,
long classPK,
String uuid,
long classTypeId,
boolean visible,
String mimeType,
String title)
|
AssetEntry |
newAssetEntry(MBMessage mbMessage)
|
AssetEntry |
newAssetEntry(WikiPage wikiPage)
|
protected AssetVocabulary |
newAssetVocabulary(long grouId,
long userId,
String userName,
String name,
String title)
|
BlogsEntry |
newBlogsEntry(long groupId,
int index)
|
BlogsStatsUser |
newBlogsStatsUser(long groupId)
|
Contact |
newContact(User user)
|
List<Counter> |
newCounters()
|
DDMStructure |
newDDLDDMStructure(long groupId)
|
DDLRecord |
newDDLRecord(DDLRecordSet ddlRecordSet)
|
DDLRecordSet |
newDDLRecordSet(DDMStructure ddmStructure,
int currentIndex)
|
DDLRecordVersion |
newDDLRecordVersion(DDLRecord ddlRecord)
|
DDMContent |
newDDMContent(DDLRecord ddlRecord,
int currentIndex)
|
DDMContent |
newDDMContent(DLFileEntry dlFileEntry)
|
protected DDMContent |
newDDMContent(long contentId,
long groupId,
String xml)
|
DDMStorageLink |
newDDMStorageLink(long ddmStorageLinkId,
DDMContent ddmContent,
long structureId)
|
protected DDMStructure |
newDDMStructure(long groupId,
long classNameId,
String structureKey,
String xsd)
|
DDMStructureLink |
newDDMStructureLink(DDLRecordSet ddlRecordSet)
|
DDMStructureLink |
newDDMStructureLink(DLFileEntryMetadata dLFileEntryMetadata)
|
protected DDMStructureLink |
newDDMStructureLink(long classNameId,
long classPK,
long structureId)
|
DLFileEntry |
newDlFileEntry(DLFolder dlFoler,
int index)
|
DLFileEntryMetadata |
newDLFileEntryMetadata(long ddmStorageLinkId,
long ddmStructureId,
DLFileVersion dlFileVersion)
|
DLFileVersion |
newDLFileVersion(DLFileEntry dlFileEntry)
|
DLFolder |
newDLFolder(long groupId,
long parentFolderId,
int index)
|
DLSync |
newDLSync(DLFileEntry dlFileEntry)
|
DLSync |
newDLSync(DLFolder dLFolder)
|
protected DLSync |
newDLSync(long fileId,
String fileUuid,
long repositoryId,
long parentFolderId,
String name,
String type)
|
protected Group |
newGroup(long groupId,
long classNameId,
long classPK,
String name,
boolean site)
|
Group |
newGroup(User user)
|
IntegerWrapper |
newInteger()
|
JournalArticle |
newJournalArticle(JournalArticleResource journalArticleResource,
int articleIndex,
int versionIndex)
|
JournalArticleResource |
newJournalArticleResource(long groupId)
|
JournalContentSearch |
newJournalContentSearch(JournalArticle journalArticle,
long layoutId)
|
Layout |
newLayout(long groupId,
String name,
String column1,
String column2)
|
protected LayoutSet |
newLayoutSet(long groupId,
boolean privateLayout,
int pageCount)
|
List<LayoutSet> |
newLayoutSets(long groupId,
int publicLayoutSetPageCount)
|
MBCategory |
newMBCategory(long groupId,
int index)
|
MBDiscussion |
newMBDiscussion(long groupId,
long classNameId,
long classPK,
long threadId)
|
MBMailingList |
newMBMailingList(MBCategory mbCategory)
|
protected MBMessage |
newMBMessage(long groupId,
long classNameId,
long classPK,
long categoryId,
long threadId,
long messageId,
long rootMessageId,
long parentMessageId,
String subject,
String body)
|
MBMessage |
newMBMessage(MBThread mbThread,
int index)
|
MBMessage |
newMBMessage(MBThread mbThread,
long classNameId,
long classPK,
int index)
|
MBStatsUser |
newMBStatsUser(long groupId)
|
MBThread |
newMBThread(long threadId,
long groupId,
long rootMessageId,
int messageCount)
|
protected MBThread |
newMBThread(long threadId,
long groupId,
long categoryId,
long rootMessageId,
int messageCount)
|
MBThread |
newMBThread(MBCategory mbCategory)
|
List<PortletPreferences> |
newPortletPreferences(long plid)
|
PortletPreferences |
newPortletPreferences(long plid,
String portletId,
DDLRecordSet ddlRecordSet)
|
PortletPreferences |
newPortletPreferences(long plid,
String portletId,
JournalArticleResource journalArticleResource)
|
protected PortletPreferences |
newPortletPreferences(long plid,
String portletId,
String preferences)
|
List<Layout> |
newPublicLayouts(long groupId)
|
protected ResourcePermission |
newResourcePermission(String name,
String primKey,
long roleId,
long ownerId)
|
List<ResourcePermission> |
newResourcePermissions(AssetCategory assetCategory)
|
List<ResourcePermission> |
newResourcePermissions(AssetVocabulary assetVocabulary)
|
List<ResourcePermission> |
newResourcePermissions(JournalArticleResource journalArticleResource)
|
List<ResourcePermission> |
newResourcePermissions(Layout layout)
|
List<ResourcePermission> |
newResourcePermissions(PortletPreferences portletPreferences)
|
protected List<ResourcePermission> |
newResourcePermissions(String name,
String primKey,
long ownerId)
|
protected Role |
newRole(String name,
int type)
|
SocialActivity |
newSocialActivity(DLFileEntry dlFileEntry)
|
SocialActivity |
newSocialActivity(JournalArticle journalArticle)
|
protected SocialActivity |
newSocialActivity(long groupId,
long classNameId,
long classPK,
int type,
String title)
|
User |
newUser(int index)
|
protected User |
newUser(long userId,
String firstName,
String lastName,
String screenName,
boolean defaultUser)
|
WikiNode |
newWikiNode(long groupId,
int index)
|
WikiPage |
newWikiPage(WikiNode wikiNode,
int index)
|
WikiPageResource |
newWikiPageResource(WikiPage wikiPage)
|
protected Date |
nextFutureDate()
|
String[] |
nextUserName(long index)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DataFactory
public DataFactory(String baseDir,
int maxAssetCategoryCount,
int maxBlogsEntryCount,
int maxGroupsCount,
int maxJournalArticleCount,
int maxJournalArticleSize,
int maxMBCategoryCount,
int maxMBThreadCount,
int maxMBMessageCount,
int maxUserToGroupCount)
throws Exception
- Throws:
Exception
getAccount
public Account getAccount()
getAdministratorRole
public Role getAdministratorRole()
getAssetCategories
public List<AssetCategory> getAssetCategories()
getAssetCategoryId
public long getAssetCategoryId(long groupId,
int currentIndex)
getAssetVocabularies
public List<AssetVocabulary> getAssetVocabularies()
getBlogsEntryClassNameId
public long getBlogsEntryClassNameId()
getClassNames
public List<ClassName> getClassNames()
getCompany
public Company getCompany()
getCounter
public SimpleCounter getCounter()
getDateLong
public String getDateLong(Date date)
getDateString
public String getDateString(Date date)
getDDLRecordSetClassNameId
public long getDDLRecordSetClassNameId()
getDefaultDLDDMStructure
public DDMStructure getDefaultDLDDMStructure()
getDefaultDLDDMStructureId
public long getDefaultDLDDMStructureId()
getDefaultDLFileEntryType
public DLFileEntryType getDefaultDLFileEntryType()
getDefaultUser
public User getDefaultUser()
getDLFileEntryClassNameId
public long getDLFileEntryClassNameId()
getGlobalGroup
public Group getGlobalGroup()
getGroupClassNameId
public long getGroupClassNameId()
getGroups
public List<Group> getGroups()
getGuestGroup
public Group getGuestGroup()
getGuestUser
public User getGuestUser()
getJournalArticleClassNameId
public long getJournalArticleClassNameId()
getJournalArticleLayoutColumn
public String getJournalArticleLayoutColumn(String portletPrefix)
getLayoutClassNameId
public long getLayoutClassNameId()
getNewUserGroupIds
public List<Long> getNewUserGroupIds(long groupId)
getPowerUserRole
public Role getPowerUserRole()
getRoles
public List<Role> getRoles()
getSampleUser
public User getSampleUser()
getUserRole
public Role getUserRole()
getVirtualHost
public VirtualHost getVirtualHost()
getWikiPageClassNameId
public long getWikiPageClassNameId()
initAssetCateogries
public void initAssetCateogries()
initCompany
public void initCompany()
initDLFileEntryType
public void initDLFileEntryType()
initGroups
public void initGroups()
throws Exception
- Throws:
Exception
initJournalArticle
public void initJournalArticle(int maxJournalArticleSize)
initRoles
public void initRoles()
initUserNames
public void initUserNames()
throws IOException
- Throws:
IOException
initUsers
public void initUsers()
initVirtualHost
public void initVirtualHost()
newAssetEntry
public AssetEntry newAssetEntry(BlogsEntry blogsEntry)
newAssetEntry
public AssetEntry newAssetEntry(DLFileEntry dlFileEntry)
newAssetEntry
public AssetEntry newAssetEntry(JournalArticle journalArticle)
newAssetEntry
public AssetEntry newAssetEntry(MBMessage mbMessage)
newAssetEntry
public AssetEntry newAssetEntry(WikiPage wikiPage)
newBlogsEntry
public BlogsEntry newBlogsEntry(long groupId,
int index)
newBlogsStatsUser
public BlogsStatsUser newBlogsStatsUser(long groupId)
newContact
public Contact newContact(User user)
newCounters
public List<Counter> newCounters()
newDDLDDMStructure
public DDMStructure newDDLDDMStructure(long groupId)
newDDLRecord
public DDLRecord newDDLRecord(DDLRecordSet ddlRecordSet)
newDDLRecordSet
public DDLRecordSet newDDLRecordSet(DDMStructure ddmStructure,
int currentIndex)
newDDLRecordVersion
public DDLRecordVersion newDDLRecordVersion(DDLRecord ddlRecord)
newDDMContent
public DDMContent newDDMContent(DDLRecord ddlRecord,
int currentIndex)
newDDMContent
public DDMContent newDDMContent(DLFileEntry dlFileEntry)
newDDMStorageLink
public DDMStorageLink newDDMStorageLink(long ddmStorageLinkId,
DDMContent ddmContent,
long structureId)
newDDMStructureLink
public DDMStructureLink newDDMStructureLink(DDLRecordSet ddlRecordSet)
newDDMStructureLink
public DDMStructureLink newDDMStructureLink(DLFileEntryMetadata dLFileEntryMetadata)
newDlFileEntry
public DLFileEntry newDlFileEntry(DLFolder dlFoler,
int index)
newDLFileEntryMetadata
public DLFileEntryMetadata newDLFileEntryMetadata(long ddmStorageLinkId,
long ddmStructureId,
DLFileVersion dlFileVersion)
newDLFileVersion
public DLFileVersion newDLFileVersion(DLFileEntry dlFileEntry)
newDLFolder
public DLFolder newDLFolder(long groupId,
long parentFolderId,
int index)
newDLSync
public DLSync newDLSync(DLFileEntry dlFileEntry)
newDLSync
public DLSync newDLSync(DLFolder dLFolder)
newGroup
public Group newGroup(User user)
throws Exception
- Throws:
Exception
newInteger
public IntegerWrapper newInteger()
newJournalArticle
public JournalArticle newJournalArticle(JournalArticleResource journalArticleResource,
int articleIndex,
int versionIndex)
newJournalArticleResource
public JournalArticleResource newJournalArticleResource(long groupId)
newJournalContentSearch
public JournalContentSearch newJournalContentSearch(JournalArticle journalArticle,
long layoutId)
newLayout
public Layout newLayout(long groupId,
String name,
String column1,
String column2)
newLayoutSets
public List<LayoutSet> newLayoutSets(long groupId,
int publicLayoutSetPageCount)
newMBCategory
public MBCategory newMBCategory(long groupId,
int index)
newMBDiscussion
public MBDiscussion newMBDiscussion(long groupId,
long classNameId,
long classPK,
long threadId)
newMBMailingList
public MBMailingList newMBMailingList(MBCategory mbCategory)
newMBMessage
public MBMessage newMBMessage(MBThread mbThread,
int index)
newMBMessage
public MBMessage newMBMessage(MBThread mbThread,
long classNameId,
long classPK,
int index)
newMBStatsUser
public MBStatsUser newMBStatsUser(long groupId)
newMBThread
public MBThread newMBThread(long threadId,
long groupId,
long rootMessageId,
int messageCount)
newMBThread
public MBThread newMBThread(MBCategory mbCategory)
newPortletPreferences
public List<PortletPreferences> newPortletPreferences(long plid)
newPortletPreferences
public PortletPreferences newPortletPreferences(long plid,
String portletId,
DDLRecordSet ddlRecordSet)
throws Exception
- Throws:
Exception
newPortletPreferences
public PortletPreferences newPortletPreferences(long plid,
String portletId,
JournalArticleResource journalArticleResource)
throws Exception
- Throws:
Exception
newPublicLayouts
public List<Layout> newPublicLayouts(long groupId)
newResourcePermissions
public List<ResourcePermission> newResourcePermissions(AssetCategory assetCategory)
newResourcePermissions
public List<ResourcePermission> newResourcePermissions(AssetVocabulary assetVocabulary)
newResourcePermissions
public List<ResourcePermission> newResourcePermissions(JournalArticleResource journalArticleResource)
newResourcePermissions
public List<ResourcePermission> newResourcePermissions(Layout layout)
newResourcePermissions
public List<ResourcePermission> newResourcePermissions(PortletPreferences portletPreferences)
newSocialActivity
public SocialActivity newSocialActivity(DLFileEntry dlFileEntry)
newSocialActivity
public SocialActivity newSocialActivity(JournalArticle journalArticle)
newUser
public User newUser(int index)
newWikiNode
public WikiNode newWikiNode(long groupId,
int index)
newWikiPage
public WikiPage newWikiPage(WikiNode wikiNode,
int index)
newWikiPageResource
public WikiPageResource newWikiPageResource(WikiPage wikiPage)
nextUserName
public String[] nextUserName(long index)
newAssetEntry
protected AssetEntry newAssetEntry(long groupId,
Date createDate,
Date modifiedDate,
long classNameId,
long classPK,
String uuid,
long classTypeId,
boolean visible,
String mimeType,
String title)
newAssetVocabulary
protected AssetVocabulary newAssetVocabulary(long grouId,
long userId,
String userName,
String name,
String title)
newDDMContent
protected DDMContent newDDMContent(long contentId,
long groupId,
String xml)
newDDMStructure
protected DDMStructure newDDMStructure(long groupId,
long classNameId,
String structureKey,
String xsd)
newDDMStructureLink
protected DDMStructureLink newDDMStructureLink(long classNameId,
long classPK,
long structureId)
newDLSync
protected DLSync newDLSync(long fileId,
String fileUuid,
long repositoryId,
long parentFolderId,
String name,
String type)
newGroup
protected Group newGroup(long groupId,
long classNameId,
long classPK,
String name,
boolean site)
throws Exception
- Throws:
Exception
newLayoutSet
protected LayoutSet newLayoutSet(long groupId,
boolean privateLayout,
int pageCount)
newMBMessage
protected MBMessage newMBMessage(long groupId,
long classNameId,
long classPK,
long categoryId,
long threadId,
long messageId,
long rootMessageId,
long parentMessageId,
String subject,
String body)
newMBThread
protected MBThread newMBThread(long threadId,
long groupId,
long categoryId,
long rootMessageId,
int messageCount)
newPortletPreferences
protected PortletPreferences newPortletPreferences(long plid,
String portletId,
String preferences)
newResourcePermission
protected ResourcePermission newResourcePermission(String name,
String primKey,
long roleId,
long ownerId)
newResourcePermissions
protected List<ResourcePermission> newResourcePermissions(String name,
String primKey,
long ownerId)
newRole
protected Role newRole(String name,
int type)
newSocialActivity
protected SocialActivity newSocialActivity(long groupId,
long classNameId,
long classPK,
int type,
String title)
newUser
protected User newUser(long userId,
String firstName,
String lastName,
String screenName,
boolean defaultUser)
nextFutureDate
protected Date nextFutureDate()