Examples of Template


Examples of com.psddev.cms.db.Template

        if (object != null) {
            State.getInstance(object).setResolveInvisible(true);
        }

        Template template = Query.from(Template.class).where("_id = ?", param(UUID.class, "templateId")).first();

        if (template != null) {
            if (object == null) {
                Set<ObjectType> contentTypes = template.getContentTypes();

                if (!contentTypes.isEmpty()) {
                    object = contentTypes.iterator().next().createObject(objectId);
                    State.getInstance(object).as(Site.ObjectModification.class).setOwner(getSite());
                }
View Full Code Here

Examples of com.redhat.ceylon.tools.new_.Template

        return result;
    }
   
    @Test
    public void testSimple() {
        Template t = new Template("This is a test @[foo]\n@[bar]");
        Assert.assertEquals("This is a test FOO\nBAR", t.eval(env(
                "foo", "FOO",
                "bar", "BAR")));
    }
View Full Code Here

Examples of com.salas.bb.remixfeeds.templates.Template

                editor = edNor;
            }

            // Get template
            Template template = Templates.getByName(templateName);

            PostData data = type.getPostData(template);
            if (data.text == null) return;

            editor.setPostTitle(data.title);
View Full Code Here

Examples of com.samskivert.mustache.Template

    public void render(Writer out, String view, Object context) throws IOException {
        Reader source = null;
        try {
            source = load(view);
            Template template = mustache.compile(source);
            template.execute(context, out);
        } finally {
            Streams.close(source);
        }
    }
View Full Code Here

Examples of com.sequenceiq.cloudbreak.domain.Template

    @Override
    public Stack create(CbUser user, Stack stack) {
        MDCBuilder.buildMdcContext(stack);
        Stack savedStack = null;
        Template template = templateRepository.findOne(stack.getTemplate().getId());
        stack.setOwner(user.getUserId());
        stack.setAccount(user.getAccount());
        stack.setHash(generateHash(stack));
        try {
            savedStack = stackRepository.save(stack);
            LOGGER.info("Publishing {} event [StackId: '{}']", ReactorConfig.PROVISION_REQUEST_EVENT, stack.getId());
            reactor.notify(ReactorConfig.PROVISION_REQUEST_EVENT, Event.wrap(new ProvisionRequest(template.cloudPlatform(), stack.getId())));
        } catch (DataIntegrityViolationException ex) {
            throw new DuplicateKeyValueException(stack.getName(), ex);
        }
        return savedStack;
    }
View Full Code Here

