Process the start of this tag.
@throws JspException if a JSP exception has occurred
965033
public int doStartTag() throws JspException
    {
        // verify that the parent is a CheckBoxGroup
        Tag parentTag = findAncestorWithClass(this, CheckBoxGroup.class);
        if (parentTag == null) {
            String s = Bundle.getString("Tags_CheckBoxOptionNoCheckBoxGroup");
            registerTagError(s, null);
            return SKIP_BODY;
        }

        CheckBoxGroup parent = (CheckBoxGroup) parentTag;
        if ((parent.getOptionsDataSource() != null && !parent.isRepeater())) {
            String s = Bundle.getString("Tags_CheckBoxOptionParentHasOptionsDataSource");
            parent.registerTagError(s, null);
            return SKIP_BODY;
        }

        // Do nothing until doEndTag() is called
        return EVAL_BODY_BUFFERED;
    }
620546
public int doStartTag() throws JspException
    {
        if (hasErrors())
            return SKIP_BODY;
        
        // Error out if there is a parent form
        if (getNearestForm() != null) {
            registerTagError(Bundle.getString("Tags_FormParentForm"), null);
        }

        // Look up the form bean name, scope, and type if necessary
        HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
        ServletContext servletContext = pageContext.getServletContext();

        // find the beanName, beanType and beanScope
        lookupBeanScopeAndName(request, servletContext);
        if (hasErrors())
            return SKIP_BODY;

        // Generate the real name.  We generate it here so we can return it to any contained tags if
        // they need it.  If they access it, the most likely will cause the realName to be output
        if (_state.id != null) {
            _realName = getIdForTagId(_state.id);
        }
        else {
            String formId = FORM_ID + getNextId(request);
            _realName = getIdForTagId(formId);
        }

        // Store this tag itself as a page attribute
        pageContext.setAttribute(Constants.FORM_KEY, this, PageContext.REQUEST_SCOPE);

        // Locate or create the bean associated with our form
        int scope = PageContext.SESSION_SCOPE;
        if ("request".equals(_beanScope)) {
            scope = PageContext.REQUEST_SCOPE;
        }

        // setup the Bean
        Object bean = null;
        if (_beanName != null)
            bean = pageContext.getAttribute(_beanName, scope);
        if (bean == null) {
            if (_explicitBeanType) {
                // Backwards compatibility - use explicitly specified values
                try {
                    Handlers handlers = Handlers.get(pageContext.getServletContext());
                    bean = handlers.getReloadableClassHandler().newInstance(_beanType);
                    if (bean != null) {
                        ((ActionForm) bean).setServlet(_servlet);
                    }
                }
                catch (Exception e) {
                    registerTagError(Bundle.getString("Tags_FormNameBadType"), e);
                }
            }
            else {
                // New and improved - use the values from the action mapping
                
                // First, check to see if this is a page flow-scoped form bean.  If so, use the current value
                // from the member field in the page flow (or shared flow).
                if (_flowController != null) {
                    bean = _flowController.getFormBean(_mapping);
                }

                if (bean == null) {
                    bean = InternalUtils.createActionForm(_mapping, _appConfig, _servlet, servletContext);
                }
            }

            if (hasErrors())
                return SKIP_BODY;

            // Call the reset method if we have an ActionForm
            if (bean instanceof ActionForm) {
                ((ActionForm) bean).reset(_mapping, request);
            }
            if (bean != null) {
                pageContext.setAttribute(_beanName, bean, scope);
            }
        }
        if (bean != null) {
            pageContext.setAttribute(Constants.BEAN_KEY, bean, PageContext.REQUEST_SCOPE);
            ImplicitObjectUtil.loadActionForm(pageContext, bean);
        }
        
        // Create the action URL here, so child tags can access it.
        try {
            HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();
            _extraHiddenParams = new LinkedHashMap/*<String, List<String>>*/();
            _actionUrl = rewriteActionURL(servletContext, request, response, _extraHiddenParams);
        }
        catch (URISyntaxException e) {
            // report the error...
            logger.error(Bundle.getString("Tags_URISyntaxException"));
            String s = Bundle.getString("Tags_Form_URLException",
                    new Object[]{_state.action, e.getMessage()});
            registerTagError(s, e);
        }

        // Continue processing this page
        return EVAL_BODY_BUFFERED;
    }
