Example #1
0
void GLView::setViewName(const std::string &pszViewName)
{
    GLViewProtocol::setViewName(pszViewName);
    if (m_glParentWidget) {
        m_glParentWidget->setWindowTitle(getViewName().c_str());
    }
}
Example #2
0
//-----------------------------------------------------------------------------
bool UIViewFactory::getPossibleAttributeListValues (CView* view, const std::string& attributeName, StringPtrList& values) const
{
	ViewCreatorRegistry& registry = getCreatorRegistry ();
	ViewCreatorRegistry::const_iterator iter = registry.find (getViewName (view));
	while (iter != registry.end () && (*iter).second->getPossibleListValues (attributeName, values) == false && (*iter).second->getBaseViewName ())
	{
		iter = registry.find ((*iter).second->getBaseViewName ());
	}
	return !values.empty ();
}
Example #3
0
//-----------------------------------------------------------------------------
bool UIViewFactory::getAttributeValueRange (CView* view, const std::string& attributeName, double& minValue, double& maxValue) const
{
	minValue = maxValue = -1.;
	ViewCreatorRegistry& registry = getCreatorRegistry ();
	ViewCreatorRegistry::const_iterator iter = registry.find (getViewName (view));
	while (iter != registry.end () && (*iter).second->getAttributeValueRange (attributeName, minValue, maxValue) == false && (*iter).second->getBaseViewName ())
	{
		iter = registry.find ((*iter).second->getBaseViewName ());
	}
	return minValue != maxValue && minValue != -1.;
}
Example #4
0
//-----------------------------------------------------------------------------
bool UIViewFactory::getAttributeNamesForView (CView* view, StringList& attributeNames) const
{
	bool result = false;
	ViewCreatorRegistry& registry = getCreatorRegistry ();
	ViewCreatorRegistry::const_iterator iter = registry.find (getViewName (view));
	while (iter != registry.end () && (result = (*iter).second->getAttributeNames (attributeNames)) && (*iter).second->getBaseViewName ())
	{
		iter = registry.find ((*iter).second->getBaseViewName ());
	}
	return result;
}
Example #5
0
//-----------------------------------------------------------------------------
IViewCreator::AttrType UIViewFactory::getAttributeType (CView* view, const std::string& attributeName) const
{
	ViewCreatorRegistry& registry = getCreatorRegistry ();
	IViewCreator::AttrType type = IViewCreator::kUnknownType;
	ViewCreatorRegistry::const_iterator iter = registry.find (getViewName (view));
	while (iter != registry.end () && (type = (*iter).second->getAttributeType (attributeName)) == IViewCreator::kUnknownType && (*iter).second->getBaseViewName ())
	{
		iter = registry.find ((*iter).second->getBaseViewName ());
	}
	return type;
}
Example #6
0
//-----------------------------------------------------------------------------
bool UIViewFactory::getAttributeValue (CView* view, const std::string& attributeName, std::string& stringValue, IUIDescription* desc) const
{
	bool result = false;
	ViewCreatorRegistry& registry = getCreatorRegistry ();
	ViewCreatorRegistry::const_iterator iter = registry.find (getViewName (view));
	while (iter != registry.end () && !(result = (*iter).second->getAttributeValue (view, attributeName, stringValue, desc)) && (*iter).second->getBaseViewName ())
	{
		iter = registry.find ((*iter).second->getBaseViewName ());
	}
	return result;
}
Example #7
0
//-----------------------------------------------------------------------------
bool UIViewFactory::applyAttributeValues (CView* view, const UIAttributes& attributes, IUIDescription* desc) const
{
	bool result = false;
	ViewCreatorRegistry& registry = getCreatorRegistry ();
	ViewCreatorRegistry::const_iterator iter = registry.find (getViewName (view));
	while (iter != registry.end () && (result = (*iter).second->apply (view, attributes, desc)) && (*iter).second->getBaseViewName ())
	{
		iter = registry.find ((*iter).second->getBaseViewName ());
	}
	return result;
}
Example #8
0
 void INView::navigate(const NString & outcome)
 {
     if (getParent() != NULL)
     {
         getParent()->navigate(outcome);
     }
     else
     {
         getSession()->navigateByRule(getViewName(), outcome);
     }
 }