Examples of com.sogou.qadev.service.cynthia.bean.Template

            }
           
            flowList.addAll(allFlows);
           
          }else if(type.equals("t")){
            Template template = TemplateCache.getInstance().get(id);
            if(template == null){
              continue;
            }
            Flow flow = FlowCache.getInstance().get(template.getFlowId());
            if (flow == null) {
              continue;
            }
            flowList.add(flow);
          }
         
          for(Flow flow : flowList){
            if(flow == null){
              continue;
            }
           
            if(fieldValue.equals("[逻辑开始]") && flow.getBeginStats() != null){
              for(Stat stat : flow.getBeginStats()){
                if(statusIdStrb.length() > 0){
                  statusIdStrb.append(",");
                }
               
                statusIdStrb.append(stat.getId());
              }
            }
            else if(fieldValue.equals("[逻辑关闭]") && flow.getEndStats() != null){
              for(Stat stat : flow.getEndStats()){
                if(statusIdStrb.length() > 0){
                  statusIdStrb.append(",");
                }
               
                statusIdStrb.append(stat.getId());
              }
            }
          }
         
          if(statusIdStrb.length() == 0){
            continue;
          }
         
          if(fieldMethod.equals("=")){
            XMLUtil.setAttribute(whereFieldNode, "method", "in");
          }
          else if(fieldMethod.equals("!=")){
            XMLUtil.setAttribute(whereFieldNode, "method", "not in");
          }
         
          whereFieldNode.setTextContent(statusIdStrb.toString());
        }
       
       
        //创建人 指派人可以指派给角色
        if((fieldId.equals("create_user") || fieldId.equals("assign_user") || fieldId.equals("log_create_user")) && (fieldValue.startsWith("role_"))){
         
          String roleIdStr = fieldValue.substring(5);
         
          if (!CommonUtil.isPosNum(roleIdStr))
            continue;
         
          StringBuffer roleUsers = new StringBuffer();
          if (type.equals("t")) {
            Template template = TemplateCache.getInstance().get(id);
            if(template == null){
              continue;
            }
            Flow flow = FlowCache.getInstance().get(template.getFlowId());
            if (flow == null) {
              continue;
            }
            UUID roleId = DataAccessFactory.getInstance().createUUID(roleIdStr);
            Set<Right> allRoleRight = flow.queryRightsByRole(roleId);
View Full Code Here

Examples of com.sun.grid.cull.template.Template

    }

    public void convert(CullDefinition cullDef) throws java.io.IOException {

        if (!outputFile.exists() || outputFile.lastModified() < templateFile.lastModified()) {
            Template template = fac.createTemplate(templateFile);
            Printer p = new Printer(outputFile);
            JavaHelper jh = new JavaHelper(cullDef);
            Map params = new HashMap();

            params.put("cullDef", cullDef);
            params.put("javaHelper", jh);

            if (super.iterateObjects()) {
                for (String name : cullDef.getObjectNames()) {
                    CullObject obj = cullDef.getCullObject(name);
                    params.put("cullObj", obj);
                    template.print(p, params);
                }
            } else {
                template.print(p, params);
            }
            p.flush();
            p.close();
        }
    }
View Full Code Here

Examples of com.sun.tools.javac.comp.Resolve.MethodResolutionDiagHelper.Template

                case ABSENT_MTH:
                    return true;
                case WRONG_MTH:
                    InapplicableSymbolError errSym =
                            (InapplicableSymbolError)s;
                    return new Template(MethodCheckDiag.ARITY_MISMATCH.regex())
                            .matches(errSym.errCandidate().snd);
                case WRONG_MTHS:
                    InapplicableSymbolsError errSyms =
                            (InapplicableSymbolsError)s;
                    return errSyms.filterCandidates(errSyms.mapCandidates()).isEmpty();
View Full Code Here

Examples of com.uic.ase.proj.xbn.template.Template

  /**
    <P>Create a Template from the constructor parameters.</P>
   **/
  protected Template createTemplate(String s_templateName, ForLineRetrieval flr_srcTxt, TParseConfig tp_config, TFilter template_filter)  {
    try  {
      return (new Template(s_templateName, flr_srcTxt, tp_config, template_filter));
    catch(TemplateFormatException tfx)  {
      throwAX("getTemplateFrom:  " + tfx.toString());
    }

    //Never reached.  Required for compile.
View Full Code Here

Examples of com.uwyn.rife.template.Template

public class ChangeNick extends Element implements BotListener
{
  public void processElement()
  {
    Template      t = getHtmlTemplate("drone.admin.change_nick");
    FormBuilder      form_builder = t.getBeanHandler().getFormBuilder();
    ValidationBuilder  validation_builder = form_builder.getValidationBuilder();
   
    form_builder.generateField(t, "new_nick", new String[] {getParameter("new_nick")}, null);
   
    // validate inputs
    ArrayList  errors = new ArrayList();
    String    botname = null;
    if (hasSubmission("perform_change"))
    {
      botname = getParameter("bot_to_change");
      if (isParameterEmpty("new_nick"))
      {
        errors.add(new ValidationError.MANDATORY("nick"));
      }
    }
    else
    {
      botname = getInput("botname");
    }
    Bot bot = Home.validateBotName(errors, botname);
   
    // act according to the actions that were performed
    if (errors.size() > 0)
    {
      if (botname != null)
      {
        t.setValue("botname", encodeHtml(botname));
      }
      validation_builder.generateValidationErrors(t, errors, null, null);
      validation_builder.generateErrorMarkings(t, errors, null, null);
    }
    else
    {
      if (hasSubmission("perform_change"))
      {
        String new_nick = getParameter("new_nick");
       
        t.setValue("botname", encodeHtml(bot.getName()));
        t.setValue("nick", encodeHtml(new_nick));

        try
        {
          bot.addBotListener(this);
          bot.changeNick(new_nick);
          synchronized (this)
          {
            if (null == bot.getConnectedNick() ||
              !bot.getConnectedNick().equals(new_nick))
            {
              try
              {
                this.wait();
              }
              catch (InterruptedException e)
              {
                // do nothing
              }
            }
          }
          bot.removeBotListener(this);
         
          if (bot.getConnectedNick().equals(new_nick))
          {
            exit("nick_changed");
          }
          validation_builder.setFallbackErrorArea(t, t.getBlock("ERROR_CHANGING_NICK"));
        }
        catch (CoreException e)
        {
          validation_builder.setFallbackErrorArea(t, t.getBlock("ERROR_CHANGING_NICK"));
        }
      }
    }
     
    setSubmissionForm(t, "perform_change", new String[] {"bot_to_change", botname});
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.