|
|
@ -4,16 +4,22 @@ import com.fr.general.FArray; |
|
|
|
import com.fr.general.GeneralUtils; |
|
|
|
import com.fr.general.GeneralUtils; |
|
|
|
import com.fr.intelli.record.Focus; |
|
|
|
import com.fr.intelli.record.Focus; |
|
|
|
import com.fr.intelli.record.Original; |
|
|
|
import com.fr.intelli.record.Original; |
|
|
|
|
|
|
|
import com.fr.plugin.context.PluginContexts; |
|
|
|
import com.fr.record.analyzer.EnableMetrics; |
|
|
|
import com.fr.record.analyzer.EnableMetrics; |
|
|
|
import com.fr.script.AbstractFunction; |
|
|
|
import com.fr.script.AbstractFunction; |
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
import com.fr.stable.Primitive; |
|
|
|
import com.fr.stable.Primitive; |
|
|
|
|
|
|
|
import com.fr.stable.fun.Authorize; |
|
|
|
|
|
|
|
|
|
|
|
@EnableMetrics |
|
|
|
@EnableMetrics |
|
|
|
|
|
|
|
@Authorize(callSignKey = MyFunctionConstants.PLUGIN_ID) |
|
|
|
public class MyAbs extends AbstractFunction { |
|
|
|
public class MyAbs extends AbstractFunction { |
|
|
|
|
|
|
|
|
|
|
|
@Focus(id = "com.fr.plugin.function.test", text = "Plugin-Test_Function_Abs", source = Original.PLUGIN) |
|
|
|
@Focus(id = "com.fr.plugin.function.test", text = "Plugin-Test_Function_Abs", source = Original.PLUGIN) |
|
|
|
public Object run(Object[] args) { |
|
|
|
public Object run(Object[] args) { |
|
|
|
|
|
|
|
if (!PluginContexts.currentContext().isAvailable()) { |
|
|
|
|
|
|
|
return "Error:authorization is expired."; |
|
|
|
|
|
|
|
} |
|
|
|
int len = ArrayUtils.getLength(args); |
|
|
|
int len = ArrayUtils.getLength(args); |
|
|
|
if (len == 0) { |
|
|
|
if (len == 0) { |
|
|
|
return Primitive.ERROR_VALUE; |
|
|
|
return Primitive.ERROR_VALUE; |
|
|
|