org.wso2.carbon.registry.core.Resource.getProperty()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(8.2k)|赞(0)|评价(0)|浏览(91)

本文整理了Java中org.wso2.carbon.registry.core.Resource.getProperty方法的一些代码示例,展示了Resource.getProperty的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Resource.getProperty方法的具体详情如下:
包路径:org.wso2.carbon.registry.core.Resource
类名称:Resource
方法名:getProperty

Resource.getProperty介绍

暂无

代码示例

代码示例来源:origin: wso2/carbon-identity-framework

public int compare(Resource r1, Resource r2) {
    return ((Long) Long.parseLong(r1.getProperty("expireTime")))
        .compareTo((Long) Long.parseLong(r2.getProperty("expireTime")));
  }
});

代码示例来源:origin: org.wso2.carbon.governance/org.wso2.carbon.governance.list

public static String getLifeCycleName(Resource resource) {
  String lifeCycleName = "";
  if (resource.getProperties() != null) {
    if (resource.getProperty("registry.LC.name") != null) {
      lifeCycleName = resource.getProperty("registry.LC.name");
    }
  }
  return lifeCycleName;
}

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.cmis

@Override
protected boolean isMajorVersion() {
  String property = getNode().getProperty(CMISConstants.GREG_VERSION_STATE);
  return (property != null && property.equals(CMISConstants.GREG_MAJOR_VERSION));
}

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.cmis

protected static String getPropertyOrElse(Resource resource, String propertyName, String defaultValue)
    throws RegistryException {
  return hasProperty(resource, propertyName)
    ? resource.getProperty(propertyName)
    : defaultValue;
}

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.cmis

/**
 * @return  <code>true</code> if the document is checked out
 */
public boolean isDocumentCheckedOut() {
  String property = getNode().getProperty(CMISConstants.GREG_IS_CHECKED_OUT);
  return (property != null && !property.equals("false"));
}

代码示例来源:origin: org.wso2.carbon.identity.framework/org.wso2.carbon.identity.core

protected OpenIDUserDO resourceToObject(Resource resource) {
  OpenIDUserDO openIDUserDo = new OpenIDUserDO();
  openIDUserDo.setUserName(resource
      .getProperty(IdentityRegistryResources.PROP_OPENID_SIGN_UP_USERID));
  openIDUserDo.setOpenID(resource.getProperty(IdentityRegistryResources.PROP_OPENID));
  return openIDUserDo;
}

代码示例来源:origin: org.wso2.carbon.governance/org.wso2.carbon.governance.list

public static String getLifeCycleState(Resource resource) {
  String lifeCycleState = "";
  if (resource.getProperties() != null) {
    if (!getLifeCycleName(resource).equals("")) {
      String LCStatePropertyName = "registry.lifecycle." + getLifeCycleName(resource) + ".state";
      if (resource.getProperty(LCStatePropertyName) != null) {
        lifeCycleState = resource.getProperty(LCStatePropertyName);
      }
    }
  }
  return lifeCycleState;
}

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.core

protected OpenIDUserDO resourceToObject(Resource resource) {
  OpenIDUserDO openIDUserDo = new OpenIDUserDO();
  openIDUserDo.setUserName(resource
      .getProperty(IdentityRegistryResources.PROP_OPENID_SIGN_UP_USERID));
  openIDUserDo.setOpenID(resource.getProperty(IdentityRegistryResources.PROP_OPENID));
  return openIDUserDo;
}

代码示例来源:origin: wso2/carbon-identity-framework

protected OpenIDUserDO resourceToObject(Resource resource) {
  OpenIDUserDO openIDUserDo = new OpenIDUserDO();
  openIDUserDo.setUserName(resource
      .getProperty(IdentityRegistryResources.PROP_OPENID_SIGN_UP_USERID));
  openIDUserDo.setOpenID(resource.getProperty(IdentityRegistryResources.PROP_OPENID));
  return openIDUserDo;
}

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.cmis

private boolean isPrivateWorkingCopy(RegistryObject node) {
  String checkedOutProperty = node.getNode().getProperty(CMISConstants.GREG_IS_CHECKED_OUT);
  String createdAsPwcProperty = node.getNode().getProperty(CMISConstants.GREG_CREATED_AS_PWC);
  boolean checkedOut = checkedOutProperty != null && checkedOutProperty.equals("true");
  boolean createdAsPwc = createdAsPwcProperty != null && createdAsPwcProperty.equals("true");
  boolean endsWithPwc = node.getNode().getPath().endsWith(CMISConstants.PWC_SUFFIX);
  return (checkedOut || createdAsPwc || endsWithPwc);
}

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions

