Package org.infoglue.cms.entities.management

Examples of org.infoglue.cms.entities.management.Language


   * so it recognises the change.
   */

  public RoleProperties create(Integer languageId, Integer contentTypeDefinitionId, RolePropertiesVO rolePropertiesVO, Database db) throws ConstraintException, SystemException, Exception
    {
    Language language = LanguageController.getController().getLanguageWithId(languageId, db);
    ContentTypeDefinition contentTypeDefinition = ContentTypeDefinitionController.getController().getContentTypeDefinitionWithId(contentTypeDefinitionId, db);

    RoleProperties roleProperties = new RolePropertiesImpl();
    roleProperties.setLanguage((LanguageImpl)language);
    roleProperties.setContentTypeDefinition((ContentTypeDefinition)contentTypeDefinition);
View Full Code Here


   * This method removes a Language from the system and also cleans out all depending repositoryLanguages.
   */
 
    public void delete(Database db, LanguageVO languageVO) throws ConstraintException, SystemException
    {
    Language language = getLanguageWithId(languageVO.getId(), db);
    RepositoryLanguageController.getController().deleteAllRepositoryLanguageWithLanguage(language, db);       
     
    deleteEntity(LanguageImpl.class, languageVO.getLanguageId(), db);
    }       
View Full Code Here

    public Language getLanguageWithId(Integer languageId) throws ConstraintException, SystemException, Bug
    {
        Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        Language language = null;

        try
        {
      beginTransaction(db);
View Full Code Here

    public LanguageVO update(LanguageVO languageVO) throws ConstraintException, SystemException
    {
        Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        Language language = null;

        beginTransaction(db);

        try
        {
            //add validation here if needed
            language = getLanguageWithId(languageVO.getLanguageId(), db);
            language.setValueObject(languageVO);

            //If any of the validations or setMethods reported an error, we throw them up now before create.
            ceb.throwIfNotEmpty();
           
            commitTransaction(db);
        }
        catch(ConstraintException ce)
        {
            logger.warn("An error occurred so we should not complete the transaction:" + ce, ce);
            rollbackTransaction(db);
            throw ce;
        }
        catch(Exception e)
        {
            logger.error("An error occurred so we should not complete the transaction:" + e, e);
            rollbackTransaction(db);
            throw new SystemException(e.getMessage());
        }


        return language.getValueObject();
    }       
View Full Code Here

    try
    {
      beginTransaction(db);

      Language language = getLanguageWithName(name, db);
      if(language != null)
        languageVO = language.getValueObject();
     
      commitTransaction(db);
    }
    catch (Exception e)
    {
View Full Code Here

   * @throws Bug
   */

  public Language getLanguageWithName(String name, Database db) throws SystemException, Bug
  {
    Language language = null;
   
    try
    {
      OQLQuery oql = db.getOQLQuery("SELECT f FROM org.infoglue.cms.entities.management.impl.simple.LanguageImpl f WHERE f.name = $1");
      oql.bind(name);
View Full Code Here

 
  public LanguageVO getLanguageVOWithCode(String code, Database db) throws SystemException, Bug
  {
    LanguageVO languageVO = null;
   
    Language language = getLanguageWithCode(code, db);
    if(language != null)
      languageVO = language.getValueObject();
   
    return languageVO; 
  }
View Full Code Here

      try
      {
        beginTransaction(db);

        Language language = getLanguageWithCode(code, db);
        if(language != null)
          languageVO = language.getValueObject();
       
        commitTransaction(db);
      }
      catch (Exception e)
      {
View Full Code Here

   * @throws Bug
   */

  public Language getLanguageWithCode(String code, Database db) throws SystemException, Bug
  {
    Language language = null;
   
    try
    {
      OQLQuery oql = db.getOQLQuery("SELECT f FROM org.infoglue.cms.entities.management.impl.simple.LanguageImpl f WHERE f.languageCode = $1");
      oql.bind(code);
View Full Code Here

    return language;   
  }
 
    public LanguageVO create(LanguageVO languageVO) throws ConstraintException, SystemException
    {
        Language ent = new LanguageImpl();
        ent.setValueObject(languageVO);
        ent = (Language) createEntity(ent);
        return ent.getValueObject();
    }    
View Full Code Here

TOP

Related Classes of org.infoglue.cms.entities.management.Language

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.