Package org.brixcms.plugin.site.page

Examples of org.brixcms.plugin.site.page.AbstractContainer$Properties


        nodeModel.detach();
    }


    public String getText() {
        AbstractContainer container = (AbstractContainer) new BrixNodeModel(nodeModel).getObject();

        String title = null;
        while (title == null && container != null) {
            title = container.getTitle();
            container = container.getTemplate();
        }

        return title != null ? title : "";
    }
View Full Code Here


    public void setWorkspaceState(Workspace workspace, String state) {
        workspace.setAttribute(WORKSPACE_ATTRIBUTE_STATE, state);
    }

    public Collection<String> getGlobalTileIDs(JcrSession session) {
        AbstractContainer globalContainer = getGlobalContainer(session);
        Set<String> result;
        if (globalContainer != null) {
            result = new HashSet<String>();
            for (BrixNode n : globalContainer.tiles().getTileNodes()) {
                String id = TileContainerFacet.getTileId(n);
                if (!Strings.isEmpty(id)) {
                    result.add(id);
                }
            }
View Full Code Here

        }
        return result;
    }

    public Collection<String> getGlobalVariableKeys(JcrSession session) {
        AbstractContainer globalContainer = getGlobalContainer(session);
        Collection<String> result;
        if (globalContainer != null) {
            result = globalContainer.getSavedVariableKeys();
        } else {
            result = Collections.emptyList();
        }
        return result;
    }
View Full Code Here

    public String getWebRootPath() {
        return brix.getRootPath() + "/" + WEB_NODE_NAME;
    }

    public String getGlobalVariableValue(JcrSession session, String variableKey) {
        AbstractContainer globalContainer = getGlobalContainer(session);
        if (globalContainer != null) {
            return globalContainer.getVariableValue(variableKey, false);
        } else {
            return null;
        }
    }
View Full Code Here

                if (node instanceof ResourceNode == false) {
                    return;
                }

                AbstractContainer container = null;
                if (rule.getType() == Rule.Type.TEMPLATE) {
                    container = TemplateNode.initialize(node);
                } else if (rule.getType() == Rule.Type.PAGE) {
                    container = PageNode.initialize(node);
                }

                if (container != null) {
                    if (rule.getTemplateModel().getObject() != null) {
                        container.setTemplate(rule.getTemplateModel().getObject());
                    }
                    if (save) {
                        container.save();
                    }
                }

                return;
            }
View Full Code Here

  }

 
  public static String loadWithNewPattern(S3 s3,RefInteger storage, String path) {
    PageContext pc = ThreadLocalPageContext.get();
    Properties prop=null;
    if(pc!=null){
      prop=pc.getApplicationContext().getS3();
    }
    if(prop==null) prop=new PropertiesImpl();
   
    int defaultLocation = prop.getDefaultLocation();
    storage.setValue(defaultLocation);
    String accessKeyId = prop.getAccessKeyId();
    String secretAccessKey = prop.getSecretAccessKey();
   
    int atIndex=path.indexOf('@');
    int slashIndex=path.indexOf('/');
    if(slashIndex==-1){
      slashIndex=path.length();
      path+="/";
    }
    int index;
   
    // key/id
    if(atIndex!=-1) {
      index=path.indexOf(':');
      if(index!=-1 && index<atIndex) {
        accessKeyId=path.substring(0,index);
        secretAccessKey=path.substring(index+1,atIndex);
        index=secretAccessKey.indexOf(':');
        if(index!=-1) {
          String strStorage=secretAccessKey.substring(index+1).trim().toLowerCase();
          secretAccessKey=secretAccessKey.substring(0,index);
          //print.out("storage:"+strStorage);
          storage.setValue(S3.toIntStorage(strStorage, defaultLocation));
        }
      }
      else accessKeyId=path.substring(0,atIndex);
    }
    path=prettifyPath(path.substring(atIndex+1));
    index=path.indexOf('/');
    s3.setHost(prop.getHost());
    if(index==-1){
      if(path.equalsIgnoreCase(S3Constants.HOST) || path.equalsIgnoreCase(prop.getHost())){
        s3.setHost(path);
        path="/";
      }
    }
    else {
      String host=path.substring(0,index);
      if(host.equalsIgnoreCase(S3Constants.HOST) || host.equalsIgnoreCase(prop.getHost())){
        s3.setHost(host);
        path=path.substring(index);
      }
    }
   
View Full Code Here

    if(ac.isORMEnabled()){
      ORMConfiguration conf = ac.getORMConfiguration();
      if(conf!=null)sct.setEL(KeyConstants._orm, conf.toStruct());
    }
    // s3
    Properties props = ac.getS3();
    if(props!=null) {
      sct.setEL(KeyConstants._s3, props.toStruct());
    }
   
    // datasources
    DataSource[] sources = ac.getDataSources();
    if(!ArrayUtil.isEmpty(sources)){
View Full Code Here

TOP

Related Classes of org.brixcms.plugin.site.page.AbstractContainer$Properties

Copyright © 2018 www.massapicom. 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.