195744
public int doStartTag() throws JspException
    {
        if (hasErrors())
            return reportAndExit(SKIP_BODY);

        Tag parentTag = findAncestorWithClass(this, IUrlParams.class);
        if (parentTag != null) {
            // this map shouldn't be null because the attribute is required.
            assert(_map != null);
            IUrlParams parent = (IUrlParams) parentTag;
            Iterator it = _map.entrySet().iterator();
            while (it.hasNext()) {
                Map.Entry key = (Map.Entry) it.next();
                parent.addParameter(key.getKey().toString(), key.getValue(), null);
            }
        }
        else {
            String msg = Bundle.getString("Tags_InvalidParameterMapParent");
            registerTagError(msg, null);
            reportErrors();
        }

        localRelease();
        return SKIP_BODY;
    }
50120
public int doEndTag() throws JspException
    {
        Object val = evaluateDataSource();

        ServletRequest req = pageContext.getRequest();

        if (_dataInput != null) {
            val = _dataInput.toString();
        }

        // if there were expression errors report them
        if (hasErrors())
            return reportAndExit(SKIP_BODY);

        if (val != null) {
            _value = val.toString();
        }

        // Create an appropriate "input" element based on our parameters
        ByRef ref = new ByRef();
        nameHtmlControl(_state, ref);

        if (_value != null) {
            InternalStringBuilder sb = new InternalStringBuilder(_value.length() + 16);
            StringBuilderRenderAppender sbAppend = new StringBuilderRenderAppender(sb);
            HtmlUtils.filter(_value, sbAppend);
            _state.value = sb.toString();
        }

        // correct for null text here
        if (_state.value == null)
            _state.value = "";

        WriteRenderAppender writer = new WriteRenderAppender(pageContext);
        TagRenderingBase hiddenTag = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_HIDDEN_TAG, req);

        hiddenTag.doStartTag(writer, _state);
        hiddenTag.doEndTag(writer);

        if (!ref.isNull())
            write((String) ref.getRef());

        // Continue processing this page
        localRelease();
        return SKIP_BODY;
    }
394955
public void startElement(String tag, HashMap h)
    {
        if ( !foundRoot ) {
            if (!tag.equals("xfdf")) {
                throw new RuntimeException("Root element is not Bookmark.");
            }
            else { 
            	foundRoot = true;
            }
        }

        if ( tag.equals("xfdf") ){
    		
    	} else if ( tag.equals("f") ) {
    		fileSpec = (String)h.get( "href" );
    	} else if ( tag.equals("fields") ) {
            fields = new HashMap();		// init it!
            listFields = new HashMap();
    	} else if ( tag.equals("field") ) {
    		String	fName = (String) h.get( "name" );
    		fieldNames.push( fName );
    	} else if ( tag.equals("value") ) {
    		fieldValues.push( "" );
    	}
    }
1332356
public int doStartTag() throws JspException {
      try {
	SPathFilter s = new SPathFilter(new SPathParser(select).expression());
	pageContext.setAttribute(var, s);
	return SKIP_BODY;
      } catch (ParseException ex) {
	throw new JspTagException(ex.toString(), ex);
      }
    }
48287
private void processStartTag(final StartElement paramElem) throws IOException, XMLStreamException,
        TTException {
        assert paramElem != null;

        // Initialize variables.
        initializeVars();

        // Main algorithm to determine if same, insert or a delete has to be
        // made.
        algorithm(paramElem);

        if (mFound && mIsRightSibling) {
            mDelete = EDelete.ATSTARTMIDDLE;
            deleteNode();
        } else if (!mFound) {
            // Increment levels.
            mLevelInToShredder++;

            insertElementNode(paramElem);
        } else if (mFound) {
            // Increment levels.
            mLevelInToShredder++;

            sameElementNode();
        }
    }
