Ejemplo n.º 1
0
IPropertyTree *CEspBinding::ensureNavLink(IPropertyTree &folder, const char *name, const char *path, const char *tooltip, const char *menuname, const char *navPath, unsigned relPosition, bool force)
{
    StringBuffer xpath;
    xpath.appendf("Link[@name=\"%s\"]", name);

    bool addNew = true;
    IPropertyTree *ret = folder.queryPropTree(xpath.str());
    if (ret)
    {
        bool forced = ret->getPropBool("@force");
        if (forced || !force)
            return ret;

        addNew = false;
    }

    if (addNew)
        ret=createPTree("Link");

    ret->setProp("@name", name);
    ret->setProp("@tooltip", tooltip);
    ret->setProp("@path", path);
    ret->setProp("@menu", menuname);
    ret->setProp("@navPath", navPath);
    ret->setPropInt("@relPosition", relPosition);
    ret->setPropBool("@force", force);

    if (addNew)
        folder.addPropTree("Link", ret);

    return ret;
}
void CWSESPControlEx::setSessionTimeout(int timeoutMinutes, IPropertyTree& session)
{
    CDateTime timeNow;
    timeNow.setNow();
    time_t simple = timeNow.getSimple() + timeoutMinutes*60;
    session.setPropInt64(PropSessionTimeoutAt, simple);
    session.setPropBool(PropSessionTimeoutByAdmin, true);
}
Ejemplo n.º 3
0
void addSimpleGraphEdge(IPropertyTree * subGraph, unsigned __int64 source, unsigned __int64 target, unsigned outputIndex, unsigned inputIndex, IAtom * kind, const char * label, bool nWay)
{
    IPropertyTree *edge = createPTree();
    edge->setPropInt64("@target", target);
    edge->setPropInt64("@source", source);
    if (outputIndex != 0)
        addGraphAttributeInt(edge, "_sourceIndex", outputIndex);
    if (inputIndex != 0)
        addGraphAttributeInt(edge, "_targetIndex", inputIndex);
    if (label)
        edge->setProp("@label", label);

    if (kind == dependencyAtom)
        addGraphAttributeBool(edge, "_dependsOn", true);

    if (nWay)
        edge->setPropBool("@nWay", true);

    StringBuffer s;
    edge->setProp("@id", s.append(source).append('_').append(outputIndex).str());
    subGraph->addPropTree("edge", edge);
}