Package org.infoglue.cms.entities.management

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


    try
    {
      beginTransaction(db);

      FormEntry formEntry = getFormEntryWithId(formEntryId, db);
      formEntryValueVOList = toVOList(formEntry.getFormEntryValues());
       
      commitTransaction(db);
    }
    catch (Exception e)
    {
View Full Code Here


    try
    {
      beginTransaction(db);

      FormEntry formEntry = getFormEntryWithId(formEntryId, db);
      formEntryAssetVOList = toVOList(formEntry.getFormEntryAssets());
       
      commitTransaction(db);
    }
    catch (Exception e)
    {
View Full Code Here

    return formEntryCountMap;   
  }

    public FormEntryVO create(FormEntryVO redirectVO) throws ConstraintException, SystemException
    {
        FormEntry formEntry = new FormEntryImpl();
        formEntry.setValueObject(redirectVO);
        formEntry = (FormEntry) createEntity(formEntry);
        return formEntry.getValueObject();
    }
View Full Code Here

        return formEntry.getValueObject();
    }

    public FormEntry create(FormEntryVO formEntryVO, List<FormEntryValueVO> formEntryValueVOList, Database db) throws ConstraintException, SystemException, Exception
    {
        FormEntry formEntry = new FormEntryImpl();
        formEntry.setValueObject(formEntryVO);
        formEntry = (FormEntry) createEntity(formEntry, db);
       
        Iterator<FormEntryValueVO> formEntryValueVOListIterator = formEntryValueVOList.iterator();
        while(formEntryValueVOListIterator.hasNext())
        {
          FormEntryValueVO formEntryValueVO = formEntryValueVOListIterator.next();
         
          FormEntryValue formEntryValue = new FormEntryValueImpl();
          formEntryValue.setFormEntry(formEntry);
          formEntry.getFormEntryValues().add(formEntryValue);
          formEntryValue.setValueObject(formEntryValueVO);
          formEntryValue = (FormEntryValue) createEntity(formEntryValue, db);
        }
         
        return formEntry;
View Full Code Here

      Database db = CastorDatabaseService.getDatabase();
       
      beginTransaction(db);
     try
        {   
       FormEntry formEntry = getFormEntryWithId(formEntryVO.getId(), db);
      
       Collection formEntryValues = formEntry.getFormEntryValues();
       Iterator formEntryValuesIterator = formEntryValues.iterator();
       while(formEntryValuesIterator.hasNext())
       {
         FormEntryValue value = (FormEntryValue)formEntryValuesIterator.next();
         //value.getFormEntry().getFormEntryValues().remove(value);
         formEntryValuesIterator.remove();
         db.remove(value);
       }
      
       Collection formEntryAssets = formEntry.getFormEntryAssets();
       Iterator formEntryAssetsIterator = formEntryAssets.iterator();
       while(formEntryAssetsIterator.hasNext())
       {
         FormEntryAsset asset = (FormEntryAsset)formEntryAssetsIterator.next();
         //asset.getFormEntry().getFormEntryAssets().remove(asset);
View Full Code Here

              formEntryVO.setUserAgent(userAgent);
              formEntryVO.setUserIP(userIP);
              formEntryVO.setUserName(userName);
              formEntryVO.setRegistrationDateTime(registrationDate);

              FormEntry newFormEntry = null;
             
              Database db = CastorDatabaseService.getDatabase();
              ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

              beginTransaction(db);
              try
              {
                newFormEntry = formEntryController.create(formEntryVO, formEntryValueVOList, db);
                               
                  commitTransaction(db);
              }
              catch(Exception e)
              {
                  logger.error("An error occurred so we should not completes the transaction:" + e, e);
                  rollbackTransaction(db);
                  throw new SystemException(e.getMessage());
              }
             
             
              Database db2 = CastorDatabaseService.getDatabase();

              beginTransaction(db2);
              try
              {
                newFormEntry = formEntryController.getFormEntryWithId(newFormEntry.getFormEntryId(), db2);

                List digitalAssets = (List)formEntry.get("digitalAssets");
                logger.info("digitalAssets:" + digitalAssets);
                if(digitalAssets != null)
                {
                  Iterator digitalAssetIterator = digitalAssets.iterator();
                  while(digitalAssetIterator.hasNext())
                  {
                      RemoteAttachment remoteAttachment = (RemoteAttachment)digitalAssetIterator.next();
                    logger.info("digitalAssets in ws:" + remoteAttachment);
                   
                    FormEntryAssetVO newAsset = new FormEntryAssetVO();
              newAsset.setContentType(remoteAttachment.getContentType());
              newAsset.setAssetKey(remoteAttachment.getName());
              newAsset.setFileName(remoteAttachment.getFileName());
              newAsset.setFileSize(new Integer(new Long(remoteAttachment.getBytes().length).intValue()));
              byte[] bytes = remoteAttachment.getBytes();
              InputStream is = new ByteArrayInputStream(bytes);
   
              formEntryController.createAsset(newAsset, newFormEntry, is, newFormEntry.getId(), principal, db2);
                }  
                }

                  commitTransaction(db2);
              }
View Full Code Here

TOP

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

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.