• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RepositoryException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中atg.repository.RepositoryException的典型用法代码示例。如果您正苦于以下问题:Java RepositoryException类的具体用法?Java RepositoryException怎么用?Java RepositoryException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RepositoryException类属于atg.repository包,在下文中一共展示了RepositoryException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initializeNewEngine

import atg.repository.RepositoryException; //导入依赖的package包/类
/**
 * Initialize engine for first time use. This method created a new random data encryption passphrase which is shown
 * to no one.
 */
private void initializeNewEngine() {
	// Generate a new data passphrase
	String newDataPassphrase = generateNewDataPassphrase();
	// Encrypt the data passphrase with the key passphrase
	final StandardPBEStringEncryptor dataPassEncryptor = new StandardPBEStringEncryptor();
	dataPassEncryptor.setProviderName(CryptoConstants.BOUNCY_CASTLE_PROVIDER_NAME);
	dataPassEncryptor.setAlgorithm(CryptoConstants.STRONG_ALGO);
	dataPassEncryptor.setPassword(getKeyPassphrase());
	String encryptedNewDataPassphrase = dataPassEncryptor.encrypt(newDataPassphrase);

	// Persist the new engine config
	try {
		MutableRepositoryItem newCryptoEngineItem = getCryptoRepository().createItem(getCryptoEngineIdentifier(),
				CryptoConstants.CRYPTO_ENGINE_ITEM_DESC);
		newCryptoEngineItem.setPropertyValue(CryptoConstants.DESCRIPTION_PROP_NAME, getCryptoEngineDescription());
		newCryptoEngineItem.setPropertyValue(CryptoConstants.ENC_DATA_KEY_PROP_NAME, encryptedNewDataPassphrase);
		newCryptoEngineItem.setPropertyValue(CryptoConstants.KEY_DATE_PROP_NAME, new Date());
		getCryptoRepository().addItem(newCryptoEngineItem);
	} catch (RepositoryException e) {
		if (isLoggingError()) {
			logError("CryptoEngine.initializeEngine: " + "unable to create new crypto engine config item.", e);
		}
	}
}
 
开发者ID:sparkred-insight,项目名称:ATGCrypto,代码行数:29,代码来源:CryptoEngine.java


示例2: getItem

import atg.repository.RepositoryException; //导入依赖的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: disableAllItemCaches

import atg.repository.RepositoryException; //导入依赖的package包/类
public void disableAllItemCaches() {
String[] descriptorNames = getItemDescriptorNames();

try {
    for (int i = 0; i < descriptorNames.length; i++) {
	GSAItemDescriptor gsaItemDescriptor = ((GSAItemDescriptor) getItemDescriptor(descriptorNames[i]));
	gsaItemDescriptor.setCacheMode(GSAItemDescriptor.CACHE_MODE_DISABLED);
	gsaItemDescriptor.disableItemCache();
	gsaItemDescriptor.setItemCacheSize(0);
	gsaItemDescriptor.setItemCacheTimeout(0);
	gsaItemDescriptor.setItemExpireTimeout(0);
    }
} catch (RepositoryException exc) {
    exc.printStackTrace();
}
   }
 
开发者ID:varelma,项目名称:atg-generics,代码行数:17,代码来源:RepositoryWithCachesDisabled.java


示例4: updateProfileWithChildDetails

import atg.repository.RepositoryException; //导入依赖的package包/类
/**
 * Creates a child repository item and updates the child information from VPChildrenResponseBean.
 * 
 * @param pProfile
 * @param pChild
 * @return
 */
private MutableRepositoryItem updateProfileWithChildDetails(Profile pProfile, VPChildrenResponseBean pChild){
	MutableRepository profRep = (MutableRepository) pProfile.getRepository();
	try {
		//transient
		MutableRepositoryItem childItem = profRep.createItem(VPProfileConstants.ITEMS_DESC_VP_CHILD);
		childItem.setPropertyValue(VPProfileConstants.PROPERTY_NAME_VP_CHILD_ID, pChild.getIdentifier());
		childItem.setPropertyValue(VPProfileConstants.PROPERTY_NAME_VP_CHILD_NAME, pChild.getName());
		childItem.setPropertyValue(VPProfileConstants.PROPERTY_NAME_VP_CHILD_TYPE, pChild.getType());
		
		return childItem;
	} catch (RepositoryException e) {
		if(isLoggingError()){
			logError(e.getMessage());
		}
	}
	return null;
}
 
开发者ID:VirtualPiggyInc,项目名称:oink_oracle_atg_commerce,代码行数:25,代码来源:VPProfileTools.java


示例5: addShipAddressToProfile

