/** * Updates the uri of this link with a new target, anchor and query.<p> * * If anchor and/or query are <code>null</code>, this features are not used.<p> * * Note that you can <b>not</b> update the "internal" or "type" values of the link, * so the new link must be of same type (A, IMG) and also remain either an internal or external link.<p> * * Also updates the structure of the underlying XML page document this link belongs to.<p> * * @param target the target (destination) of this link * @param anchor the anchor or null if undefined * @param query the query or null if undefined */ public void updateLink(String target, String anchor, String query) { // set the components m_target = target; m_anchor = anchor; setQuery(query); // create the uri from the components setUri(); // update the xml CmsLinkUpdateUtil.updateXml(this, m_element, true); }
/** * Updates the uri of this link with a new target, anchor and query.<p> * * If anchor and/or query are <code>null</code>, this features are not used.<p> * * Note that you can <b>not</b> update the "internal" or "type" values of the link, * so the new link must be of same type (A, IMG) and also remain either an internal or external link.<p> * * Also updates the structure of the underlying XML page document this link belongs to.<p> * * @param target the target (destination) of this link * @param anchor the anchor or null if undefined * @param query the query or null if undefined */ public void updateLink(String target, String anchor, String query) { // set the components m_target = target; m_anchor = anchor; setQuery(query); // create the uri from the components setUri(); // update the xml CmsLinkUpdateUtil.updateXml(this, m_element, true); }
/** * Sets the component member variables (target, anchor, query) * by splitting the uri <code>scheme://authority/path#anchor?query</code>.<p> */ private void setComponents() { CmsUriSplitter splitter = new CmsUriSplitter(m_uri, true); m_target = splitter.getPrefix(); m_anchor = splitter.getAnchor(); setQuery(splitter.getQuery()); }
m_target = (target != null) ? target.getText() : null; m_anchor = (anchor != null) ? anchor.getText() : null; setQuery((query != null) ? query.getText() : null);
m_target = (target != null) ? target.getText() : null; m_anchor = (anchor != null) ? anchor.getText() : null; setQuery((query != null) ? query.getText() : null);
/** * Sets the component member variables (target, anchor, query) * by splitting the uri <code>scheme://authority/path#anchor?query</code>.<p> */ private void setComponents() { CmsUriSplitter splitter = new CmsUriSplitter(m_uri, true); m_target = splitter.getPrefix(); m_anchor = CmsLinkProcessor.unescapeLink(splitter.getAnchor()); setQuery(splitter.getQuery()); }