1164310
@Override
    public int doEndTag() throws JspException {

        ServletRequest req = pageContext.getRequest();
        A_CmsConfiguredHtmlParser parser;
        if (m_allowInlineEdit && CmsJspTagEditable.isEditableRequest(req)) {
            // during inline editing the content should not be parsed
            try {
                getBodyContent().writeOut(pageContext.getOut());
                release();
            } catch (Exception ex) {
                release();
                if (LOG.isErrorEnabled()) {
                    LOG.error(Messages.get().getBundle().key(Messages.ERR_PROCESS_TAG_1, TAG_NAME), ex);
                }
                // this is severe
                throw new JspException(ex);
            }
        } else {
            // This will always be true if the page is called through OpenCms
            if (CmsFlexController.isCmsRequest(req)) {
                String content = "";
                try {
                    if (CmsStringUtil.isEmpty(m_configuredParserClassname)) {
                        if (LOG.isErrorEnabled()) {
                            LOG.error(
                                Messages.get().getBundle().key(
                                    Messages.GUI_ERR_TAG_ATTRIBUTE_MISSING_2,
                                    new Object[] {TAG_NAME, ATT_VISITOR_CLASS}));
                        }

                    }
                    // wrong attribute visitorClass -> content will remain empty, but no exception is
                    // thrown
                    try {
                        // load
                        Class<?> cl = Class.forName(m_configuredParserClassname);
                        // Instantiate
                        Object instance = cl.newInstance();
                        // cast
                        parser = (A_CmsConfiguredHtmlParser)instance;
                        parser.setParam(m_param);
                        // cms object:
                        CmsFlexController controller = CmsFlexController.getController(req);
                        CmsObject cms = controller.getCmsObject();
                        parser.setCmsObject(cms);
                        content = parseTagAction(getBodyContent().getString(), pageContext, parser);

                    } catch (Exception e) {
                        if (LOG.isErrorEnabled()) {
                            LOG.error(
                                Messages.get().getBundle().key(
                                    Messages.GUI_ERR_TAG_ATTRIBUTE_INVALID_3,
                                    new Object[] {
                                        TAG_NAME,
                                        ATT_VISITOR_CLASS,
                                        A_CmsConfiguredHtmlParser.class.getName()}),
                                e);
                        }
                        e.printStackTrace(System.err);
                    }

                } finally {
                    try {
                        getBodyContent().clear();
                        getBodyContent().print(content);
                        getBodyContent().writeOut(pageContext.getOut());
                        release();

                    } catch (Exception ex) {
                        release();
                        if (LOG.isErrorEnabled()) {
                            LOG.error(Messages.get().getBundle().key(Messages.ERR_PROCESS_TAG_1, TAG_NAME), ex);
                        }
                        // this is severe
                        throw new JspException(ex);
                    }

                }

            }
        }
        return EVAL_PAGE;
    }
86201
private void readTag() throws XMLException, IOException {
		try {
			char c;
			if ((c = stream.read()) == '!') {
				readTagExclamation();
			} else if (c == '?') {
				readProcessingInstruction();
			} else if (c == '/') {
				readEndTag();
			} else if (isNameStartChar(c)) {
				readStartTag(c);
			} else {
				throw new XMLException(getPosition(), "Unexpected character", Character.valueOf(c));
			}
		} catch (EOFException e) {
			throw new XMLException(getPosition(), new LocalizableString("lc.xml.error", "Unexpected end"),
					new LocalizableString("lc.xml.error", "in XML document"));
		}
	}
436891
public int doStartTag() throws JspException
    {
        // we assume that tagId will over have override id if both are defined.
        if (_state.id != null) {
            _idScript = renderNameAndId((HttpServletRequest) pageContext.getRequest(), _state, null);
        }

        // render the header...
        _writer = new WriteRenderAppender(pageContext);
        _br = TagRenderingBase.Factory.getRendering(TagRenderingBase.BODY_TAG, pageContext.getRequest());
        _br.doStartTag(_writer, _state);

        return EVAL_BODY_INCLUDE;
    }
1352546
private void processCharacters(final Characters paramText) throws IOException, XMLStreamException,
        TTException {
        assert paramText != null;
        // Initialize variables.
        initializeVars();
        final String text = paramText.getData().toString();
        if (!text.isEmpty()) {
            // Main algorithm to determine if same, insert or a delete has to be
            // made.
            algorithm(paramText);

            if (mFound && mIsRightSibling) {
                /*
                 * Cannot happen because if text node after end tag get's
                 * deleted it's done already while parsing the end tag. If text
                 * node should be deleted at the top of a subtree (right after a
                 * start tag has been parsed) it's done in
                 * processStartTag(StartElement).
                 */
                // mDelete = EDelete.ATSTARTMIDDLE;
                // deleteNode();
                throw new AssertionError("");
            } else if (!mFound) {
                insertTextNode(paramText);
            } else if (mFound) {
                sameTextNode();
            }
        }
    }