import atg.repository.RepositoryException; //导入依赖的package包/类
/**
 * Creates a new contact info item and updates the address information retrieved from Virtual Piggy for a User.
 * Address is mapped to a child-id.
 * 
 * @param pProfile user profile.
 * @param pUserIdentifier child id to map the address with.
 * @param pInBean address response bean from Virtual Piggy service call.
 * @return contact info repository item.
 */
public MutableRepositoryItem addShipAddressToProfile(Profile pProfile, String pUserIdentifier, VPAddressResponseBean pInBean){
	MutableRepository profRep = (MutableRepository) pProfile.getRepository();
	try {
		//transient
		MutableRepositoryItem addressItem = profRep.createItem(getContactInfoItemDescriptorName());
		copyShipAddress(pInBean, addressItem);
		
		//set to profile
		//VPProfileUtil.setProfileProperty(pProfile, VPProfileConstants.PROPERTY_NAME_VP_USER_SHIP_ADDRESS, addressItem);
		Map addMap = (Map)VPProfileUtil.getProfileProperty(pProfile, VPProfileConstants.PROPERTY_NAME_VP_USER_SHIP_ADDRESSES);
		if(addMap == null){
			addMap = new HashMap();
			VPProfileUtil.setProfileProperty(pProfile, VPProfileConstants.PROPERTY_NAME_VP_USER_SHIP_ADDRESSES, addMap);
		}
		
		addMap.put(pUserIdentifier,addressItem);
		
		return addressItem;
	} catch (RepositoryException e) {
		if(isLoggingError()){
			logError(e.getMessage());
		}
	}
	return null;
}
 
开发者ID:VirtualPiggyInc,项目名称:oink_oracle_atg_commerce,代码行数:35,代码来源:VPProfileTools.java


示例6: createPaymentAccountItem

import atg.repository.RepositoryException; //导入依赖的package包/类
/**
 * Creates a Virtual Piggy parent payment information repository item from the VirtualPiggyPaymentAccountInfoBean.
 * 
 * @param pProfile user profile.
 * @param pPayBean VirtualPiggyPaymentAccountInfoBean object as a payment a/c info of a parent.
 * @return Virtual Piggy Parent Payment repository item.
 */
public MutableRepositoryItem createPaymentAccountItem(Profile pProfile, VirtualPiggyPaymentAccountInfoBean pPayBean){
	MutableRepository profRep = (MutableRepository) pProfile.getRepository();
	try {
		//transient
		MutableRepositoryItem payItem = profRep.createItem(VPProfileConstants.ITEMS_DESC_VP_PAYMENT);
		if(payItem != null){
			payItem.setPropertyValue(VPProfileConstants.PROPERTY_NAME_VP_PAYMENT_ID, pPayBean.getIdentifier());
			payItem.setPropertyValue(VPProfileConstants.PROPERTY_NAME_VP_PAYMENT_NAME, pPayBean.getName());
			payItem.setPropertyValue(VPProfileConstants.PROPERTY_NAME_VP_PAYMENT_TYPE, pPayBean.getType());
			payItem.setPropertyValue(VPProfileConstants.PROPERTY_NAME_VP_PAYMENT_URL, pPayBean.getUrl());
		}
		return payItem;
	} catch (RepositoryException e) {
		if(isLoggingError()){
			logError(e.getMessage());
		}
	}
	return null;
}
 
开发者ID:VirtualPiggyInc,项目名称:oink_oracle_atg_commerce,代码行数:27,代码来源:VPProfileTools.java


示例7: find

import atg.repository.RepositoryException; //导入依赖的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


示例8: delete

import atg.repository.RepositoryException; //导入依赖的package包/类
public void delete(T pBean, boolean pDeleteNested) {
  mLog.trace("Entering delete({})", pBean);
  String repositoryId = getBeanId(pBean);
  
  mLog.debug("Deleting RepositoryItem [{}] of type [{}]", repositoryId, this.mItemDescriptor.getItemDescriptorName());
  try {
    mRepository.removeItem(repositoryId, this.mItemDescriptor.getItemDescriptorName());
    
    if(pDeleteNested) {
      for(PropertyMapper propertyMapper : mPropMapperForBeanPropertyName.values()) {
        propertyMapper.removeProperty(pBean);
      }
    }
  } catch (RepositoryException e) {
    throw new MappingException(String.format("Error removing item [%s] of type [%s] from Repository [%s]", repositoryId, this.mItemDescriptor.getItemDescriptorName(), mRepository), e);
  }
}
 
开发者ID:talberto,项目名称:easybeans,代码行数:18,代码来源:BeanMapper.java


示例9: extractBeans

