/** * ReConstruct. * * @param id * The id. * @param target * The target. * @param createdBy * The createdBy property. * @param createdOn * The createdOn property. * @param modifiedBy * The modified by property. * @param modifiedOn * The modified on property. */ public BaseAliasEdit(String id, String target, String createdBy, Time createdOn, String modifiedBy, Time modifiedOn) { m_id = id; m_target = target; m_createdUserId = createdBy; m_lastModifiedUserId = modifiedBy; m_createdTime = createdOn; m_lastModifiedTime = modifiedOn; // setup for properties, but mark them lazy since we have not yet established them from data BaseResourcePropertiesEdit props = new BaseResourcePropertiesEdit(); props.setLazy(true); m_properties = props; } // BaseAlias
/** * @inheritDoc */ public ResourcePropertiesEdit getPropertiesEdit() { // if lazy, resolve if (((BaseResourceProperties) m_properties).isLazy()) { ((BaseResourcePropertiesEdit) m_properties).setLazy(false); m_storage.readProperties(this, m_properties); } return m_properties; }
/** * @inheritDoc */ public ResourceProperties getProperties() { // if lazy, resolve if (((BaseResourceProperties) m_properties).isLazy()) { ((BaseResourcePropertiesEdit) m_properties).setLazy(false); m_storage.readProperties(this, m_properties); } return m_properties; }
/** * Construct. * * @param id * The user id. */ public BaseUserEdit(String id, String eid) { m_id = id; m_eid = eid; // setup for properties BaseResourcePropertiesEdit props = new BaseResourcePropertiesEdit(); m_properties = props; // if the id is not null (a new user, rather than a reconstruction) // and not the anon (id == "") user, // add the automatic (live) properties if ((m_id != null) && (m_id.length() > 0)) addLiveProperties(this); //KNL-567 lazy set the properties to be lazy so they get loaded props.setLazy(true); }
/** * Access the resources's properties. * * @return The resources's properties. */ public ResourceProperties getProperties() { // if lazy, resolve if (((BaseResourceProperties) m_properties).isLazy()) { ((BaseResourcePropertiesEdit) m_properties).setLazy(false); m_storage.readProperties(this, m_properties); } return m_properties; } // getProperties
/** * Access the resource's properties for modification * * @return The resource's properties. */ public ResourcePropertiesEdit getPropertiesEdit() { // if lazy, resolve if (((BaseResourceProperties) m_properties).isLazy()) { ((BaseResourcePropertiesEdit) m_properties).setLazy(false); m_storage.readProperties(this, m_properties); } return m_properties; } // getPropertiesEdit
((BaseResourcePropertiesEdit) m_properties).setLazy(true);
((BaseResourcePropertiesEdit) m_properties).setLazy(true);
((BaseResourcePropertiesEdit) m_properties).setLazy(true);
/** * @inheritDoc */ public ResourcePropertiesEdit getPropertiesEdit() { if (((BaseResourceProperties) m_properties).isLazy()) { siteService.storage().readPageProperties(this, m_properties); ((BaseResourcePropertiesEdit) m_properties).setLazy(false); } return m_properties; }
/** * @inheritDoc */ public ResourceProperties getProperties() { if (((BaseResourceProperties) m_properties).isLazy()) { siteService.storage().readPageProperties(this, m_properties); ((BaseResourcePropertiesEdit) m_properties).setLazy(false); } return m_properties; }
/** * @inheritDoc */ public ResourcePropertiesEdit getPropertiesEdit() { // if lazy, resolve if (((BaseResourceProperties) m_properties).isLazy()) { siteService.storage().readSiteProperties( this, m_properties); ((BaseResourcePropertiesEdit) m_properties).setLazy(false); } return m_properties; }
props.setLazy(true); m_properties = props;
((BaseResourcePropertiesEdit) m_properties).setLazy(((BaseResourceProperties) azGroup.getProperties()).isLazy());
/** * Access the Site's properties, with control over fetching of lazy collections. * * The allowFetch flag is typically passed as true, but passed as false for * fine-grained control while building copies, etc. This signature is not provided * on the Site interface and is only intended for use within the implementation package. * * @param allowFetch * when true, fetch properties if not loaded; * when false, avoid fetching and return the properties collection as-is * @return The Site's properties. * */ public ResourceProperties getProperties(boolean allowFetch) { // if lazy, resolve unless requested to avoid fetching (as for copy constructor) if (allowFetch && ((BaseResourceProperties) m_properties).isLazy()) { siteService.storage().readSiteProperties( this, m_properties); ((BaseResourcePropertiesEdit) m_properties).setLazy(false); } return m_properties; }
/** * Construct as a copy of another. * * @param other * The other to copy. * @param site * The site in which this group lives. * @param exact * If true, we copy id - else we generate a new one. */ protected BaseGroup(BaseSiteService siteService, Group other, Site site, boolean exact) { this.siteService = siteService; if (site == null) log.warn("BaseGroup(other, site...) created with null site"); BaseGroup bOther = (BaseGroup) other; m_site = (Site) site; if (exact) { m_id = bOther.m_id; } else { m_id = siteService.idManager().createUuid(); } m_title = bOther.m_title; m_description = bOther.m_description; m_properties = new BaseResourcePropertiesEdit(); m_properties.addAll(other.getProperties()); ((BaseResourcePropertiesEdit) m_properties).setLazy(((BaseResourceProperties) other.getProperties()).isLazy()); }
/** * Take all values from this object. * * @param alias * The alias object to take values from. */ protected void setAll(BaseAliasEdit alias) { m_id = alias.m_id; m_target = alias.m_target; m_createdUserId = ((BaseAliasEdit) alias).m_createdUserId; m_lastModifiedUserId = ((BaseAliasEdit) alias).m_lastModifiedUserId; if (((BaseAliasEdit) alias).m_createdTime != null) m_createdTime = (Time) ((BaseAliasEdit) alias).m_createdTime.clone(); if (((BaseAliasEdit) alias).m_lastModifiedTime != null) m_lastModifiedTime = (Time) ((BaseAliasEdit) alias).m_lastModifiedTime.clone(); m_properties = new BaseResourcePropertiesEdit(); m_properties.addAll(alias.getProperties()); ((BaseResourcePropertiesEdit) m_properties).setLazy(((BaseResourceProperties) alias.getProperties()).isLazy()); } // setAll
((BaseResourcePropertiesEdit) page.m_properties).setLazy(false);
((BaseResourcePropertiesEdit) m_properties).setLazy(true);
/** * Take all values from this object. * * @param user * The user object to take values from. */ protected void setAll(User user) { m_id = user.getId(); m_eid = user.getEid(); m_firstName = user.getFirstName(); m_lastName = user.getLastName(); m_type = user.getType(); setEmail(user.getEmail()); m_pw = ((BaseUserEdit) user).m_pw; m_createdUserId = ((BaseUserEdit) user).m_createdUserId; m_lastModifiedUserId = ((BaseUserEdit) user).m_lastModifiedUserId; if (((BaseUserEdit) user).m_createdInstant != null) m_createdInstant = (Instant) ((BaseUserEdit) user).m_createdInstant; if (((BaseUserEdit) user).m_lastModifiedInstant != null) m_lastModifiedInstant = (Instant) ((BaseUserEdit) user).m_lastModifiedInstant; m_properties = new BaseResourcePropertiesEdit(); m_properties.addAll(user.getProperties()); ((BaseResourcePropertiesEdit) m_properties).setLazy(((BaseResourceProperties) user.getProperties()).isLazy()); }