亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? testcmsxmlcontentwithvfs.java

?? cms是開源的框架
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
        level0Sequence = xmlcontent.getValueSequence("DeepCascade", Locale.ENGLISH);
        assertEquals(1, level0Sequence.getElementCount());
    }

    /**
     * Test adding and removing elements from an XML content.<p>
     * 
     * @throws Exception in case something goes wrong
     */
    public void testAddRemoveElements() throws Exception {

        CmsObject cms = getCmsObject();
        echo("Testing adding and removing elements from an XML content");

        CmsXmlEntityResolver resolver = new CmsXmlEntityResolver(cms);

        String content;
        CmsXmlContent xmlcontent;

        // unmarshal content definition
        content = CmsFileUtil.readFile(
            "org/opencms/xml/content/xmlcontent-definition-6.xsd",
            CmsEncoder.ENCODING_UTF_8);
        // store content definition in entitiy resolver
        CmsXmlEntityResolver.cacheSystemId(SCHEMA_SYSTEM_ID_6, content.getBytes(CmsEncoder.ENCODING_UTF_8));

        // now read the XML content
        content = CmsFileUtil.readFile("org/opencms/xml/content/xmlcontent-6.xml", CmsEncoder.ENCODING_UTF_8);
        xmlcontent = CmsXmlContentFactory.unmarshal(content, CmsEncoder.ENCODING_UTF_8, resolver);

        CmsXmlContentValueSequence titleSequence;

        titleSequence = xmlcontent.getValueSequence("Title", Locale.ENGLISH);
        assertEquals("Title", titleSequence.getElementName());
        assertEquals(1, titleSequence.getElementCount());
        assertEquals(1, titleSequence.getMinOccurs());
        assertEquals(5, titleSequence.getMaxOccurs());
        assertEquals("This is just a modification test", titleSequence.getValue(0).getStringValue(cms));

        CmsXmlStringValue newValue;

        newValue = (CmsXmlStringValue)titleSequence.addValue(cms, 0);
        assertEquals(2, titleSequence.getElementCount());
        assertEquals(newValue, titleSequence.getValue(0));
        newValue.setStringValue(cms, "This is another Value!");

        // now re-create the XML content from the XML document
        content = xmlcontent.toString();
        System.out.println(content);
        xmlcontent = CmsXmlContentFactory.unmarshal(content, CmsEncoder.ENCODING_UTF_8, resolver);

        // ensure the document structure is as expected
        titleSequence = xmlcontent.getValueSequence("Title", Locale.ENGLISH);
        assertEquals("Title", titleSequence.getElementName());
        assertEquals(2, titleSequence.getElementCount());
        assertEquals(1, titleSequence.getMinOccurs());
        assertEquals(5, titleSequence.getMaxOccurs());
        assertEquals("This is another Value!", titleSequence.getValue(0).getStringValue(cms));
        assertEquals("This is just a modification test", titleSequence.getValue(1).getStringValue(cms));

        // add an element at the last position
        newValue = (CmsXmlStringValue)titleSequence.addValue(cms, 2);
        newValue.setStringValue(cms, "This is the last value.");
        assertEquals(newValue, titleSequence.getValue(2));
        // add another element at the 2nd position
        newValue = (CmsXmlStringValue)titleSequence.addValue(cms, 1);
        newValue.setStringValue(cms, "This is the 2nd value.");
        assertEquals(newValue, titleSequence.getValue(1));
        assertEquals(4, titleSequence.getElementCount());

        // now re-create the XML content from the XML document
        content = xmlcontent.toString();
        System.out.println(content);
        xmlcontent = CmsXmlContentFactory.unmarshal(content, CmsEncoder.ENCODING_UTF_8, resolver);

        // ensure the document structure is as expected
        titleSequence = xmlcontent.getValueSequence("Title", Locale.ENGLISH);
        assertEquals("Title", titleSequence.getElementName());
        assertEquals(4, titleSequence.getElementCount());
        assertEquals(1, titleSequence.getMinOccurs());
        assertEquals(5, titleSequence.getMaxOccurs());
        assertEquals("This is another Value!", titleSequence.getValue(0).getStringValue(cms));
        assertEquals("This is the 2nd value.", titleSequence.getValue(1).getStringValue(cms));
        assertEquals("This is just a modification test", titleSequence.getValue(2).getStringValue(cms));
        assertEquals("This is the last value.", titleSequence.getValue(3).getStringValue(cms));

        // now the optional element
        CmsXmlContentValueSequence optionSequence;

        optionSequence = xmlcontent.getValueSequence("Option", Locale.ENGLISH);
        assertEquals("Option", optionSequence.getElementName());
        assertEquals(0, optionSequence.getElementCount());
        assertEquals(0, optionSequence.getMinOccurs());
        assertEquals(2, optionSequence.getMaxOccurs());

        // add an element for the optional element
        newValue = (CmsXmlStringValue)optionSequence.addValue(cms, 0);
        newValue.setStringValue(cms, "Optional value 1");
        assertEquals(newValue, optionSequence.getValue(0));
        // add another element
        newValue = (CmsXmlStringValue)optionSequence.addValue(cms, 0);
        newValue.setStringValue(cms, "Optional value 0");
        assertEquals(newValue, optionSequence.getValue(0));
        assertEquals(2, optionSequence.getElementCount());

        // now re-create the XML content from the XML document
        content = xmlcontent.toString();
        System.out.println(content);
        xmlcontent = CmsXmlContentFactory.unmarshal(content, CmsEncoder.ENCODING_UTF_8, resolver);

        optionSequence = xmlcontent.getValueSequence("Option", Locale.ENGLISH);
        assertEquals("Option", optionSequence.getElementName());
        assertEquals(2, optionSequence.getElementCount());
        assertEquals(0, optionSequence.getMinOccurs());
        assertEquals(2, optionSequence.getMaxOccurs());

        assertEquals("Optional value 0", optionSequence.getValue(0).getStringValue(cms));
        assertEquals("Optional value 1", optionSequence.getValue(1).getStringValue(cms));

        optionSequence.removeValue(1);
        assertEquals(1, optionSequence.getElementCount());
        assertEquals("Optional value 0", optionSequence.getValue(0).getStringValue(cms));

        optionSequence.removeValue(0);
        assertEquals(0, optionSequence.getElementCount());

        // now re-create the XML content from the XML document
        content = xmlcontent.toString();
        System.out.println(content);
        xmlcontent = CmsXmlContentFactory.unmarshal(content, CmsEncoder.ENCODING_UTF_8, resolver);

        titleSequence = xmlcontent.getValueSequence("Title", Locale.ENGLISH);
        assertEquals(4, titleSequence.getElementCount());

        titleSequence.removeValue(0);
        titleSequence.removeValue(2);
        assertEquals(2, titleSequence.getElementCount());
        assertEquals("This is the 2nd value.", titleSequence.getValue(0).getStringValue(cms));
        assertEquals("This is just a modification test", titleSequence.getValue(1).getStringValue(cms));

        // now re-create the XML content from the XML document
        content = xmlcontent.toString();
        System.out.println(content);
    }

    /**
     * Test adding and removing elements from an XML content, including nested elements.<p>
     * 
     * @throws Exception in case something goes wrong
     */
    public void testAddRemoveNestedElements() throws Exception {

        CmsObject cms = getCmsObject();
        echo("Testing adding and removing nested elements from an XML content");

        CmsXmlEntityResolver resolver = new CmsXmlEntityResolver(cms);

        String content;
        CmsXmlContent xmlcontent;

        // unmarshal content definition
        content = CmsFileUtil.readFile(
            "org/opencms/xml/content/xmlcontent-definition-7.xsd",
            CmsEncoder.ENCODING_UTF_8);
        // store content definition in entitiy resolver
        CmsXmlEntityResolver.cacheSystemId(SCHEMA_SYSTEM_ID_7, content.getBytes(CmsEncoder.ENCODING_UTF_8));

        // now read the XML content
        content = CmsFileUtil.readFile("org/opencms/xml/content/xmlcontent-7.xml", CmsEncoder.ENCODING_UTF_8);
        xmlcontent = CmsXmlContentFactory.unmarshal(content, CmsEncoder.ENCODING_UTF_8, resolver);

        CmsXmlContentValueSequence nestedSequence;

        nestedSequence = xmlcontent.getValueSequence("Cascade", Locale.ENGLISH);
        assertEquals(1, nestedSequence.getElementCount());
        I_CmsXmlContentValue newValue;
        newValue = nestedSequence.addValue(cms, 0);
        assertNotNull(newValue);
        assertFalse(newValue.isSimpleType());
        assertEquals(CmsXmlNestedContentDefinition.class.getName(), newValue.getClass().getName());

        // re-create the XML content
        content = xmlcontent.toString();
        System.out.println(content);
        xmlcontent = CmsXmlContentFactory.unmarshal(content, CmsEncoder.ENCODING_UTF_8, resolver);
        // validate the XML structure
        xmlcontent.validateXmlStructure(resolver);

        nestedSequence = xmlcontent.getValueSequence("Cascade", Locale.ENGLISH);
        assertEquals(2, nestedSequence.getElementCount());

        CmsXmlContentValueSequence deepNestedSequence;
        deepNestedSequence = xmlcontent.getValueSequence("DeepCascade", Locale.ENGLISH);
        assertEquals(0, deepNestedSequence.getElementCount());

        newValue = deepNestedSequence.addValue(cms, 0);
        assertNotNull(newValue);
        assertFalse(newValue.isSimpleType());
        assertEquals(CmsXmlNestedContentDefinition.class.getName(), newValue.getClass().getName());

        // re-create the XML content
        content = xmlcontent.toString();
        System.out.println(content);
        xmlcontent = CmsXmlContentFactory.unmarshal(content, CmsEncoder.ENCODING_UTF_8, resolver);
        // validate the XML structure
        xmlcontent.validateXmlStructure(resolver);

        deepNestedSequence = xmlcontent.getValueSequence("DeepCascade", Locale.ENGLISH);
        assertEquals(1, deepNestedSequence.getElementCount());

        nestedSequence = xmlcontent.getValueSequence("Cascade", Locale.ENGLISH);
        assertEquals(2, nestedSequence.getElementCount());

        nestedSequence.removeValue(1);
        deepNestedSequence.removeValue(0);

        // re-create the XML content
        content = xmlcontent.toString();
        System.out.println(content);
        xmlcontent = CmsXmlContentFactory.unmarshal(content, CmsEncoder.ENCODING_UTF_8, resolver);
        // validate the XML structure
        xmlcontent.validateXmlStructure(resolver);

        deepNestedSequence = xmlcontent.getValueSequence("DeepCascade", Locale.ENGLISH);
        assertEquals(0, deepNestedSequence.getElementCount());

        nestedSequence = xmlcontent.getValueSequence("Cascade", Locale.ENGLISH);
        assertEquals(1, nestedSequence.getElementCount());
    }

    /**
     * Test using a different XML content handler then the default handler.<p>
     * 
     * @throws Exception in case something goes wrong
     */
    public void testContentHandler() throws Exception {

        CmsObject cms = getCmsObject();
        echo("Testing individual content handler for XML content");

        CmsXmlEntityResolver resolver = new CmsXmlEntityResolver(cms);

        String content;

        // unmarshal content definition
        content = CmsFileUtil.readFile(
            "org/opencms/xml/content/xmlcontent-definition-3.xsd",
            CmsEncoder.ENCODING_UTF_8);
        CmsXmlContentDefinition definition = CmsXmlContentDefinition.unmarshal(content, SCHEMA_SYSTEM_ID_3, resolver);
        // store content definition in entitiy resolver
        CmsXmlEntityResolver.cacheSystemId(SCHEMA_SYSTEM_ID_3, content.getBytes(CmsEncoder.ENCODING_UTF_8));

        // now create the XML content
        content = CmsFileUtil.readFile("org/opencms/xml/content/xmlcontent-3.xml", CmsEncoder.ENCODING_UTF_8);
        CmsXmlContent xmlcontent = CmsXmlContentFactory.unmarshal(content, CmsEncoder.ENCODING_UTF_8, resolver);

        assertTrue(xmlcontent.hasValue("Html", Locale.ENGLISH));
        assertTrue(xmlcontent.hasValue("VfsLink", Locale.ENGLISH));
        assertSame(definition.getContentHandler().getClass().getName(), TestXmlContentHandler.class.getName());
    }
    
    /**
     * Test default values in the appinfo node using a nested XML content schema.<p>
     * 
     * @throws Exception in case something goes wrong
     */
    public void testDefaultNested() throws Exception {

        CmsObject cms = getCmsObject();
        echo("Testing for default values in nested XML content schemas");

        CmsXmlEntityResolver resolver = new CmsXmlEntityResolver(cms);

        String content;

        // unmarshal content definition
        content = CmsFileUtil.readFile(
            "org/opencms/xml/content/xmlcontent-definition-4.xsd",
            CmsEncoder.ENCODING_UTF_8);
        // store content definition in entitiy resolver
        CmsXmlEntityResolver.cacheSystemId(SCHEMA_SYSTEM_ID_4, content.getBytes(CmsEncoder.ENCODING_UTF_8));

        // now create the XML content
        content = CmsFileUtil.readFile("org/opencms/xml/content/xmlcontent-4.xml", CmsEncoder.ENCODING_UTF_8);
        CmsXmlContent xmlcontent = CmsXmlContentFactory.unmarshal(content, CmsEncoder.ENCODING_UTF_8, resolver);
        System.out.println(xmlcontent.toString());

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99九九99九九九视频精品| 亚洲免费观看高清完整版在线 | 午夜亚洲国产au精品一区二区| 91国偷自产一区二区开放时间 | 国产精品免费看片| 成人亚洲精品久久久久软件| 国产精品午夜在线观看| 99久久精品国产网站| 亚洲欧美在线视频观看| 在线亚洲一区二区| 天天色综合天天| 欧美一级视频精品观看| 国产美女在线观看一区| 国产精品久久久久久久裸模| 欧美自拍丝袜亚洲| 久久不见久久见免费视频7 | 欧美久久一二三四区| 青草av.久久免费一区| 久久综合狠狠综合| 91麻豆精品在线观看| 午夜久久久久久| 337p粉嫩大胆色噜噜噜噜亚洲| 国产98色在线|日韩| 一区二区成人在线| 2021中文字幕一区亚洲| 97久久精品人人爽人人爽蜜臀 | 亚洲五月六月丁香激情| 精品电影一区二区三区| 97精品久久久久中文字幕 | 欧美一卡在线观看| 国产99久久久国产精品潘金网站| 亚洲综合在线视频| 精品国产sm最大网站| 色八戒一区二区三区| 九色porny丨国产精品| 亚洲欧美综合另类在线卡通| 欧美一区二区不卡视频| 99国产麻豆精品| 精品一区二区免费| 亚洲国产精品久久人人爱| 国产性做久久久久久| 欧美日韩中文字幕精品| 丁香桃色午夜亚洲一区二区三区| 午夜av一区二区三区| 国产精品久久久久久久久快鸭 | 亚洲国产精品高清| 欧美第一区第二区| 久久久久久97三级| 色又黄又爽网站www久久| 国产一区亚洲一区| 午夜精品在线看| 亚洲精品国产a久久久久久| 国产日韩av一区| 欧美大片在线观看一区二区| 色猫猫国产区一区二在线视频| 国产乱妇无码大片在线观看| 日韩av一二三| 亚洲午夜久久久久久久久电影院| 国产精品乱人伦一区二区| 精品精品欲导航| 777精品伊人久久久久大香线蕉| 9色porny自拍视频一区二区| 国产精选一区二区三区| 麻豆精品在线播放| 免费日本视频一区| 青青草国产精品97视觉盛宴| 五月婷婷综合激情| 亚洲国产精品久久久久秋霞影院| 亚洲欧美激情插| ㊣最新国产の精品bt伙计久久| 久久亚洲精华国产精华液| 日韩一区二区三区在线视频| 欧美色涩在线第一页| 日本黄色一区二区| 欧美在线三级电影| 欧美手机在线视频| 欧美老肥妇做.爰bbww| 欧美老人xxxx18| 91精品国产综合久久久久| 欧美人xxxx| 日韩欧美中文字幕制服| 欧美一区日韩一区| 精品va天堂亚洲国产| 国产午夜精品理论片a级大结局| 精品sm捆绑视频| 国产欧美日韩亚州综合| 1024成人网色www| 亚洲一区二区三区四区中文字幕| 一区二区成人在线| 五月天激情综合| 婷婷久久综合九色综合伊人色| 裸体在线国模精品偷拍| 日韩美女视频一区二区| 中文字幕免费不卡| 精品免费视频一区二区| 色综合天天综合网天天狠天天| 欧美精品一区二区久久久| 欧美成人猛片aaaaaaa| 精品国产乱码久久久久久1区2区 | 成av人片一区二区| 91视频免费看| 欧美精品精品一区| 久久网站热最新地址| 中文字幕精品一区二区精品绿巨人| 国产精品女同一区二区三区| 综合色天天鬼久久鬼色| 玉米视频成人免费看| 日本三级韩国三级欧美三级| 国产资源在线一区| 99久久精品国产精品久久| 在线不卡中文字幕| 国产亚洲一区二区三区在线观看| 国产精品日日摸夜夜摸av| 亚洲一区二区欧美日韩| 久久66热偷产精品| 91丨九色丨国产丨porny| 欧美日韩免费观看一区二区三区 | 久久精品国产**网站演员| 国产69精品久久久久毛片 | 极品少妇一区二区三区精品视频| 成人小视频免费在线观看| 在线亚洲一区二区| 久久亚洲综合色| 亚洲第一综合色| 国产·精品毛片| 91精品国产综合久久精品app | 成人在线一区二区三区| 欧美日韩精品一区二区天天拍小说| 久久综合五月天婷婷伊人| 亚洲精品欧美综合四区| 国产一区二区三区在线观看免费| 在线观看国产日韩| 久久久91精品国产一区二区精品| 亚洲自拍欧美精品| 国产精品88av| 欧美一区二区成人| 亚洲一区二区欧美激情| 福利91精品一区二区三区| 日韩写真欧美这视频| 一区二区三区自拍| 成人夜色视频网站在线观看| 欧美一级理论性理论a| 一二三区精品福利视频| 成人爱爱电影网址| 国产欧美一区二区三区沐欲| 全国精品久久少妇| 欧美综合天天夜夜久久| **性色生活片久久毛片| 国产成人免费在线视频| 日韩欧美中文字幕公布| 亚洲成人三级小说| 日本黄色一区二区| 亚洲色图第一区| 国产成人综合亚洲91猫咪| 精品毛片乱码1区2区3区| 天天操天天色综合| 欧美做爰猛烈大尺度电影无法无天| 国产欧美精品一区aⅴ影院| 精品一区二区三区在线播放| 91精品国产综合久久小美女| 亚洲成av人片www| 欧美视频中文字幕| 亚洲国产精品久久久久婷婷884 | 亚洲伦理在线精品| 91欧美一区二区| 日韩理论片中文av| 91丨porny丨首页| 中文字幕日韩一区| 99精品在线观看视频| 中文字幕日韩av资源站| 99视频热这里只有精品免费| 最近中文字幕一区二区三区| 99精品视频在线免费观看| 亚洲欧洲成人精品av97| 一本大道久久a久久精品综合| 亚洲日本丝袜连裤袜办公室| 91免费在线播放| 亚洲精品福利视频网站| 欧美午夜视频网站| 亚洲成人精品一区| 欧美大片一区二区| 国产综合久久久久久久久久久久| 精品久久久三级丝袜| 国产成人精品影视| 亚洲色图在线看| 欧美熟乱第一页| 免费高清视频精品| 国产色综合久久| 99国产精品久| 亚洲国产乱码最新视频 | 在线看国产日韩| 日韩电影在线观看电影| 日韩电影在线免费看| 国产精品久久福利| 欧美激情一区二区三区四区| 色婷婷综合久久久久中文| 国内精品久久久久影院一蜜桃| 国产精品亚洲一区二区三区妖精| 性久久久久久久| 亚洲大片一区二区三区|