import atg.repository.RepositoryException; //导入依赖的package包/类
public List<MetaBean> extractBeans(Repository pRepo, List<String> pBeanNames) {
  mLog.info("Extracting beans [{}] from repository [{}]", Joiner.on(",").join(pBeanNames), pRepo.toString());
  List<MetaBean> extractedBeans = Lists.newLinkedList();
  
  for(String beanName : pBeanNames) {
    try {
      RepositoryItemDescriptor descriptor = pRepo.getItemDescriptor(beanName);
      
      if(descriptor == null) {
        throw new IllegalArgumentException(String.format("Doesn't exist an item descriptor named [%s]", beanName));
      }
      
      List<MetaProperty> properties = extractProperties(descriptor);
      extractedBeans.add(new MetaBean(beanName, properties));
    } catch (RepositoryException e) {
      throw new MappingException(e);
    }
  }
  
  return extractedBeans;
}
 
开发者ID:talberto,项目名称:easybeans,代码行数:22,代码来源:RepositoryBeansExtractor.java


示例10: testExtraction

import atg.repository.RepositoryException; //导入依赖的package包/类
@Test
public void testExtraction() throws RepositoryException {
  Repository repo = buildRepository();
  List<String> beanNames = Arrays.asList(BEAN_NAME);
  
  RepositoryBeansExtractor extractor = new RepositoryBeansExtractor();
  
  List<MetaBean> extractedBeans = extractor.extractBeans(repo, beanNames);
  assertThat("Incorrect number of extracted beans", extractedBeans, hasSize(1));
  MetaBean extractedBean = extractedBeans.get(0);
  assertThat("Incorrect name for the extracted bean", extractedBean.getName(), equalTo(CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, BEAN_NAME)));
  assertThat("Incorrect number of extracted properties", extractedBean.getProperties(), hasSize(1));
  MetaProperty extractedProperty = extractedBean.getProperties().get(0);
  assertThat("Incorrect property name", extractedProperty.getName(), equalTo(PROPERTY_NAME));
  assertThat("Incorrect property type", extractedProperty.getType().getName(), equalTo(PROPERTY_TYPE.getSimpleName()));
}
 
开发者ID:talberto,项目名称:easybeans,代码行数:17,代码来源:RepositoryBeansExtractorTest.java


示例11: getSpecifiedCreateFiles

import atg.repository.RepositoryException; //导入依赖的package包/类
/**
 * returns array of user-specified SQL files that should be executed, or null
 * if output from startSQLRepository should be used.
 *
 * @throws RepositoryException
 *         if an error occurs getting the array of files to execute
 */
private String[] getSpecifiedCreateFiles()
        throws RepositoryException {
    // try to get mapped value for this specific db type, and if it's empty try
    // the default
    String files = (String) getSqlCreateFiles().get(getDatabaseType());
    if (files == null) {
        files = (String) getSqlCreateFiles().get(DEFAULT);
    }
    // if it's still empty then just return b/c there's nothing to execute
    if (files == null) {
        return null;
    }

    // if file list is not null, convert it and return the array
    try {
        return TestUtils.convertFileArray(files, ":");
    } catch (Exception e) {
        throw new RepositoryException(e);
    }
}
 
开发者ID:jvz,项目名称:dynunit,代码行数:28,代码来源:InitializingGSA.java


示例12: getSpecifiedDropFiles

import atg.repository.RepositoryException; //导入依赖的package包/类
/**
 * returns array of user-specified SQL files that should be executed, or null
 * if output from startSQLRepository should be used.
 *
 * @throws RepositoryException
 *         if an error occurs getting the array of files to execute
 */
private String[] getSpecifiedDropFiles()
        throws RepositoryException {
    // try to get mapped value for this specific db type, and if it's empty try
    // the default
    String files = (String) getSqlDropFiles().get(getDatabaseType());
    if (files == null) {
        files = (String) getSqlDropFiles().get(DEFAULT);
    }
    // if it's still empty then just return b/c there's nothing to execute
    if (files == null) {
        return null;
    }

    // if file list is not null, convert it and return the array
    try {
        return TestUtils.convertFileArray(files, ":");
    } catch (Exception e) {
        throw new RepositoryException(e);
    }
}
 
开发者ID:jvz,项目名称:dynunit,代码行数:28,代码来源:InitializingGSA.java


示例13: dropTables

import atg.repository.RepositoryException; //导入依赖的package包/类
/**
 * This method drops all tables required by the GSARepository.
 *
 * @throws RepositoryException   if an error occurs while retrieving a
 *                               list of the tables associated with the repository
 */
public void dropTables()
        throws RepositoryException {
    // execute SQL files, if specified
    String[] dropFiles = getSpecifiedDropFiles();
    if ( dropFiles != null ) {
        if ( isExecuteCreateAndDropScripts() ) {
            executeSqlFiles(dropFiles, false);
        } else if ( isLoggingInfo() ) {
            logInfo("Skipping execution of SQL scripts b/c property 'executeCreateAndDropScripts' is false.");
        }
        return;
    }

    // otherwise, just drop tables based on startSQLRepository SQL  -- not implement yet.
    if ( isLoggingInfo() ) {
        logInfo("Can not drop tables based on startSQLRepositoryRepository SQL. Please specified DropFiles!");
    }
}
 