private void encodeProperty(Resource resource, String propKey) {
  try {
    if (resource.getProperty(propKey) != null) {
      resource.setProperty(propKey,
          CryptoUtil.getDefaultCryptoUtil().encryptAndBase64Encode(
              resource.getProperty(propKey).getBytes()));
    }
  } catch (CryptoException e) {
    log.error("Unable to encrypt property key: " + propKey + " for resource " +
        "path: " + resource.getPath(), e);
  }
}

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions

public String[] getAvailableActions(RequestContext context) {
    String reviewer = context.getResource().getProperty(REVIEWER);
    if (CurrentSession.getUser().equals(reviewer)) {
      return new String [] { "approve", "reject" };
    }
    return new String[0];
  }
}

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions

private void decodeProperty(Resource resource, String propKey) {
    try {
      if(resource.getProperty(propKey)!=null){
        resource.setProperty(propKey,
            new String(CryptoUtil.getDefaultCryptoUtil().base64DecodeAndDecrypt(
                resource.getProperty(propKey))));
      }
    } catch (CryptoException e) {
      log.error("Unable to decrypt property key: " + propKey + " for resource " +
          "path: " + resource.getPath(), e);
    }
  }
}

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.cmis

@Override
protected String getCheckedOutBy() throws RegistryException {
  return isCheckedOut()
      ? getNode().getProperty(CMISConstants.GREG_CHECKED_OUT_BY)
      : null;
}

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.cmis

@Override
protected String getObjectId() throws RegistryException {
  String property = getNode().getProperty(CMISConstants.GREG_CREATED_AS_PWC);
  if(property != null && property.equals("true")){
    return getVersionSeriesId();
  } else{
    return getVersionSeriesId() + '_' + PWC_NAME;
  }
}

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.cmis

protected static GregorianCalendar getPropertyOrElse(Resource resource, String propertyName, GregorianCalendar defaultValue)
    throws RegistryException {
  if (hasProperty(resource, propertyName)) {
    Calendar date = toDate(resource.getProperty(propertyName));
    return toCalendar(date);
  } else {
    return defaultValue;
  }
}

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.cmis

@Override
protected String getCheckedOutId() throws RegistryException {
  if (isCheckedOut()){
    String property = getNode().getProperty(CMISConstants.GREG_CREATED_AS_PWC);
    if(property != null && property.equals("true")){
      return getVersionSeriesId();
    } else {
      return getVersionSeriesId() + CMISConstants.PWC_SUFFIX;
    }
  }
  return null;
}

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions

public String saveSchemasToRegistry(RequestContext requestContext, String commonSchemaLocation,
                  String symlinkLocation, Resource metaResource,boolean disableSymlinkCreation)
    throws RegistryException {
  updateSchemaPaths(commonSchemaLocation,requestContext.getResource().getProperty("version"), requestContext);
  updateSchemaInternalsAndAssociations();
  String path = saveSchemaToRegistry(requestContext, null, symlinkLocation, metaResource,disableSymlinkCreation);
  persistAssociations(path);
  return path;
}
public String saveSchemasToRegistry(RequestContext requestContext, String commonSchemaLocation,

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.jcr

public void restoreByLabel(String s, String s1, boolean b) throws VersionException, ItemExistsException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException {
  try {
    String verPath = ((RegistrySession) session).getUserRegistry().get(
        RegistryJCRSpecificStandardLoderUtil.
            getSystemConfigVersionLabelPath((RegistrySession) session)).
        getProperty(s1);
    ((RegistrySession) session).getUserRegistry().restoreVersion(verPath);
  } catch (RegistryException e) {
    throw new RepositoryException(
       "Excepion occurred in registry level while restoring by label on : " + s);
  }
}

代码示例来源:origin: org.wso2.greg/org.wso2.carbon.governance.samples.shutterbug

public static String getCurrentUserID() throws Exception {
  Registry registry = getRegistryService().getSystemRegistry();
  Resource shutterbugCollection = registry.get(DEFAULT_SHUTTERBUG_HOME);
  UserRegistry userRegistry = CommonUtil.getUserRegistry(Utils.getRegistryService());
  String tenantUser = TENANT_USER_PREFIX + userRegistry.getTenantId() + "." +
      userRegistry.getUserName();
  return shutterbugCollection.getProperty(tenantUser);
}

相关文章