321970
@SuppressWarnings("unchecked")
	@Override
	public int doStartTag() throws JspException {
		super.doStartTag();

		if(AssertUtils.isNotEmpty(this.url)) {
			final HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
			Object object = request.getAttribute(JavascriptIncludeTag.JAVASCRIPT_INCLUDE_URL_TAG);
			List<String> urls;
			
			if(object == null) {
				urls = new ArrayList<String>();
				request.setAttribute(JavascriptIncludeTag.JAVASCRIPT_INCLUDE_URL_TAG, urls);
			} else {
				urls = (List<String>) object;
			}
			
			if(this.appendContext) {
				url = UriUtils.addWebPaths(request.getContextPath(), url); 
			}
			
			// do not add a duplicate url here
			if(!urls.contains(url)) {
				urls.add(url);
			}
			
			return SKIP_BODY;
		}
		
		return EVAL_BODY_BUFFERED;
	}
610220
@Override
    public int doEndTag() throws JspException {

        // only execute action for the first "ade" tag on the page (include file)
        enableAdeTagAction(pageContext);

        if (OpenCms.getSystemInfo().getServletContainerSettings().isReleaseTagsAfterEnd()) {
            // need to release manually, JSP container may not call release as required (happens with Tomcat)
            release();
        }

        return EVAL_PAGE;
    }
125509
public boolean nextStartElement() throws XMLException, IOException {
		try {
			do {
				next();
			} while (!Type.START_ELEMENT.equals(event.type));
			return true;
		} catch (EOFException e) {
			return false;
		}
	}
460882
public void actionNew() throws JspException {

        String newFileName = "";
        try {
            newFileName = A_CmsResourceCollector.createResourceForCollector(
                getCms(),
                m_paramNewLink,
                getElementLocale(),
                getParamResource(),
                getParamModelFile(),
                getParamMode(),
                getParamPostCreateHandler());
            // wipe out parameters for the editor to ensure proper operation
            setParamNewLink(null);
            setParamAction(null);
            setParamResource(newFileName);
            setAction(ACTION_DEFAULT);

            // create the temporary file to work with
            setParamTempfile(createTempFile());

            // set the member variables for the content
            m_file = getCms().readFile(getParamTempfile(), CmsResourceFilter.ALL);
            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(getParamModelFile())) {
                m_content = CmsXmlContentFactory.unmarshal(
                    getCms(),
                    getCms().readFile(newFileName, CmsResourceFilter.ALL));
            } else {
                m_content = CmsXmlContentFactory.unmarshal(getCms(), m_file);
            }

        } catch (CmsException e) {
            if (LOG.isErrorEnabled()) {
                LOG.error(Messages.get().getBundle().key(Messages.LOG_CREATE_XML_CONTENT_ITEM_1, m_paramNewLink), e);
            }
            throw new JspException(e);
        } finally {
            try {
                // delete the new file
                getCms().deleteResource(newFileName, CmsResource.DELETE_REMOVE_SIBLINGS);
            } catch (CmsException e) {
                // ignore
            }
        }
    }
622665
public int doStartTag() throws JspException
    {
        JspTag parentTag = SimpleTagSupport.findAncestorWithClass(this, IUrlParams.class);
        if (parentTag == null) {
            String msg = Bundle.getString("Tags_InvalidParameterParent");
            registerTagError(msg, null);
            reportErrors();
        }
        else {
            IUrlParams parent = (IUrlParams) parentTag;
            parent.addParameter(_name, _value, null);
        }
        localRelease();
        return SKIP_BODY;
    }
287964
public int doStartTag()
            throws JspException {
        Tag parent = getParent();
        if(parent == null || !(parent instanceof AbstractCallMethod)) {
            String msg = Bundle.getErrorString("Tags_MethodParameter_invalidParent");
            registerTagError(msg, null);
            reportErrors();
            return SKIP_BODY;
        }

        if(!_isNull && _value == null) {
            String msg = Bundle.getErrorString("Tags_MethodParameter_undefinedValue");
            registerTagError(msg, null);
            reportErrors();
            return SKIP_BODY;
        }

        return SKIP_BODY;
    }