开发者ID:jvz,项目名称:dynunit,代码行数:25,代码来源:InitializingVersionRepository.java


示例14: getSpecifiedCreateFiles

import atg.repository.RepositoryException; //导入依赖的package包/类
/**
 * returns array of user-specified SQL files that should be executed, or null
 * if output from startSQLRepository should be used.
 *
 * @throws RepositoryException if an error occurs getting the array of files to execute
 */
private String[] getSpecifiedCreateFiles()
        throws RepositoryException {
    // try to get mapped value for this specific db type, and if it's empty try the default
    String files = (String) getSqlCreateFiles().get(getDatabaseType());
    if ( files == null ) {
        files = (String) getSqlCreateFiles().get(DEFAULT);
    }
    // if it's still empty then just return b/c there's nothing to execute
    if ( files == null ) {
        return null;
    }

    // if file list is not null, convert it and return the array
    try {
        return TestUtils.convertFileArray(files, ",");
    } catch ( Exception e ) {
        throw new RepositoryException(e);
    }
}
 
开发者ID:jvz,项目名称:dynunit,代码行数:26,代码来源:InitializingVersionRepository.java


示例15: getSpecifiedDropFiles

import atg.repository.RepositoryException; //导入依赖的package包/类
/**
 * returns array of user-specified SQL files that should be executed, or null
 * if output from startSQLRepository should be used.
 *
 * @throws RepositoryException if an error occurs getting the array of files to execute
 */
private String[] getSpecifiedDropFiles()
        throws RepositoryException {
    // try to get mapped value for this specific db type, and if it's empty try the default
    String files = (String) getSqlDropFiles().get(getDatabaseType());
    if ( files == null ) {
        files = (String) getSqlDropFiles().get(DEFAULT);
    }
    // if it's still empty then just return b/c there's nothing to execute
    if ( files == null ) {
        return null;
    }

    // if file list is not null, convert it and return the array
    try {
        return TestUtils.convertFileArray(files, ",");
    } catch ( Exception e ) {
        throw new RepositoryException(e);
    }
}
 
开发者ID:jvz,项目名称:dynunit,代码行数:26,代码来源:InitializingVersionRepository.java


示例16: create

import atg.repository.RepositoryException; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
   protected MutableRepositoryItemExt create(MutableRepositoryItem in, Class beanClass) throws RepositoryException {
MutableRepositoryItemExt mutableRepositoryItemExt = null;
try {
    mutableRepositoryItemExt = ConstructorUtils.invokeExactConstructor(beanClass, null);
    mutableRepositoryItemExt.setDelegate(in);
    mutableRepositoryItemExt.setRepositoryId(in.getRepositoryId());
    String className = beanClass.getCanonicalName();
    String key = in.getRepositoryId() + SPLIT_CHAR + className;
    itemCache.put(key, mutableRepositoryItemExt);
} catch (Exception e) {
    throw new RepositoryException(e);
}
return mutableRepositoryItemExt;
   }
 
开发者ID:varelma,项目名称:atg-generics,代码行数:16,代码来源:GenericsRepository.java


示例17: findOrCreate

import atg.repository.RepositoryException; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes" })
   protected MutableRepositoryItemExt findOrCreate(MutableRepositoryItem in, Class beanClass) throws RepositoryException {
MutableRepositoryItemExt result = (MutableRepositoryItemExt) itemCache.get(in.getRepositoryId() + SPLIT_CHAR + beanClass.getCanonicalName());
if (result != null) {
    return result;
}
result = create(in, beanClass);
return result;
   }
 
开发者ID:varelma,项目名称:atg-generics,代码行数:10,代码来源:GenericsRepository.java


示例18: disableAllQueryCaches

import atg.repository.RepositoryException; //导入依赖的package包/类
public void disableAllQueryCaches() {
String[] descriptorNames = getItemDescriptorNames();

try {
    for (int i = 0; i < descriptorNames.length; i++) {
	GSAItemDescriptor gsaItemDescriptor = ((GSAItemDescriptor) getItemDescriptor(descriptorNames[i]));
	gsaItemDescriptor.disableQueryCache();
    }
} catch (RepositoryException exc) {
    exc.printStackTrace();
}
   }
 
开发者ID:varelma,项目名称:atg-generics,代码行数:13,代码来源:RepositoryWithCachesDisabled.java


示例19: translate

import atg.repository.RepositoryException; //导入依赖的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


示例20: productHasChildSkus

import atg.repository.RepositoryException; //导入依赖的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



注:本文中的atg.repository.RepositoryException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Response类代码示例发布时间:2022-05-23
下一篇:
Java DistributedRPC类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap