Package com.dotmarketing.portlets.structure.model

Examples of com.dotmarketing.portlets.structure.model.Structure


     */
    @Test
    public void getFieldsByStructure () {

        //Getting a known structure
        Structure structure = structures.iterator().next();

        //Getting the fields for this structure
        Collection<Field> fields = FieldFactory.getFieldsByStructure( structure.getInode() );

        //Start with the validations
        assertTrue( fields != null && !fields.isEmpty() );
        assertEquals( fields.size(), FIELDS_SIZE );
    }
View Full Code Here


     */
    @Test
    public void getFieldsByStructureSortedBySortOrder () {

        //Getting a known structure
        Structure structure = structures.iterator().next();

        //Getting the fields for this structure
        Collection<Field> fields = FieldFactory.getFieldsByStructureSortedBySortOrder( structure.getInode() );

        //Start with the validations
        assertTrue( fields != null && !fields.isEmpty() );
        assertEquals( fields.size(), FIELDS_SIZE );
    }
View Full Code Here

     */
    @Test
    public void isTagField () {

        //Getting a known structure
        Structure structure = structures.iterator().next();

        //Getting the fields for this structure
        Collection<Field> fields = FieldsCache.getFieldsByStructureInode( structure.getInode() );

        //Start with the validations
        assertTrue( fields != null && !fields.isEmpty() );

        for ( Field field : fields ) {
View Full Code Here

    @Test
    @SuppressWarnings ( "unchecked" )
    public void getFieldsByContentletField () {

        //Getting a known structure
        Structure structure = structures.iterator().next();

        //Getting the fields for this structure
        Collection<Field> fields = FieldsCache.getFieldsByStructureInode( structure.getInode() );

        //Validations
        assertTrue( fields != null && !fields.isEmpty() );

        Iterator<Field> iterator = fields.iterator();
        Field field = iterator.next();

        //Search by the field contentlet
        //TODO: The data type is used everywhere instead the field.getFieldContentlet() as the method name, parameter and even te query suggested...
        Collection<Field> fieldsByContentlet = FieldFactory.getFieldsByContentletField( Field.DataType.TEXT.toString(), field.getInode(), structure.getInode() );

        //Validations
        assertTrue( fieldsByContentlet != null && !fieldsByContentlet.isEmpty() );

        //Search by the field contentlet and with an Inode null
        //TODO: The data type is used everywhere instead the field.getFieldContentlet() as the method name, parameter and even te query suggested...
        fieldsByContentlet = FieldFactory.getFieldsByContentletField( Field.DataType.TEXT.toString(), null, structure.getInode() );

        //Validations
        assertTrue( fieldsByContentlet != null && !fieldsByContentlet.isEmpty() );
    }
View Full Code Here

     */
    @Test
    public void getFieldByVariableName () {

        //Getting a known structure
        Structure structure = structures.iterator().next();

        //Getting the fields for this structure
        Collection<Field> fields = FieldsCache.getFieldsByStructureInode( structure.getInode() );

        //Validations
        assertTrue( fields != null && !fields.isEmpty() );

        Iterator<Field> iterator = fields.iterator();
        Field field = iterator.next();

        //Search by variable name
        Field foundField = FieldFactory.getFieldByVariableName( structure.getInode(), field.getVelocityVarName() );

        //Start with the validations
        assertNotNull( foundField );
        assertEquals( foundField.getInode(), field.getInode() );
    }
View Full Code Here

     */
    @Test
    public void getFieldByStructure () {

        //Getting a known structure
        Structure structure = structures.iterator().next();

        //Getting the fields for this structure
        Collection<Field> fields = FieldsCache.getFieldsByStructureInode( structure.getInode() );

        //Validations
        assertTrue( fields != null && !fields.isEmpty() );

        Iterator<Field> iterator = fields.iterator();
        Field field = iterator.next();

        //Search by field name
        Field foundField = FieldFactory.getFieldByStructure( structure.getInode(), field.getFieldName() );

        //Start with the validations
        assertNotNull( foundField );
        assertEquals( foundField.getInode(), field.getInode() );
    }
View Full Code Here

     */
    @Test
    public void getFieldByName () {

        //Getting a known structure
        Structure structure = structures.iterator().next();

        //Getting the fields for this structure
        Collection<Field> fields = FieldsCache.getFieldsByStructureInode( structure.getInode() );

        //Validations
        assertTrue( fields != null && !fields.isEmpty() );

        Iterator<Field> iterator = fields.iterator();
        Field field = iterator.next();

        //Search by field name
        //Field foundField = FieldFactory.getFieldByName( structure.getInode(), field.getFieldName() );
        //TODO: The definition of the method getFieldByName receive a parameter named "String:structureType", some examples I saw send the Inode, but actually what it needs is the structure name....
        Field foundField = FieldFactory.getFieldByName( structure.getName(), field.getFieldName() );

        //Start with the validations
        assertNotNull( foundField );
        assertEquals( foundField.getInode(), field.getInode() );
    }
View Full Code Here

        String NAME_ORIGINAL = "JUnit Test Text --  test";
        String NAME_UPDATED = "UPDATED --- JUnit Test Text --  test";

        //Getting a known structure
        Structure structure = structures.iterator().next();

        //Creating a field
        Field field = new Field( NAME_ORIGINAL, Field.FieldType.TEXT, Field.DataType.TEXT, structure, false, true, false, 1, false, false, false );
        Field field2 = new Field( NAME_ORIGINAL + "_2", Field.FieldType.TEXT, Field.DataType.TEXT, structure, false, true, false, 1, false, false, false );
View Full Code Here

     */
    @Test
    public void getNextAvailableFieldNumber () {

        //Getting a known structure
        Structure structure = structures.iterator().next();

        //Getting the fields for this structure
        Collection<Field> fields = FieldsCache.getFieldsByStructureInode( structure.getInode() );

        //Validations
        assertTrue( fields != null && !fields.isEmpty() );

        Iterator<Field> iterator = fields.iterator();
View Full Code Here

        String NAME_ORIGINAL = "JUnit Test variable name";
        String NAME_UPDATED = "UPDATED --- Test variable name";

        //Getting a known structure
        Structure structure = structures.iterator().next();

        //Getting the fields for this structure
        Collection<Field> fields = FieldsCache.getFieldsByStructureInode( structure.getInode() );

        //Validations
        assertTrue( fields != null && !fields.isEmpty() );

        Iterator<Field> iterator = fields.iterator();
View Full Code Here

TOP

Related Classes of com.dotmarketing.portlets.structure.model.Structure

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.