/* (non-Javadoc)
@see org.apereo.portal.portlet.dao.IPortletEntityDao#createPortletEntity(org.apereo.portal.portlet.om.IPortletDefinitionId, java.lang.String, int)
773622
@Override
    public IPortletEntity createPortletEntity(
            IPortletDefinitionId portletDefinitionId, String layoutNodeId, int userId) {
        if (layoutNodeId.startsWith(TransientUserLayoutManagerWrapper.SUBSCRIBE_PREFIX)) {
            final String transientLayoutNodeId = layoutNodeId;
            layoutNodeId = this.getPersistentLayoutNodeId(portletDefinitionId);

            final IPortletEntity portletEntity =
                    this.delegatePortletEntityDao.createPortletEntity(
                            portletDefinitionId, layoutNodeId, userId);
            return new TransientPortletEntity(portletEntity, transientLayoutNodeId);
        }

        return this.delegatePortletEntityDao.createPortletEntity(
                portletDefinitionId, layoutNodeId, userId);
    }
773547
@Override
    public DestinationDefinition createDestinationDefinition(DestinationType type, String name) {
        return new DestinationDefinitionImpl(type, name);
    }
1248450
private static Element createAndAppendPosition(
            String elementID, Element positions, IPerson person) throws PortalException {
        if (LOG.isDebugEnabled()) LOG.debug("Adding Position Set entry " + elementID + ".");

        String ID = null;

        try {
            ID = getDLS().getNextStructDirectiveId(person);
        } catch (Exception e) {
            throw new PortalException(
                    "Exception encountered while "
                            + "generating new position node "
                            + "Id for userId="
                            + person.getID(),
                    e);
        }
        Document plf = positions.getOwnerDocument();
        Element position = plf.createElement(Constants.ELM_POSITION);
        position.setAttribute(Constants.ATT_TYPE, Constants.ELM_POSITION);
        position.setAttribute(Constants.ATT_ID, ID);
        position.setAttributeNS(Constants.NS_URI, Constants.ATT_NAME, elementID);
        positions.appendChild(position);
        return position;
    }
1074932
@Override
    protected void initPrototypeId(int id)
    {
        String s;
        int arity;
        switch (id) {
          case Id_defaultSettings:  arity=0; s="defaultSettings";  break;
          case Id_settings:         arity=0; s="settings";         break;
          case Id_setSettings:      arity=1; s="setSettings";      break;
          default: throw new IllegalArgumentException(String.valueOf(id));
        }
        initPrototypeMethod(XMLCTOR_TAG, id, s, arity);
    }
643374
public static Identity createExtendedIdentity(String extendedIdentifier,
			Charset c) throws MarshalException {
		return createExtendedIdentity(DomHelpers.toDocument(extendedIdentifier, c));
	}
88330
@Override
    public IPortletDefinition savePortletDefinition(IPortletDefinition portletDefinition) {
        Validate.notNull(portletDefinition, "portletDefinition can not be null");
        return this.portletDefinitionDao.savePortletDefinition(portletDefinition);
    }
1234493
public LocalizationDefinition createLocalizationDefinition(
                                                               String destinationName) {
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.entry(tc, "createLocalizationDefinition", destinationName);

        JsAdminFactory factory = (JsAdminFactory) getSingletonInstance(SIMPConstants.JS_ADMIN_FACTORY);

        LocalizationDefinition locDef = factory
                        .createLocalizationDefinition(destinationName);

        // Set the high and low message thresholds to sensible values, otherwise
        // the defaults
        // are both MAX_VALUE (which cannot be valid, and breaks any message
        // depth checks) (510343)
        locDef.setDestinationHighMsgs(getHighMessageThreshold());
        locDef.setDestinationLowMsgs((getHighMessageThreshold() / 10) * 8);

        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.exit(tc, "createLocalizationDefinition", locDef);

        return locDef;
    }
48067
@Override
    public PortletDefinition getParentPortletDescriptor(IPortletDefinitionId portletDefinitionId) {
        final IPortletDefinition portletDefinition = this.getPortletDefinition(portletDefinitionId);
        if (portletDefinition == null) {
            return null;
        }

        final Tuple<String, String> portletDescriptorKeys =
                this.getPortletDescriptorKeys(portletDefinition);

        final PortletRegistryService portletRegistryService =
                this.portalDriverContainerServices.getPortletRegistryService();
        try {
            return portletRegistryService.getPortlet(
                    portletDescriptorKeys.first, portletDescriptorKeys.second);
        } catch (PortletContainerException e) {
            if (this.logger.isDebugEnabled()) {
                this.logger.warn(
                        "No portlet descriptor could be found for the portlet definition, null will be returned: "
                                + portletDefinition,
                        e);
            } else {
                this.logger.warn(
                        "No portlet descriptor could be found for the portlet definition, null will be returned: "
                                + portletDefinition
                                + " Enable DEBUG for stack trace.");
            }
            return null;
        }
    }
291951
public CmsEntityWrapper createEntity(String id, String typeName) {

        return new CmsEntityWrapper(CmsEntityBackend.getInstance().createEntity(id, typeName));
    }
1068453
@Override
    public CreateUpdateEntitiesResult createEntities(String entityInstanceDefinition) throws AtlasException {
        entityInstanceDefinition = ParamChecker.notEmpty(entityInstanceDefinition, "Entity instance definition");

        ITypedReferenceableInstance[] typedInstances = deserializeClassInstances(entityInstanceDefinition);

        return createEntities(typedInstances);
    }
1208051
@Override
    public DestinationAliasDefinition createDestinationAliasDefinition(DestinationType type, String name) {
        return new DestinationAliasDefinitionImpl(type, name);
    }
774902
@Override
    public ExternalPortletType exportData(String id) {
        IPortletType portletType = this.portletTypeRegistry.getPortletType(Integer.parseInt(id));
        if (null == portletType) {
            return null;
        }

        return convert(portletType);
    }
1329108
private PortletApplicationDefinition createDefinition(
            ServletContext servletContext, String name, String contextPath)
            throws PortletContainerException {
        PortletApplicationDefinition portletApp = null;
        try {
            InputStream paIn = servletContext.getResourceAsStream(PORTLET_XML);
            InputStream webIn = servletContext.getResourceAsStream(WEB_XML);
            if (paIn == null) {
                throw new PortletContainerException(
                        "Cannot find '"
                                + PORTLET_XML
                                + "'. Are you sure it is in the deployed package?");
            }
            if (webIn == null) {
                throw new PortletContainerException(
                        "Cannot find '"
                                + WEB_XML
                                + "'. Are you sure it is in the deployed package?");
            }
            portletApp = this.portletAppDescriptorService.read(name, contextPath, paIn);
            this.portletAppDescriptorService.mergeWebDescriptor(portletApp, webIn);
        } catch (Exception ex) {
            throw new PortletContainerException(
                    "Exception loading portlet descriptor for: "
                            + servletContext.getServletContextName(),
                    ex);
        }
        return portletApp;
    }
1155842
@Override
	public CommerceRegion create(long commerceRegionId) {
		CommerceRegion commerceRegion = new CommerceRegionImpl();

		commerceRegion.setNew(true);
		commerceRegion.setPrimaryKey(commerceRegionId);

		String uuid = PortalUUIDUtil.generate();

		commerceRegion.setUuid(uuid);

		commerceRegion.setCompanyId(companyProvider.getCompanyId());

		return commerceRegion;
	}
478271
@Override
	public com.liferay.commerce.model.CommerceShipmentItem createCommerceShipmentItem(
		long commerceShipmentItemId) {
		return _commerceShipmentItemLocalService.createCommerceShipmentItem(commerceShipmentItemId);
	}
10571
public Entity newEntity(QualifiedName id, String label) {
	Entity res = newEntity(id);
	if (label != null)
	    res.getLabel().add(newInternationalizedString(label));
	return res;
    }
972845
@Override
    public PortletApplicationDefinition getParentPortletApplicationDescriptor(
            IPortletDefinitionId portletDefinitionId) {
        final IPortletDefinition portletDefinition = this.getPortletDefinition(portletDefinitionId);
        if (portletDefinition == null) {
            return null;
        }

        final Tuple<String, String> portletDescriptorKeys =
                this.getPortletDescriptorKeys(portletDefinition);

        final PortletRegistryService portletRegistryService =
                this.portalDriverContainerServices.getPortletRegistryService();
        try {
            return portletRegistryService.getPortletApplication(portletDescriptorKeys.first);
        } catch (PortletContainerException e) {
            this.logger.warn(
                    "No portlet application descriptor could be found likely not deployed. For portlet definition: "
                            + portletDefinition,
                    e);
            return null;
        }
    }