Examples of PropertysetItem


Examples of com.opensymphony.module.propertyset.hibernate.PropertySetItem

        }
        */
       
       
        Session session = null;
        PropertySetItem item = null;

        try {
            session = this.sessionFactory.openSession();
            item = InfoglueHibernatePropertySetDAOUtils.getItem(session, entityName, entityId, key);
            session.flush();
        } catch (HibernateException e) {
            //t.printElapsedTime("FindByKey empty: " + entityName + ":" + entityId + ":" + key);
          //e.printStackTrace();
           
            return null;
        } finally {
            try {
                if (session != null) {
                    session.close();
                }
            } catch (Exception e) {
            }
        }
       
        if(valueMap != null)
          valueMap.put(key, item);
        if(key.equals("workflow_status") || key.indexOf("languageId") > -1)
        {
          logger.info("Key:" + key);
          logger.info("Item:" + item.getType());
          logger.info("Item:" + item.getStringVal());
        }

        //t.printElapsedTime("FindByKey: " + entityName + ":" + entityId + ":" + key);
        return item;
    }
View Full Code Here

Examples of com.opensymphony.module.propertyset.hibernate.PropertySetItem

  /**
   *
   */
    protected void setDataImpl(int type, String key, Object value) throws PropertyException
    {
    PropertySetItem item = configProvider.getPropertySetDAO().findByKey(entityName, entityId, key);
        boolean update = (item == null) ? false : true;
        if (item == null)
        {
            item = configProvider.getPropertySetDAO().create(entityName, entityId.longValue(), key);
        }
        else if (item.getType() != type)
        {
            throw new PropertyException("Existing key '" + key + "' does not have matching type of " + type);
        }
   
    ((InfogluePropertySetItem) item).setDataVal(((com.opensymphony.util.Data) value).getBytes());
   
        item.setType(type);
        configProvider.getPropertySetDAO().setImpl(item, update);
    }
View Full Code Here

Examples of com.opensymphony.module.propertyset.hibernate.PropertySetItem

  /**
   *
   */
  private Object getData(int type, String key) throws PropertyException
  {
        final PropertySetItem item = findByKey(key);
        if (item == null)
        {
            return null;
        }
        if (item.getType() != type)
        {
            throw new PropertyException("key '" + key + "' does not have matching type of " + type);
        }
    return new com.opensymphony.util.Data(((InfogluePropertySetItem) item).getDataVal());
    }
View Full Code Here

Examples of com.vaadin.data.util.PropertysetItem

        setDate(date);
        date.setLocale(new Locale("fi", "fi"));
        date.setShowISOWeekNumbers(true);
        row.addComponent(date);

        PropertysetItem item = new PropertysetItem();
        item.addItemProperty("date", new ObjectProperty<Date>(getDefaultDate()));

        FormLayout form = new FormLayout();
        form.setMargin(false);

        FieldGroup binder = new FieldGroup(item);
View Full Code Here

Examples of com.vaadin.data.util.PropertysetItem

    public static final String ITEM_2_ID = "2";
    public static final String PROPERTY_1_ID = "property 1";
    public static final String PROPERTY_2_ID = "property 2";

    private void loadItems() {
        final PropertysetItem item1 = new PropertysetItem();
        item1.addItemProperty(PROPERTY_1_ID, new ObjectProperty<String>(
                "value 1", String.class));
        item1.addItemProperty(PROPERTY_2_ID, new ObjectProperty<String>(
                "name 1", String.class));
        items.put(ITEM_1_ID, item1);

        final PropertysetItem item2 = new PropertysetItem();
        item2.addItemProperty(PROPERTY_1_ID, new ObjectProperty<String>(
                "value 2", String.class));
        item2.addItemProperty(PROPERTY_2_ID, new ObjectProperty<String>(
                "name 2", String.class));
        items.put(ITEM_2_ID, item2);
    }
View Full Code Here