Example #9
0
//-----------------------------------------------------------------------------
bool UIViewFactory::getAttributesForView (CView* view, const IUIDescription* desc, UIAttributes& attr) const
{
	bool result = false;
	StringList attrNames;
	if (getAttributeNamesForView (view, attrNames))
	{
		StringList::const_iterator it = attrNames.begin ();
		while (it != attrNames.end ())
		{
			std::string value;
			if (getAttributeValue (view, *it, value, desc))
				attr.setAttribute (*it, value);
			it++;
		}
		attr.setAttribute (UIViewCreator::kAttrClass, getViewName (view));
		result = true;
	}
	return result;
}
Example #10
0
//-----------------------------------------------------------------------------
bool UIViewFactory::getAttributesForView (CView* view, IUIDescription* desc, UIAttributes& attr) const
{
	bool result = false;
	std::list<std::string> attrNames;
	if (getAttributeNamesForView (view, attrNames))
	{
		std::list<std::string>::const_iterator it = attrNames.begin ();
		while (it != attrNames.end ())
		{
			std::string value;
			if (getAttributeValue (view, (*it), value, desc))
				attr.setAttribute ((*it).c_str (), value.c_str ());
			it++;
		}
		attr.setAttribute ("class", getViewName (view));
		result = true;
	}
	return result;
}
Example #11
0
void MainWindow::tableAddTab(IDataView::ViewType type)
{
	int index;
	if (!m_dataviews[type])
	{
		auto view = getDataView(type);
		index = ui->tabWidget->insertTab(type, view, view->getViewName());
	}
	else
	{
		for (int i = 0; i < ui->tabWidget->count(); ++i)
		{
			if (ui->tabWidget->widget(i) == m_dataviews[type])
			{
				index = i;
				break;
			}
		}
	}
	ui->tabWidget->setCurrentIndex(index);
}
const NAString
StmtDDLDropView::displayLabel1() const
{
  return NAString("View name: ") + getViewName();
}
Example #13
0
//-----------------------------------------------------------------------------
// Function: NewDesignDialog::updateVlnvName()
//-----------------------------------------------------------------------------
void NewDesignDialog::updateVlnvName()
{
    vlnvEditor_->setName(component_->getVlnv()->getName().remove(".comp") + "." + getViewName());
}
Example #14
0
void View::transform()
{
	erydbSelectExecutionPlan* csep = new erydbSelectExecutionPlan();
	csep->sessionID(fParentGwip->sessionid);

	// gwi for the sub query
	gp_walk_info gwi;
	gwi.thd = fParentGwip->thd;

	uint32_t sessionID = csep->sessionID();
	gwi.sessionid = sessionID;
	boost::shared_ptr<erydbSystemCatalog> csc = erydbSystemCatalog::makeerydbSystemCatalog(sessionID);
	csc->identity(erydbSystemCatalog::FE);
	gwi.csc = csc;

	// traverse the table list of the view
	TABLE_LIST* table_ptr = fSelect.get_table_list();
	erydbSelectExecutionPlan::SelectList derivedTbList;

	// @bug 1796. Remember table order on the FROM list.
	gwi.clauseType = FROM;
	try {
		for (; table_ptr; table_ptr= table_ptr->next_local)
		{
			// mysql put vtable here for from sub. we ignore it
			if (string(table_ptr->table_name).find("$vtable") != string::npos)
				continue;

			string viewName = getViewName(table_ptr);

			if (table_ptr->derived)
			{
				SELECT_LEX *select_cursor = table_ptr->derived->first_select();
				FromSubQuery *fromSub = new FromSubQuery(gwi, select_cursor);
				string alias(table_ptr->alias);
				gwi.viewName = make_aliasview("", alias, table_ptr->belong_to_view->alias, "");
				algorithm::to_lower(alias);
				fromSub->alias(alias);
				gwi.derivedTbList.push_back(SCSEP(fromSub->transform()));
				// set alias to both table name and alias name of the derived table
				erydbSystemCatalog::TableAliasName tn = make_aliasview("", "", alias, viewName);
				gwi.tbList.push_back(tn);
				gwi.tableMap[tn] = make_pair(0, table_ptr);
				gwi.thd->erydb_vtable.isUnion = true; //by-pass the 2nd pass of rnd_init
			}
			else if (table_ptr->view)
			{
				// for nested view, the view name is vout.vin... format
				erydbSystemCatalog::TableAliasName tn = make_aliasview(table_ptr->db, table_ptr->table_name, table_ptr->alias, viewName);
				gwi.viewName = make_aliastable(table_ptr->db, table_ptr->table_name, viewName);
				View *view = new View(table_ptr->view->select_lex, &gwi);
				view->viewName(gwi.viewName);
				gwi.viewList.push_back(view);
				view->transform();
			}
			else
			{
				// check foreign engine tables
				bool infiniDB = (table_ptr->table ? isEryDB(table_ptr->table) : true);

				// trigger system catalog cache
				if (infiniDB)
					csc->columnRIDs(make_table(table_ptr->db, table_ptr->table_name), true);

				erydbSystemCatalog::TableAliasName tn = make_aliasview(table_ptr->db, table_ptr->table_name, table_ptr->alias, viewName, infiniDB);
				gwi.tbList.push_back(tn);
				gwi.tableMap[tn] = make_pair(0, table_ptr);
				fParentGwip->tableMap[tn] = make_pair(0, table_ptr);
			}
		}
		if (gwi.fatalParseError)
		{
			setError(gwi.thd, ER_INTERNAL_ERROR, gwi.parseErrorText);
			return;
		}
	}
	catch (ERYDBExcept& ie)
	{
		setError(gwi.thd, ER_INTERNAL_ERROR, ie.what());
		erydbSystemCatalog::removeerydbSystemCatalog(sessionID);
		return;
	}
	catch (...)
	{
		string emsg = ERYDBErrorInfo::instance()->errorMsg(ERR_LOST_CONN_EXEMGR);
		setError(gwi.thd, ER_INTERNAL_ERROR, emsg);
		erydbSystemCatalog::removeerydbSystemCatalog(sessionID);
		return;
	}

	// merge table list to parent select
	fParentGwip->tbList.insert(fParentGwip->tbList.end(), gwi.tbList.begin(), gwi.tbList.end());
	fParentGwip->derivedTbList.insert(fParentGwip->derivedTbList.end(), gwi.derivedTbList.begin(), gwi.derivedTbList.end());
	fParentGwip->correlatedTbNameVec.insert(fParentGwip->correlatedTbNameVec.end(), gwi.correlatedTbNameVec.begin(), gwi.correlatedTbNameVec.end());

	// merge view list to parent
	fParentGwip->viewList.insert(fParentGwip->viewList.end(), gwi.viewList.begin(), gwi.viewList.end());

	// merge non-collapsed outer join to parent select
	stack<ParseTree*> tmpstack;
	while (!gwi.ptWorkStack.empty())
	{
		tmpstack.push(gwi.ptWorkStack.top());
		gwi.ptWorkStack.pop();
	}

	while (!tmpstack.empty())
	{
		fParentGwip->ptWorkStack.push(tmpstack.top());
		tmpstack.pop();
	}
}