本文整理汇总了Java中atg.repository.RepositoryItem类的典型用法代码示例。如果您正苦于以下问题:Java RepositoryItem类的具体用法?Java RepositoryItem怎么用?Java RepositoryItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RepositoryItem类属于atg.repository包,在下文中一共展示了RepositoryItem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: executeMethod
import atg.repository.RepositoryItem; //导入依赖的package包/类
private static Object executeMethod(Object o, String methodName) {
Object newObject = null;
try {
if (o instanceof RepositoryItem) {
RepositoryItem repositoryItem = (RepositoryItem) o;
if (repositoryItem.getItemDescriptor().hasProperty(methodName)) {
newObject = repositoryItem.getPropertyValue(methodName);
}
} else if (o instanceof Map) {
Map map = (Map) o;
newObject = map.get(methodName);
} else {
methodName = "get" + upperCaseFirstLetter(methodName);
newObject = MethodUtils.invokeMethod(o, methodName, null);
}
} catch (Exception e) {
// dont care
}
return newObject;
}
开发者ID:varelma,项目名称:atg-generics,代码行数:21,代码来源:BeanUtils.java
示例2: getItem
import atg.repository.RepositoryItem; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes" })
public RepositoryItem getItem(String pId, String pDescriptorName) throws RepositoryException {
String javaClassName = getPackageName() + "." + getClassName(pDescriptorName);
String key = pId + SPLIT_CHAR + javaClassName;
MutableRepositoryItemExt cachedValue = (MutableRepositoryItemExt) itemCache.get(key);
if (cachedValue != null) {
return cachedValue;
}
MutableRepositoryItem result = (MutableRepositoryItem) super.getItem(pId, pDescriptorName);
try {
Class beanClass = Class.forName(javaClassName);
MutableRepositoryItemExt mutableRepositoryItemExt = create(result, beanClass);
return mutableRepositoryItemExt;
} catch (Exception e) {
throw new RepositoryException(e);
}
}
开发者ID:varelma,项目名称:atg-generics,代码行数:18,代码来源:GenericsRepository.java
示例3: createDefaultRepriceMap
import atg.repository.RepositoryItem; //导入依赖的package包/类
public Map<String, Object> createDefaultRepriceMap(){
Profile profile = (Profile) ServletUtil.getCurrentUserProfile();
RepositoryItem priceList = (RepositoryItem) profile.getPropertyValue("myPriceList");
Map<String, Object> repriceMap = Maps.newHashMap();
repriceMap.put("OrderManager", mOrderManager);
repriceMap.put("Order", getShoppingCart().getCurrent());
repriceMap.put("Profile", profile);
repriceMap.put("PricingModels", getUserPricingModels());
repriceMap.put("PricingOp", PricingConstants.OP_REPRICE_ORDER_TOTAL);
Map<String, Object> extraParams = Maps.newHashMap();
extraParams.put("priceList", priceList);
repriceMap.put("ExtraParameters", extraParams);
return repriceMap;
}
开发者ID:Roanis,项目名称:atg-tdd,代码行数:18,代码来源:OrderTestHelper.java
示例4: find
import atg.repository.RepositoryItem; //导入依赖的package包/类
public T find(Object pPk) {
mLog.trace("Entering find()");
try {
RepositoryItem item = mRepository.getItem(pPk.toString(), mItemDescriptor.getItemDescriptorName());
if(item == null) {
mLog.debug("Couldn't find any RepositoryItem with id [{}] in the repository [{}]. Returning null", pPk, mRepository);
return null;
} else {
mLog.debug("Found RepositoryItem [{}] for id [{}] in Repository [{}]. Converting it to a Bean of type [{}]", item, pPk, mRepository, mType);
return toBean(item);
}
} catch (RepositoryException e) {
throw new IllegalArgumentException();
}
}
开发者ID:talberto,项目名称:easybeans,代码行数:17,代码来源:BeanMapper.java
示例5: toBean
import atg.repository.RepositoryItem; //导入依赖的package包/类
public T toBean(RepositoryItem pItem) {
mLog.trace("Entering toBean({})", pItem);
mLog.debug("Creating new instance of type [{}]", mType);
@SuppressWarnings("unchecked")
T bean = (T) mInstantiator.newInstance();
mLog.debug("Extracting all properties from the RepositoryItem [{}]", pItem);
for(PropertyMapper propertyMapper : mPropMapperForBeanPropertyName.values()) {
mLog.debug("Property mapper [{}] will map the property", propertyMapper);
Object propertyValue = propertyMapper.mapRepositoryProperty(pItem);
propertyMapper.setBeanProperty(bean, propertyValue);
}
// Set the bean id
setBeanId(bean, pItem.getRepositoryId());
return bean;
}
开发者ID:talberto,项目名称:easybeans,代码行数:20,代码来源:BeanMapper.java
示例6: testIt
import atg.repository.RepositoryItem; //导入依赖的package包/类
public void testIt() {
try {
RepositoryItem loader = repository.getItem("xprod2078", "product");
System.gc();
Thread.sleep(1000);
long start = System.currentTimeMillis();
String[] products = { "xprod2531", "xprod2536", "xprod2535", "xprod2500", "xprod2502", "xprod2501", "xprod2504", "xprod2503", "xprod2505", "xprod2506", "xprod2507", "xprod2508", "xprod2509", "xprod2521", "xprod2522", "xprod2528", "xprod2527",
"xprod2529", "xprod2514", "xprod2512", "xprod2513", "xprod2510", "xprod2511", "xprod2519", "xprod2518", "xprod2517", "xprod2516", "xprod2532", "xprod2533", "xprod1014", "xprod1015", "xprod1003", "xprod1004", "xprod1001", "xprod1002",
"xprod1007", "xprod1008", "xprod1005", "xprod1006", "xprod1009", "xprod2523", "xprod2524", "xprod2525", "xprod2526", "xprod2520", "xprod2156", "xprod2157", "xprod2158", "xprod2159", "xprod2152", "xprod2153", "xprod2154", "xprod2155",
"xprod2150", "xprod2151", "xprod1010", "xprod1011", "xprod1012", "xprod1013", "xprod1042", "xprod40028", "xprod40022", "xprod1039", "xprod1038", "xprod2169", "xprod2167", "xprod2168", "xprod2165", "xprod2166", "xprod2163", "xprod2164",
"xprod2161", "xprod2162", "xprod1043", "xprod2160", "xprod2114", "xprod2113", "xprod1069", "xprod2112", "xprod1057", "xprod1056", "xprod1059", "xprod1058", "xprod1048", "xprod1047", "xprod1046", "xprod1045", "xprod1049", "xprod1040",
"xprod40026", "xprod1044", "xprod2129", "xprod2124", "xprod2123", "xprod2126", "xprod2125", "xprod2111", "xprod2110", "xprod1064" };
for (int i = 0; i < products.length; i++) {
StringBuffer buff = new StringBuffer();
String prodId = products[i];
RepositoryItem repositoryItem = repository.getItem(prodId, "product");
String description = (String) repositoryItem.getPropertyValue("description");
List<RepositoryItem> childSKUs = (List<RepositoryItem>) repositoryItem.getPropertyValue("childSKUs");
for (RepositoryItem sku : childSKUs) {
Set<RepositoryItem> parents = (Set<RepositoryItem>) sku.getPropertyValue("parentProducts");
for (RepositoryItem parent : parents) {
String id = parent.getRepositoryId();
String description2 = (String) parent.getPropertyValue("description");
//buff.append(id).append("DESCRIPTION=" + description2 );
}
}
}
long totalTime = System.currentTimeMillis() - start;
System.out.println("total time " + totalTime);
} catch (Exception e) {
logError(e);
}
}
开发者ID:varelma,项目名称:atg-generics,代码行数:40,代码来源:ColdLookupNonGenericsRepositoryPerformanceTest.java
示例7: wrapList
import atg.repository.RepositoryItem; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
protected List wrapList(List<RepositoryItem> in, String repositryId, String propertyName, Class clazz) {
List<RepositoryItem> list = new ArrayList<RepositoryItem>();
String itemDescriptorName = "";
try {
itemDescriptorName = this.getItemDescriptor().getItemDescriptorName();
for (RepositoryItem repositoryItem : in) {
MutableRepositoryItemExt mutableRepositoryItemExt = getRepository().getItemCache().get(repositoryItem.getRepositoryId() + GenericsRepository.SPLIT_CHAR + clazz.getCanonicalName());
if (mutableRepositoryItemExt != null) {
// is the item already in the cache.
// this can happen if product -- childSkus -- parantProducts so running this check ensures that objects are
// created only once
list.add(mutableRepositoryItemExt);
} else {
mutableRepositoryItemExt = ConstructorUtils.invokeExactConstructor(clazz, null);
mutableRepositoryItemExt.setDelegate(repositoryItem);
mutableRepositoryItemExt.setRepositoryId(repositoryItem.getRepositoryId());
list.add(mutableRepositoryItemExt);
getRepository().getItemCache().put(mutableRepositoryItemExt.getRepositoryId() + GenericsRepository.SPLIT_CHAR + mutableRepositoryItemExt.getClass().getCanonicalName(), mutableRepositoryItemExt);
}
}
} catch (Exception e) {
throw new RuntimeException(e);
}
List result = null;
if (getRepository().isChangeAware()) {
result = new ChangeAwareList(list, this, itemDescriptorName, (ApplicationLogging) this.getRepository());
} else {
result = list;
}
return result;
}
开发者ID:varelma,项目名称:atg-generics,代码行数:33,代码来源:MutableRepositoryItemExt.java
示例8: wrapSet
import atg.repository.RepositoryItem; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
protected Set wrapSet(Set<RepositoryItem> in, String repositryId, String propertyName, Class clazz) {
Set<RepositoryItem> set = new HashSet<RepositoryItem>();
String itemDescriptorName = "";
try {
itemDescriptorName = this.getItemDescriptor().getItemDescriptorName();
for (RepositoryItem repositoryItem : in) {
MutableRepositoryItemExt mutableRepositoryItemExt = getRepository().getItemCache().get(repositoryItem.getRepositoryId() + GenericsRepository.SPLIT_CHAR + clazz.getCanonicalName());
if (mutableRepositoryItemExt != null) {
// is the item already in the cache.
// this can happen if product -- childSkus -- parantProducts so running this check ensures that objects are
// created only once
set.add(mutableRepositoryItemExt);
} else {
mutableRepositoryItemExt = ConstructorUtils.invokeExactConstructor(clazz, null);
mutableRepositoryItemExt.setDelegate(repositoryItem);
mutableRepositoryItemExt.setRepositoryId(repositoryItem.getRepositoryId());
set.add(mutableRepositoryItemExt);
getRepository().getItemCache().put(mutableRepositoryItemExt.getRepositoryId() + GenericsRepository.SPLIT_CHAR + mutableRepositoryItemExt.getClass().getCanonicalName(), mutableRepositoryItemExt);
}
}
} catch (Exception e) {
throw new RuntimeException(e);
}
Set result = null;
if (getRepository().isChangeAware()) {
result = new ChangeAwareSet(set, this, itemDescriptorName);
} else {
result = set;
}
return result;
}
开发者ID:varelma,项目名称:atg-generics,代码行数:33,代码来源:MutableRepositoryItemExt.java
示例9: wrapMap
import atg.repository.RepositoryItem; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
protected Map wrapMap(Map<String, RepositoryItem> in, String repositryId, String propertyName, Class clazz) {
Map<String, RepositoryItem> map = new HashMap<String, RepositoryItem>();
String itemDescriptorName = "";
Set<String> keySet = in.keySet();
try {
itemDescriptorName = this.getItemDescriptor().getItemDescriptorName();
for (String key : keySet) {
RepositoryItem repositoryItem = map.get(key);
MutableRepositoryItemExt mutableRepositoryItemExt = getRepository().getItemCache().get(repositoryItem.getRepositoryId() + clazz.getCanonicalName());
if (mutableRepositoryItemExt != null) {
map.put(key, mutableRepositoryItemExt);
} else {
mutableRepositoryItemExt = ConstructorUtils.invokeExactConstructor(clazz, null);
mutableRepositoryItemExt.setDelegate(repositoryItem);
mutableRepositoryItemExt.setRepositoryId(repositoryItem.getRepositoryId());
map.put(key, mutableRepositoryItemExt);
getRepository().getItemCache().put(mutableRepositoryItemExt.getRepositoryId() + GenericsRepository.SPLIT_CHAR + mutableRepositoryItemExt.getClass().getCanonicalName(), mutableRepositoryItemExt);
}
}
} catch (Exception e) {
throw new RuntimeException(e);
}
Map result = null;
if (getRepository().isChangeAware()) {
result = new ChangeAwareMap(map, this, itemDescriptorName);
} else {
result = map;
}
return result;
}
开发者ID:varelma,项目名称:atg-generics,代码行数:34,代码来源:MutableRepositoryItemExt.java
示例10: wrapItem
import atg.repository.RepositoryItem; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes" })
protected MutableRepositoryItemExt wrapItem(RepositoryItem repositoryItem, Class beanClass) {
try {
MutableRepositoryItemExt mutableRepositoryItemExt = getRepository().findOrCreate((MutableRepositoryItem) repositoryItem, beanClass);
return mutableRepositoryItemExt;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
开发者ID:varelma,项目名称:atg-generics,代码行数:10,代码来源:MutableRepositoryItemExt.java
示例11: getIds
import atg.repository.RepositoryItem; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
protected List<String> getIds(Collection items) {
List<String> result = new ArrayList<String>();
if (items == null || items.isEmpty()) {
return result;
}
for (Object repositoryItem : items) {
result.add(((RepositoryItem) repositoryItem).getRepositoryId());
}
return result;
}
开发者ID:varelma,项目名称:atg-generics,代码行数:12,代码来源:MutableRepositoryItemExt.java
示例12: translate
import atg.repository.RepositoryItem; //导入依赖的package包/类
public static String translate(String key, Locale locale) {
RepositoryItem tranlationItem = null;
String result = "";
try {
tranlationItem = I18N_REPOSITORY.getItem(key + "_" + locale.toString(), "translation");
} catch (RepositoryException e) {
mLogger.logError(e);
}
if (tranlationItem != null) {
result = (String) tranlationItem.getPropertyValue("value");
}
return result;
}
开发者ID:varelma,项目名称:atg-utils,代码行数:14,代码来源:TranslationTools.java
示例13: productHasChildSkus
import atg.repository.RepositoryItem; //导入依赖的package包/类
@Test
public void productHasChildSkus() throws RepositoryException{
RepositoryItem jacket = mCatalogTools.findProduct(CatalogTestConstants.MENS_JACKET_PRODUCT_ID);
@SuppressWarnings("unchecked")
List<RepositoryItem> childSkus = (List<RepositoryItem>) jacket.getPropertyValue("childSKUs");
assertEquals(3, childSkus.size());
}
开发者ID:Roanis,项目名称:atg-tdd,代码行数:9,代码来源:CatalogToolsTest.java
示例14: mapRepositoryProperty
import atg.repository.RepositoryItem; //导入依赖的package包/类
@Override
public Object mapRepositoryProperty(RepositoryItem pItem) {
Object propertyValue = pItem.getPropertyValue(getRepositoryPropertyName());
try {
Object enumItem;
if(mEnumRepositoryType.getUseCodeForValue()) {
enumItem = mFromCode.invoke(null, propertyValue);
} else {
enumItem = mFromValue.invoke(null, propertyValue);
}
return mBeanPropertyDescriptor.getPropertyType().cast(enumItem);
} catch (Exception e) {
throw new MappingException(String.format("Error extracting and converting [%s] enum", propertyValue), e);
}
}
开发者ID:talberto,项目名称:easybeans,代码行数:16,代码来源:PropertyMapper.java
示例15: repositoryItemForBean
import atg.repository.RepositoryItem; //导入依赖的package包/类
protected RepositoryItem repositoryItemForBean(Object pBean) {
checkArgument(pBean.getClass().equals(mType), "The bean pBean is of type [%s] whereas this mapper is of type [%s]", pBean.getClass(), mType);
@SuppressWarnings("unchecked")
T castedBean = (T) pBean;
try {
return mRepository.getItem(getBeanId(castedBean), mItemDescriptor.getItemDescriptorName());
} catch (RepositoryException e) {
throw new MappingException(String.format("Error getting a RepositoryItem for bean [%s]", castedBean), e);
}
}
开发者ID:talberto,项目名称:easybeans,代码行数:12,代码来源:BeanMapper.java
示例16: testDelete
import atg.repository.RepositoryItem; //导入依赖的package包/类
@Test
public void testDelete() throws RepositoryException {
Child child1 = new Child();
child1.setId("child01");
Child child2 = new Child();
child2.setId("child2");
ContactInfo billingAddress = new ContactInfo();
billingAddress.setId("billingAddress");
ContactInfo officeContact = new ContactInfo();
officeContact.setId("officeContact");
User user = new User();
user.setId("user01");
user.setBillingAddress(billingAddress);
user.setChildren(Lists.newArrayList(child1, child2));
user.setAddresses(Maps.newHashMap(ImmutableMap.of("officeAddress", officeContact)));
mEntityManager.delete(user);
// Check that the repository items no longer exist
RepositoryItem item = mUserRepository.getItem("user01", "user");
assertThat("The repository item user still exists", item, nullValue());
item = mUserRepository.getItem("billingAddress", "contactInfo");
assertThat("The billing address doesn't exists", item, notNullValue());
item = mUserRepository.getItem("child01", "child");
assertThat("The first child doesn't exists", item, notNullValue());
item = mUserRepository.getItem("child02", "child");
assertThat("The second child doesn't exists", item, notNullValue());
item = mUserRepository.getItem("officeContact", "contactInfo");
assertThat("The office contact doesn't exists", item, notNullValue());
}
开发者ID:talberto,项目名称:easybeans,代码行数:35,代码来源:NucleusEntityManagerIT.java
示例17: testDeleteNested
import atg.repository.RepositoryItem; //导入依赖的package包/类
@Test
public void testDeleteNested() throws RepositoryException {
Child child1 = new Child();
child1.setId("child01");
Child child2 = new Child();
child2.setId("child02");
ContactInfo billingAddress = new ContactInfo();
billingAddress.setId("billingAddress");
ContactInfo officeContact = new ContactInfo();
officeContact.setId("officeContact");
User user = new User();
user.setId("user01");
user.setBillingAddress(billingAddress);
user.setChildren(Lists.newArrayList(child1, child2));
user.setAddresses(Maps.newHashMap(ImmutableMap.of("officeAddress", officeContact)));
mEntityManager.delete(user, true);
// Check that the repository items no longer exist
RepositoryItem item = mUserRepository.getItem("user01", "user");
assertThat("The repository item user still exists", item, nullValue());
item = mUserRepository.getItem("billingAddress", "contactInfo");
assertThat("The billing address still exists", item, nullValue());
item = mUserRepository.getItem("child01", "child");
assertThat("The first child still exists", item, nullValue());
item = mUserRepository.getItem("child02", "child");
assertThat("The second child still exists", item, nullValue());
item = mUserRepository.getItem("officeContact", "contactInfo");
assertThat("The office contact still exists", item, nullValue());
}
开发者ID:talberto,项目名称:easybeans,代码行数:35,代码来源:NucleusEntityManagerIT.java
示例18: songsRepositoryTest
import atg.repository.RepositoryItem; //导入依赖的package包/类
private void songsRepositoryTest()
throws TransactionDemarcationException, RepositoryException, IOException {
GSARepository songsRepository = (GSARepository) resolveNucleusComponent(
"/GettingStarted/SongsRepository"
);
assertNotNull(songsRepository);
final TransactionDemarcation td = new TransactionDemarcation();
assertNotNull(td);
try {
// Start a new transaction
td.begin(songsRepository.getTransactionManager());
// Create a new artist
MutableRepositoryItem artist = songsRepository.createItem("artist");
artist.setPropertyValue("name", "joe");
// Persist to the repository
songsRepository.addItem(artist);
// Try to get it back from the repository
String id = artist.getRepositoryId();
RepositoryItem retrievedArtist = songsRepository.getItem(
id, "artist"
);
assertEquals(artist, retrievedArtist);
} finally {
// End the transaction, roll-back to restore original database state
td.end(true);
}
}
开发者ID:jvz,项目名称:dynunit,代码行数:31,代码来源:SongsRepositoryTest.java
示例19: doStartService
import atg.repository.RepositoryItem; //导入依赖的package包/类
/**
* Do start service.
*
* @throws ServiceException
* the service exception
* @see atg.nucleus.GenericService#doStartService()
*/
@Override
public void doStartService() throws ServiceException {
// Validate required properties
if (getCryptoRepository() == null) {
if (isLoggingError()) {
logError("CryptoEngine.doStartService: " + "CryptoRepository was null.");
}
throw new ServiceException("CryptoRepository was null.");
}
if (getCryptoEngineIdentifier() == null) {
if (isLoggingError()) {
logError("CryptoEngine.doStartService: " + "CryptoEngineIdentifier was null.");
}
throw new ServiceException("CryptoEngineIdentifier was null.");
}
if (getKeyPassphrase() == null) {
if (isLoggingError()) {
logError("CryptoEngine.doStartService: " + "KeyPassphrase was null.");
}
throw new ServiceException("KeyPassphrase was null.");
}
// Add the BouncyCastle JCE Security provider
Security.addProvider(new BouncyCastleProvider());
try {
// Load this crypo engine's encrypted data passphrase
RepositoryItem cryptoEngineItem = getCryptoRepository().getItem(getCryptoEngineIdentifier(),
CryptoConstants.CRYPTO_ENGINE_ITEM_DESC);
if (cryptoEngineItem == null) {
if (isLoggingWarning()) {
logWarning("CryptoEngine.doStartService: "
+ "This Crypto Engine has not yet been initialized. Initializing it now.");
}
initializeNewEngine();
cryptoEngineItem = getCryptoRepository().getItem(getCryptoEngineIdentifier(),
CryptoConstants.CRYPTO_ENGINE_ITEM_DESC);
}
String encryptedDataPassphrase = (String) cryptoEngineItem
.getPropertyValue(CryptoConstants.ENC_DATA_KEY_PROP_NAME);
// Decrypt the data passphrase using the key passphrase
final StandardPBEStringEncryptor dataPassDecryptor = new StandardPBEStringEncryptor();
dataPassDecryptor.setProviderName(CryptoConstants.BOUNCY_CASTLE_PROVIDER_NAME);
dataPassDecryptor.setAlgorithm(CryptoConstants.STRONG_ALGO);
dataPassDecryptor.setPassword(getKeyPassphrase());
String dataPassphrase = dataPassDecryptor.decrypt(encryptedDataPassphrase);
if (isLoggingInfo()) {
logInfo("CryptoEngine.doStartService: " + "dataPassphrase is: " + dataPassphrase);
}
// Setup the encryptor
this.mEncryptor = new StandardPBEStringEncryptor();
this.mEncryptor.setProviderName(CryptoConstants.BOUNCY_CASTLE_PROVIDER_NAME);
this.mEncryptor.setAlgorithm(CryptoConstants.STRONG_ALGO);
this.mEncryptor.setPassword(dataPassphrase);
} catch (Exception e) {
if (isLoggingError()) {
logError("CryptoEngine.doStartService: " + "Exception caught setting up the encryptor.", e);
}
}
// Setup scheduled job to check the key expiration status
ScheduledJob job = new ScheduledJob("SR:Crypto:" + getCryptoEngineIdentifier(),
"Checks the key expiration status for the Spark::red encryptor: " + getCryptoEngineIdentifier(),
getAbsoluteName(), getSchedule(), this, ScheduledJob.SCHEDULER_THREAD);
setJobId(getScheduler().addScheduledJob(job));
}
开发者ID:sparkred-insight,项目名称:ATGCrypto,代码行数:76,代码来源:CryptoEngine.java
示例20: testIt
import atg.repository.RepositoryItem; //导入依赖的package包/类
public void testIt() {
try {
RepositoryItem loader = repository.getItem("xprod2078", "product");
System.gc();
Thread.sleep(1000);
long start = System.currentTimeMillis();
String[] products = { "xprod2531", "xprod2536", "xprod2535", "xprod2500", "xprod2502", "xprod2501", "xprod2504", "xprod2503", "xprod2505", "xprod2506", "xprod2507", "xprod2508", "xprod2509", "xprod2521", "xprod2522", "xprod2528", "xprod2527",
"xprod2529", "xprod2514", "xprod2512", "xprod2513", "xprod2510", "xprod2511", "xprod2519", "xprod2518", "xprod2517", "xprod2516", "xprod2532", "xprod2533", "xprod1014", "xprod1015", "xprod1003", "xprod1004", "xprod1001", "xprod1002",
"xprod1007", "xprod1008", "xprod1005", "xprod1006", "xprod1009", "xprod2523", "xprod2524", "xprod2525", "xprod2526", "xprod2520", "xprod2156", "xprod2157", "xprod2158", "xprod2159", "xprod2152", "xprod2153", "xprod2154", "xprod2155",
"xprod2150", "xprod2151", "xprod1010", "xprod1011", "xprod1012", "xprod1013", "xprod1042", "xprod40028", "xprod40022", "xprod1039", "xprod1038", "xprod2169", "xprod2167", "xprod2168", "xprod2165", "xprod2166", "xprod2163", "xprod2164",
"xprod2161", "xprod2162", "xprod1043", "xprod2160", "xprod2114", "xprod2113", "xprod1069", "xprod2112", "xprod1057", "xprod1056", "xprod1059", "xprod1058", "xprod1048", "xprod1047", "xprod1046", "xprod1045", "xprod1049", "xprod1040",
"xprod40026", "xprod1044", "xprod2129", "xprod2124", "xprod2123", "xprod2126", "xprod2125", "xprod2111", "xprod2110", "xprod1064" };
for (int i = 0; i < products.length; i++) {
StringBuffer buff = new StringBuffer();
String prodId = products[i];
Product product = repository.getItem(prodId, Product.class);
String description = product.getDescription();
List<Sku> skus = product.getChildSKUs();
for (Sku sku : skus) {
String s = sku.getDisplayNameDefault();
Set<Product> parents = sku.getParentProducts();
for (Product parent : parents) {
String id = parent.getRepositoryId();
String description2 = parent.getDescription();
// buff.append(id).append("DESCRIPTION=" + description2);
}
//buff.append(description).append(s).append(sku.getGiftWrapEligible());
}
}
long totalTime = System.currentTimeMillis() - start;
System.out.println("total time " + totalTime);
} catch (Exception e) {
logError(e);
}
}
开发者ID:varelma,项目名称:atg-generics,代码行数:42,代码来源:ColdLookupGenericsRepositoryPerformanceTest.java
注:本文中的atg.repository.RepositoryItem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论