-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from ortus-boxlang/development
v1.3.0
- Loading branch information
Showing
15 changed files
with
520 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Gradle Properties | ||
version=1.2.0 | ||
group=io.boxlang | ||
#Fri Aug 09 20:10:30 UTC 2024 | ||
boxlangVersion=1.0.0-beta9 | ||
jdkVersion=21 | ||
version=1.3.0 | ||
group=io.boxlang |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
src/main/java/ortus/boxlang/modules/compat/bifs/struct/DeleteClientVariable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/** | ||
* [BoxLang] | ||
* | ||
* Copyright [2023] [Ortus Solutions, Corp] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package ortus.boxlang.modules.compat.bifs.struct; | ||
|
||
import java.util.Set; | ||
|
||
import ortus.boxlang.runtime.bifs.BIF; | ||
import ortus.boxlang.runtime.bifs.BoxBIF; | ||
import ortus.boxlang.runtime.context.IBoxContext; | ||
import ortus.boxlang.runtime.scopes.ArgumentsScope; | ||
import ortus.boxlang.runtime.scopes.IScope; | ||
import ortus.boxlang.runtime.scopes.Key; | ||
import ortus.boxlang.runtime.types.Argument; | ||
import ortus.boxlang.runtime.validation.Validator; | ||
|
||
@BoxBIF | ||
public class DeleteClientVariable extends BIF { | ||
|
||
/** | ||
* Name of client scope | ||
*/ | ||
private static final Key clientKey = Key.of( "client" ); | ||
|
||
/** | ||
* Constructor | ||
*/ | ||
public DeleteClientVariable() { | ||
super(); | ||
declaredArguments = new Argument[] { | ||
new Argument( true, Argument.STRING, Key._NAME, Set.of( Validator.NON_EMPTY ) ) | ||
}; | ||
} | ||
|
||
/** | ||
* Deletes a client variable. Returns true if variable was successfully deleted; false if it was not deleted. | ||
* | ||
* @param context The context in which the BIF is being invoked. | ||
* @param arguments Argument scope for the BIF. | ||
* | ||
* @argument.name The name of the variable to delete. | ||
* | ||
*/ | ||
public Object _invoke( IBoxContext context, ArgumentsScope arguments ) { | ||
Key name = Key.of( arguments.getAsString( Key._NAME ) ); | ||
|
||
IScope clientScope = context.getScope( clientKey ); | ||
boolean existed = clientScope.containsKey( name ); | ||
clientScope.remove( name ); | ||
return existed; | ||
} | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
src/main/java/ortus/boxlang/modules/compat/bifs/struct/GetClientVariablesList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* [BoxLang] | ||
* | ||
* Copyright [2023] [Ortus Solutions, Corp] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package ortus.boxlang.modules.compat.bifs.struct; | ||
|
||
import java.util.stream.Collectors; | ||
|
||
import ortus.boxlang.runtime.bifs.BIF; | ||
import ortus.boxlang.runtime.bifs.BoxBIF; | ||
import ortus.boxlang.runtime.context.IBoxContext; | ||
import ortus.boxlang.runtime.scopes.ArgumentsScope; | ||
import ortus.boxlang.runtime.scopes.IScope; | ||
import ortus.boxlang.runtime.scopes.Key; | ||
|
||
@BoxBIF | ||
public class GetClientVariablesList extends BIF { | ||
|
||
/** | ||
* Name of client scope | ||
*/ | ||
private static final Key clientKey = Key.of( "client" ); | ||
|
||
/** | ||
* Finds the client variables to which a page has write access. Comma-delimited list of non-read-only client variables | ||
* | ||
* @param context The context in which the BIF is being invoked. | ||
* @param arguments Argument scope for the BIF. | ||
* | ||
*/ | ||
public Object _invoke( IBoxContext context, ArgumentsScope arguments ) { | ||
IScope clientScope = context.getScope( clientKey ); | ||
return clientScope.getKeysAsStrings().stream().collect( Collectors.joining( "," ) ); | ||
} | ||
|
||
} |
Oops, something went wrong.