protected String processAssetXML(Element assetElement, boolean create) {  String linkid = "", name = "", typeCode = ""; boolean accessible = false; int linkType = 0, status = 0, numKids = 0; boolean hasLinkType = false, hasStatus = false, hasName = false, hasAccessible = false, hasUrl = false, hasWebPath = false, hasSortOrder = false, hasNumKids = false, hasTypeCode = false; AssetType type = this.type;  if (assetElement.hasAttribute("linkid")) linkid = MatrixToolkit.rawUrlDecode(assetElement.getAttribute("linkid"));     try { if (assetElement.hasAttribute("type_code")) { typeCode = assetElement.getAttribute("type_code"); type = AssetManager.getAssetType(typeCode); hasTypeCode = true; } if (assetElement.hasAttribute("name")) { name = MatrixToolkit.rawUrlDecode(assetElement.getAttribute("name")); hasName = true; }  if (assetElement.hasAttribute("link_type")) { linkType = Integer.parseInt(assetElement.getAttribute("link_type")); hasLinkType = true; } if (assetElement.hasAttribute("status")) { status = Integer.parseInt(assetElement.getAttribute("status")); hasStatus = true; } if (assetElement.hasAttribute("num_kids")) { numKids = Integer.parseInt(assetElement.getAttribute("num_kids")); hasNumKids = true; } if (assetElement.hasAttribute("accessible")) { accessible = assetElement.getAttribute("accessible").equals("1"); hasAccessible = true; } if (assetElement.hasAttribute("url")) { String url = assetElement.getAttribute("url"); hasUrl = true; } if (assetElement.hasAttribute("web_path")) { String webPath = assetElement.getAttribute("web_path"); hasWebPath = true; } if (assetElement.hasAttribute("sort_order")) { this.sort_order	= Integer.parseInt(assetElement.getAttribute("sort_order")); hasSortOrder = true; }  } catch (NumberFormatException exp) { System.out.println(exp.getMessage()); }  if (create) { this.initName	= name; this.accessible = accessible; this.status     = status; this.url        = url; this.webPath    = webPath; this.numKids    = numKids; this.type       = AssetManager.getAssetType(typeCode); } else { this.initName	= name; boolean refresh = false;   boolean linkTypeChanged = setLinkType(linkType, linkid);  if (linkTypeChanged) Log.log("Link Type changed for asset "  + id, Asset.class);     refresh |= hasName       && setName(name, linkid); refresh |= hasStatus     && setStatus(status); refresh |= hasLinkType   && linkTypeChanged; refresh |= hasAccessible && setAccessible(accessible); refresh |= hasNumKids    && setNumKids(numKids); refresh |= hasTypeCode   && setTypeCode(type); refresh |= hasSortOrder	 && setNodeSortOrder(linkid, this.sort_order);  if (refresh) nodesChanged(); if (hasUrl && setUrl(url)) updateUrls(); if (hasWebPath && setWebPath(webPath)) updateWebPaths(); }
public String processAssetXML(Element assetElement) { String linkid = processAssetXML(assetElement, false);
	protected String processAssetXML(Element assetElement, boolean create) {		String linkid = "", name = "", typeCode = "";		boolean accessible = false;		int linkType = 0, status = 0, numKids = 0;		boolean hasLinkType = false, hasStatus = false, hasName = false,		hasAccessible = false, hasUrl = false, hasWebPath = false, hasSortOrder = false,		hasNumKids = false, hasTypeCode = false;		AssetType type = this.type;		if (assetElement.hasAttribute("linkid"))			linkid = MatrixToolkit.rawUrlDecode(assetElement.getAttribute("linkid"));		// the following attributes can be modified after creation		try {			if (assetElement.hasAttribute("type_code")) {				typeCode = assetElement.getAttribute("type_code");				type = AssetManager.getAssetType(typeCode);				hasTypeCode = true;			}			if (assetElement.hasAttribute("name")) {				name = MatrixToolkit.rawUrlDecode(assetElement.getAttribute("name"));				hasName = true;			}			if (assetElement.hasAttribute("link_type")) {				linkType = Integer.parseInt(assetElement.getAttribute("link_type"));				hasLinkType = true;			}			if (assetElement.hasAttribute("status")) {				status = Integer.parseInt(assetElement.getAttribute("status"));				hasStatus = true;			}			if (assetElement.hasAttribute("num_kids")) {				numKids = Integer.parseInt(assetElement.getAttribute("num_kids"));				hasNumKids = true;			}			if (assetElement.hasAttribute("accessible")) {				accessible = assetElement.getAttribute("accessible").equals("1");				hasAccessible = true;			}			if (assetElement.hasAttribute("url")) {				String url = assetElement.getAttribute("url");				hasUrl = true;			}			if (assetElement.hasAttribute("web_path")) {				String webPath = assetElement.getAttribute("web_path");				hasWebPath = true;			}			if (assetElement.hasAttribute("sort_order")) {				this.sort_order	= Integer.parseInt(assetElement.getAttribute("sort_order"));				hasSortOrder = true;			}		} catch (NumberFormatException exp) {			System.out.println(exp.getMessage());		}		if (create) {			this.initName	= name;			this.accessible = accessible;			this.status     = status;			this.url        = url;			this.webPath    = webPath;			this.numKids    = numKids;			this.type       = AssetManager.getAssetType(typeCode);		} else {			this.initName	= name;			boolean refresh = false;			// TODO: Change this back to what it was			boolean linkTypeChanged = setLinkType(linkType, linkid);			if (linkTypeChanged)				Log.log("Link Type changed for asset "  + id, Asset.class);			// the following properties require that an event			// is fired to notify that the nodes of this asset			// have visually changed			refresh |= hasName       && setName(name, linkid);			refresh |= hasStatus     && setStatus(status);			refresh |= hasLinkType   && linkTypeChanged;			refresh |= hasAccessible && setAccessible(accessible);			refresh |= hasNumKids    && setNumKids(numKids);			refresh |= hasTypeCode   && setTypeCode(type);			refresh |= hasSortOrder	 && setNodeSortOrder(linkid, this.sort_order);			if (refresh)				nodesChanged();			if (hasUrl && setUrl(url))				updateUrls();			if (hasWebPath && setWebPath(webPath))				updateWebPaths();		}		return linkid;	}