Examples of ExpandoTable


Examples of com.liferay.portlet.expando.model.ExpandoTable

  protected void doRun(long companyId) throws Exception {
    setupExpando(companyId);
  }

  protected void setupExpando(long companyId) throws Exception {
    ExpandoTable table = null;

    try {
      table = ExpandoTableLocalServiceUtil.addTable(
        companyId, User.class.getName(), "SN");
    }
    catch (DuplicateTableNameException dtne) {
      table = ExpandoTableLocalServiceUtil.getTable(
        companyId, User.class.getName(), "SN");
    }

    try {
      ExpandoColumnLocalServiceUtil.addColumn(
        table.getTableId(), "aboutMe", ExpandoColumnConstants.STRING);
    }
    catch (DuplicateColumnNameException dcne) {
    }
  }
View Full Code Here

Examples of com.liferay.portlet.expando.model.ExpandoTable

  }

  protected void addExpandoColumn(long companyId, String modelClassName, String expandoColumnName,
    int expandoColumnType, boolean indexable) throws PortalException, SystemException {

    ExpandoTable expandoTable = null;

    try {
      expandoTable = ExpandoTableLocalServiceUtil.getDefaultTable(companyId, modelClassName);
    }
    catch (NoSuchTableException e) {
      expandoTable = ExpandoTableLocalServiceUtil.addDefaultTable(companyId, modelClassName);
      logger.debug("Added expando table for modelClassName=[{0}]", modelClassName);
    }

    ExpandoColumn expandoColumn = null;

    expandoColumn = ExpandoColumnLocalServiceUtil.getColumn(expandoTable.getTableId(), expandoColumnName);

    if (expandoColumn != null) {
      logger.debug("Expando column=[{0}] exists for modelClassName=[{1}]", expandoColumnName, modelClassName);
    }
    else {
      expandoColumn = ExpandoColumnLocalServiceUtil.addColumn(expandoTable.getTableId(), expandoColumnName,
          expandoColumnType);
      logger.debug("Added expando column=[{0}] to modelClassName=[{1}]", expandoColumnName, modelClassName);
    }

    if (indexable) {
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.