Examples of App


Examples of org.bladerunnerjs.model.App

  }
 
  @Test
  public void testExceptionThrownIfNamespaceCantBeAutomaticallyDetirmined() throws UnableToAutomaticallyGenerateAppRequirePrefixException
  {
    App app = mock(App.class);
    when(app.getName()).thenReturn("my�App");
    exception.expectMessage( startsWith("Unable to automatically calculate app namespace") );
    NameValidator.generateRequirePrefixFromApp(app);
  }
View Full Code Here

Examples of org.bladerunnerjs.model.App

            || contentPath.formName.equals(VERSIONED_UNBUNDLED_RESOURCES_REQUEST))
        {
          String relativeFilePath = contentPath.properties.get(FILE_PATH_REQUEST_FORM);
         
          File unbundledResourcesDir = bundleSet.getBundlableNode().file(UNBUNDLED_RESOURCES_DIRNAME);
          App app = bundleSet.getBundlableNode().app();
          File requestedFile = new File(unbundledResourcesDir, relativeFilePath);
          String requestedFilePathRelativeToApp = RelativePathUtility.get(brjs.getFileInfoAccessor(), app.dir(), requestedFile);
         
          if (!requestedFile.isFile())
          {
            String requestedFilePathRelativeToRoot = RelativePathUtility.get(brjs.getFileInfoAccessor(), app.dir().getParentFile(), requestedFile);
            throw new ContentProcessingException("The requested unbundled resource at '"+requestedFilePathRelativeToRoot+"' does not exist or is not a file.");
          }
       
          ByteArrayOutputStream outputBuffer = new ByteArrayOutputStream();
          contentAccessor.handleRequest(requestedFilePathRelativeToApp, outputBuffer);
View Full Code Here

Examples of org.bladerunnerjs.model.App

  private List<String> getGeneratedRequests(boolean isDev, Map<String, String> tagAttributes, BundleSet bundleSet, Locale locale, String version) throws MalformedTokenException, ContentProcessingException
  {
    List<String> possibleRequests = new ArrayList<String>();
    MinifierSetting minifierSettings = new MinifierSetting(tagAttributes);
    String minifierSetting = (isDev) ? minifierSettings.devSetting() : minifierSettings.prodSetting();
    App app = bundleSet.getBundlableNode().app();
   
    if(minifierSetting.equals(MinifierSetting.SEPARATE_JS_FILES)) {
      for(ContentPlugin contentPlugin : brjs.plugins().contentPlugins("text/javascript")) {
        List<String> contentPaths = (isDev) ? contentPlugin.getValidDevContentPaths(bundleSet) : contentPlugin.getValidProdContentPaths(bundleSet);
        for (String contentPath : contentPaths) {
          String requestPath = (isDev) ? app.createDevBundleRequest(contentPath, version) : app.createProdBundleRequest(contentPath, version);
          possibleRequests.add(requestPath);
        }
      }
    }
    else {
      String bundleRequestForm = (isDev) ? "dev-bundle-request" : "prod-bundle-request";
      String contentPath = compositeJsBundlerPlugin.getContentPathParser().createRequest(bundleRequestForm, minifierSetting);
      String requestPath = (isDev) ? app.createDevBundleRequest(contentPath, version) : app.createProdBundleRequest(contentPath, version);
      possibleRequests.add( requestPath );
    }
    return possibleRequests;
  }
View Full Code Here

Examples of org.bladerunnerjs.model.App

  {
    if (contentPath.formName.equals(APP_META_REQUEST))
    {
      try
      {
        App app = bundleSet.getBundlableNode().app();
        //NOTE: this metadata is used by the BRAppMetaService
        return new CharResponseContent( brjs, "// these variables should not be used directly but accessed via the 'br.app-meta-service' instead\n" +
            "window.$BRJS_APP_VERSION = '"+version+"';\n" +
            "window.$BRJS_VERSIONED_BUNDLE_PATH = '"+AppMetadataUtility.getRelativeVersionedBundlePath(version, "")+"';\n" +
            "window.$BRJS_LOCALE_COOKIE_NAME = '"+app.appConf().getLocaleCookieName()+"';\n" +
            "window.$BRJS_APP_LOCALES = {'" + Joiner.on("':true, '").join(app.appConf().getLocales()) + "':true};\n" );
      }
      catch (ConfigException ex)
      {
        throw new ContentProcessingException(ex);
      }
View Full Code Here

Examples of org.bladerunnerjs.model.App

    String sourceAppName = parsedArgs.getString("source-app-name");
    String sourceBladesetName = parsedArgs.getString("source-bladeset-name");
    String targetAppName = parsedArgs.getString("target-app-name");
    String targetBladesetName = (parsedArgs.getString("target-bladeset-name") == null) ? sourceBladesetName : parsedArgs.getString("target-bladeset-name");
   
    App sourceApp = brjs.app(sourceAppName);
    Bladeset sourceBladeset = sourceApp.bladeset(sourceBladesetName);
    App targetApp = brjs.app(targetAppName);
   
    try {
      NameValidator.assertValidPackageName(targetApp, targetBladesetName);
    }
    catch (InvalidPackageNameException e) {
      throw new CommandArgumentsException(e, this);
    }
   
    Bladeset targetBladeset = targetApp.bladeset(targetBladesetName);
   
    if (!sourceApp.dirExists()) throw new NodeDoesNotExistException(sourceApp, this);
    if (!sourceBladeset.dirExists()) throw new NodeDoesNotExistException(sourceBladeset, this);
    if (!targetApp.dirExists()) throw new NodeDoesNotExistException(targetApp, this);
    if (targetBladeset.dirExists()) throw new NodeAlreadyExistsException(targetBladeset, this);
   
    try {
      NodeImporter.importBladeset(sourceBladeset.dir(), sourceApp.appConf().getRequirePrefix(), sourceApp.appConf().getRequirePrefix() + "/" + sourceBladesetName, targetBladeset);
     
View Full Code Here

Examples of org.dmrad.view.App

   */
  protected void populateItem(ListItem item) {
    IOrderedEntities entry = (IOrderedEntities) item.getModelObject();
    ConceptConfig entryConceptConfig = entry.getConceptConfig();
    try {
      App app = viewContext.getApp();

      String conceptKey = entryConceptConfig.getCode();
      String conceptName = getLocalizer().getString(conceptKey, this);
      Label entryConceptName = new Label("entryName", conceptName);
      item.add(entryConceptName);

      ModelContext entryModelContext = new ModelContext(modelContext);
      entryModelContext.setEntities(entry);

      ViewContext entryViewContext = new ViewContext(viewContext);
      WebPage entryConceptPage = null;
      String displayType = entry.getConceptConfig().getDisplayType();
      if (displayType == null) {
        displayType = "table";
      }
      if (displayType.equals("table")) {
        entryConceptPage = app.getViewMeta().getPage(
            "EntityDisplayTablePage", entryModelContext,
            entryViewContext);
      } else if (displayType.equals("list")) {
        entryConceptPage = app.getViewMeta().getPage(
            "EntityDisplayListPage", entryModelContext,
            entryViewContext);
      } else if (displayType.equals("slide")) {
        entryConceptPage = app.getViewMeta().getPage(
            "EntityDisplaySlidePage", entryModelContext,
            entryViewContext);
      }
      Link entryConceptLink = new PageLink("entry", entryConceptPage);
      item.add(entryConceptLink);

      ModelContext keywordSelectionModelContext = new ModelContext(
          modelContext);
      keywordSelectionModelContext.setEntities(entry);
      PropertyConfig propertyConfig = entryConceptConfig
          .getPropertiesConfig().getFirstMaxTextSizePropertyConfig();
      keywordSelectionModelContext.setPropertyConfig(propertyConfig);

      ViewContext keywordSelectionViewContext = new ViewContext(
          viewContext);
      keywordSelectionViewContext.getMoreArgs().add("keywords", "");
      keywordSelectionViewContext.getMoreArgs().add("andKeywords",
          Boolean.TRUE);

      WebPage keywordSelectionPage = app.getViewMeta().getPage(
          "EntityPropertyKeywordSelectPage",
          keywordSelectionModelContext, keywordSelectionViewContext);
      Link keywordSelectionLink = new PageLink("entryKeywordSelection",
          keywordSelectionPage);
      item.add(keywordSelectionLink);
      if (!app.isConceptDisplayAllowed(getAppSession(),
          entryConceptConfig)) {
        entryConceptLink.setVisible(false);
        keywordSelectionLink.setVisible(false);
      } else if (propertyConfig == null) {
        keywordSelectionLink.setVisible(false);
View Full Code Here

Examples of org.domain.view.App

   *            Home page
   */
  public HomePageMenuPanel(final String wicketId, final Page page) {
    super(wicketId);
    try {
      App app = (App) getApplication();

      ModelContext commentsModelContext = new ModelContext();
      commentsModelContext.setDomainModel(app.getDomainModel());
      Comments comments = (Comments) app.getEntry("Comments");
      commentsModelContext.setEntities(comments);

      ViewContext commentsViewContext = new ViewContext();
      commentsViewContext.setApp(app);

      EntityDisplayTablePage commentsPage = new EntityDisplayTablePage(
          commentsModelContext, commentsViewContext);
      Link commentsLink = new PageLink("commentsLink", commentsPage);
      add(commentsLink);

      ModelContext questionsModelContext = new ModelContext();
      questionsModelContext.setDomainModel(app.getDomainModel());
      Questions questions = (Questions) app.getEntry("Questions");
      questionsModelContext.setEntities(questions);

      ViewContext questionsViewContext = new ViewContext();
      questionsViewContext.setApp(app);

      EntityDisplayTablePage questionsPage = new EntityDisplayTablePage(
          questionsModelContext, questionsViewContext);
      Link questionsLink = new PageLink("questionsLink", questionsPage);
      add(questionsLink);

      ModelContext presentationsModelContext = new ModelContext();
      presentationsModelContext.setDomainModel(app.getDomainModel());
      Presentations presentations = (Presentations) app
          .getEntry("Presentations");
      Presentations orderedPresentations = presentations
          .getPresentationsOrderedByTitle();
      presentationsModelContext.setEntities(orderedPresentations);

      ViewContext presentationsViewContext = new ViewContext();
      presentationsViewContext.setApp(app);

      EntityDisplayTablePage orderedPresentationsPage = new EntityDisplayTablePage(
          presentationsModelContext, presentationsViewContext);
      Link orderedPresentationsLink = new PageLink("presentationsLink",
          orderedPresentationsPage);
      add(orderedPresentationsLink);

      Link loginLink = new PageLink("login", LoginPage.class);
      add(loginLink);
      Link logoutLink = new Link("logout") {
        static final long serialVersionUID = 300331L;

        public void onClick() {
          getAppSession().invalidate();
          setResponsePage(HomePage.class);
        }
      };
      add(logoutLink);
      if (getAppSession().isMemberLoggedIn()) {
        loginLink.setVisible(false);
      } else {
        logoutLink.setVisible(false);
      }
      if (!app.getModelConfig().isLogin()) {
        loginLink.setVisible(false);
      }

      ModelContext dmLiteEntryPageModelContext = new ModelContext();
      dmLiteEntryPageModelContext.setDomainModel(app.getDomainModel());

      ViewContext dmLiteEntryPageViewContext = new ViewContext();
      dmLiteEntryPageViewContext.setApp(app);

      WebPage dmLiteEntryPage = new DmLiteEntryPage(
          dmLiteEntryPageModelContext, dmLiteEntryPageViewContext);
      Link dmLiteEntryLink = new PageLink("dmLiteEntry", dmLiteEntryPage);
      add(dmLiteEntryLink);

      ModelContext countryLanguageModelContext = new ModelContext();
      countryLanguageModelContext.setDomainModel(app.getDomainModel());
      CountryLanguages countryLanguages = (CountryLanguages) app
          .getEntry("CountryLanguages");
      countryLanguageModelContext.setEntities(countryLanguages);
      String languageCode = null;
      CountryLanguage defaultCountryLanguage = null;
      languageCode = getSession().getLocale().getLanguage();
      defaultCountryLanguage = (CountryLanguage) countryLanguages
          .retrieveByCode(languageCode);
      countryLanguageModelContext.setEntity(defaultCountryLanguage);
      ViewContext countryLanguageViewContext = new ViewContext();
      countryLanguageViewContext.setApp(app);
      countryLanguageViewContext.setPage(page);
      countryLanguageViewContext
          .setWicketId("countryLanguageChoicePanel");
      CountryLanguageChoicePanel countryLanguageChoicePanel = new CountryLanguageChoicePanel(
          countryLanguageModelContext, countryLanguageViewContext);
      add(countryLanguageChoicePanel);
      if (!app.getModelConfig().isI18n()) {
        countryLanguageChoicePanel.setVisible(false);
      }
    } catch (Exception e) {
      log.error("Error in HomePageMenuPanel: " + e.getMessage());
    }
View Full Code Here

Examples of org.eclipse.jetty.deploy.App

     *            {@link Resource#newResource(String)}
     * @return The App object for this particular context definition file.
     */
    protected App createApp(String filename)
    {
        return new App(_deploymentManager,this,filename);
    }
View Full Code Here

Examples of org.eclipse.orion.server.cf.objects.App

      if (!getStatus.isOK())
        return getStatus;

      JSONObject summaryJSON = getStatus.getJsonData();

      this.app = new App();
      this.app.setAppJSON(appJSON);
      this.app.setSummaryJSON(summaryJSON);
      this.app.setGuid(appJSON.getString("guid"));

      return new ServerStatus(Status.OK_STATUS, HttpServletResponse.SC_OK, this.app.toJSON());
View Full Code Here

Examples of org.nutz.ngqa.bean.App

  @At("/user/login/app")
  @Ok("ajax")
  public Object appLogin(@Param("appId") String appId, HttpSession session)
      throws Exception {
    if (appId != null) {
      App app = dao.findById(App.class, appId);
      if (app != null) {
        if (!app.isActive())
          return Ajax.fail().setData("app isn't active!");
        String value = UUID.randomUUID().toString() + "_"
            + Math.random();
        session.setAttribute("app.token", value);
        MessageDigest sha1 = MessageDigest.getInstance("sha1");
        sha1.update(value.getBytes());
        sha1.update(app.getKey().getBytes());
        session.setAttribute("app.token", getHexString(sha1.digest()));
        session.setAttribute("app.id", appId);
        return Ajax.ok().setData(value);
      }
    }
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.