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

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

?? htmltemplatedisplay.java

?? JAVA開源LDAP瀏覽器jxplorer的源碼!
?? JAVA
?? 第 1 頁 / 共 5 頁
字號(hào):
                }
            }
        }
    }


    /**
     *	Checks if the HTML page has any custom tags such as...
     *	<p><dxtemplate:get-all-attributes style="list"/></p>
     *	<p><dxtemplate:get-attribute name="cn" style="list"/></p>
     *	if so it enters the data.  If the tag is 'get-all-attributes', all
     *	the attributes are included in the page.  If the tag is 'get-attribute', the
     *	specific attribute is displayed.
     *	This method also kicks off the handling of inserting form data.
     *	@param entry the entry that we are trying to display.
     */

    protected void displayData(DXEntry entry)
    {
        if (entry == null)
        {
            setEditorText(NODATA);
            return;
        }

        int tagstart = 0;        				// the start of the ATTRIBTAG html tag
        int tagend;            				// the end of the ATTRIBTAG html tag

        //int htmlTagLen = ATTRIBTAG.length();

        htmlText = new StringBuffer(baseText);

        // check if doco is XHTML, and try to convert to HTML 3.2 by replacing all end tags '/>' with '>'
        htmlText = parseXHTML(htmlText);


        mediaCheck(entry, "jpegPhoto");			//TE: checks for jpegPhoto and creates temporary file that can be later displayed in a template.
        mediaCheck(entry, "audio");				//TE: checks for audio and creates temporary file that can be later displayed in a template.
        mediaCheck(entry, "odDocumentDOC"); 	//TE: checks for odDocumentDOC and creates temporary file that can be later displayed in a template.
        mediaCheck(entry, "odSpreadSheetXLS"); 	//TE: checks for odSpreadSheetXLS and creates temporary file that can be later displayed in a template.
        mediaCheck(entry, "odMusicMID"); 		//TE: checks for odMusicMID and creates temporary file that can be later displayed in a template.
        mediaCheck(entry, "odSoundWAV"); 		//TE: checks for odSoundWAV and creates temporary file that can be later displayed in a template.
        mediaCheck(entry, "odMovieAVI"); 		//TE: checks for odMovieAVI and creates temporary file that can be later displayed in a template.


        tagstart = htmlText.indexOf(ATTRIBTAG, tagstart);
        while (tagstart >= 0)
        {
            tagend = htmlText.indexOf(">", tagstart);
            String tempTag = htmlText.substring(tagstart, tagend);

            String attName = "";
            if (tempTag.indexOf("get-all-attributes") > 0)		//TE: splat all attribute values onto the page.
                attName = "all";
            else											//TE: get the name of the specific attribute to splat.  The next line is basically just getting the attribute name between the quotes e.g. 'cn' from name="cn".
                attName = tempTag.substring(tempTag.indexOf("name=\"") + 6, tempTag.indexOf("\"", tempTag.indexOf("name=\"") + 6));

            String modifier = null;

            if (tempTag.indexOf("style=\"") > 0)				//TE: get the name of the specific attribute to splat.  The next line is basically just getting the style of display from between the quotes e.g. 'list' from style="list".
                modifier = tempTag.substring(tempTag.indexOf("style=\"") + 7, tempTag.indexOf("\"", tempTag.indexOf("style=\"") + 7));

            htmlText.delete(tagstart, tagend + 1);			//TE: remove the tag, we don't need it anymore.
            if (attName.equalsIgnoreCase("all"))  			//TE: make new tags for all the attributes and splat them into where the old tag use to be.
                htmlText.insert(tagstart, formattedAllAttributes(currentEntry, modifier));
            else											//TE: make a new tag for the attribute specified and splat it into where the old tag use to be.
                htmlText.insert(tagstart, formattedAttribute(attName, currentEntry, modifier));	//TE: splat certain attributes.

            //TE: moves the position to the beginning of the next custom tag, if there is one and...
            //TE: breaks the loop if there are no more tags i.e. tagstart would =-1.
            tagstart = htmlText.indexOf(ATTRIBTAG, tagstart);

        }
        if ((htmlText == null) || (htmlText.length() == 0))
        {
            log.warning("HTMLTemplateDisplay:displayNodeData - bad html String " + ((htmlText == null) ? " (is null!)" : ""));
            setEditorText(NODATA);
            return;
        }

        String htmlString = htmlText.toString().trim();

        htmlString = insertFormData(htmlString, entry);


        try
        {
            setEditorText(htmlString);
        }
        catch (EmptyStackException e)    // the amazingly buggy HTML editor has done it again...
        {
            log.warning("Another Bug in Sun HTML Component: " + e);
        }

        scrollDisplay.getVerticalScrollBar().setValue(0);   //TE: sets the scroll bar back to the top.
        viewport.setViewPosition(new Point(0, 0));           //TE: sets the view back to the top.
    }


    /**
     *    Checks if there is any jpegPhoto, audio or odDocumentDOC attributes in the entry if so creates temporary files for them
     *    only if there isn't any already.  Gets the byte[] of the jpegPhoto, audio or odDocumentDOC attributes of the entry being
     *    displayed.  Makes a temp directory called 'temp'. Lists all files in the directory, if there are
     *    any temp files for the jpegPhoto, audio or odDocumentDOC attributes in question it does not recreate them.  Otherwise, if
     *    there isn't any temp files for the entry, it goes ahead and makes them.  The temp files are named
     *    as followed: dn+unique number+.jpg.  The temp files and directory are removed when the JX exists.
     *    @param entry the entry that is to be displayed.
     *	 @param type the type of media being checked for (jpegPhoto, audio or odDocumentDOC).
     */

    protected void mediaCheck(DXEntry entry, String type)
    {
        DXAttribute attribute = null;
        attribute = (DXAttribute) entry.get(type);

        if (attribute == null)
            return;

        currentDN = entry.getDN().toString();    				//TE: the name of the dn becomes the main part of the temporary jpegPhoto or audio file.
        currentDN = Integer.toString(currentDN.hashCode());		//TE: make a hash code of it.

        int size = attribute.size();    						//TE: the amount of jpegPhoto or audio attributes in the entry.

        if (attribute != null)
        {
            CBCache.createCache(entry.getDN().toString(), entry, type, size);   //TE: creates a cache for the jpegPhoto or audio file.
        }
    }



    /**
     *	Changes XHTML into standard HTML for display.
     *  (Currently all this involves is changing any string '/&gt;' into '&gt;').
     */
    // (Currently all this involves is changing any string '/>' into '>').

    static public StringBuffer parseXHTML(StringBuffer html)
    {
        return CBParse.replaceAllBufferString(html, "/>", ">");
    }

    /**
     *    This method looks for form elements, and fills in the initial form values based on
     *    the entry data received.  It is fairly picky about white space - it prefers there to
     *    be minimal whitespace in the form html.  Also, there is minimal form validation; an
     *    incorrect form will cause all sorts of mess.<p>
     *    Note that if <i>anything</i> is wrong with the form, this will simply fail with
     *    an exception (probably a substring exception).
     *
     */

    // XXX This should be rewritten to correctly use the HTML Document object model, but I don't
    // XXX have time right now to work out how to do that :-)   - CB

    protected String insertFormData(String htmlString, DXEntry entry)
    {
        if (htmlString.indexOf("<form") < 0)
        {
            if (currentBinaryAttributes.size() > 0)
                currentBinaryAttributes.clear();
            return htmlString;  // no forms today.
        }

        try
        {
            htmlString = insertFormInputData(htmlString, entry);
            htmlString = insertFormSelectData(htmlString, entry);
            htmlString = insertFormTextAreaData(htmlString, entry);
            htmlString = insertFormImageData(htmlString, entry);    //TE: inserts jpegPhotos into the html template.
            htmlString = insertFormAudioData(htmlString, entry);	//TE: inserts a link (or links) to temporary audio files which should be played by the systems default player depending on the extension of the file.
        }
        catch (Exception e)  // usually simply that the value can't be found.
        {
            if (showHTMLErrors)
            {
                log.warning("Error parsing form html for value insertion in HTMLTemplateDisplay. \n  " + e);
                e.printStackTrace();
            }
        }

        return htmlString;
    }

    // XXX This should be rewritten to correctly use the HTML Document object model,
    protected String getTagValue(String tagName, String tag)
    {
        tag = tag.toLowerCase();
        tagName = tagName.toLowerCase();
        try
        {
            int start = tag.indexOf(tagName) + tagName.length();
            start = tag.indexOf("\"", start) + 1;
            if (start < 0) return null;
            int end = tag.indexOf("\"", start);
            if (end < 0) return null;
            String val = tag.substring(start, end);
            return val.trim();
        }
        catch (Exception e)
        {
            if (showHTMLErrors)
                log.warning("error parsing: " + tagName + "\n  " + e);
            return null;
        }
    }



    /**
     *    Goes through the html template, checking for any field tags of text type for example:
     *    <p>
     *        &#60tr&#62
     *            &#60th align="right" width="200"&#62Common Name:&#60/th&#62
     *            &#60td width="230"&#62&#60input type="text" name="cn" value=""/&#62&#60/td&#62
     *        &#60/tr&#62
     *    <p>
     *    If one is found, it checks the name and gets (in this example) the cn value from the entry and inserts
     *    it into the value part of the tag (for example value="Trudi").  If the attribute is multivalued, the
     *    input tag (&#60input type="text" name="cn" value=""/&#62) is copied and reused until all of the attribute
     *    values are inserted.  For layout, a &#60/br&#62 is added to the end of multivalued attribute tags.  The tag
     *    is then inserted back into the html template and returned.
     *    @param htmlString the actual html file that is to be displayed.
     *    @param entry the current entry that the html file is trying to display.
     *    @return the updated html file (updated with the values of the text fields that are to be displayed).
     */

    // XXX This should be rewritten to correctly use the HTML Document object model,
    protected String insertFormInputData(String htmlString, DXEntry entry)
    {
        int tagStart,tagEnd,pos = 0;
        StringBuffer multiValuedTag = new StringBuffer(0);

        while ((pos = htmlString.indexOf("<input", pos)) >= 0)
        {
            tagStart = pos;
            tagEnd = htmlString.indexOf(">", pos);

            String tag = htmlString.substring(tagStart, tagEnd + 1);

            String type = getTagValue("type", tag);
            String name = getTagValue("name", tag);

            DXAttribute attribute = null;
            attribute = (DXAttribute) entry.get(name);    //TE: get the attribute values that are being processed.

            int size = 0;

            if (attribute != null)
                size = attribute.size();    //TE: get the number of values the attribute has so we can tell if it is multivalued.

            if ("text".equalsIgnoreCase(type) && name != null && attribute != null)    //TE: if the input type is 'text', and the input name is not null, and the attribute is not null.
            {
                if (size == 1)	//TE: was attribute.size() -> throws a null pointer exception.
                    tag = insertFormValue(tag, entry, name);    //TE: if there is only one value process it normally.
                else if (size > 1)	//TE: multivalued.
                {
                    for (int i = 0; i < size; i++)
                    {   //TE: make a new tag for each attribute value (only used for multivalued attributes),
                        //    for example: <input type="text" name="telephoneNumber" value="9727 8941"/><br/>.
                        //    Then append the tag to a string buffer.
                        multiValuedTag.append(new String(insertFormValue(tag, entry, name, i) + "<br>"));
                    }
                    tag = multiValuedTag.toString();
                    multiValuedTag.setLength(0);
                }
            }
            else if ("hidden".equalsIgnoreCase(type) && name != null)
                tag = insertFormValue(tag, entry, name);
            else if ("password".equalsIgnoreCase(type) && name != null && attribute != null)
            {
                if (attribute.size() == 1)
                    tag = insertFormValue(tag, entry, name);
                else if (attribute.size() > 1)
                {
                    for (int i = 0; i < size; i++)
                    {   //TE: make a new tag for each password value (only used for multivalued attributes),
                        //    for example: <input type="text" name="userPassword" value="*****"/><br/>.
                        //    Then append the tag to a string buffer.
                        multiValuedTag.append(new String(insertFormValue(tag, entry, name, i) + "<br>"));
                    }
                    tag = multiValuedTag.toString();
                    multiValuedTag.setLength(0);
                }
            }
            pos = tagStart + tag.length(); // reset pos because tag may have grown larger and may now contains multiple html tags.
            htmlString = htmlString.substring(0, tagStart) + tag + htmlString.substring(tagEnd + 1);    //TE: insert the tag into the htmlString.
        }
        return htmlString;
    }

    // XXX This should be rewritten to correctly use the HTML Document object model,
    protected String insertFormSelectData(String htmlString, DXEntry entry)
    {
        int tagStart,tagEnd,pos = 0;
        while ((pos = htmlString.indexOf("<select", pos)) >= 0)
        {
            t

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
丰满放荡岳乱妇91ww| 91精品国产欧美日韩| 国产精品久久午夜夜伦鲁鲁| 国产精品亚洲专一区二区三区 | 亚洲精品视频一区二区| 在线视频国内自拍亚洲视频| 亚洲一区视频在线| 日韩欧美一区二区不卡| 久久99久久精品| 亚洲精品免费在线播放| 91麻豆精品国产自产在线 | 日韩欧美国产综合一区| 国产999精品久久久久久| 亚洲精品国产精华液| 欧美mv日韩mv| 91老师片黄在线观看| 国产一区二区三区在线观看免费 | 日韩欧美国产不卡| 中文字幕亚洲一区二区av在线| 国产一区在线精品| 一区二区三区四区精品在线视频 | 成人黄色电影在线 | 国产精品一区不卡| 日本欧洲一区二区| 午夜精品久久久久久久99水蜜桃 | 欧美老女人第四色| 色先锋aa成人| 91福利在线导航| 色综合天天视频在线观看| 国产电影一区二区三区| 国产乱码字幕精品高清av| 狠狠色伊人亚洲综合成人| 三级久久三级久久久| 婷婷综合五月天| 免费人成黄页网站在线一区二区| 国产精品家庭影院| 精品少妇一区二区三区日产乱码 | 国内精品国产三级国产a久久| 日产国产欧美视频一区精品| 日韩综合在线视频| 激情另类小说区图片区视频区| 五月综合激情日本mⅴ| 日本在线不卡视频| 国产一区在线观看视频| 国产91在线观看丝袜| 99久久久久免费精品国产| 成人免费毛片a| 在线亚洲一区二区| 日韩视频123| 一区二区三区高清不卡| 日本强好片久久久久久aaa| 国产美女在线观看一区| 色激情天天射综合网| 精品国内二区三区| 亚洲成人动漫一区| 国产成人av一区二区三区在线观看| 成人app网站| 日韩久久精品一区| 亚洲国产一区二区视频| 久久电影网电视剧免费观看| 波波电影院一区二区三区| 欧美午夜不卡视频| 中文字幕亚洲视频| 国产成人午夜99999| 欧美精品日韩精品| 18成人在线观看| 高潮精品一区videoshd| 精品福利在线导航| 日本欧美一区二区三区| 欧美日韩精品免费| 亚洲免费观看在线视频| 成人高清视频免费观看| 久久久久成人黄色影片| 日韩精品亚洲专区| 91精品国产综合久久蜜臀| 一区二区高清在线| 成人av免费在线观看| 国产精品入口麻豆原神| 91免费观看视频| 亚洲国产另类av| 日韩一级免费一区| 一区二区三区精品视频在线| 亚洲国产综合色| 男男视频亚洲欧美| 久久精品一二三| 成人午夜大片免费观看| 中文字幕一区二区三区乱码在线 | 国产九色精品成人porny| 精品美女在线播放| 成人91在线观看| 亚洲国产精品自拍| 久久久久久久久久久黄色| 国产·精品毛片| 日韩电影免费在线观看网站| 中文字幕不卡的av| 91精品国产一区二区三区蜜臀 | 成人高清免费在线播放| 性感美女极品91精品| 久久久精品蜜桃| 欧美一激情一区二区三区| caoporen国产精品视频| 日本在线不卡视频| 亚洲免费大片在线观看| 久久欧美一区二区| 91精品国产乱码| 69堂精品视频| 欧美日韩综合一区| 色噜噜久久综合| 成人免费的视频| 国产精品一卡二| 国产高清在线精品| 国产乱一区二区| 国产一区二区三区黄视频 | 宅男噜噜噜66一区二区66| 91免费视频网址| 色播五月激情综合网| 日本久久一区二区三区| 色妞www精品视频| 欧美日韩在线三区| 91精品福利在线一区二区三区| 91浏览器在线视频| 欧美综合一区二区| 欧美一区二区三区啪啪| 日韩三级电影网址| 欧美成人三级在线| 国产视频一区在线播放| 亚洲三级小视频| 亚洲丶国产丶欧美一区二区三区| 一区二区三区四区乱视频| 亚洲电影中文字幕在线观看| 麻豆精品精品国产自在97香蕉| 国产精品一线二线三线精华| 99久久亚洲一区二区三区青草| 欧美日韩精品一区二区三区四区| 欧美精品1区2区3区| 欧美经典三级视频一区二区三区| 亚洲三级在线免费| 国产麻豆成人精品| 欧美性猛片xxxx免费看久爱| 精品国产一区二区在线观看| 日本一区二区三区久久久久久久久不| 最新不卡av在线| 久久99国产精品久久| 精品视频免费在线| 一区二区三区日本| 成人免费av在线| 久久综合丝袜日本网| 亚洲国产一区在线观看| 一本色道久久加勒比精品| 国产欧美日韩亚州综合| 精品一区二区三区蜜桃| 欧美二区在线观看| 亚洲综合免费观看高清完整版在线 | 日本一区二区三区dvd视频在线| 亚洲综合激情另类小说区| 91在线观看视频| 国产精品久久久久永久免费观看 | 久久色.com| 久久99精品国产.久久久久| 欧美人牲a欧美精品| 亚洲大片免费看| 欧美精品色综合| 日韩主播视频在线| 精品日产卡一卡二卡麻豆| 免费xxxx性欧美18vr| 精品国产伦一区二区三区免费| 久久福利资源站| 亚洲天堂中文字幕| 欧美日韩国产bt| 久久精品国产77777蜜臀| 久久久精品日韩欧美| 色婷婷一区二区三区四区| 亚洲国产综合色| 国产日韩欧美综合在线| 色8久久人人97超碰香蕉987| 日韩在线卡一卡二| 国产欧美日韩另类一区| 91国产视频在线观看| 激情另类小说区图片区视频区| 国产日韩欧美一区二区三区乱码 | 欧美在线免费视屏| 久久精品国产99国产精品| 亚洲最新视频在线观看| 精品美女在线观看| 欧美精品色一区二区三区| 高清不卡一区二区在线| 麻豆精品视频在线观看| 亚洲自拍偷拍图区| 日韩美女视频19| 国产欧美日韩麻豆91| 日韩久久免费av| 日韩午夜三级在线| 欧美一区二区三区四区五区 | 在线91免费看| 色综合色综合色综合色综合色综合 | 日本一区二区三区dvd视频在线| 欧美一区二区免费观在线| 色综合久久久久综合| 色狠狠色噜噜噜综合网| 91久久线看在观草草青青|