本文整理匯總了Java中org.sakaiproject.tool.api.Placement.getConfig方法的典型用法代碼示例。如果您正苦於以下問題:Java Placement.getConfig方法的具體用法?Java Placement.getConfig怎麽用?Java Placement.getConfig使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.sakaiproject.tool.api.Placement
的用法示例。
在下文中一共展示了Placement.getConfig方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isPropertyFinal
import org.sakaiproject.tool.api.Placement; //導入方法依賴的package包/類
public boolean isPropertyFinal(String propName)
{
Placement placement = ToolManager.getCurrentPlacement();
String propertyName = placement.getToolId() + "." + propName;
String propValue = ServerConfigurationService.getString(propertyName,null);
if ( propValue != null && propValue.trim().length() > 0 ) {
return true;
}
Properties config = placement.getConfig();
propValue = getSakaiProperty(config, "imsti."+propName);
if ( propValue != null && "true".equals(config.getProperty("final."+propName)) )
{
return true;
}
return false;
}
示例2: getCorrectProperty
import org.sakaiproject.tool.api.Placement; //導入方法依賴的package包/類
public String getCorrectProperty(PortletRequest request, String propName, String defaultValue)
{
Placement placement = ToolManager.getCurrentPlacement();
String propertyName = placement.getToolId() + "." + propName;
String propValue = ServerConfigurationService.getString(propertyName,null);
if ( propValue != null && propValue.trim().length() > 0 ) {
log.debug("Sakai.home {}={}", propName, propValue);
return propValue;
}
Properties config = placement.getConfig();
propValue = getSakaiProperty(config, "imsti."+propName);
if ( propValue != null && "true".equals(config.getProperty("final."+propName)) )
{
log.debug("Frozen {} ={}", propName, propValue);
return propValue;
}
PortletPreferences prefs = request.getPreferences();
propValue = prefs.getValue("imsti."+propName, null);
if ( propValue != null ) {
log.debug("Portlet {} ={}", propName, propValue);
return propValue;
}
propValue = getSakaiProperty(config, "imsti."+propName);
if ( propValue != null ) {
log.debug("Tool {} ={}", propName, propValue);
return propValue;
}
if ( defaultValue != null ) {
log.debug("Default {} ={}", propName, defaultValue);
return defaultValue;
}
log.debug("Fell through {}", propName);
return null;
}
示例3: getPortletDD
import org.sakaiproject.tool.api.Placement; //導入方法依賴的package包/類
public PortletDD getPortletDD(Placement placement)
{
Properties toolProperties = placement.getPlacementConfig();
String portletName = null;
String appName = null;
String fred = null;
if (toolProperties != null)
{
log.debug("tp = {}", toolProperties);
portletName = toolProperties.getProperty(PortalService.TOOL_PORTLET_NAME);
appName = toolProperties.getProperty(PortalService.TOOL_PORTLET_APP_NAME);
fred = toolProperties.getProperty("FRED");
}
log.debug("appName={}", appName);
log.debug("portletName={}", portletName);
log.debug("fred={}", fred);
Properties configProperties = placement.getConfig();
if (configProperties != null)
{
if (portletName == null)
{
portletName = configProperties
.getProperty(PortalService.TOOL_PORTLET_NAME);
}
if (appName == null)
{
appName = configProperties
.getProperty(PortalService.TOOL_PORTLET_APP_NAME);
}
}
log.debug("appName={}", appName);
log.debug("portletName={}", portletName);
PortletDD pdd = PortletContextManager.getManager().getPortletDescriptor(appName,
portletName);
log.debug("pdd={}", pdd);
return pdd;
}
示例4: SakaiPortletConfig
import org.sakaiproject.tool.api.Placement; //導入方法依賴的package包/類
public SakaiPortletConfig(Placement placement)
{
if (placement == null)
{
return;
}
Properties toolProperties = placement.getPlacementConfig();
if (toolProperties != null)
{
contextPath = toolProperties
.getProperty(PortalService.TOOL_PORTLET_CONTEXT_PATH);
portletName = toolProperties.getProperty(PortalService.TOOL_PORTLET_NAME);
}
Properties configProperties = placement.getConfig();
if (configProperties != null)
{
if (isEmpty(contextPath))
{
contextPath = configProperties
.getProperty(PortalService.TOOL_PORTLET_CONTEXT_PATH);
}
if (isEmpty(portletName))
{
portletName = configProperties
.getProperty(PortalService.TOOL_PORTLET_NAME);
}
}
portlet = !(isEmpty(contextPath) || isEmpty(portletName));
}
示例5: extractPropertiesFromTool
import org.sakaiproject.tool.api.Placement; //導入方法依賴的package包/類
protected Properties extractPropertiesFromTool() {
Placement placement = toolManager.getCurrentPlacement();
Properties props = placement.getPlacementConfig();
if(props.isEmpty())
props = placement.getConfig();
return props;
}
示例6: loadFromPlacement
import org.sakaiproject.tool.api.Placement; //導入方法依賴的package包/類
public static boolean loadFromPlacement(Properties info, Properties launch, Placement placement)
{
Properties config = placement.getConfig();
log.debug("Sakai properties={}", config);
String launch_url = toNull(getCorrectProperty(config,LTIService.LTI_LAUNCH, placement));
setProperty(info, "launch_url", launch_url);
if ( launch_url == null ) {
String xml = toNull(getCorrectProperty(config,"xml", placement));
if ( xml == null ) return false;
BasicLTIUtil.parseDescriptor(info, launch, xml);
}
String secret = getCorrectProperty(config,LTIService.LTI_SECRET, placement);
// BLTI-195 - Compatibility mode for old-style encrypted secrets
if ( secret == null || secret.trim().length() < 1 ) {
String eSecret = getCorrectProperty(config,"encryptedsecret", placement);
if ( eSecret != null && eSecret.trim().length() > 0 ) {
secret = eSecret.trim() + ":" + SimpleEncryption.CIPHER;
}
}
setProperty(info, LTIService.LTI_SECRET, secret );
// This is not "consumerkey" on purpose - we are mimicking the old placement model
setProperty(info, "key", getCorrectProperty(config,"key", placement) );
setProperty(info, LTIService.LTI_DEBUG, getCorrectProperty(config,LTIService.LTI_DEBUG, placement) );
setProperty(info, LTIService.LTI_FRAMEHEIGHT, getCorrectProperty(config,LTIService.LTI_FRAMEHEIGHT, placement) );
setProperty(info, LTIService.LTI_NEWPAGE, getCorrectProperty(config,LTIService.LTI_NEWPAGE, placement) );
setProperty(info, LTIService.LTI_TITLE, getCorrectProperty(config,"tooltitle", placement) );
// Pull in and parse the custom parameters
String customstr = toNull(getCorrectProperty(config,LTIService.LTI_CUSTOM, placement) );
parseCustom(info, customstr);
if ( info.getProperty("launch_url", null) != null ||
info.getProperty("secure_launch_url", null) != null ) {
return true;
}
return false;
}
示例7: getSakaiProperties
import org.sakaiproject.tool.api.Placement; //導入方法依賴的package包/類
public Properties getSakaiProperties()
{
Placement placement = ToolManager.getCurrentPlacement();
return placement.getConfig();
}
示例8: ToolConfigBean
import org.sakaiproject.tool.api.Placement; //導入方法依賴的package包/類
public ToolConfigBean(Placement currentPlacement, String defaultHomePageName)
{
m_properties = currentPlacement.getConfig();
this.defaultHomePageName = defaultHomePageName;
}