Examples of storageType()


Examples of org.mifosplatform.infrastructure.documentmanagement.data.DocumentData.storageType()

    @Override
    public FileData retrieveFileData(final String entityType, final Long entityId, final Long documentId) {
        try {
            final DocumentMapper mapper = new DocumentMapper(false, false);
            final DocumentData documentData = fetchDocumentDetails(entityType, entityId, documentId, mapper);
            final ContentRepository contentRepository = this.contentRepositoryFactory.getRepository(documentData.storageType());
            return contentRepository.fetchFile(documentData);
        } catch (final EmptyResultDataAccessException e) {
            throw new DocumentNotFoundException(entityType, entityId, documentId);
        }
    }
View Full Code Here

Examples of org.mifosplatform.infrastructure.documentmanagement.data.ImageData.storageType()

            final ImageMapper imageMapper = new ImageMapper(client.getDisplayName());

            final String sql = "select " + imageMapper.schema();

            final ImageData imageData = this.jdbcTemplate.queryForObject(sql, imageMapper, new Object[] { clientId });
            final ContentRepository contentRepository = this.contentRepositoryFactory.getRepository(imageData.storageType());
            final ImageData result = contentRepository.fetchImage(imageData);

            if (result.getContent() == null) { throw new ImageNotFoundException("clients", clientId); }

            return result;
View Full Code Here

Examples of org.mifosplatform.infrastructure.documentmanagement.domain.Document.storageType()

            // user
            final Document documentForUpdate = this.documentRepository.findOne(documentCommand.getId());
            if (documentForUpdate == null) { throw new DocumentNotFoundException(documentCommand.getParentEntityType(),
                    documentCommand.getParentEntityId(), documentCommand.getId()); }

            final StorageType documentStoreType = documentForUpdate.storageType();
            oldLocation = documentForUpdate.getLocation();
            if (inputStream != null && documentCommand.isFileNameChanged()) {
                final ContentRepository contentRepository = this.contentRepositoryFactory.getRepository();
                documentCommand.setLocation(contentRepository.saveFile(inputStream, documentCommand));
                documentCommand.setStorageType(contentRepository.getStorageType().getValue());
View Full Code Here

Examples of org.mifosplatform.infrastructure.documentmanagement.domain.Document.storageType()

        final Document document = this.documentRepository.findOne(documentCommand.getId());
        if (document == null) { throw new DocumentNotFoundException(documentCommand.getParentEntityType(),
                documentCommand.getParentEntityId(), documentCommand.getId()); }
        this.documentRepository.delete(document);

        final ContentRepository contentRepository = this.contentRepositoryFactory.getRepository(document.storageType());
        contentRepository.deleteFile(document.getName(), document.getLocation());
        return new CommandProcessingResult(document.getId());
    }

    private void validateParentEntityType(final DocumentCommand documentCommand) {
View Full Code Here

Examples of siena.core.DecimalPrecision.storageType()

          else if (fieldClass == BigDecimal.class){
            DecimalPrecision ann = field.getAnnotation(DecimalPrecision.class);
            if(ann == null) {
              value = ((BigDecimal)value).toPlainString();
            }else {
              switch(ann.storageType()){
              case DOUBLE:
                value = ((BigDecimal)value).doubleValue();
                break;
              case STRING:
              case NATIVE:
View Full Code Here

Examples of siena.core.DecimalPrecision.storageType()

      else if(f.getType() == BigDecimal.class){
        DecimalPrecision ann = f.getAnnotation(DecimalPrecision.class);
        if(ann == null) {
          value = new BigDecimal((String)value);
        }else {
          switch(ann.storageType()){
          case DOUBLE:
            value = BigDecimal.valueOf((Double)value);
            break;
          case STRING:
          case NATIVE:
View Full Code Here

Examples of siena.core.DecimalPrecision.storageType()

        else if (fieldClass == BigDecimal.class){
          DecimalPrecision ann = f.getAnnotation(DecimalPrecision.class);
          if(ann == null) {
            propValue = ((BigDecimal)propValue).toPlainString();
          }else {
            switch(ann.storageType()){
            case DOUBLE:
              propValue = ((BigDecimal)propValue).doubleValue();
              break;
            case STRING:
            case NATIVE:
View Full Code Here

Examples of siena.core.DecimalPrecision.storageType()

      else if (type == BigDecimal.class){
        DecimalPrecision ann = field.getAnnotation(DecimalPrecision.class);
        if(ann == null) {
          return ((BigDecimal)val).toPlainString();
        }else {
          switch(ann.storageType()){
          case DOUBLE:
            return ((Double)((BigDecimal)val).doubleValue()).toString();
          case STRING:
          case NATIVE:
            return ((BigDecimal)val).toPlainString();
View Full Code Here

Examples of siena.core.DecimalPrecision.storageType()

        DecimalPrecision ann = field.getAnnotation(DecimalPrecision.class);
        if(ann == null) {
          Util.setField(obj, field, new BigDecimal((String)val));
          return;
        }else {
          switch(ann.storageType()){
          case DOUBLE:
            // TODO add bigdecimal double lexicographic storage
            Util.setField(obj, field, new BigDecimal(val));
            return;
          case STRING:
View Full Code Here

Examples of siena.core.DecimalPrecision.storageType()

          else if(BigDecimal.class == type){
            DecimalPrecision ann = field.getAnnotation(DecimalPrecision.class);
            if(ann == null) {
              value = (BigDecimal)value;
            }else {
              switch(ann.storageType()){
              case DOUBLE:
                value = ((BigDecimal)value).doubleValue();
                break;
              case STRING:
                value = ((BigDecimal)value).toPlainString();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.