Examples of DomainEntity


Examples of org.eurekastreams.commons.model.DomainEntity

    @Test
    public void testLoadProperties()
    {
        final long entityId = 0xF00BA7;
        final float searchScore = 3.0272F;
        final DomainEntity entity = new MyDomainEntity();

        Map<String, Object> props = new HashMap<String, Object>();
        props.put("__HSearch_id", entityId);
        props.put("__HSearch_Score", searchScore);
        props.put("__HSearch_This", entity);
View Full Code Here

Examples of org.eurekastreams.commons.model.DomainEntity

    @Test
    public void testLoadPropertiesWithId()
    {
        final long entityId = 0xF00BA7;
        final float searchScore = 3.0272F;
        final DomainEntity entity = new MyDomainEntity();

        Map<String, Object> props = new HashMap<String, Object>();
        props.put("id", entityId);
        props.put("__HSearch_Score", searchScore);
        props.put("__HSearch_This", entity);
View Full Code Here

Examples of org.eurekastreams.commons.model.DomainEntity

     * Test the managedEntity property.
     */
    @Test
    public void testManagedEntityProperty()
    {
        DomainEntity entity = new MyDomainEntity();
        assertNull(sut.getManagedEntity());
        sut.setManagedEntity(entity);
        assertEquals(entity, sut.getManagedEntity());
    }
View Full Code Here

Examples of org.eurekastreams.commons.model.DomainEntity

     * @return null.
     */
    @Override
    public Serializable execute(final ActionContext inActionContext)
    {
        DomainEntity entity = objectMapper.execute(new FindByIdRequest(domainEntityName, (Long) inActionContext
                .getParams()));
        if (entity != null)
        {
            objectIndexer.execute(entity);
        }
View Full Code Here

Examples of org.internna.iwebmvc.model.DomainEntity

  }

  @Override
    public void doTag() throws JspException {
    try {
      DomainEntity entity = entityClass.newInstance();
          Boolean required = entity != null ? entity.isCaptchaRequired() : Boolean.FALSE;
          getJspContext().setAttribute(property, required);
    } catch (Exception ex) {
      throw new JspException(ex);
    }
    }
View Full Code Here

Examples of org.internna.iwebmvc.model.DomainEntity

    @Override
    @RemoteMethod
    @SuppressWarnings("unchecked")
    public List<ValuePair<String, String>> fetchReferences(Class<?> clazz, String path, String query, int count, int number) throws Exception {
        Assert.isEncrypted(decipherer, path);
        DomainEntity parent = (DomainEntity) ClassUtils.instantiateClass(clazz);
        Selectable entity = (Selectable) ClassUtils.instantiateClass(new BeanWrapperImpl(parent).getPropertyType(decipherer.decrypt(path)));
        if (entity == null) entity = (Selectable) parent;
        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("query", query + "%");
        List<ValuePair<String, String>> result = new ArrayList<ValuePair<String, String>>(number);
View Full Code Here

Examples of org.internna.iwebmvc.model.DomainEntity

    @SuppressWarnings("unchecked")
    public boolean update(Class entityClass, UpdateDataDTO[] data) throws Exception {
        Assert.notNull(entityClass);
        for (UpdateDataDTO dto : data) {
            Assert.isEncrypted(decipherer, dto.getPrimaryKey());
            DomainEntity o = dao.find(entityClass, new UUID(decipherer.decrypt(dto.getPrimaryKey())));
            BeanWrapper w = new BeanWrapperImpl(o);
            w.setPropertyValue(dto.getPath(), dto.getValue());
            dao.update(o);
        }
        return true;
View Full Code Here

Examples of org.internna.iwebmvc.model.DomainEntity

        return e.getFieldErrors(path);
    }

    @SuppressWarnings("unchecked")
    protected Errors doValidation(Class clazz, String path, Object value) throws Exception {
        DomainEntity object = (DomainEntity) ClassUtils.instantiateClass(clazz);
        object.initialize(contextHolder);
        BeanWrapper validatable = new BeanWrapperImpl(object);
        validatable.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd"), false));
        validatable.setPropertyValue(path, value);
        Errors errors = new BeanPropertyBindingResult(object, "target");
        validator.validate(object, errors);
View Full Code Here

Examples of org.internna.iwebmvc.model.DomainEntity

                if (!captchaService.validateResponse(captchaId, captcha.getInput())) {
                    throw new SecurityException("Captcha validation failed! This should be investigated further");
                }
            }
        }
        DomainEntity binded = parse(entity);
        Map<String, InvalidValue> errors = validate(binded);
        if (CollectionUtils.isEmpty(errors))
            errors = entity.getId() == null ? proceedWithNewEntity(entity): proceedWithExistingEntity(entity);
        if (!CollectionUtils.isEmpty(errors)) throw new RollbackException(errors);
        return errors;
View Full Code Here

Examples of org.internna.iwebmvc.model.DomainEntity

                            dao.update(element);
                        }
                    }
                    reverseSetter = null;
                    for (DomainEntity element : newCollection) {
                        DomainEntity newElement = dao.find(ClassUtils.getActualClass(element), element.getId());
                        oldCollection.add(newElement);
                        if (reverseSetter == null) reverseSetter = getReverseSetter(ClassUtils.getActualClass(entity), ClassUtils.getActualClass(newElement), property.getName());
                        if (reverseSetter != null) {
                            reverseSetter.invoke(newElement, entity);
                            dao.update(newElement);
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.