Examples of com.vaadin.data.util.PropertysetItem

    public static final String PROPERTY_1_ID = "property 1";
    public static final String PROPERTY_2_ID = "property 2";

    private void loadItems() {
        for (int i = 1; i < 15; i++) {
            final PropertysetItem item = new PropertysetItem();
            item.addItemProperty(PROPERTY_1_ID, new ObjectProperty<String>(
                    "value " + i, String.class));
            item.addItemProperty(PROPERTY_2_ID, new ObjectProperty<String>(
                    "name " + i, String.class));
            items.put(String.valueOf(i), item);
        }
    }
View Full Code Here

Examples of com.vaadin.data.util.PropertysetItem

        assertTrue("Jack".equals(form.firstName.getValue()));
    }

    @Test
    public void perfectMatchPriority() {
        PropertysetItem item = new PropertysetItem();
        item.addItemProperty("first_name", new ObjectProperty<String>(
                "Not this"));
        item.addItemProperty("firstName", new ObjectProperty<String>("This"));

        class MyForm extends FormLayout {
            TextField firstName = new TextField("First name");

            public MyForm() {
View Full Code Here

Examples of com.vaadin.data.util.PropertysetItem

    protected final Filter lessEqualNull = new LessOrEqual(PROPERTY1, null);

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        itemNull = new PropertysetItem();
        itemNull.addItemProperty(PROPERTY1, new ObjectProperty<String>(null,
                String.class));
        itemEmpty = new PropertysetItem();
        itemEmpty.addItemProperty(PROPERTY1, new ObjectProperty<String>("",
                String.class));
        itemA = new PropertysetItem();
        itemA.addItemProperty(PROPERTY1, new ObjectProperty<String>("a",
                String.class));
        itemB = new PropertysetItem();
        itemB.addItemProperty(PROPERTY1, new ObjectProperty<String>("b",
                String.class));
        itemC = new PropertysetItem();
        itemC.addItemProperty(PROPERTY1, new ObjectProperty<String>("c",
                String.class));
    }
View Full Code Here

Examples of com.vaadin.data.util.PropertysetItem

    public void testCompareInteger() {
        int negative = -1;
        int zero = 0;
        int positive = 1;

        Item itemNegative = new PropertysetItem();
        itemNegative.addItemProperty(PROPERTY1, new ObjectProperty<Integer>(
                negative, Integer.class));
        Item itemZero = new PropertysetItem();
        itemZero.addItemProperty(PROPERTY1, new ObjectProperty<Integer>(zero,
                Integer.class));
        Item itemPositive = new PropertysetItem();
        itemPositive.addItemProperty(PROPERTY1, new ObjectProperty<Integer>(
                positive, Integer.class));

        Filter equalZero = new Equal(PROPERTY1, zero);
        Assert.assertFalse(equalZero.passesFilter(null, itemNegative));
        Assert.assertTrue(equalZero.passesFilter(null, itemZero));
View Full Code Here

Examples of com.vaadin.data.util.PropertysetItem

        BigDecimal zero = new BigDecimal(0);
        BigDecimal positive = new BigDecimal(1);
        positive.setScale(1);
        BigDecimal positiveScaleTwo = new BigDecimal(1).setScale(2);

        Item itemNegative = new PropertysetItem();
        itemNegative.addItemProperty(PROPERTY1, new ObjectProperty<BigDecimal>(
                negative, BigDecimal.class));
        Item itemZero = new PropertysetItem();
        itemZero.addItemProperty(PROPERTY1, new ObjectProperty<BigDecimal>(
                zero, BigDecimal.class));
        Item itemPositive = new PropertysetItem();
        itemPositive.addItemProperty(PROPERTY1, new ObjectProperty<BigDecimal>(
                positive, BigDecimal.class));
        Item itemPositiveScaleTwo = new PropertysetItem();
        itemPositiveScaleTwo.addItemProperty(PROPERTY1,
                new ObjectProperty<BigDecimal>(positiveScaleTwo,
                        BigDecimal.class));

        Filter equalZero = new Equal(PROPERTY1, zero);
        Assert.assertFalse(equalZero.passesFilter(null, itemNegative));
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.